# tmpfs file systems
touch /etc/fstab
- mkdir -p /live
- mount -t tmpfs tmpfs /live
mkdir -p /live/overlay
+ mount -t tmpfs tmpfs /live/overlay
# Looking for persistence devices or files
if [ -n "${PERSISTENCE}" ] && [ -z "${NOPERSISTENCE}" ]
# Correct the permissions of /:
chmod 0755 "${rootmnt}"
+ # Correct the permission of /tmp:
+ if [ -d "${rootmnt}/tmp" ]
+ then
+ chmod 1777 "${rootmnt}"/tmp
+ fi
+
live_rofs_list=""
# SHOWMOUNTS is necessary for custom mounts with the union option
# Since we may want to do custom mounts in user-space it's best to always enable SHOWMOUNTS
done
fi
- mkdir -p "${rootmnt}/live"
- mount -o move /live "${rootmnt}/live" >/dev/null 2>&1 || mount -o bind /live "${rootmnt}/live" || log_warning_msg "Unable to move or bind /live to ${rootmnt}/live"
+ # make /root/lib/live writable for moving filesystems
+ mkdir -p "${rootmnt}/lib/live"
+ mount -t tmpfs tmpfs "${rootmnt}/lib/live"
+
+ # move all mountpoints to root filesystem
+ for _DIRECTORY in rofs persistence
+ do
+ if [ -d "/live/${_DIRECTORY}" ]
+ then
+ mkdir -p "${rootmnt}/lib/live/${_DIRECTORY}"
+
+ for _MOUNT in $(ls /live/${_DIRECTORY})
+ do
+ mkdir -p "${rootmnt}/lib/live/${_DIRECTORY}/${_MOUNT}"
+ mount -o move "/live/${_DIRECTORY}/${_MOUNT}" "${rootmnt}/lib/live/${_DIRECTORY}/${_MOUNT}" > /dev/null 2>&1 || \
+ mount -o bind "/live/${_DIRECTORY}/${_MOUNT}" "${rootmnt}/lib/live/${_DIRECTORY}/${_MOUNT}" || \
+ log_warning_msg "W: failed to mount /live/${_DIRECTORY}/${_MOUNT} to ${rootmnt}/lib/live/${_DIRECTORY}/${_MOUNT}"
+ done
+ fi
+ done
- # shows cow fs on /overlay (FIXME: do we still need/want this? probably yes)
- mkdir -p "${rootmnt}/live/overlay"
- mount -o move /live/overlay "${rootmnt}/live/overlay" >/dev/null 2>&1 || mount -o bind /overlay "${rootmnt}/live/overlay" || log_warning_msg "Unable to move or bind /overlay to ${rootmnt}/live/overlay"
+ mkdir -p "${rootmnt}/lib/live/overlay"
+ mount -o move /live/overlay "${rootmnt}/lib/live/overlay" > /dev/null 2>&1 || \
+ mount -o bind /live/overlay "${rootmnt}/lib/live/overlay" || \
+ log_warning_msg "W: failed to mount /live/overlay to ${rootmnt}/lib/live/overlay"
}