# CONFIG_FEATURE_TAR_BZIP2 is not set
# CONFIG_FEATURE_TAR_EXCLUDE is not set
CONFIG_FEATURE_TAR_GZIP=y
-# CONFIG_FEATURE_TAR_OLDGNU_COMPATABILITY is not set
+CONFIG_FEATURE_TAR_OLDGNU_COMPATABILITY=y
CONFIG_FEATURE_TAR_GNU_EXTENSIONS=y
# CONFIG_FEATURE_UNARCHIVE_TAPE is not set
# CONFIG_UNCOMPRESS is not set
CONFIG_RDATE=y
CONFIG_SWAPONOFF=y
CONFIG_MOUNT=y
-# CONFIG_NFSMOUNT is not set
+CONFIG_NFSMOUNT=y
CONFIG_UMOUNT=y
# CONFIG_FEATURE_MOUNT_FORCE is not set
# are not module groups need to be defined here...
HWOPTS='usb firewire keymap cache lvm2 evms2 dmraid sata'
-MY_HWOPTS='usb firewire lvm2 evms2 dmraid sata'
+MY_HWOPTS='usb firewire dmraid sata'
QUIET=1
ROOT_LINKS='bin sbin lib lib64 boot usr opt'
fi
}
+findnfsmount() {
+ if [ "${IP}" != '' ]; then
+ if [ "${NFSROOT}" = '' ]; then
+ OPTIONS=`busybox dmesg | grep rootserver | sed -e "s/,/ /g"`
+ for OPTION in $OPTIONS
+ do
+ if [ `echo $OPTION | sed -e "s/=/ /g" | cut -d " " -f 1` = 'rootserver' ]; then
+ NFSIP=`echo $OPTION | sed -e "s/=/ /g" | cut -d " " -f 2`;
+ fi
+ done
+
+ OPTIONS=`busybox dmesg | grep rootpath | sed -e "s/,/ /g"`
+ for OPTION in $OPTIONS
+ do
+ if [ `echo $OPTION | sed -e "s/=/ /g" | cut -d " " -f 1` = 'rootpath' ]; then
+ NFSPATH=`echo $OPTION | sed -e "s/=/ /g" | cut -d " " -f 2`;
+ fi
+ done
+ if [ "${NFSIP}" != "" ] && [ "$NFSPATH" != "" ]
+ then
+ NFSROOT="${NFSIP}:${NFSPATH}"
+ else
+ echo -e "${BAD}>>${NORMAL} The DHCP Server did not send a valid root-path."
+ echo -e "${BAD}>>${NORMAL} Please check your DHCP setup, or provide a nfsroot=<...> parameter."
+ fi
+ fi
+ if [ "${NFSROOT}" != "" ]; then
+ if [ "${CDROOT}" != '' ]; then
+ echo -e "${GOOD}>>${NORMAL} Attempting to mount NFS CD image on ${NFSPATH}"
+ mount -t nfs -o ro,nolock,rsize=1024,wsize=1024 ${NFSROOT} /newroot/mnt/cdrom
+ if [ "$?" = '0' ]; then
+ REAL_ROOT="/dev/nfs"
+ else
+ echo -e "${BAD}>>${NORMAL} NFS Mounting failed. Is the path corrent ?"
+ fi
+ else
+ echo -e "${GOOD}>>${NORMAL} Attemping to mount NFS root on ${NFSPATH}"
+ mount -t nfs -o ro,nolock,rsize=1024,wsize=1024 ${NFSROOT} /newroot
+ if [ "$?" = '0' ]; then
+ REAL_ROOT="/dev/nfs"
+ else
+ echo -e "${BAD}>>${NORMAL} NFS Mounting failed. Is the path correct ?"
+ fi
+ # FIXME: Need to start portmap and the other rpc daemons in order to
+ # FIXME: remount rw.
+ fi
+
+ fi
+ fi
+}
+
kill_devfsd() {
killall devfsd > /dev/null 2>&1
}
MLIST=`parse_opt "${x}"`
MLIST="`echo ${MLIST} | sed -e \"s/,/ /\"`"
export MLIST
+ ;;
+ ip\=*)
+ IP=`parse_opt "${x}"`
+ if [ "${REAL_ROOT}" = '' ]; then
+ CDROOT=1
+ NFSLIVECD=1
+ fi
+ ;;
+ nfsroot\=*)
+ NFSROOT=`parse_opt "${x}"`
;;
esac
done
then
echo -e "${GOOD}>>${NORMAL}${BOLD} Activating Device-Mapper raid(s)...${NORMAL}"
/sbin/dmraid -ay
+ [ "${USE_UDEV_NORMAL}" -eq '1' ] && /sbin/dmsetup mknodes
fi
fi
[ "${REAL_ROOT}" = '' ] && findcdmount /newroot/dev/ide/cd/*
[ "${REAL_ROOT}" = '' ] && findcdmount /newroot/dev/sr0
[ "${REAL_ROOT}" = '' ] && findcdmount /newroot/dev/sd* # USB Keychain
+ [ "${REAL_ROOT}" = '' ] && [ "{NFSLIVECD}" != '' ] && findnfsmount # NFS
else
# Device specified on command line
findcdmount /newroot/${CDROOT_DEV}
echo -n 'boot() :: '
read REAL_ROOT
got_good_root=0
- elif [ -b "${REAL_ROOT}" ]
+ elif [ -b "${REAL_ROOT}" ] || [ "${REAL_ROOT}" = "/dev/nfs" ]
then
got_good_root=1
else
break
else
echo -e "${GOOD}>>${NORMAL}${BOLD} Mounting root...${NORMAL}"
- mount -o rw ${REAL_ROOT} /newroot
+ if [ "${REAL_ROOT}" = '/dev/nfs' ]; then
+ findnfsmount
+ else
+ mount -o rw ${REAL_ROOT} /newroot
+ fi
if [ "$?" = '0' ]
then
echo -e "${GOOD}>>${NORMAL}${BOLD} Filling tmpfs...${NORMAL}"
cd /newroot
+ # Find loop and looptype if we have NFS-mounted a livecd
+ if [ "${LOOP}" = '' ] && [ "${REAL_ROOT}" = "/dev/nfs" ]
+ then
+ if [ -e '/newroot/mnt/cdrom/livecd.loop' ]; then
+ LOOP='/livecd.loop'
+ LOOPTYPE='normal'
+ elif [ -e '/newroot/mnt/cdrom/zisofs' ]; then
+ LOOP='/zisofs'
+ LOOPTYPE='zisofs'
+ elif [ -e '/newroot/mnt/cdrom/livecd.squashfs' ]; then
+ LOOP='/livecd.squashfs'
+ LOOPTYPE='squashfs'
+ elif [ -e '/newroot/mnt/cdrom/livecd.gcloop' ]; then
+ LOOP='/livecd.gcloop'
+ LOOPTYPE='gcloop'
+ else
+ LOOPTYPE='noloop'
+ fi
+ fi
+
# Failsafe the loop type wasn't set
if [ "${LOOPTYPE}" = '' ]
then
fi
echo -e "${GOOD}>>${NORMAL}${BOLD} Filling filesystem...${NORMAL}"
+
+ # Copy over stuff that should be writable
+ (cd /newroot/${FS_LOCATION}; cp -a ${ROOT_TREES} /newroot)
+
+ # Unpacking additional packages from NFS mount
+ # This is useful for adding kernel modules to /lib
+ # We do this now, so that additional packages can add whereever they want.
+ if [ "${REAL_ROOT}" = '/dev/nfs' ]
+ then
+ if [ -e '/newroot/mnt/cdrom/add' ]
+ then
+ for targz in `ls /newroot/mnt/cdrom/add/*.tar.gz`
+ do
+ tarname=`basename ${targz}`
+ echo -e "${GOOD}>>${NORMAL}${BOLD} Adding additional package ${tarname}${NORMAL}"
+ (cd /newroot ; tar -xzf ${targz})
+ done
+ fi
+ fi
+
+ # Now we do the links.
for x in ${ROOT_LINKS}
do
- ln -s "${FS_LOCATION}/${x}" "${x}"
+ # List all subdirectories of x
+ for directory in `find "/newroot/${FS_LOCATION}/${x}" -type d`
+ do
+ ## Strip the prefix of the FS_LOCATION
+ directory=${directory#/newroot/${FS_LOCATION}/}
+
+ ## Skip this directory if we already linked a parent directory
+ if [ "${current_parrent}" != '' ]; then
+ var=`echo "${directory}" | grep "^${current_parrent}"`
+ if [ "${var}" != '' ]; then
+ continue
+ fi
+ fi
+ ## Test if the directory exists already
+ if [ -e "/newroot/${directory}" ]
+ then
+ # It does exist, link all the individual files
+ for file in `ls /newroot/${FS_LOCATION}/${directory}`
+ do
+ if [ ! -d "/newroot/${FS_LOCATION}/${directory}/${file}" ] && [ ! -e "/newroot/${directory}/${file}" ]; then
+ ln -s "/${FS_LOCATION}/${directory}/${file}" "${directory}/${file}" 2> /dev/null
+ fi
+ done
+ else
+ # It does not exist, make a link to the livecd
+ ln -s "/${FS_LOCATION}/${directory}" "${directory}" 2> /dev/null
+ current_parrent=${directory}
+ fi
+ done
done
+
mkdir initrd proc tmp sys
chmod 1777 tmp
- (cd /newroot/${FS_LOCATION}; cp -a ${ROOT_TREES} /newroot)
+
+ # Let Init scripts know that we booted from CD
+ export CDBOOT
+ CDBOOT=1
else
mkdir -p /newroot/tmp/.initrd
fi
\fBscandelay\fR=<...>
Pauses for 10 seconds before running devfsd if no argument is specified;
otherwise pauses for the number of specified seconds.
+.TP
+\fBip\fR=<...>
+Normally used to tell the kernel that it should start a network interface. If present, the initrd will try to mount a livecd over NFS.
+.TP
+\fBnfsroot\fR=<...>
+If present, the initrd will try to mount a livecd from that location. Otherwise the location will be deduced from the DCHP request (option root\-path)
+
+.SH NETBOOTING
+The initrd scripts have limited support for network booting.
+This is activated if the ip=<...> kernel parameter was given. Please refer to the genkernel guide at http://www.gentoo.org/doc/en/genkernel.xml for more information.
+
+The initrd scripts will extract any *.tar.gz files found in the \fB/add\fR directory of the livecd into the root filesystem during boot. This way its easy to extend a netbooted livecd i.e. with custom tools, or other kernel modules.
.SH REPORTING BUGS
If you believe you have found a bug in the genkernel scripts, then please
file a bug on the Gentoo Linux Bugzilla:
# CONFIG_FEATURE_TAR_BZIP2 is not set
# CONFIG_FEATURE_TAR_EXCLUDE is not set
CONFIG_FEATURE_TAR_GZIP=y
-# CONFIG_FEATURE_TAR_OLDGNU_COMPATABILITY is not set
+CONFIG_FEATURE_TAR_OLDGNU_COMPATABILITY=y
CONFIG_FEATURE_TAR_GNU_EXTENSIONS=y
# CONFIG_FEATURE_UNARCHIVE_TAPE is not set
# CONFIG_UNCOMPRESS is not set
CONFIG_RDATE=y
CONFIG_SWAPONOFF=y
CONFIG_MOUNT=y
-# CONFIG_NFSMOUNT is not set
+CONFIG_NFSMOUNT=y
CONFIG_UMOUNT=y
# CONFIG_FEATURE_MOUNT_FORCE is not set
# CONFIG_FEATURE_TAR_BZIP2 is not set
# CONFIG_FEATURE_TAR_EXCLUDE is not set
CONFIG_FEATURE_TAR_GZIP=y
-# CONFIG_FEATURE_TAR_OLDGNU_COMPATABILITY is not set
+CONFIG_FEATURE_TAR_OLDGNU_COMPATABILITY=y
CONFIG_FEATURE_TAR_GNU_EXTENSIONS=y
# CONFIG_FEATURE_UNARCHIVE_TAPE is not set
# CONFIG_UNCOMPRESS is not set
CONFIG_RDATE=y
CONFIG_SWAPONOFF=y
CONFIG_MOUNT=y
-# CONFIG_NFSMOUNT is not set
+CONFIG_NFSMOUNT=y
CONFIG_UMOUNT=y
# CONFIG_FEATURE_MOUNT_FORCE is not set
# CONFIG_FEATURE_TAR_BZIP2 is not set
# CONFIG_FEATURE_TAR_EXCLUDE is not set
CONFIG_FEATURE_TAR_GZIP=y
-# CONFIG_FEATURE_TAR_OLDGNU_COMPATABILITY is not set
+CONFIG_FEATURE_TAR_OLDGNU_COMPATABILITY=y
CONFIG_FEATURE_TAR_GNU_EXTENSIONS=y
# CONFIG_FEATURE_UNARCHIVE_TAPE is not set
# CONFIG_UNCOMPRESS is not set
CONFIG_RDATE=y
CONFIG_SWAPONOFF=y
CONFIG_MOUNT=y
-# CONFIG_NFSMOUNT is not set
+CONFIG_NFSMOUNT=y
CONFIG_UMOUNT=y
# CONFIG_FEATURE_MOUNT_FORCE is not set
# CONFIG_FEATURE_TAR_BZIP2 is not set
# CONFIG_FEATURE_TAR_EXCLUDE is not set
CONFIG_FEATURE_TAR_GZIP=y
-# CONFIG_FEATURE_TAR_OLDGNU_COMPATABILITY is not set
+CONFIG_FEATURE_TAR_OLDGNU_COMPATABILITY=y
CONFIG_FEATURE_TAR_GNU_EXTENSIONS=y
# CONFIG_FEATURE_UNARCHIVE_TAPE is not set
# CONFIG_UNCOMPRESS is not set
CONFIG_RDATE=y
CONFIG_SWAPONOFF=y
CONFIG_MOUNT=y
-# CONFIG_NFSMOUNT is not set
+CONFIG_NFSMOUNT=y
CONFIG_UMOUNT=y
# CONFIG_FEATURE_MOUNT_FORCE is not set
# CONFIG_FEATURE_TAR_BZIP2 is not set
# CONFIG_FEATURE_TAR_EXCLUDE is not set
CONFIG_FEATURE_TAR_GZIP=y
-# CONFIG_FEATURE_TAR_OLDGNU_COMPATABILITY is not set
+CONFIG_FEATURE_TAR_OLDGNU_COMPATABILITY=y
CONFIG_FEATURE_TAR_GNU_EXTENSIONS=y
# CONFIG_FEATURE_UNARCHIVE_TAPE is not set
# CONFIG_UNCOMPRESS is not set
CONFIG_RDATE=y
CONFIG_SWAPONOFF=y
CONFIG_MOUNT=y
-# CONFIG_NFSMOUNT is not set
+CONFIG_NFSMOUNT=y
CONFIG_UMOUNT=y
# CONFIG_FEATURE_MOUNT_FORCE is not set
# CONFIG_FEATURE_TAR_BZIP2 is not set
# CONFIG_FEATURE_TAR_EXCLUDE is not set
CONFIG_FEATURE_TAR_GZIP=y
-# CONFIG_FEATURE_TAR_OLDGNU_COMPATABILITY is not set
+CONFIG_FEATURE_TAR_OLDGNU_COMPATABILITY=y
CONFIG_FEATURE_TAR_GNU_EXTENSIONS=y
# CONFIG_FEATURE_UNARCHIVE_TAPE is not set
# CONFIG_UNCOMPRESS is not set
CONFIG_RDATE=y
CONFIG_SWAPONOFF=y
CONFIG_MOUNT=y
-# CONFIG_NFSMOUNT is not set
+CONFIG_NFSMOUNT=y
CONFIG_UMOUNT=y
# CONFIG_FEATURE_MOUNT_FORCE is not set
# CONFIG_FEATURE_TAR_BZIP2 is not set
# CONFIG_FEATURE_TAR_EXCLUDE is not set
CONFIG_FEATURE_TAR_GZIP=y
-# CONFIG_FEATURE_TAR_OLDGNU_COMPATABILITY is not set
+CONFIG_FEATURE_TAR_OLDGNU_COMPATABILITY=y
CONFIG_FEATURE_TAR_GNU_EXTENSIONS=y
# CONFIG_FEATURE_UNARCHIVE_TAPE is not set
# CONFIG_UNCOMPRESS is not set
CONFIG_RDATE=y
CONFIG_SWAPONOFF=y
CONFIG_MOUNT=y
-# CONFIG_NFSMOUNT is not set
+CONFIG_NFSMOUNT=y
CONFIG_UMOUNT=y
# CONFIG_FEATURE_MOUNT_FORCE is not set
# CONFIG_FEATURE_TAR_BZIP2 is not set
# CONFIG_FEATURE_TAR_EXCLUDE is not set
CONFIG_FEATURE_TAR_GZIP=y
-# CONFIG_FEATURE_TAR_OLDGNU_COMPATABILITY is not set
+CONFIG_FEATURE_TAR_OLDGNU_COMPATABILITY=y
CONFIG_FEATURE_TAR_GNU_EXTENSIONS=y
# CONFIG_FEATURE_UNARCHIVE_TAPE is not set
# CONFIG_UNCOMPRESS is not set
CONFIG_RDATE=y
CONFIG_SWAPONOFF=y
CONFIG_MOUNT=y
-# CONFIG_NFSMOUNT is not set
+CONFIG_NFSMOUNT=y
CONFIG_UMOUNT=y
# CONFIG_FEATURE_MOUNT_FORCE is not set
# CONFIG_FEATURE_TAR_BZIP2 is not set
# CONFIG_FEATURE_TAR_EXCLUDE is not set
CONFIG_FEATURE_TAR_GZIP=y
-# CONFIG_FEATURE_TAR_OLDGNU_COMPATABILITY is not set
+CONFIG_FEATURE_TAR_OLDGNU_COMPATABILITY=y
CONFIG_FEATURE_TAR_GNU_EXTENSIONS=y
# CONFIG_FEATURE_UNARCHIVE_TAPE is not set
# CONFIG_UNCOMPRESS is not set
CONFIG_RDATE=y
CONFIG_SWAPONOFF=y
CONFIG_MOUNT=y
-# CONFIG_NFSMOUNT is not set
+CONFIG_NFSMOUNT=y
CONFIG_UMOUNT=y
# CONFIG_FEATURE_MOUNT_FORCE is not set
# CONFIG_FEATURE_TAR_BZIP2 is not set
# CONFIG_FEATURE_TAR_EXCLUDE is not set
CONFIG_FEATURE_TAR_GZIP=y
-# CONFIG_FEATURE_TAR_OLDGNU_COMPATABILITY is not set
+CONFIG_FEATURE_TAR_OLDGNU_COMPATABILITY=y
CONFIG_FEATURE_TAR_GNU_EXTENSIONS=y
# CONFIG_FEATURE_UNARCHIVE_TAPE is not set
# CONFIG_UNCOMPRESS is not set
CONFIG_RDATE=y
CONFIG_SWAPONOFF=y
CONFIG_MOUNT=y
-# CONFIG_NFSMOUNT is not set
+CONFIG_NFSMOUNT=y
CONFIG_UMOUNT=y
# CONFIG_FEATURE_MOUNT_FORCE is not set
# CONFIG_FEATURE_TAR_BZIP2 is not set
# CONFIG_FEATURE_TAR_EXCLUDE is not set
CONFIG_FEATURE_TAR_GZIP=y
-# CONFIG_FEATURE_TAR_OLDGNU_COMPATABILITY is not set
+CONFIG_FEATURE_TAR_OLDGNU_COMPATABILITY=y
CONFIG_FEATURE_TAR_GNU_EXTENSIONS=y
# CONFIG_FEATURE_UNARCHIVE_TAPE is not set
# CONFIG_UNCOMPRESS is not set
CONFIG_RDATE=y
CONFIG_SWAPONOFF=y
CONFIG_MOUNT=y
-# CONFIG_NFSMOUNT is not set
+CONFIG_NFSMOUNT=y
CONFIG_UMOUNT=y
# CONFIG_FEATURE_MOUNT_FORCE is not set
# CONFIG_FEATURE_TAR_BZIP2 is not set
# CONFIG_FEATURE_TAR_EXCLUDE is not set
CONFIG_FEATURE_TAR_GZIP=y
-# CONFIG_FEATURE_TAR_OLDGNU_COMPATABILITY is not set
+CONFIG_FEATURE_TAR_OLDGNU_COMPATABILITY=y
CONFIG_FEATURE_TAR_GNU_EXTENSIONS=y
# CONFIG_FEATURE_UNARCHIVE_TAPE is not set
# CONFIG_UNCOMPRESS is not set
CONFIG_RDATE=y
CONFIG_SWAPONOFF=y
CONFIG_MOUNT=y
-# CONFIG_NFSMOUNT is not set
+CONFIG_NFSMOUNT=y
CONFIG_UMOUNT=y
# CONFIG_FEATURE_MOUNT_FORCE is not set