# cd /mnt
# cp initrd initrd.orig.gz
# zcat initrd.orig.gz > initrd.new
# mkdir img
# mount -o loop initrd.new img
# cd img
initrdの変更
./linuxrc
#!/bin/sh
export PATH=/sbin:/bin:/usr/sbin:/usr/bin
### mount proc
mount -t proc proc /proc
### load drivers
for i in leddrv buzdrv btndrv # same as module and device name
do
/sbin/insmod /lib/modules/noversion/$i.ko $* || exit 1
done
### check boot device
stty -F /dev/ttyUSB0 38400 > /dev/null 2>&1
if [ $? -eq 0 ] ; then
ROOT_DEVICE=0x0100 # initrd
else
ROOT_DEVICE=0x0303 # /dev/hda3
fi
### set root device
echo $ROOT_DEVICE > /proc/sys/kernel/real-root-dev
umount /proc
exit 0
./etc/inittab
::sysinit:/etc/rc.d/rcS2ttyUSB0::askfirst:/bin/sh
ttySC1::askfirst:/bin/sh
::ctrlaltdel:/sbin/reboot
::shutdown:/sbin/swapoff -a
::shutdown:/bin/umount -a -r
::restart:/sbin/init
./etc/securetty
console
ttySC1
ttyUSB0
./etc/rc.d/rcS2
#!/bin/sh
# mount filesystems
mount -t proc /proc /proc
mount -o remount,rw /
Debian GNU/Linux 3.1 glantank
glantank login: root
Last login: Sun Jan 15 21:34:53 2006 from 192.168.1.2 on pts/0
Linux glantank 2.6.10-iop1 #22 Fri Aug 19 13:37:07 JST 2005 armv5tel GNU/Linux
The programs included with the Debian GNU/Linux system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.
Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
permitted by applicable law.
glantank:~#