On Thursday 29-Nov-2007 I purchased a used IBM ThinkPad T41. This blog is for notes about that notebook. (initial notes) Notes about Damn Small Linux on the T41 have been moved to the DSL Blog.
I had some time to kill at Penn Station this afternoon, so I decided to try out the wireless access in the waiting room.
I was able to connect, but DNS didn't work. Fortunately I've got a sufficent number of static IP addresses in /etc/hosts that I was able to check email, both at work and at home, but access to the web was less than glorious.
ntfsprogsautorunThis morning I had occasion to use System Rescue CD to do actual work on my desktop. During the course of that session I navigated with Firefox to a page that wanted a Flash player. It offered first an installation, and when that failed, a manual download and installation. I ended up with a .tar.gz file that contained a script and an object file. The script required user input.
After I was able to manually install the Flash player successfully, I copied the tarball to my hard drive. I'm going to try to make this happen under the auspices of autorun.
# autorun1
# personal configuration files
#
echo Loading personal configuration files...
/bin/mount /dev/sda2 /mnt/gentoo
/bin/cp -p /mnt/gentoo/sysrcd/autorun_files/pann.rc /root/.zsh/rc/
/bin/cp -p /mnt/gentoo/sysrcd/autorun_files/local.start /etc/conf.d/
/bin/cp -p /mnt/gentoo/sysrcd/autorun_files/local.stop /etc/conf.d/
/bin/mkdir -p /root/.config/Terminal
/bin/cp -p /mnt/gentoo/sysrcd/autorun_files/terminalrc /root/.config/Terminal/
/bin/umount /mnt/gentoo
# autorun2
# use existing ssh keys
#
echo Loading existing ssh keys...
/bin/mount /dev/sda6 /mnt/gentoo
/bin/rm /etc/ssh/*
/bin/cp -p /mnt/gentoo/etc/ssh/* /etc/ssh/
/bin/umount /mnt/gentoo
# autorun3
# install flash
#
cd /root
/bin/mount /dev/sda2 /mnt/gentoo
/bin/tar xzf /mnt/gentoo/sysrcd/autorun_files/install_flash_player_9_linux.tar.gz
/bin/umount /mnt/gentoo
cd install_flash_player_9_linux/
echo /usr/lib/mozilla-firefox is the installation path
./flashplayer-installer
cd /root
/bin/rm -rf install_flash_player_9_linux/
autorun scriptskernel /sysrcd/rescuecd subdir=sysrcd setkmap=us docache ar_source=/dev/sda2
-rwxr-xr-x 1 root root 305 2008-05-05 14:39 /working/autorun
-rw-r--r-- 1 root root 50 2008-05-05 14:39 /working/autorun1
Both of the scripts are run so the executable bit need not be set.
The autorun scripts are run very near the end of bootup. The only items echoed after autorun are portmap and local. Everything is mounted, so it should be possible to replace files. Let's try replacing root's .profile with a new version stored on /dev/sda2.
$ cat /working/autorun
#!/bin/sh
# autorun
/bin/mount /dev/sda2 /mnt/gentoo
/bin/cp /mnt/gentoo/sysrcd/pann.rc /root/.zsh/rc/
/bin/umount /mnt/gentoo
$ cat /working/sysrcd/pann.rc
set -o vi
Well, sorta like I said. And this does indeed work.
I did some more reading earlier this morning and discovered that only shell scripts are supported. That makes me wonder: since I don't need the executable bit set, do I even need the shebang line?
I expect to do some more experimentation using my disk-based installation of System Rescue CD to get a better handle on the autorun process. I think the next step is to see if I can replace the /etc/conf.d/local.start and /etc/conf.d/local.stop scripts with my own versions.
Update: Replacing local.start and local.stop works as expected. Also, consistent with the executable bit not needing to be set, the shebang line is not required in autorun scripts.
It occurs to me that an obvious use for this facility would be to replace the contents of /etc/ssh (generated on boot) with the contents of /etc/ssh from an existing partition, so that t41.mccuaig.us will look the same on port 22 regardless of which partition is booted. (implemented but not tested on the T41)
namib needs 2ps, abiword-help, dvdrip, gimp-help-*, groff, hexcat, hexedit, sun-java6-*, tcl8.4, tk8.4, tkdiff, tkman, tkinfo, @tidy -doc, mutt, par, sc, unclutter, urlview, binfmt-support, acroread and friends, audacious and friends, dict and friends, gnuplot and friends, ispell, iamerican, linklint, nmap, nvi, pax, partimage -doc, sqlite3 -doc, tofrodos, pcal, vim-doc, whois, xtightvncviewer, audacity?
namib has anthy, dmsetup, lvm2, mdadm, mdetect, dselect, edgy-*, python-2.4*. Why?
namib has gaim and gaim-data, needs pidgin, has gftp, needs filezilla.
panda has adobereader-enu, needs acroread and friends, has flashplayer-mozilla, needs flash-plugin-nonfree.
panda needs gimp-helpbrowser, apt-howto-en, audacious and friends, more friends of dict, dvdrip, easytag, gnuplot and friends, more friends of gnumeric, linklint, pax, pcal, partimage -doc, sqlite3 -doc, sun-java6-*, tkinfo, tkman, vim-doc, vim-gtk, xtightvncviewer.
panda doesn't need bluez-*.
Of course for panda what I really need to do is exchange my (currently external) 250G drive and my (currently internal) 80G drive. Put a fresh install of Xubuntu gutsy on the 250G, with the option to boot to the existing Ubuntu gutsy (upgraded from dapper) partition.
I can reliably connect to my wireless router at home under Damn Small Linux, but have not as yet been able to transfer that experience to the System Rescue CD. I an see that the wireless interface is detected and the kernel module is loaded. Under DSL the device is ath0, but there is no such thing under SysResCD, which shows me wlan0. However, although I can do all the same iwconfig and ifconfig machinations to wlan0 that I do to ath0 under DSL, dhclient gets no results, and I don't see the wireless indicator on the T41 light up while it's making the attempt.
More investigation is in order.
I booted both DSL and SysResCD on the train and made some comparisons and nothing jumps out at me.
partimage BackupI booted System Rescue CD (from the hard disk) with the intention of backing up /dev/sda6, but it was going to take more time than I had left on the commute, so I aborted the process. Good idea, though.
I think from now on I'll create a /boot partition on my Linux systems, and make sure that that partition is big enough to put the necessary files to boot System Rescue CD, along with what normally goes there. I'll probably create a bootable Damn Small Linux system on that partition as well. Takes not much disk space and adds a couple of options for when things go awry (or for when another partition needs backing up).
$ mkdir /working/sysrcd
$ sudo cp -p /media/cdrom0/sysrcd.* /working/sysrcd/
$ sudo cp -p /media/cdrom0/isolinux/initram.igz /working/sysrcd/
$ sudo cp -p /media/cdrom0/isolinux/rescuecd /working/sysrcd/
$ sudo chown root:root /working/sysrcd/
$ ls -lh /working/sysrcd/
total 162M
-rw-r--r-- 1 root root 5.6M 2008-03-28 17:19 initram.igz
-rw-r--r-- 1 root root 4.6M 2008-03-27 17:24 rescuecd
-rw-rw-rw- 1 root root 152M 2008-03-27 18:23 sysrcd.dat
-rw-r--r-- 1 root root 45 2008-03-27 18:23 sysrcd.md5
$ grep -A3 Syst /boot/grub/menu.lst
title System Rescue CD 1.0.1 (sda2)
root (hd0,1)
kernel /sysrcd/rescuecd subdir=sysrcd setkmap=us docache
initrd /sysrcd/initram.igz
And Bob's your uncle! This boots just fine, and for rescue purposes, is obviously superior to Damn Small Linux, which loads faster, uses less memory, and has more desktop options, as well as being an effective XAMPP host.