|
|
@ -81,33 +81,6 @@ do
|
|
|
|
looptype\=*)
|
|
|
|
looptype\=*)
|
|
|
|
LOOPTYPE=`parse_opt "${x}"`
|
|
|
|
LOOPTYPE=`parse_opt "${x}"`
|
|
|
|
;;
|
|
|
|
;;
|
|
|
|
unionfs)
|
|
|
|
|
|
|
|
if [ ! -x /sbin/unionctl ]
|
|
|
|
|
|
|
|
then
|
|
|
|
|
|
|
|
USE_UNIONFS_NORMAL=0
|
|
|
|
|
|
|
|
bad_msg 'Unionctl not found: aborting use of unionfs!'
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
USE_UNIONFS_NORMAL=1
|
|
|
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
;;
|
|
|
|
|
|
|
|
unionfs\=*)
|
|
|
|
|
|
|
|
if [ ! -x /sbin/unionctl ]
|
|
|
|
|
|
|
|
then
|
|
|
|
|
|
|
|
USE_UNIONFS_NORMAL=0
|
|
|
|
|
|
|
|
bad_msg 'Unionctl not found: aborting use of unionfs!'
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
USE_UNIONFS_NORMAL=1
|
|
|
|
|
|
|
|
CMD_UNIONFS=`parse_opt "${x}"`
|
|
|
|
|
|
|
|
echo ${CMD_UNIONFS}|grep , >/dev/null 2>&1
|
|
|
|
|
|
|
|
if [ "$?" -eq '0' ]
|
|
|
|
|
|
|
|
then
|
|
|
|
|
|
|
|
UID=`echo ${CMD_UNIONFS#*,}`
|
|
|
|
|
|
|
|
UNIONFS=`echo ${CMD_UNIONFS%,*}`
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
UNIONFS=${CMD_UNIONFS}
|
|
|
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
;;
|
|
|
|
|
|
|
|
# Start Volume manager options
|
|
|
|
# Start Volume manager options
|
|
|
|
dolvm)
|
|
|
|
dolvm)
|
|
|
|
USE_LVM_NORMAL=1
|
|
|
|
USE_LVM_NORMAL=1
|
|
|
@ -274,27 +247,16 @@ then
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
|
|
# Set up unionfs
|
|
|
|
|
|
|
|
mkdir -p ${NEW_ROOT}
|
|
|
|
mkdir -p ${NEW_ROOT}
|
|
|
|
setup_unionfs
|
|
|
|
CHROOT=${NEW_ROOT}
|
|
|
|
|
|
|
|
|
|
|
|
if [ "${USE_UNIONFS_NORMAL}" = '1' ]
|
|
|
|
|
|
|
|
then
|
|
|
|
|
|
|
|
CHROOT=${UNION}
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
CHROOT=${NEW_ROOT}
|
|
|
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# Run debug shell if requested
|
|
|
|
# Run debug shell if requested
|
|
|
|
rundebugshell
|
|
|
|
rundebugshell
|
|
|
|
|
|
|
|
|
|
|
|
if [ "${CDROOT}" = '1' ]
|
|
|
|
if [ "${CDROOT}" = '1' ]
|
|
|
|
then
|
|
|
|
then
|
|
|
|
if [ ! "${USE_UNIONFS_NORMAL}" = '1' ]
|
|
|
|
|
|
|
|
then
|
|
|
|
|
|
|
|
good_msg "Making tmpfs for ${NEW_ROOT}"
|
|
|
|
good_msg "Making tmpfs for ${NEW_ROOT}"
|
|
|
|
mount -t tmpfs tmpfs ${NEW_ROOT}
|
|
|
|
mount -t tmpfs tmpfs ${NEW_ROOT}
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
for i in dev mnt mnt/cdrom mnt/livecd mnt/key tmp tmp/.initrd mnt/gentoo sys
|
|
|
|
for i in dev mnt mnt/cdrom mnt/livecd mnt/key tmp tmp/.initrd mnt/gentoo sys
|
|
|
|
do
|
|
|
|
do
|
|
|
@ -608,15 +570,6 @@ then
|
|
|
|
# End cdrom looptype determination and mounting if necessary
|
|
|
|
# End cdrom looptype determination and mounting if necessary
|
|
|
|
#
|
|
|
|
#
|
|
|
|
|
|
|
|
|
|
|
|
if [ "${USE_UNIONFS_NORMAL}" = '1' ]
|
|
|
|
|
|
|
|
then
|
|
|
|
|
|
|
|
union_insert_dir ${UNION} ${NEW_ROOT}/${FS_LOCATION}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# Make sure fstab notes livecd is mounted ro. Makes system skip remount which fails on unionfs dirs.
|
|
|
|
|
|
|
|
sed -e 's|\(.*\s/\s*tmpfs\s*\)defaults\(.*\)|\1defaults,ro\2|' /${UNION}/etc/fstab > /${UNION}/etc/fstab.new
|
|
|
|
|
|
|
|
mv /${UNION}/etc/fstab.new /${UNION}/etc/fstab
|
|
|
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# Unpacking additional packages from NFS mount
|
|
|
|
# Unpacking additional packages from NFS mount
|
|
|
|
# This is useful for adding kernel modules to /lib
|
|
|
|
# This is useful for adding kernel modules to /lib
|
|
|
|
# We do this now, so that additional packages can add whereever they want.
|
|
|
|
# We do this now, so that additional packages can add whereever they want.
|
|
|
@ -634,8 +587,6 @@ then
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if [ "${USE_UNIONFS_NORMAL}" != '1' ]
|
|
|
|
|
|
|
|
then
|
|
|
|
|
|
|
|
good_msg "Copying read-write image contents to tmpfs"
|
|
|
|
good_msg "Copying read-write image contents to tmpfs"
|
|
|
|
# Copy over stuff that should be writable
|
|
|
|
# Copy over stuff that should be writable
|
|
|
|
(cd ${NEW_ROOT}/${FS_LOCATION}; cp -a ${ROOT_TREES} ${NEW_ROOT})
|
|
|
|
(cd ${NEW_ROOT}/${FS_LOCATION}; cp -a ${ROOT_TREES} ${NEW_ROOT})
|
|
|
@ -685,7 +636,6 @@ then
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
mkdir initrd proc tmp sys 2>/dev/null
|
|
|
|
mkdir initrd proc tmp sys 2>/dev/null
|
|
|
|
chmod 1777 tmp
|
|
|
|
chmod 1777 tmp
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#UML=`cat /proc/cpuinfo|grep UML|sed -e 's|model name.*: ||'`
|
|
|
|
#UML=`cat /proc/cpuinfo|grep UML|sed -e 's|model name.*: ||'`
|
|
|
|
#if [ "${UML}" = 'UML' ]
|
|
|
|
#if [ "${UML}" = 'UML' ]
|
|
|
@ -701,12 +651,6 @@ then
|
|
|
|
then
|
|
|
|
then
|
|
|
|
sleep 10
|
|
|
|
sleep 10
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
else
|
|
|
|
|
|
|
|
if [ "${USE_UNIONFS_NORMAL}" = '1' ]
|
|
|
|
|
|
|
|
then
|
|
|
|
|
|
|
|
union_insert_dir ${UNION} ${NEW_ROOT}
|
|
|
|
|
|
|
|
mkdir -p ${UNION}/tmp/.initrd
|
|
|
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
|
|
# Execute script on the cdrom just before boot to update things if necessary
|
|
|
|
# Execute script on the cdrom just before boot to update things if necessary
|
|
|
@ -720,16 +664,6 @@ fi
|
|
|
|
|
|
|
|
|
|
|
|
verbose_kmsg
|
|
|
|
verbose_kmsg
|
|
|
|
|
|
|
|
|
|
|
|
# Move the /memory mount point to what will be the system root so that
|
|
|
|
|
|
|
|
# init scripts will be able to unmount it properly at next reboot
|
|
|
|
|
|
|
|
#
|
|
|
|
|
|
|
|
# Eventually, all "unions over /" mounts should go in that /.unions/
|
|
|
|
|
|
|
|
if [ "${USE_UNIONFS_NORMAL}" = '1' ]
|
|
|
|
|
|
|
|
then
|
|
|
|
|
|
|
|
mkdir -p /${CHROOT}/.unions/memory 2>/dev/null
|
|
|
|
|
|
|
|
mount -o move /memory /${CHROOT}/.unions/memory || echo '*: Failed to move unionfs /memory into the system root!'
|
|
|
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if [ "$0" = '/linuxrc' ] || [ "$0" = 'linuxrc' ]
|
|
|
|
if [ "$0" = '/linuxrc' ] || [ "$0" = 'linuxrc' ]
|
|
|
|
then
|
|
|
|
then
|
|
|
|
[ ! -e ${CHROOT}/dev/console ] && mknod ${CHROOT}/dev/console c 5 1
|
|
|
|
[ ! -e ${CHROOT}/dev/console ] && mknod ${CHROOT}/dev/console c 5 1
|
|
|
|