return 1
}
+grml_match_bootid()
+{
+ path="$1"
+
+ if [ -n "$IGNORE_BOOTID" ] ; then
+ echo " * Ignoring verification of bootid.txt as requested via ignore_bootid.">>/boot.log
+ return 0
+ fi
+
+ if [ -n "$BOOTID" ] && ! [ -r "${path}/conf/bootid.txt" ] ; then
+ echo " * Warning: bootid=... specified but no bootid.txt found on currently requested device.">>/boot.log
+ return 1
+ fi
+
+ [ -r "${path}/conf/bootid.txt" ] || return 0
+
+ bootid_conf=$(cat "${path}/conf/bootid.txt")
+
+ if [ -z "$BOOTID" -a -z "$IGNORE_BOOTID" ]
+ then
+ echo " * Warning: bootid.txt found but ignore_bootid / bootid=.. bootoption missing...">>/boot.log
+ return 1
+ fi
+
+ if [ "$BOOTID" = "$bootid_conf" ]
+ then
+ echo " * Successfully verified /conf/bootid.txt from ISO, continuing... ">>/boot.log
+ else
+ echo " * Warning: BOOTID of ISO does not match. Retrying and continuing search...">>/boot.log
+ return 1
+ fi
+
+ return 0
+}
+
+
matches_uuid ()
{
if [ "${IGNORE_UUID}" ] || [ ! -e /conf/uuid.conf ]
fi
if is_live_path ${mountpoint} && \
- ([ "${skip_uuid_check}" ] || matches_uuid ${mountpoint})
+ ([ "${skip_uuid_check}" ] || grml_match_bootid ${mountpoint})
then
echo ${mountpoint}
return 0
return 0
fi
done
- elif [ "${fstype}" = "squashfs" -o \
- "${fstype}" = "btrfs" -o \
- "${fstype}" = "ext2" -o \
- "${fstype}" = "ext3" -o \
- "${fstype}" = "ext4" -o \
- "${fstype}" = "jffs2" ]
- then
- # This is an ugly hack situation, the block device has
- # an image directly on it. It's hopefully
- # live-boot, so take it and run with it.
- ln -s "${devname}" "${devname}.${fstype}"
- echo "${devname}.${fstype}"
- return 0
fi
done
return 1
fi
+ # get_fstype might report "unknown" or "swap", ignore it as no such kernel module exists
+ if [ "${fstype}" = "unknown" ] || [ "${fstype}" = "swap" ]
+ then
+ return 1
+ fi
+
# Try to look if it is already supported by the kernel
if grep -q ${fstype} /proc/filesystems
then
rw_opt="rw"
ro_opt="rr+wh"
noxino_opt="noxino"
- ;;
-
- unionfs-fuse)
- rw_opt="RW"
- ro_opt="RO"
- ;;
- *)
- rw_opt="rw"
- ro_opt="ro"
- ;;
- esac
-
- case "${UNIONTYPE}" in
- unionfs-fuse)
- unionmountopts="-o cow -o noinitgroups -o default_permissions -o allow_other -o use_ino -o suid"
- unionmountopts="${unionmountopts} ${unionrw}=${rw_opt}"
+ unionmountopts="-o noatime,${noxino_opt},dirs=${unionrw}=${rw_opt}"
if [ -n "${unionro}" ]
then
for rofs in ${unionro}
unionmountopts="${unionmountopts}:${rofs}=${ro_opt}"
done
fi
- ( sysctl -w fs.file-max=391524 ; ulimit -HSn 16384
- unionfs-fuse ${unionmountopts} "${unionmountpoint}" ) && \
- ( mkdir -p /run/sendsigs.omit.d
- pidof unionfs-fuse >> /run/sendsigs.omit.d/unionfs-fuse || true )
;;
overlay)
then
panic "overlay needs at least one lower filesystem (read-only branch)."
fi
- unionmountopts="-o noatime,lowerdir=${unionro},upperdir=${unionrw}"
- mount -t ${UNIONTYPE} ${unionmountopts} ${UNIONTYPE} "${unionmountpoint}"
- ;;
-
- *)
- unionmountopts="-o noatime,${noxino_opt},dirs=${unionrw}=${rw_opt}"
- if [ -n "${unionro}" ]
- then
- for rofs in ${unionro}
- do
- unionmountopts="${unionmountopts}:${rofs}=${ro_opt}"
- done
- fi
- mount -t ${UNIONTYPE} ${unionmountopts} ${UNIONTYPE} "${unionmountpoint}"
+ # overlayfs requires:
+ # + 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"
+ unionmountopts="-o noatime,lowerdir=${unionro},upperdir=${unionrw}/rw,workdir=${unionrw}/work"
;;
esac
+
+ mount -t ${UNIONTYPE} ${unionmountopts} ${UNIONTYPE} "${unionmountpoint}"
}
get_custom_mounts ()
echo ${used_devices}
}
+fix_backwards_compatibility ()
+{
+ local device dir opt backing include_list
+ device=${1}
+ dir=${2}
+ opt=${3}
+
+ if [ -n "${PERSISTENCE_READONLY}" ]
+ then
+ return
+ fi
+
+ backing="$(mount_persistence_media ${device})"
+ if [ -z "${backing}" ]
+ then
+ return
+ fi
+
+ include_list="${backing}/${persistence_list}"
+ if [ ! -r "${include_list}" ] && [ ! -r "${backing}/${old_persistence_list}" ]
+ then
+ echo "# persistence backwards compatibility:
+${dir} ${opt},source=." > "${include_list}"
+ fi
+}
+
is_mountpoint ()
{
directory="$1"