Installing Debian Wheezy (testing) on your new UEFI junk

1's picture

Software: 

Hardware: 

This is a summary of experience I had when installing debian Wheezy on a brand new Acer Aspire One 725 netbook.

Lets consider the worst case scenario. People who buy netbooks and use them as their main machines are usually the
people who are constantly on the move, perhaps freelancing somewhere far far away from anything they could call home,
and definitively not enamoured with the idea to be tied down to some place by a wired internet connection. This leaves
WiFi, USB tethering to a phone, USB internet dongle, WiFi tethered to a broadband connection via phone and similar.

In the worst case scenario, Debian Testing (not to mention the Stable distribution) is not going to include a driver for your bleeding
edge (or bloody new trash) WiFi subsystem, even in the non-free installation image. This means you can't just obtain the Netinst image,
install the minimal system and download everything else from the internet. Instead , my recommendation is to somehow grab the full first
CD from the internet from another OS and use it for the first phase of installation.

Caveat emptor

Warning 1 : This guide is a work in progress and a hastily assembled lump of text. Please forgive the crudeness of the expression.
It will get better, if I continue working on it.

Warning 2 : By installing Debian GNU/Linux on my machine, I have made the access to Windows 8 uncomfortable. However, even as I write
this the situation might be different, considering that this is a testing distribution and things change swiftly as Wheezy
advances to its eventual release.

Warning 3 : Given the previous two warnings, it is obvious that the process is risky, especially if you are a GNU/Linux , or Debian novice.
I don't give any warranty that this guide, which is based only on my personal experience with just one machine, is going to
work for you. Some of the steps which I discuss may make your computer unusable, as well as wipe out all the important data.
Proceed with extra caution and on your own responsibility!

Advice 1 : Read the link about UEFI provided below. It is very well written and it is important to understand changes in the way our computers
are booting. Gone are the days of the old BIOS.

Idea 1 : Support the fight against the unfairness of the "Secure Boot". Support FSF! Smile

The place to start is the debian installer website for testing distro.
Here I have to comment that either I am blind, or the web designers of Debian site are blind, because I was unable to reach any useful
Debian testing resources from the main site (www.debian.org) . I admit to employing a web search engine to find the site linked above.

Your new system is probably coming with some hyper trash like Windows 8. Hopefully, you are going to be able to reconfigure the booting order
in your BIOS so that USB devices come before the hard drive (i didn't see a netbook with a "feature" such as optical drive, so i assume
you are going to depend on an USB connection to your installation medium, for example, an USB stick). Acer has ingeniously wiped out
any useful information of how to access the BIOS from their start-up screen (i guess because it looks nicer without the good old standard
message "Press F?? for BIOS"), so it took another web search to find out the the right key is F2 (was that it? now i don't remember, some of
those F-keys except F12 :-)).
Another important setting is the Secure Boot. I _assume_ you'll be able to turn that anti-feature off.

Before you change the boot sequence, burn the installation image (CD) on your installation media (even the USB stick can
be used). This is possible even in Windows these days. After you configure the boot process, restart the computer and boot
your installer.

Early in the installation process it is very probable that the installer is going to complain about the missing kernel modules. Write down their
names, you'll need that later. If your network depends on those drivers, just skip the network installation part and proceed to partitioning.

I assume a potential reader is someone who has some experience with partitioning of hard drives and is aware of the dangers involved.
With a new machine, the biggest danger is to wipe out the windows partition (unless this was the intention). Proceed with caution.
Modern computers usually come with a new partition layout (GPT), read a bit about it.
I was surprised with the number of already existing partitions in such a layout. Some are for windows backup/restore points, one is "C:", but there is another
especially important one, the EFI partition.
If the partition manager already lists the EFI partition , leave it be for now. Instead , resize "C:" (of course it is going to labeled as sd? or hd?) so that you have place for root (min 10G), swap (the size of your memory) and, maybe a separate /home partition (be generous here). Follow the advice of the partition manager if this is your first sex with the linux installation process. Finally, make sure you choose the existing EFI as the boot partition, please don't wipe it out. Also, take note
which partition is efi partition.

