# Directory used for rw changes in union mount filesystem
UNION=/union
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 ${UNION}
bad_msg "mount of $CHANGESDEV failed falling back to ramdisk based unionfs"
mount -t tmpfs tmpfs $MEMORY
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
good_msg "Mounting ramdisk to $MEMORY for unionfs support..."
mount -t tmpfs tmpfs $MEMORY
bad_msg 'Unionctl not found: aborting use of unionfs!'
else
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
;;
TEMP=${TMPDIR}/$RANDOM.$RANDOM.$RANDOM.$$
+trap_cleanup(){
+ #Call exit code of 1 for failure
+ cleanup
+ exit 1
+}
+
cleanup(){
if [ -n "$TEMP" -a -d "$TEMP" ]; then
rm -rf "$TEMP"
print_info 1 "TMPDIR: ${TMPDIR}"
clear_tmpdir
fi
-
- exit 1
}
-trap cleanup SIGHUP SIGQUIT SIGINT SIGTERM SIGKILL
+
+trap trap_cleanup SIGHUP SIGQUIT SIGINT SIGTERM SIGKILL
BUILD_KERNEL=0
BUILD_INITRD=0
BUILD_MODULES=0