# Reading configuration file from filesystem and live-media
for _FILE in /etc/live/boot.conf /etc/live/boot/* \
- /lib/live/mount/media/live/boot.conf /lib/live/mount/media/live/boot/*
+ /run/live/medium/live/boot.conf /run/live/medium/live/boot/*
do
if [ -e "${_FILE}" ]
then
#!/bin/sh
-mountpoint="/live/medium"
+mountpoint="/run/live/medium"
alt_mountpoint="/media"
LIVE_MEDIA_PATH="live"
HOSTNAME="host"
esac
# Remove persistence
- cd /live/overlay && find . -not -name 'persistence.conf' | xargs rm -rf
+ cd /run/live/overlay && find . -not -name 'persistence.conf' | xargs rm -rf
}
mount_images_in_directory "${livefs_root}" "${rootmnt}" "${mac}"
fi
- # At this point /root should contain the final root filesystem.
- # Move all mountpoints below /live into /root/lib/live/mount.
- # This has to be done after mounting the root filesystem to /
- # otherwise these mount points won't be accessible from the running system.
- for _MOUNT in $(cat /proc/mounts | cut -f 2 -d " " | grep -e "^/live/")
- do
- local newmount
- newmount="${rootmnt}/lib/live/mount/${_MOUNT#/live/}"
- mkdir -p "${newmount}"
- mount -o move "${_MOUNT}" "${newmount}" > /dev/null 2>&1 || \
- mount -o bind "${_MOUNT}" "${newmount}" > /dev/null || \
- log_warning_msg "W: failed to move or bindmount ${_MOUNT} to ${newmount}"
- done
-
if [ -n "${ROOT_PID}" ]
then
echo "${ROOT_PID}" > "${rootmnt}"/lib/live/root.pid
then
losetup -d /dev/loop0
- if is_mountpoint /root/lib/live/mount/findiso
+ if is_mountpoint /run/live/findiso
then
- umount /root/lib/live/mount/findiso
- rmdir --ignore-fail-on-non-empty /root/lib/live/mount/findiso \
+ umount /run/live/findiso
+ rmdir --ignore-fail-on-non-empty /run/live/findiso \
>/dev/null 2>&1 || true
fi
fi
if [ -f ${mountpoint}/${FINDISO} ]
then
umount ${mountpoint}
- mkdir -p /live/findiso
- mount -t ${fstype} -o ro,noatime "${devname}" /live/findiso
- loopdevname=$(setup_loop "/live/findiso/${FINDISO}" "loop" "/sys/block/loop*" 0 "")
+ mkdir -p /run/live/findiso
+ mount -t ${fstype} -o ro,noatime "${devname}" /run/live/findiso
+ loopdevname=$(setup_loop "/run/live/findiso/${FINDISO}" "loop" "/sys/block/loop*" 0 "")
devname="${loopdevname}"
mount -t iso9660 -o ro,noatime "${devname}" ${mountpoint}
else
# get_custom_mounts() might call this with a directory path instead
# of a block device path. This means we have found sub-directory path
- # underneath /lib/live/mounts/persistence, so we're done
+ # underneath /run/live/persistence, so we're done
if [ -d "${device}" ]
then
echo "${device}"
return 1
fi
- backing="/live/persistence/$(basename ${device})"
+ backing="/run/live/persistence/$(basename ${device})"
mkdir -p "${backing}"
old_backing="$(where_is_mounted ${device})"
continue
fi
- if trim_path ${dir} | grep -q -e "^[^/]" -e "^/lib" -e "^/lib/live\(/.*\)\?$" -e "^/\(.*/\)\?\.\.\?\(/.*\)\?$"
+ if trim_path ${dir} | grep -q -e "^[^/]" -e "^/lib" -e "^/run/live\(/.*\)\?$" -e "^/\(.*/\)\?\.\.\?\(/.*\)\?$"
then
- log_warning_msg "Skipping unsafe custom mount ${dir}: must be an absolute path containing neither the \".\" nor \"..\" special dirs, and cannot be \"/lib\", or \"/lib/live\" or any of its sub-directories."
+ log_warning_msg "Skipping unsafe custom mount ${dir}: must be an absolute path containing neither the \".\" nor \"..\" special dirs, and cannot be \"/lib\", or \"/run/live\" or any of its sub-directories."
continue
fi
local cow_dir links_source
if [ -n "${opt_link}" ] && [ -z "${PERSISTENCE_READONLY}" ]
then
- link_files ${source} ${dest} "s|^/live/|/lib/live/mount/|"
+ link_files ${source} ${dest} ""
elif [ -n "${opt_link}" ] && [ -n "${PERSISTENCE_READONLY}" ]
then
- mkdir -p ${rootmnt}/lib/live/mount/persistence
- links_source=$(mktemp -d ${rootmnt}/lib/live/mount/persistence/links-source-XXXXXX)
+ mkdir -p /run/live/persistence
+ links_source=$(mktemp -d /run/live/persistence/links-source-XXXXXX)
chown_ref ${source} ${links_source}
chmod_ref ${source} ${links_source}
# We put the cow dir in the below strange place to
# has its own directory and isn't nested with some
# other custom mount (if so that mount's files would
# be linked, causing breakage.
- cow_dir="/live/overlay/lib/live/mount/persistence/$(basename ${links_source})"
+ cow_dir="/run/live/overlay/run/live/persistence/$(basename ${links_source})"
mkdir -p ${cow_dir}
chown_ref "${source}" "${cow_dir}"
chmod_ref "${source}" "${cow_dir}"
# bind-mount and union mount are handled the same
# in read-only mode, but note that rootfs_dest_backing
# is non-empty (and necessary) only for unions
- cow_dir="/live/overlay/${dest}"
+ cow_dir="/run/live/overlay/${dest}"
if [ -e "${cow_dir}" ] && [ -z "${opt_link}" ]
then
# If an earlier custom mount has files here
panic "${UNIONTYPE} not available."
fi
- # run-init can't deal with images in a subdir, but we're going to
- # move all of these away before it runs anyway. No, we're not,
- # put them in / since move-mounting them into / breaks mono and
- # some other apps.
-
- croot="/"
+ croot="/run/live/rootfs"
# Let's just mount the read-only file systems first
rootfslist=""
# tmpfs file systems
touch /etc/fstab
- mkdir -p /live/overlay
- mount -t tmpfs tmpfs /live/overlay
+ mkdir -p /run/live/overlay
# Looking for persistence devices or files
if [ -n "${PERSISTENCE}" ] && [ -z "${NOPERSISTENCE}" ]
if [ -n "${PERSISTENCE_READONLY}" ] && [ "${cowdevice}" != "tmpfs" ]
then
mount -t tmpfs -o rw,noatime,mode=755,size=${OVERLAY_SIZE:-50%} tmpfs "/live/overlay"
- root_backing="/live/persistence/$(basename ${cowdevice})-root"
+ root_backing="/run/live/persistence/$(basename ${cowdevice})-root"
mkdir -p ${root_backing}
else
- root_backing="/live/overlay"
+ root_backing="/run/live/overlay"
fi
if [ "${cow_fstype}" = "nfs" ]
for dir in ${cow_dirs}; do
unionmountpoint=$(trim_path "${rootmnt}${dir}")
mkdir -p ${unionmountpoint}
- cow_dir=$(trim_path "/live/overlay${dir}")
+ cow_dir=$(trim_path "/run/live/overlay${dir}")
rootfs_dir="${rootfs}${dir}"
mkdir -p ${cow_dir}
if [ -n "${PERSISTENCE_READONLY}" ] && [ "${cowdevice}" != "tmpfs" ]
chmod 1777 "${rootmnt}"/tmp
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}"
- ;;
- *)
- mount -o move "${d}" "${live_rootfs}"
- ;;
- esac
- done
-
# Adding custom persistence
if [ -n "${PERSISTENCE}" ] && [ -z "${NOPERSISTENCE}" ]
then
# Gather information about custom mounts from devies detected as overlays
get_custom_mounts ${custom_mounts} ${overlay_devices}
- [ -n "${LIVE_BOOT_DEBUG}" ] && cp ${custom_mounts} "/lib/live/mount/persistence"
+ [ -n "${LIVE_BOOT_DEBUG}" ] && cp ${custom_mounts} "/run/live/persistence"
# Now we do the actual mounting (and symlinking)
local used_overlays
fi
done
fi
-
- # ensure that a potentially stray tmpfs gets removed
- # otherways, initramfs-tools is unable to remove /live
- # and fails to boot
- umount /live/overlay > /dev/null 2>&1 || true
}