Fix exit 1 issue being always called. Add UID support for unionfs. add check for livecd.unionfs file on blockdev

git-svn-id: svn+ssh://svn.gentoo.org/var/svnroot/genkernel/trunk@275 67a159dc-881f-0410-a524-ba9dfbe2cb84
cleanup-cruft
Eric Edgar 20 years ago
parent 132905237e
commit 1845cce130

@ -539,7 +539,13 @@ setup_unionfs(){
# Directory used for rw changes in union mount filesystem # Directory used for rw changes in union mount filesystem
UNION=/union UNION=/union
MEMORY=/memory MEMORY=/memory
CHANGES=$MEMORY/changes if [ -n "$UID" ]
then
CHANGES=$MEMORY/unionfs_changes/default
else
CHANGES=$MEMORY/unionfs_changes/$UID
fi
mkdir -p ${MEMORY} mkdir -p ${MEMORY}
mkdir -p ${UNION} mkdir -p ${UNION}
@ -558,6 +564,14 @@ setup_unionfs(){
bad_msg "mount of $CHANGESDEV failed falling back to ramdisk based unionfs" bad_msg "mount of $CHANGESDEV failed falling back to ramdisk based unionfs"
mount -t tmpfs tmpfs $MEMORY mount -t tmpfs tmpfs $MEMORY
fi fi
if [ ! -f ${MEMORY}/livecd.unionfs ]
then
umount $CHANGESDEV
bad_msg "failed to find livecd.unionfs file on $CHANGESDEV"
bad_msg "falling back to ramdisk based unionfs for safety"
bad_msg "create a livecd.unionfs file on this device if you wish to use it for unionfs"
mount -t tmpfs tmpfs $MEMORY
fi
else else
good_msg "Mounting ramdisk to $MEMORY for unionfs support..." good_msg "Mounting ramdisk to $MEMORY for unionfs support..."
mount -t tmpfs tmpfs $MEMORY mount -t tmpfs tmpfs $MEMORY

@ -100,7 +100,15 @@ do
bad_msg 'Unionctl not found: aborting use of unionfs!' bad_msg 'Unionctl not found: aborting use of unionfs!'
else else
USE_UNIONFS_NORMAL=1 USE_UNIONFS_NORMAL=1
UNIONFS=`parse_opt "${x}"` 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 fi
;; ;;

@ -27,6 +27,12 @@ source ${GK_BIN}/gen_bootloader.sh || gen_die "Could not read ${GK_BIN}/gen_boot
TEMP=${TMPDIR}/$RANDOM.$RANDOM.$RANDOM.$$ TEMP=${TMPDIR}/$RANDOM.$RANDOM.$RANDOM.$$
trap_cleanup(){
#Call exit code of 1 for failure
cleanup
exit 1
}
cleanup(){ cleanup(){
if [ -n "$TEMP" -a -d "$TEMP" ]; then if [ -n "$TEMP" -a -d "$TEMP" ]; then
rm -rf "$TEMP" rm -rf "$TEMP"
@ -47,10 +53,9 @@ cleanup(){
print_info 1 "TMPDIR: ${TMPDIR}" print_info 1 "TMPDIR: ${TMPDIR}"
clear_tmpdir clear_tmpdir
fi fi
exit 1
} }
trap cleanup SIGHUP SIGQUIT SIGINT SIGTERM SIGKILL
trap trap_cleanup SIGHUP SIGQUIT SIGINT SIGTERM SIGKILL
BUILD_KERNEL=0 BUILD_KERNEL=0
BUILD_INITRD=0 BUILD_INITRD=0
BUILD_MODULES=0 BUILD_MODULES=0

Loading…
Cancel
Save