Updated May 05, 2004
Created May 05, 2004
Autogenerated Site Map
Search this Site!:
All of the following is on Fedora Core 1 installer. The modifications needed for any other anaconda installation should be very similar to this.
The purpose of this is to wedge in a /linuxrc script into the anaconda installer initrd. Hopefully one can load a nic driver and keep the network stack in the /linuxrc which is then passed off to the anaconda installer (/sbin/init).
Current layout. Here is the current layout as I have it working right now. I have not optimized this yet.
Items I'm sure of:
* mount /proc; echo 0x100 >/proc/real-root-dev; umount /proc
* do not call /sbin/init directly, just exit and /sbin/init will run.
Contents of my /linuxrc.swap script which is pointed to by a symbolic link from /linuxrc.
The original /linuxrc which was a symbolic link to /sbin/init has been renamed beforehand to /linuxrc-bin.
#!/bin/bash -x
# Take off the -x above.
# insmod NICDRIVER.o
# optionally: sleep 30/120 (probably not needed)
# optionally: dhclient/pump (probably not needed)
mount -t proc /proc /proc
echo -ne "Old real-root-dev: "
cat /proc/sys/kernel/real-root-dev
echo 0x100 > /proc/sys/kernel/real-root-dev
echo -ne "New real-root-dev: "
cat /proc/sys/kernel/real-root-dev
umount /proc
rm -rf /linuxrc
mv /linuxrc-bin /linuxrc
rm -rf /bin/bash /lib
Programs needed for the above script:
/bin/bash
/bin/echo
/bin/cat
/bin/mount
/bin/umount
/bin/mv
/bin/rm
libs for /lib
already provided: /sbin/insmod, /sbin/rmmod
optionally: /bin/sleep
optionally: /sbin/dhclient or /sbin/pump
[root@rrb new.dir]# ls -l
total 10
lrwxrwxrwx 1 root root 4 Apr 28 15:30 bin -> sbin
drwxr-xr-x 4 root root 1024 Nov 3 2003 dev
drwxr-xr-x 4 root root 1024 Nov 3 2003 etc
drwxr-xr-x 3 root root 1024 Apr 28 15:57 lib
lrwxrwxrwx 1 root root 12 Apr 28 16:04 linuxrc -> linuxrc.swap
lrwxrwxrwx 1 root root 10 Apr 28 15:30 linuxrc-bin -> /sbin/init
-rwxr-xr-x 1 root root 335 May 5 15:58 linuxrc.swap
drwx------ 2 root root 1024 Nov 3 2003 lost+found
drwxr-xr-x 2 root root 1024 Nov 3 2003 modules
drwxr-xr-x 2 root root 1024 Nov 3 2003 proc
drwxr-xr-x 3 root root 1024 May 5 15:59 sbin
drwxr-xr-x 2 root root 1024 Nov 3 2003 tmp
drwxr-xr-x 4 root root 1024 Nov 3 2003 var
[root@rrb new.dir]#
[root@rrb new.dir]# ls -l lib
total 1659
drwxr-xr-x 2 root root 1024 Apr 28 14:44 i686
-rwxr-xr-x 1 root root 106400 Nov 12 18:56 ld-2.3.2.so
lrwxrwxrwx 1 root root 11 Apr 28 15:42 ld-linux.so.2 -> ld-2.3.2.so
-rwxr-xr-x 1 root root 1552740 Nov 12 18:56 libc-2.3.2.so
lrwxrwxrwx 1 root root 13 Apr 28 15:42 libc.so.6 -> libc-2.3.2.so
-rwxr-xr-x 1 root root 15900 Nov 12 18:56 libdl-2.3.2.so
lrwxrwxrwx 1 root root 14 Apr 28 15:42 libdl.so.2 -> libdl-2.3.2.so
lrwxrwxrwx 1 root root 19 Apr 28 15:42 libtermcap.so.2 -> libtermcap.so.2.0.8
-rwxr-xr-x 1 root root 11784 Feb 4 2003 libtermcap.so.2.0.8
[root@rrb new.dir]# ls -l lib/i686/
total 0
[root@rrb new.dir]#
[root@rrb new.dir]# ls -l sbin
total 1278
-rwxr-xr-x 1 root root 626028 Apr 9 2003 bash
drwxr-xr-x 2 root root 1024 Apr 28 16:01 bin
-rwxr-xr-x 1 root root 14716 Oct 29 2003 cat
-rwxr-xr-x 1 root root 12572 Oct 29 2003 echo
-rwxr-xr-x 1 root root 20980 Nov 3 2003 init
lrwxrwxrwx 1 root root 6 Apr 28 15:30 insmod -> loader
-rwxr-xr-x 1 root root 436416 Nov 3 2003 loader
lrwxrwxrwx 1 root root 6 Apr 28 15:30 modprobe -> loader
-rwsr-xr-x 1 root root 68508 Feb 24 2003 mount
-rwxr-xr-x 1 root root 51060 Oct 29 2003 mv
-rwxr-xr-x 1 root root 26780 Oct 29 2003 rm
lrwxrwxrwx 1 root root 6 Apr 28 15:30 rmmod -> loader
lrwxrwxrwx 1 root root 11 Apr 28 15:30 sh -> /usr/bin/sh
-rwsr-xr-x 1 root root 30816 Feb 24 2003 umount
[root@rrb new.dir]#
The new initrd file with more space was created by:
# Make a new initrd image larger than the original if we need more space
dd if=/dev/null of=new-initrd bs=1024k count=4
# format it
mkfs.ext2 new-initrd -N 4096
# Make a mount point for it
mkdir new-initrd.dir
# mount it.
mount new-initrd new-initrd.dir -o loop
# Let's gunzip the original initrd.img
mv initrd.img initrd.img.gz
gunzip initrd.img.gz
# make a mount point
mkdir initrd.img.dir
# and mount it (the original initrd.img)
mount initrd.img initrd.img.dir -o loop,ro
# Now let's dump all contents from the original initrd to our new larger one
(cd initrd.img.dir && tar -cf - .)|(cd new-initrd.dir && tar -xvf -)
# Unmount everything and remove unnecessary directories
umount initrd.img.dir
rmdir initrd.img.dir
umount new-initrd.dir
rmdir new-initrd.dir
Search this Site!:
Homepage: http://www.cpqlinux.com
Site Map: http://www.cpqlinux.com/sitemap.html