Added unionfs patches from bug #121334.

git-svn-id: svn+ssh://svn.gentoo.org/var/svnroot/genkernel/trunk@374 67a159dc-881f-0410-a524-ba9dfbe2cb84
cleanup-cruft
Chris Gianelloni 19 years ago
parent 3098153d53
commit accba45515

@ -572,7 +572,7 @@ setup_unionfs() {
# Directory used for rw changes in union mount filesystem
UNION=/union
MEMORY=/memory
if [ -n "$UID" ]
if [ -z "$UID" ]
then
CHANGES=$MEMORY/unionfs_changes/default
else
@ -596,9 +596,9 @@ setup_unionfs() {
bad_msg "mount of $CHANGESDEV failed falling back to ramdisk based unionfs"
mount -t tmpfs tmpfs $MEMORY
fi
if [ ! -f ${MEMORY}/livecd.unionfs ]
if [ "${CDROOT}" -eq '1' -a ! -f ${MEMORY}/livecd.unionfs ]
then
umount $CHANGESDEV
umount $MEMORY
bad_msg "failed to find livecd.unionfs file on $CHANGESDEV"
bad_msg "create a livecd.unionfs file on this device if you wish to use it for unionfs"
bad_msg "falling back to ramdisk based unionfs for safety"

@ -533,7 +533,7 @@ then
if [ "${USE_UNIONFS_NORMAL}" -eq '1' ]
then
union_insert_dir $UNION /${NEW_ROOT}/${FS_LOCATION}
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
@ -619,7 +619,13 @@ then
CDBOOT=1
[ "${DO_slowusb}" ] && sleep 10
else
mkdir -p ${NEW_ROOT}/tmp/.initrd
if [ "${USE_UNIONFS_NORMAL}" -eq '1' ]
then
union_insert_dir ${UNION} ${NEW_ROOT}
mkdir -p ${UNION}/tmp/.initrd
else
mkdir -p ${NEW_ROOT}/tmp/.initrd
fi
fi
# Execute script on the cdrom just before boot to update things if necessary
@ -633,6 +639,17 @@ fi
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}" -eq '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' ]
then
[ ! -e ${CHROOT}/dev/console ] && mknod ${CHROOT}/dev/console c 5 1

Loading…
Cancel
Save