Tuesday, March 08, 2005

Adding busybox To an existing boot cd

Why would you want todo this?
(long story here is how to do it).

The bootable cd was/is essentially all
binary. I am able to add new things to
it but chaning how the system boot
scripts work would be a long process
I dont wish to undertake.
In a script I added the followning:

#This kernel level module was present and
#did match the hardware I could obtain.
modprobe 3c59x
#Manually configure the network
ifconfig eth0 inet 192.168.0.x netmask 255.255.255.0 broadcast 192.168.0.255 u
#Also manually set up the loopback device
ifconfig lo 127.0.0.1 broadcast 255.0.0.0 up
#These are the busybox based telnet daemon
mkdir /dev/pts
mknod /dev/ptmx c 5 2
mount -t devpts none /dev/pts
#I had to copy the pam directories off of redhat cd
#as the bootable cdrom is redhat based.
#also I had to remove the securytty entry from the
#file login.
ln -s /cdrom/etc/pam.d /etc/pam.d
#next I created a derivated of the busybox
#passwd program that would just change
#passwd to predefined value. this util was called passwd1
/cdrom/busybox/adduser foobar
/cdrom/busybox/passwd1 foobar
/cdrom/busybox/telnetd
#note busybox was compiled static
#a nice feature not dependence on the binaries
#found on the cd.
#copy my entry into passwd file
/cdrom/bin/mini_httpd -u root -d /

No comments: