diff -Nru bilibop-0.5.5/debian/changelog bilibop-0.5.6/debian/changelog --- bilibop-0.5.5/debian/changelog 2019-01-30 23:52:22.000000000 +0000 +++ bilibop-0.5.6/debian/changelog 2019-05-11 01:40:04.000000000 +0000 @@ -1,3 +1,15 @@ +bilibop (0.5.6) unstable; urgency=high + + * bilibop-lockfs: + - fix boot failure by supporting the new path /usr/bin/mount as well as + the legacy /bin/mount (kept for backward compatibility). + Closes: #928658. + - fix boot failure about mounts flagged 'ro' in fstab by applying the + 'ro' option to the union instead of its writable branch. + Closes: #928780. + + -- Yann Amar Sat, 11 May 2019 01:40:04 +0000 + bilibop (0.5.5) unstable; urgency=low * debian/control: diff -Nru bilibop-0.5.5/lib/bilibop/lockfs_mount_helper bilibop-0.5.6/lib/bilibop/lockfs_mount_helper --- bilibop-0.5.5/lib/bilibop/lockfs_mount_helper 2017-09-11 18:52:36.000000000 +0000 +++ bilibop-0.5.6/lib/bilibop/lockfs_mount_helper 2019-05-11 01:40:04.000000000 +0000 @@ -54,11 +54,17 @@ } # ===========================================================================}}} -# Works only if the parent process is /bin/mount: -if [ "$(readlink -f /proc/${PPID}/exe)" != "/bin/mount" ]; then - usage >&2 - exit 3 -fi +# Works only if the parent process is the mount command (/bin/mount for backward +# compatibility, or /usr/bin/mount). This will ensure arguments are passed in a +# specific order, and shorten the code to parse them. +case "$(readlink -f /proc/${PPID}/exe)" in + "/bin/mount"|"/usr/bin/mount") + ;; + *) + usage >&2 + exit 3 + ;; +esac . /lib/bilibop/common.sh get_bilibop_variables @@ -182,31 +188,32 @@ mntpnt="${2}" options="${4}" -# Parse mount options. Two cases: +# Parse mount options and allocate them to the proper branches or their +# union: # 1. the block device will be mounted with the same options than in the # original fstab entry, plus 'ro'. # 2. the tmpfs will be mounted with only some options of the previous: -# ro, nodev, noexec, nosuid, if they exist. +# nodev, noexec, nosuid, if they exist. +# 3. when set in the persistent fstab, the ro flag could be deferred to +# the tmpfs mount (and the union will inherit of it), but this would +# forbid creation of subdirectories for submountpoints. for opt in $(IFS=','; echo ${options}); do - # 1. Options for the readonly branch: case "${opt}" in fstype=*) eval "${opt}" ;; rw) ;; - *) - robr_opts="${robr_opts:+${robr_opts},}${opt}" + ro) + union_opts="${union_opts:+${union_opts},}${opt}" ;; - esac - - # 2. Options for the writable branch: - case "${opt}" in - ro|nodev|noexec|nosuid) + nodev|noexec|nosuid) rwbr_opts="${rwbr_opts:+${rwbr_opts},}${opt}" + robr_opts="${robr_opts:+${robr_opts},}${opt}" ;; *) + robr_opts="${robr_opts:+${robr_opts},}${opt}" ;; esac done @@ -374,9 +381,9 @@ # Now set the union filesystem mount options if [ "${METHOD}" = "aufs" ]; then - UNIONFS_OPTS="br:${rwbr}=rw:${robr}=${RO}" + UNIONFS_OPTS="${union_opts:+${union_opts},}br:${rwbr}=rw:${robr}=${RO}" elif [ "${METHOD}" = "overlay" ]; then - UNIONFS_OPTS="lowerdir=${robr},upperdir=${rwbr},workdir=${work}" + UNIONFS_OPTS="${union_opts:+${union_opts},}lowerdir=${robr},upperdir=${rwbr},workdir=${work}" fi # Try to mount the union fs now. In case of failure, undo what has been done diff -Nru bilibop-0.5.5/lib/bilibop/lockfs.sh bilibop-0.5.6/lib/bilibop/lockfs.sh --- bilibop-0.5.5/lib/bilibop/lockfs.sh 2017-09-11 18:52:36.000000000 +0000 +++ bilibop-0.5.6/lib/bilibop/lockfs.sh 2019-05-11 01:40:04.000000000 +0000 @@ -319,6 +319,7 @@ #!/bin/sh # THIS IS A FALLBACK; IT DON'T LOCK FS BUT JUST RECALLS /bin/mount WITH VALID FSTYPE AND OPTIONS. PATH="/bin" +[ "\$(readlink -f /proc/\${PPID}/exe)" = "/usr/bin/mount" ] || [ "\$(readlink -f /proc/\${PPID}/exe)" = "/bin/mount" ] || exit 3 for opt in \$(IFS=',' ; echo \${4}) ; do case "\${opt}" in