summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoranonym <anonym@riseup.net>2016-06-15 23:51:59 +0200
committeranonym <anonym@riseup.net>2016-06-15 23:51:59 +0200
commit305e4933516e7022a9010615976cc7f21bad57a7 (patch)
tree03c1739255e51240d139ed58500103540718dbee
parent435cf1745a7700774cf90ce16fbdd9650f3513bd (diff)
Patch live-boot to support bind-mounting individual files.feature/11533-persistent-bind-mounted-files
A first attempt. Will-fix: #11533
-rw-r--r--config/chroot_local-patches/live-boot_bind-mount-files.patch38
1 files changed, 38 insertions, 0 deletions
diff --git a/config/chroot_local-patches/live-boot_bind-mount-files.patch b/config/chroot_local-patches/live-boot_bind-mount-files.patch
new file mode 100644
index 0000000..f2729ae
--- /dev/null
+++ b/config/chroot_local-patches/live-boot_bind-mount-files.patch
@@ -0,0 +1,38 @@
+diff --git a/components/9990-misc-helpers.sh b/components/9990-misc-helpers.sh
+index 9951873..e8b4f27 100755
+--- a/lib/live/boot/9990-misc-helpers.sh
++++ b/lib/live/boot/9990-misc-helpers.sh
+@@ -1513,7 +1513,7 @@ activate_custom_mounts ()
+ fi
+ fi
+
+- if [ ! -d "${dest}" ]
++ if [ ! -e "${dest}" ]
+ then
+ # create the destination and delete existing files in
+ # its path that are in the way
+@@ -1544,7 +1544,13 @@ activate_custom_mounts ()
+ # dealing with /etc or other system dir.
+ if [ ! -d "${source}" ]
+ then
+- if [ -n "${PERSISTENCE_READONLY}" ]
++ if [ -f "${source}" ]
++ then
++ rm -rf "${dest}"
++ touch "${dest}"
++ chown_ref "${source}" "${dest}"
++ chmod_ref "${source}" "${dest}"
++ elif [ -n "${PERSISTENCE_READONLY}" ]
+ then
+ continue
+ elif [ -n "${opt_union}" ] || [ -n "${opt_link}" ]
+@@ -1610,6 +1616,9 @@ activate_custom_mounts ()
+ elif [ -n "${opt_bind}" ] && [ -z "${PERSISTENCE_READONLY}" ]
+ then
+ mount --bind "${source}" "${dest}"
++ elif [ -n "${opt_bind}" ] && [ -n "${PERSISTENCE_READONLY}" ] && [ -f "${source}" ]
++ then
++ cp -a "${source}" "${dest}"
+ elif [ -n "${opt_bind}" -o -n "${opt_union}" ] && [ -n "${PERSISTENCE_READONLY}" ]
+ then
+ # bind-mount and union mount are handled the same