summaryrefslogtreecommitdiffstats
path: root/modules.d/90dmsquash-live-ntfs
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-06-03 13:54:25 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-06-03 13:54:25 +0000
commit9cb1c4df7b9ce1a9ad1312621b0f2b16a94fba3a (patch)
tree2efb72864cc69e174c9c5ee33efb88a5f1553b48 /modules.d/90dmsquash-live-ntfs
parentInitial commit. (diff)
downloaddracut-9cb1c4df7b9ce1a9ad1312621b0f2b16a94fba3a.tar.xz
dracut-9cb1c4df7b9ce1a9ad1312621b0f2b16a94fba3a.zip
Adding upstream version 060+5.upstream/060+5
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'modules.d/90dmsquash-live-ntfs')
-rwxr-xr-xmodules.d/90dmsquash-live-ntfs/module-setup.sh21
-rwxr-xr-xmodules.d/90dmsquash-live-ntfs/mount-ntfs-3g.sh20
2 files changed, 41 insertions, 0 deletions
diff --git a/modules.d/90dmsquash-live-ntfs/module-setup.sh b/modules.d/90dmsquash-live-ntfs/module-setup.sh
new file mode 100755
index 0000000..7aa5802
--- /dev/null
+++ b/modules.d/90dmsquash-live-ntfs/module-setup.sh
@@ -0,0 +1,21 @@
+#!/bin/bash
+
+check() {
+ require_binaries ntfs-3g || return 1
+ return 255
+}
+
+depends() {
+ echo dmsquash-live
+ return 0
+}
+
+install() {
+ inst_multiple fusermount mount.fuse ntfs-3g
+ inst_script "$moddir/mount-ntfs-3g.sh" "/sbin/mount-ntfs-3g"
+ dracut_need_initqueue
+}
+
+installkernel() {
+ hostonly='' instmods fuse
+}
diff --git a/modules.d/90dmsquash-live-ntfs/mount-ntfs-3g.sh b/modules.d/90dmsquash-live-ntfs/mount-ntfs-3g.sh
new file mode 100755
index 0000000..289205c
--- /dev/null
+++ b/modules.d/90dmsquash-live-ntfs/mount-ntfs-3g.sh
@@ -0,0 +1,20 @@
+#!/bin/sh
+
+type vwarn > /dev/null 2>&1 || . /lib/dracut-lib.sh
+
+# Symlinking /usr/bin/ntfs-3g as /sbin/mount.ntfs seems to boot
+# at the first glance, but ends with lots and lots of squashfs
+# errors, because systemd attempts to kill the ntfs-3g process?!
+# See https://systemd.io/ROOT_STORAGE_DAEMONS/
+if [ -x "/usr/bin/ntfs-3g" ]; then
+ (
+ ln -s /usr/bin/ntfs-3g /run/@ntfs-3g
+ (sleep 1 && rm /run/@ntfs-3g) &
+ # shellcheck disable=SC2123
+ PATH=/run
+ exec @ntfs-3g "$@"
+ ) | vwarn
+else
+ die "Failed to mount block device of live image: Missing NTFS support"
+ exit 1
+fi