Add NTFS support to 90dmsquash-live module (#191)

Support booting from USB media with NTFS filesystem (optionally),
which removes the FAT32 related 4 GB file size limit for LiveOS/
squashfs.img (and any other file on the same USB media).
master
Robert Scheck 2017-06-30 00:15:57 +02:00
parent 106255afd4
commit 37437cac8a
2 changed files with 36 additions and 1 deletions

View File

@ -0,0 +1,22 @@
#!/bin/bash

command -v

check() {
require_binaries ntfs-3g || return 1
return 255
}

depends() {
echo 90dmsquash-live
return 0
}

install() {
inst_multiple fusermount ulockmgr_server mount.fuse ntfs-3g
dracut_need_initqueue
}

installkernel() {
hostonly='' instmods fuse
}

View File

@ -78,7 +78,20 @@ if [ -f $livedev ]; then
esac
[ -e /sys/fs/$fstype ] || modprobe $fstype
else
mount -n -t $fstype -o ${liverw:-ro} $livedev /run/initramfs/live
if [ "$(blkid -o value -s TYPE $livedev)" != "ntfs" ]; then
mount -n -t $fstype -o ${liverw:-ro} $livedev /run/initramfs/live
else
# 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?!
if [ -x "$(find_binary "ntfs-3g")" ]; then
( exec -a @ntfs-3g ntfs-3g -o ${liverw:-ro} $livedev /run/initramfs/live ) | vwarn
else
die "Failed to mount block device of live image: Missing NTFS support"
exit 1
fi
fi

if [ "$?" != "0" ]; then
die "Failed to mount block device of live image"
exit 1