Debian testing had a problem with installing the boot loader about 15 days ago, when I went through the installation process. At the time of writing,
i noticed that the relevant GRUB package (grub-efi-amd64-bin for 64bit computers) got updated, so maybe they've fixed the problem. Anyhow, if the boot manager installation got botched, you won't be able to enter the Debian system.
Instead boot in the installer once more, this time choosing the advance installation. From the menu, choose to enter the shell , execute "/bin/bash", and mount the EFI partition if it is not already mounted under /boot/efi . In other words, issue the command "mount -t auto /dev/sdaN /boot/efi - o rw" (N is the number of the EFI partition you noted down during the partitioning step of the install process). After it is mounted, run "grub-install" .

*** BEFORE THE NEXT STEP, I STRONGLY RECOMMEND READING THE-BEST-RESOURCE-I-COULD-FIND,
on the UEFI booting procedure ***

At the time of writing, the following procedure, while it worked for me, will REDUCE, or even REMOVE the ability of booting in Windows.

Change dir to /boot/efi/EFI. There, you should find a debian subdirectory if grub-install worked. Copy "/boot/efi/EFI/debian/grubx64.efi" into
"/boot/efi/EFI/Boot/BOOTX64.EFI". When an UEFI system does not know what to boot, it falls back to default which is EFI/Boot/bootx64.efi (the letter case is unimportant for the EFI filesystem). Some systems boot directly the Microsoft boot loader, so in principle, you may need to replace the boot file in the Microsoft subdir with grubx64.efi (this may render Windows unreachable). I can't offer advice about that problem, please check the link provided, as well as the other resources on the Internet if this is your case.

If the previous step went well, the system should be bootable. Again I remark that, once I went through this, I couldn't reach windows normally, because
GRUB2 did not create the correct Windows entry in the boot menu. Now, I every time I need to boot Windows, I am pressing F12 during the startup
sequence (before GRUB2 menu) to enter the BIOS boot menu and choose windows from here. It may happen that your BIOS does not have this ability.
I am too lazy to go through GRUB documentation in order to fix this. F12 is not a bad solution as I rarely ever need to use MS's OS.

Getting connected

If you have a list of missing kernel drivers, find them on the internet and copy them in the "/lib/firmware" directory . You should be able to use
your WiFi, after a reboot.

However, I am not sure if network configurations GUIs can be found on the first CD of Debian distro. Wicd is certainly not there, network-manager,
well i don't like it (ditto Gnome or KDE), so as a first step in configuring network i opted for a rudimentary combo of wireless-tools and wpa-supplicant.

I assume you know what is your network's ESSID. I also assume you know what is your wireless network interface (typically wlan0) .
Paste this in your "/etc/networks/interfaces" :

iface wlan0 inet dhcp
pre-up wpa_supplicant -B -Dwext -iwlan0 -c/etc/wpa_supplicant/wpa_supplicant.conf
post-down killall -q wpa_supplicant

Use "wpa_passphrase" to generate an appropriate entry for the "wpa_supplicant.conf" :

wpa_passphrase your_essid your_password

You'll get something of this form:

network={
ssid="your_essid"
#psk="yourWPA2password"
psk=some_long_hexadecimalkey
}

Paste that in "/etc/wpa_supplicant/wpa_supplicant.conf".

After all those entries are in place,
"ifup wlan0" should connect you to internet.

Now edit your /etc/apt/sources.list and fill it with appropriate repository entries.

My sources.list is:

# deb cdrom:[Debian GNU/Linux testing _Wheezy_ - Official Snapshot amd64 CD Binary-1 20121231-04:51]/ wheezy main

#deb cdrom:[Debian GNU/Linux testing _Wheezy_ - Official Snapshot amd64 CD Binary-1 20121231-04:51]/ wheezy main

# Line commented out by installer because it failed to verify:
#deb http://security.debian.org/ wheezy/updates main
# Line commented out by installer because it failed to verify:
#deb-src http://security.debian.org/ wheezy/updates main

deb http://ftp.uk.debian.org/debian/ wheezy main contrib non-free
deb http://ftp.uk.debian.org/debian/ wheezy-updates main contrib non-free
deb http://www.deb-multimedia.org wheezy main non-free

From here onward, you are limited only by your imagination!

KEYWORDS: netbook, installation, debian testing, wheezy, wifi setup, uefi, Acer Aspire One 725