- 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
- if true #[ -n "${SHOWMOUNTS}" ] || ( [ -n "${PERSISTENCE}" ] && [ -z "${NOPERSISTENCE}" ] 1)
- then
- # XXX: is the for loop really necessary? rofslist can only contain one item (see above XXX about EXPOSEDROOT) and this is also assumed elsewhere above (see use of $rofs above).
- for d in ${rofslist}
- do
- live_rofs="/live/rofs/${d##*/}"
- live_rofs_list="${live_rofs_list} ${live_rofs}"
- mkdir -p "${live_rofs}"
- case d in
- *.dir)
- # do nothing # mount -o bind "${d}" "${live_rofs}"
- ;;
- *)
- case "${UNIONTYPE}" in
- unionfs-fuse)
- mount -o bind "${d}" "${live_rofs}"
- ;;
-
- *)
- mount -o move "${d}" "${live_rofs}"
- ;;
- esac
- ;;
- esac
- done
- fi
+ live_rootfs_list=""
+ for d in ${rootfslist}
+ do
+ live_rootfs="/live/rootfs/${d##*/}"
+ live_rootfs_list="${live_rootfs_list} ${live_rootfs}"
+ mkdir -p "${live_rootfs}"
+ case d in
+ *.dir)
+ # do nothing # mount -o bind "${d}" "${live_rootfs}"
+ ;;
+ *)
+ case "${UNIONTYPE}" in
+ unionfs-fuse)
+ mount -o bind "${d}" "${live_rootfs}"
+ ;;
+
+ *)
+ mount -o move "${d}" "${live_rootfs}"
+ ;;
+ esac
+ ;;
+ esac
+ done
+
+ # move all /live mountpoints that the custom persistence
+ # system depends on into /lib/live on the root filesystem
+ for _DIRECTORY in rootfs
+ do
+ if [ -d "/live/${_DIRECTORY}" ]
+ then
+ mkdir -p "${rootmnt}/lib/live/mount/${_DIRECTORY}"
+
+ for _MOUNT in $(ls /live/${_DIRECTORY})
+ do
+ mkdir -p "${rootmnt}/lib/live/mount/${_DIRECTORY}/${_MOUNT}"
+ mount -o move "/live/${_DIRECTORY}/${_MOUNT}" "${rootmnt}/lib/live/mount/${_DIRECTORY}/${_MOUNT}" > /dev/null 2>&1 || \
+ mount -o bind "/live/${_DIRECTORY}/${_MOUNT}" "${rootmnt}/lib/live/mount/${_DIRECTORY}/${_MOUNT}" || \
+ log_warning_msg "W: failed to mount /live/${_DIRECTORY}/${_MOUNT} to ${rootmnt}/lib/live/mount/${_DIRECTORY}/${_MOUNT}"
+ done
+ fi
+ done
+
+ mkdir -p "${rootmnt}/lib/live/mount/overlay"
+ mount -o move /live/overlay "${rootmnt}/lib/live/mount/overlay" > /dev/null 2>&1 || \
+ mount -o bind /live/overlay "${rootmnt}/lib/live/mount/overlay" || \
+ log_warning_msg "W: failed to mount /live/overlay to ${rootmnt}/lib/live/mount/overlay"