check_dev ()
{
+ local force fix
sysdev="${1}"
devname="${2}"
skip_uuid_check="${3}"
if [ "$ISO_DEVICE" = "/" ]
then
- echo "Warning: device for bootoption fromiso= ($FROMISO) not found.">>/boot.log
+ # not a block device, check if it's an iso file, for
+ # example an ISO when booting on an ONIE system
+ if echo "${FROMISO}" | grep -q "\.iso$"
+ then
+ fs_type=$(get_fstype "${FROMISO}")
+ if is_supported_fs ${fs_type}
+ then
+ mkdir /run/live/fromiso
+ mount -t $fs_type "${FROMISO}" /run/live/fromiso
+ if [ "$?" != 0 ]
+ then
+ echo "Warning: unable to mount ${FROMISO}." >>/boot.log
+ fi
+ devname="/run/live/fromiso"
+ fi
+ else
+ echo "Warning: device for bootoption fromiso= ($FROMISO) not found.">>/boot.log
+ fi
else
fs_type=$(get_fstype "${ISO_DEVICE}")
if is_supported_fs ${fs_type}
then
- mkdir /live/fromiso
- mount -t $fs_type "$ISO_DEVICE" /live/fromiso
+ mkdir /run/live/fromiso
+ mount -t $fs_type "$ISO_DEVICE" /run/live/fromiso
ISO_NAME="$(echo $FROMISO | sed "s|$ISO_DEVICE||")"
- loopdevname=$(setup_loop "/live/fromiso/${ISO_NAME}" "loop" "/sys/block/loop*" "" '')
+ loopdevname=$(setup_loop "/run/live/fromiso/${ISO_NAME}" "loop" "/sys/block/loop*" "" '')
devname="${loopdevname}"
else
echo "Warning: unable to mount $ISO_DEVICE." >>/boot.log
then
devuid=$(blkid -o value -s UUID "$devname")
[ -n "$devuid" ] && grep -qs "\<$devuid\>" /var/lib/live/boot/devices-already-tried-to-mount && continue
+
+ for _PARAMETER in ${LIVE_BOOT_CMDLINE}
+ do
+ case "${_PARAMETER}" in
+ forcefsck)
+ FORCEFSCK="true"
+ ;;
+ esac
+ done
+
+ if [ "${PERSISTENCE_FSCK}" = "true" ] || [ "${PERSISTENCE_FSCK}" = "yes" ] || [ "${FORCEFSCK}" = "true" ]
+ then
+ force=""
+ if [ "$FORCEFSCK" = "true" ]
+ then
+ force="-f"
+ fi
+
+ fix="-a"
+ if [ "$FSCKFIX" = "true" ] || [ "$FSCKFIX" = "yes" ]
+ then
+ fix="-y"
+ fi
+
+ fsck $fix $force ${devname} >> fsck.log 2>&1
+ fi
+
mount -t ${fstype} -o ro,noatime "${devname}" ${mountpoint} || continue
[ -n "$devuid" ] && echo "$devuid" >> /var/lib/live/boot/devices-already-tried-to-mount
fi
# Try to look if it is already supported by the kernel
+ # For ntfs, since user space program ntfs-3g will be used. Check ntfs-3g instead of kernel module.
+ if [ "${fstype}" = "ntfs" ]; then
+ if type ntfs-3g >/dev/null 2>&1; then
+ return 0
+ else
+ return 1
+ fi
+ fi
if grep -q ${fstype} /proc/filesystems
then
return 0
then
mount_opts="ro,noatime"
fi
- if mount -t "${fstype}" -o "${mount_opts}" "${device}" "${backing}" >/dev/null
+ if mount -t "${fstype}" -o "${mount_opts}" "${device}" "${backing}" >/dev/null 2>&1
then
echo ${backing}
return 0
# in one union together.
#
black_listed_devices=""
- for d in /live/rootfs/* /live/findiso /live/fromiso
+ for d in /run/live/rootfs/* /run/live/findiso /run/live/fromiso
do
black_listed_devices="${black_listed_devices} $(what_is_mounted_on d)"
done
# + a workdir to become mounted
# + workdir and upperdir to reside under the same mount
# + workdir and upperdir to be in separate directories
- mkdir "${unionrw}/rw"
- mkdir "${unionrw}/work"
+ mkdir -p "${unionrw}/rw"
+ mkdir -p "${unionrw}/work"
unionmountopts="-o noatime,lowerdir=${unionro},upperdir=${unionrw}/rw,workdir=${unionrw}/work"
;;
esac
get_custom_mounts ()
{
- # Side-effect: leaves $devices with persistence.conf mounted in /live/persistence
+ # Side-effect: leaves $devices with persistence.conf mounted in /run/live/persistence
# Side-effect: prints info to file $custom_mounts
local custom_mounts devices bindings links
if [ -n "${LIVE_BOOT_DEBUG}" ] && [ -e "${include_list}" ]
then
- cp ${include_list} /live/persistence/${persistence_list}.${device_name}
+ cp ${include_list} /run/live/persistence/${persistence_list}.${device_name}
fi
while read dir options # < ${include_list}
rootfs_dest_backing=""
if [ -n "${opt_link}" ] || [ -n "${opt_union}" ]
then
- for d in /live/rootfs/*
+ for d in /run/live/rootfs/*
do
if [ -n "${rootmnt}" ]
then