Topic: Debian Net Install Over WPA Encrypted Wireless via a USB Drive
By sort-of request from my friend Koleoptero.
http://crunchbanglinux.org/forums/post/139182/#p139182
@hhh: I wish I had that patience to do what you did with the netinstall. I have a partition waiting for debian w xfce. It's just that the modem/router is in the kitchen.
Most of this I learned straight from the Debian Wiki...
http://wiki.debian.org/WiFi/HowToUse
This tutorial is going to be hand-holdy, because I've followed too many tutorials only to get to Step 17 and suddenly go "Zuh???". I hate that crap, so if you run into a Zuh moment, post a question here and I or someone else will gladly clear it up. As a result of not wanting to assume very much, this post will be long. I'm sorry for that, but I'm sure experienced users can skim through and quickly pick out the relevant bits they need. Yes, this guide is dumbed down, but I don't understand the GNU/Linux position of "This is the year of the Linux desktop! But I figured it out myself after years of hunching over a keyboard, so you can too, n00b!" If I've made a mistake in my instructions, please post here or PM me so I can fix it. Thanks.
I'll divide this up into the following sections...
1) Prepare
2) Notes on the Minimum Install
3) Get the Wireless Files
4) Install the Wireless Files
5) Essentials
6) Xfce Setup (skip this if you just want Openbox)
7) Openbox Setup
8) Notes on Network Manager and Compiling
*****************************
1) PREPARE
You'll need...
~a USB drive (the net.iso image is under 200MB and the wireless files are under 1MB, so you can do the entire process with a single 256MB drive).
~ how your computer identifies that drive (such as /dev/sdb1, a link for help with that is coming up in a minute)
~the module file, such as rt73usb, for your wireless device. Usually this is part of a firmware package, such as firmware-ralink, but you'll still need the name of the specific enclosed module file your driver uses so you can bring the network up when the time comes.
~the name and WPA passkey of your wireless network
~a free partition and the Debian netinst.iso...
~a Debian source (and maybe a backup in case the mirror is being synced when you are doing this) such as...
deb http://mirror.anl.gov/debian/ squeeze main contrib non-free
Debian mirrors...
http://www.debian.org/mirror/list
For the i386 ISO torrent...
http://cdimage.debian.org/debian-cd/6.0
so.torrent
For the amd64 ISO torrent...
http://cdimage.debian.org/debian-cd/6.0
so.torrent
For non-torrent and other architectures...
http://www.debian.org/CD/netinst/
For instructions on how your computer identifies your USB drive and transferring the ISO to USB...
http://crunchbanglinux.org/wiki/statler
stallation
To revive your USB after it's been overwritten by dd you can use Gparted to create a new partition table (under the Device menu in Gparted) and then reformat it to Fat32.
**********************************
2) NOTES on the Minimum Install
I'll briefly cover the netinst.iso base install and then you can grab the files for wireless, in case you're using just one USB drive...
Install the netinst.iso image onto a partition. When it gets to "Configuring the network with DHCP" choose Cancel (or just let it run and fail) and choose "Configure the network at a later time". Later in the install you'll be asked if you want to install SSH. If you don't know what SSH is just leave the default settings (SSH unselected, the other check-box selected). Install Grub, finish the installation and return to your previous OS to get the needed wireless packages.
Reformat your USB to Fat32 using Gparted if you're using the same drive for the next section.
*******************************
3) GET the Wireless Files
You'll need the following 6 .deb files. Scroll down to the bottom of the linked pages, choose your architecture and on the page it brings you to right-click a mirror link and save the file...
wpasupplicant
wireless-tools
libdbus-1-3
libiw30
libnl1
libpcsclite1
You'll also need to create a text file named "interfaces" (without quotes) and add the following to it (replace mynetworkname/mysecretpassphrase with your network's name/passphrase.)...
auto wlan0
iface wlan0 inet dhcp
wpa-ssid mynetworkname
wpa-psk mysecretpassphraseNOTE: I'm unclear about wireless network labels, you may need to replace the two wlan0 labels here, with eth0 for example, and in the upcoming "bring up the network" step.
Finally, you'll need your wireless firmware, such as firmware-ralink, or the individual module file, such as rt73usb. For simplicity, remove any files from the USB drive you'll use in the next step. Then transfer the 8 files (the 6 .deb files above, "interfaces" and your wireless firmware/driver) to your USB and you're ready.
**********************************
4) INSTALL the Wireless Files
In the "identify USB/transfer ISO" link above, there was this line...
Replace /dev/sdX with the actual hard disk device learned from the command above. In this example /dev/sdb NOT /dev/sdb1
We're not using dd any more, so this time you'll need the full path, /dev/sdb1 in this example.
When you reboot into your new install, at the Grub screen you'll probably want to hit "e" to temporarily add vga=791 to your boot options so the console text isn't so honking large (and to add nomodeset if you lose the screen because your graphics drivers aren't installed yet). For the truly novice, that means arrow down to the line just past where it says "ro quiet", arrow back once, add a space and add your temporary boot option(s).
Proceed with the boot and you should arrive at a console prompt. Login as root. Insert the USB drive and wait a few seconds for the drive to be recognized. I got a UTF8 warning, you can just continue typing or you can hit [Ctrl+c] for a new console prompt. Usually you create a directory before you mount a drive, but /mnt is empty right now so I'm just using that. Mount the drive, replacing /dev/sdb1 with your drive path if it's different...
mount /dev/sdb1 /mntSwitch to the USB directory...
cd /mntInstall the .deb files (the * is a wildcard, all .deb files on the drive will be installed)...
dpkg -i *.debIf your wireless driver was in a deb package, it's now installed to /lib/firmware. If it was a single file, copy it to /lib/firmware (replace rt73usb with your file name yadda yadda yadda)...
cp rt73usb /lib/firmwareCopy "interfaces" to /etc/network...
cp interfaces /etc/networkRestrict the permissions of "interfaces"...
chmod 0600 /etc/network/interfacesActivate the wireless module...
modprobe rt73usbBring up the network while crossing your fingers, holding your breath and praying to Shiva and Zeus (ignore the resolv.conf warnings, that file will automatically be created)...
ifup wlan0*NOTE: As mentioned earlier, your wireless label may be different than wlan0, for instance eth0.*
Leave the USB directory...
cdUnmount the drive and remove it...
umount /dev/sdb1Just one more pain in the butt step now, if you're like me and hate Vi as much as I hate Randy Newman's singing/songwriting (thank you for making fun of him, Family Guy). You need to fix /etc/apt/sources.list with Vi. Vi is a console text editor that I hate. I hate it. I hate it...
vi /etc/apt/sources.listDelete the first line, arrow down to the next line to delete that, and keep deleting them one-by one till you have an empty file except for squiggly lines. Now go to an empty line, press "i" (for "insert) and carefully type in your mirror...
deb http://mirror.anl.gov/debian/ squeeze main contrib non-free
Hit [Esc] to leave "insert" mode. To save the file, hit :x a.k.a. [Shift+;] ... I hate it.
The moment of truth...
apt-get updateIf there are no errors, HOOZAAH!
For good measure (and definitely if you used a wheezy or sid mirror instead of squeeze)...
apt-get dist-upgradeYou're now connected to your network via wpa_supplicant. If you later install wicd or network-manager you'll need to change the "interfaces" file, see section 8.
One more thing, in my /etc/fstab file I commented out (put a # in front of) the following lines at the end of the file. You may see something similar, depending on what media you installed the netinst.iso from and what drives your computer has...
#/dev/sdb /media/cdrom0 udf,iso9660 user,noauto 0 0
#/dev/scd0 /media/cdrom1 udf,iso9660 user,noauto 0 0
#/dev/sdb1 /media/usb0 auto rw,user,noauto 0 0If you're comfortable with Vi you can do that now, or just wait till you have a working desktop and can use the editor of your choice.
********************************
5) ESSENTIALS
OK, nothing is really "essential", but now what? A window server and sound...
apt-get install xorg alsa-base oss-compatAnd some basic security tools...
apt-get install sudo gksuSet up sudo...
visudoArrow down to right below the line that says "root ALL=(ALL) ALL" and type the same, only replace "root" with your user name...
hhh ALL=(ALL) ALLtype [Ctrl+o], type [Backspace] 4 times so the file name is "/etc/sudoers", type [Enter], type "y" (ignore the message about sudoers.tmp being unchanged), type [Ctrl+x].
Last edited by hhh (2011-08-22 02:59:29)