HOW TO INSTALL SKOLELINUX ON A LAPTOP ------------------------------------- Author: Finn-Arne Johansen faj@bzz.no This Document is released under the GNU General Public License, version 2. On Debian GNU/Linux systems, the complete text of the GNU General Public License can be found in `/usr/share/common-licenses/GPL'. $Id: installing_SL_to_a_laptop.txt,v 1.20 2004/09/07 16:22:47 finnarne Exp $ Introduction ----------- This HOWTO is based on the work done at the Ulsrud School, Oslo Norway, to support laptops with an ordinary network interface card (for cabled LANs) and a wireless network interface card wireless LAN (WLAN). These laptops will sometimes be connected (at school), sometimes not (e.g. on the move or at home). Accordingly, there will also be a need to synchronize user files between laptops and the server installation at school, both to have a "canonical" place where files are store and to have the assurance of backup applying to files residing on the Skolelinux mainserver ('tjener'). An installation is needed, that will handle these different scenarios and aspects. In addition, efficient cloning of the (first) installation is needed for maintaining large numbers of identical and identically installed laptops. The System Imager software has been deployed for this purpose. What to install on Laptops -------------------------- Install Skolelinux Standalone Disk Usage and Dual Boot ------------------------ If you want to have an OS on your laptop besides Skolelinux (dual boot), you could either: - Setup Skolelinux first, and use the rest of the disk for the other OS. - Install the other OS first, and leave room for Skolelinux. Skolelinux Standalone will use upto 5 GB + 2x memory size of diskspace, the rest is left unpartitioned. The installer sets up the rest of the disk as a logical volume, so you might use cfdisk to change the partitioning. At least Win98 wants to have a primary partition. If you install e.g. Win98 first, set aside at least 1GB for a / (root) partition for Skolelinux and at least 256 for swap. To support home directories also during a reinstall, we add a separate home partition, and mount it under /home Setting up X ------------ Often there is a problem with the X-server on newer laptops. After Skolelinux included XFree86 version 4.2, it should not be that much trouble. If you still experience trouble, try using either the framebuffer driver or the vesa driver. I've used fbdev, but then I get a poor video rate when playing DVDs. I think I've seen better performance when using vesa mode, but I'm not sure. For the vesa driver, I have used this XF86Config: ## Start of /etc/X11/XF86Config ## Section "Files" FontPath "unix/:7100" # local font server FontPath "/usr/lib/X11/fonts/misc" FontPath "/usr/lib/X11/fonts/cyrillic" FontPath "/usr/lib/X11/fonts/100dpi/:unscaled" FontPath "/usr/lib/X11/fonts/75dpi/:unscaled" FontPath "/usr/lib/X11/fonts/Type1" FontPath "/usr/lib/X11/fonts/Speedo" FontPath "/usr/lib/X11/fonts/100dpi" FontPath "/usr/lib/X11/fonts/75dpi" EndSection Section "Module" Load "GLcore" Load "bitmap" Load "dbe" Load "ddc" Load "dri" Load "extmod" Load "freetype" Load "glx" Load "int10" Load "record" Load "speedo" Load "type1" Load "vbe" EndSection Section "InputDevice" Identifier "Generic Keyboard" Driver "keyboard" Option "CoreKeyboard" Option "XkbRules" "xfree86" Option "XkbModel" "pc104" Option "XkbLayout" "no" EndSection Section "InputDevice" Identifier "Configured Mouse" Driver "mouse" Option "CorePointer" Option "Device" "/dev/psaux" Option "Protocol" "PS/2" Option "Emulate3Buttons" "true" EndSection Section "InputDevice" Identifier "Generic Mouse" Driver "mouse" Option "SendCoreEvents" "true" Option "Device" "/dev/input/mice" Option "Protocol" "ImPS/2" Option "Emulate3Buttons" "true" EndSection Section "Device" Identifier "Vesa display driver" Driver "vesa" EndSection Section "Monitor" Identifier "Xdebc Monitor" EndSection Section "Screen" Identifier "Default Screen" Device "Vesa Display Driver" Monitor "Xdebc Monitor" DefaultDepth 16 SubSection "Display" Depth 16 EndSubSection EndSection Section "ServerLayout" Identifier "Default Layout" Screen "Default Screen" InputDevice "Generic Keyboard" InputDevice "Configured Mouse" InputDevice "Generic Mouse" EndSection Section "DRI" Mode 0666 EndSection ## End of /etc/X11/XF86Config ## To use fbdev: - First set the kernel to use framebuffer. This is done in the file /boot/grub/menu.lst. - Edit the line # kopt=root=/dev/hda1 ro to become # kopt=root=/dev/hda1 ro vga=7xx where vga=788 for 800x600x16 vga=789 for 800x600x24 vga=791 for 1024x768x16 vga=792 for 1024x768x24 Remember to upgrade the real grub menu afterwards by running update-grub - Then reconfigure X by running dpkg-reconfigure xserver-xfree86 Use the driver "fbdev", and choose the same resolution and depth as you did with the kernel. I've had some cards that, although there should be enough memory to run in 1024x768x24 mode, are not able to run with more then a 1024x768x16 resolution. Warning: In my experience dpkg-reconfigure/xdebconfigurator is sometimes unable to modify the configuration file /etc/X11/XF86Config-4 - I don't know exactly why. Also turning off and on the Option "UseFBDev" can help solving the problem with an Xserver that will not start Network Setup ------------- If you have a laptop with an onboard NIC, and you start it without the cable plugged in, the computer will likely "hang" for a while (trying to configure the network), then time out. To fix this you need to edit the file /etc/network/interfaces, and comment out the line auto eth0 The situation is similar if you have a pcmcia card (even with the cable plugged in), because the pcmcia card is not brought up until after the network is brought up. Commenting out the "auto eth0" line will also help in this case. To make the machine "automagically" enable the network card whenever a cable is plugged in, I recommend using ifplugd: - Added the following line to your apt sources in /etc/apt/sources.list deb http://ftp.skolelinux.no/skolelinux woody-test local - Install the ifplugd package apt-get update && apt-get install ifplugd - Do remember to comment out the "deb http:// ..." line afterwards, and do apt-get update If you have a WLAN card, you should also add a line iface eth1 inet dhcp to the /etc/network/interfaces file. Even here, any line "auto eth1" should be commented out (if it exists). Ifplugd can handle WLAN as well (and normally would). But we have included a script called start-wlan that will take up wlan only if there is no LAN connected. If you want to copy a lot of data switched 100MBit gives much better bandwidth, than a crowded 11Mbit WLAN with collisions and packet loss. On Ulsrud we needed to make the machine halt each time (not reboot directly). To achieve this, manipulate the script for run level 6: ( cd /etc/rc6.d ; mv S90reboot D90reboot ; ln -sf ../init.d/halt S90halt ) The parentheses are part of the command, don't drop them. We want apm/acpi working: - First try with apm modprobe apm If apm is not supported on your laptop, try with acpi: - You will have to add "acpi=on" to the kernel boot line in /boot/grub/menu.lst - You should also add the following lines to your /etc/modules: battery ac button fan processor thermal Be aware, I have had problems with acpi. The most recent I remember was a laptop that crashes when I load the modules "processor" and "thermal" klaptopdaemon is nice to monitor the battery status. On Ulsrud we added a newer kde: deb http://download.kde.org/stable/3.2/Debian stable main apt-get update && apt-get install kdebase (Cf. previous remarks on commenting out such apt sources after use.) And for k3b, a nice GUI for burning CDs: deb http://www.planet-moll.de/debian woody main apt-get update && apt-get install k3b (Ditto.) How to multiply the Installation on Several Machines (here Laptops) ------------------------------------------------------------------- Before starting, you should decide on a machine for the role of "image server". This could be the Skolelinux main server ('tjener') or some other machine (with its own software, not a thin client) and sufficient disk space. (On Ulsrud we have used the backup server as an images server. While writing this - at a different location - I am testing with a main server ('tjener') as image server.) On Ulsrud we have used System Imager to do identical software installation on identical machines, in particular laptops. But the version in Skolelinux (woody) does not handle Grub that well. Therefor we fetched System Imager from: deb http://download.systemimager.org/debian stable main Actually, the packages from this location is the same packages that are in unstable. I have rebuilt them, on sarge, and added support for Cardbus network card (32bit pcmcia). The packages are available from: deb http://ftp.skolelinux.no/ ~finnarne/systemimager/ This apt source must be set up both on the image server and the original client, cf. 'apt-get install ...' commands below.) On the image server you need to have some storage available for system imager, so maybe before you install System Imager, do (assuming LVM support) lvcreate -L 2G -n lv_sysimg vg_data Format the logical volume/partition mkfs -t ext3 /dev/vg_data/lv_sysimg If you have installed system imager already, you must copy what is in your original /var/lib/systemimager to your new /var/lib/systemimager. E.g.: mount /dev/vg_data/lv_sysimg /mnt cp -a /var/lib/systemimager/* /mnt rm -rf /var/lib/systemimager/* umount /mnt If you have not installed system imager, just create the new mount point mkdir /var/lib/systemimager In either case, add a line to /etc/fstab /dev/vg_data/lv_sysimg /var/lib/systemimager ext3 defaults 0 2 and mount the new logical volume/partition mount /var/lib/systemimager If you have not installed system imager on the server already, install by apt-get update apt-get install systemimager-server systemimager-boot-i386-standard or if you want the homebrew version with support for cardbus: apt-get update apt-get install systemimager-server systemimager-boot-i386-skolelinux On the client install by apt-get update && apt-get install systemimager-client To create bootable CD's, you need to install mkisofs (and cdrecord on the machine were you have cdrecord) apt-get install mkisofs To boot the clients using pxe, you need to have syslinux and a tftp-daemon installed: apt-get install syslinux tftpd-hpa Now remember to comment out the system imager apt-source on both the server and client. :-) On the client, turn off devfs. The change is done /etc/default/devfsd, followed by a reboot On the client run prepareclient --server On the image server run getimage --golden-client --image When the image is done, I select that this is a replicant, meaning do not mess with the network settings on this image. Usually I do not want to run the addclient utility. We can now do some tuning of the newly created image, located in /var/lib/systemimager/images//. Do a chroot /var/lib/systemimager/images/ You are then actually inside the client image. Now tune: - First, activate devfsd, by editing /etc/default/devfsd - Second remove the old logs (they are from the first installed client anyway): find /var/log/ -type f | xargs rm Then edit what should be updated whenever you update a client after it is installed, by editing the file /etc/systemimager/updateclient.local.exclude, and add the lines /etc/passwd /etc/shadow /etc/group /etc/ssh/ssh_host_*key* Then remove the host keys from /etc/ssh/ rm /etc/ssh/ssh_host_*key* and edit /etc/init.d/ssh to create the keys on startup. Add these lines # Create ssh keys if they do not not exists if [ ! -f /etc/ssh/ssh_host_dsa_key ] ; then dpkg-reconfigure -pcritical ssh fi just before the line echo -n "Starting OpenBSD Secure Shell server: sshd" You are done working inside your image (effected by the chroot command), and you may exit from the image. Now create your boot medium. It is possible to use pxe, cdrom, or floppy based boot. Since, at Ulsrud, we are installing on laptops, some of them do not have pxe possibility, and none of them have floppies - we chose cdrom boot Create your image with mkautoinstallcd --out-file systimg-boot.img The only available choice is standard flavour. Now burn the image onto a CD. Before you reboot your client you have to tell which image you want to install. Normally this is set up using the addclients script, but systemimager will then mess up your dhcp/dns/hosts setup in a way incompatible with Skolelinux. While installing to clients, systemimager will look for a script named /var/lib/systemimager/scripts/.sh If it does not find this script, it will remove the trailing numbers of the hostname, and then take the remaining and add .master. That means that if you use the backbone to install upon, it will first look for dhcp.sh and then dhcp.master If you use a thin client network to set this up, you will instead get "tk".sh or just tk.master (The setup at Ulsrud is slightly different, but I think the above should work on a thin client net as well. At Ulsrud we just activated the thin client network on the backup server - by editing /etc/network/interfaces, and running dhcpd on eth1) Then do a ln -s .master /var/lib/systemimager/scripts/dhcp.master Now you may boot your first machine to be "imaged" on the newly created CD, and sit back. Setting up the Next Laptop Type with System Imager: --------------------------------------------------- Now if you have chosen to go for the vesa driver, and 386 kernel, you may install the same image on the next type laptop. But if you have a "native" driver for X, and maybe a different processor type (lets say change from PIII to AMD), then you may want to customize the second image a bit. Then you might choose to install by from scratch again. But you could also install by using system imager, then boot using the 386 kernel thats there already, maybe in Single user mode, and reconfigure to make it fit the changes. Then you could go on with creating a new image the same way as the previous. But then , if you have 5 images, each taking up 2 GB, that would eat 10 GB out of your server. not a big deal you may think, but your server either needs this space for backup (remember to have 3x the space used on main server for backup). or this is your main server, where you use SCSI drives. SCSI drives are not cheap :( So what you do, is that you, on the machine where you store your images, you do a cd /var/lib/systemimager/images cp -al first_image second_image This will create a new directory tree for you second image, but all the files will be the same as the first image. So you only need extra space for the directories. then you prepare the client as you did with the previous, do a getimage, specifying the new client as golden -client, and "second-image" as the image. The scripts the politely ask if you want to upgrade, and it will go about, creating the necessary new files. Since rsync is used, the old files will still remain within first_image, the new files within second_image, and files common to both will be shared. Additional Info on System Imager: --------------------------------- There are even some packages available to make it possible to use multicast. We have not tested those, and they might not be installable in Skolelinux (woody). Synchronizing User Files ------------------------ In a scenario where laptops are sometimes connected to the Skolelinux installation at school, sometimes not, there will be a need to synchronize user files. Here follows one way of doing this. Installation ------------ Install the package unison on the main server ('tjener'): apt-get update && apt-get install unison and the package unison-gtk on the laptops: apt-get update && apt-get install unison-gtk (For the laptops, this should be done while creating the 'first' image for laptops, cf. above.) Also, on the laptop, create in /etc/skel/ a directory sync, and in the Desktop create an entry "Synchronize". This will the command for the "Synchronize" entry is unison-gtk sync ssh://tjener/sync Also, create a directory 'sync' in each user's home directory (~/sync). Working with files ------------------ Users should consider their home directory on the Skolelinux mainserver 'tjener' (and directories below) the "canonical" place where files are stored. (and also have the assurance of backup applying to files residing on 'tjener'). Now all you have to remember is to save all your work that you want to have on the laptop and on the main server, in the "sync" folder. And before you leave school, remember to Synchronize, and the same when you get back home.