| #!/bin/sh |
| cd / |
| mount -nt proc proc proc |
| rootdev=$(cat proc/sys/kernel/real-root-dev) |
| cmdline=$(cat /proc/cmdline) |
| umount -n proc |
| if [ $rootdev != 256 ]; then |
| mount -nt tmpfs tmpfs /dev2 |
| mount -nt proc proc /proc |
| mount -nt devfs devfs /devfs > /dev/null 2>&1 |
| get_device |
| mount_device |
| if test -f /mnt/etc/fstab ; then |
| ext3root=`awk '!/^ *#/ { if (($2 == "/") && ($3 == "ext3")) {print $1;}}' < /mnt/etc/fstab` |
| ext2root=`awk '!/^ *#/ { if (($2 == "/") && ($3 == "ext2")) {print $1;}}' < /mnt/etc/fstab` |
| fi |
| umount -n /devfs > /dev/null 2>&1 |
| umount -n /mnt > /dev/null 2>&1 |
| if test -n "$ext3root" -o -n "$ext2root" ; then |
| mount -nt tmpfs tmpfs /etc |
| echo >> /etc/fstab |
| echo >> /etc/mtab |
| if test -n "$ext3root" ; then |
| /sbin/tune2fs -O has_journal /dev2/root2 > /dev/null 2>&1 |
| else |
| /sbin/tune2fs -O ^has_journal /dev2/root2 > /dev/null 2>&1 |
| fi |
| umount -n /etc |
| fi |
| umount -n /dev2 |
| umount -n /proc > /dev/null 2>&1 |
| fi |