From f48c016140c4e54b11124dd45419f7ba34ab239c Mon Sep 17 00:00:00 2001 From: Anton Goroshkin Date: Sat, 7 Jan 2017 01:28:40 +0300 Subject: [PATCH] fixes cryptoloop *.enc modules support --- make_uird_magos.sh | 2 +- modules.d/00uird/livekit/livekitlib | 5 +++-- modules.d/00uird/module-setup.sh | 2 ++ 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/make_uird_magos.sh b/make_uird_magos.sh index 5dc0d2c..85f55d5 100755 --- a/make_uird_magos.sh +++ b/make_uird_magos.sh @@ -4,7 +4,7 @@ ln -s ../../modules.d/* ../modules.d/ 2>/dev/null cd ../.. #./dracut/dracut.sh -l -N --strip -f -m "base uird uird-network ntfs kernel-modules kernel-network-modules" \ ./dracut/dracut.sh -l -N --strip -f -m "base uird uird-network ntfs kernel-modules" \ - -d "loop cryptoloop zram aes-generic aes-i586 aes-x86_64 pata_acpi ata_generic ahci xhci-hcd xhci-pci xhci-plat-hcd ohci-pci usb-storage uhci-hcd hid usbhid ehci-hcd ohci-hcd ehci-pci ehci-platform hid-generic + -d "loop cryptoloop cbc zram aes-generic aes-i586 aes-x86_64 pata_acpi ata_generic ahci xhci-hcd xhci-pci xhci-plat-hcd ohci-pci usb-storage uhci-hcd hid usbhid ehci-hcd ohci-hcd ehci-pci ehci-platform hid-generic sr_mod sd_mod scsi_mod jbd jbd2 lockd evdev sunrpc af_packet diff --git a/modules.d/00uird/livekit/livekitlib b/modules.d/00uird/livekit/livekitlib index deaa988..7022fa7 100644 --- a/modules.d/00uird/livekit/livekitlib +++ b/modules.d/00uird/livekit/livekitlib @@ -42,6 +42,7 @@ BIN_FSCK=/sbin/fsck BIN_BTRFSCK=/sbin/btrfsck BIN_BLKID=/sbin/blkid.real BIN_LOSETUP=/sbin/losetup.real +BIN_LOSETUP_CRYPTO=/sbin/losetup.crypto [ -f /etc/initvars ] && . /etc/initvars @@ -753,12 +754,12 @@ mount_device() echolog "$MOUNT_DEVICE_ENC" $green"$DEV"$default times=3 while [ $times -gt 0 ]; do - $BIN_LOSETUP -e AES256 "$LOOPDEV" "$DEV" >/dev/console /dev/console + $BIN_LOSETUP_CRYPTO -e AES256 "$LOOPDEV" "$DEV" >/dev/console /dev/console [ $(cmdline_parameter fsck) ] && fsck_device "$LOOPDEV" mount -n -o $OPTIONS "$LOOPDEV" "$2" >/dev/null 2>&1 ERR=$? [ $ERR -eq 0 ] && break - $BIN_LOSETUP -d "$LOOPDEV" + $BIN_LOSETUP_CRYPTO -d "$LOOPDEV" times=$(expr $times - 1) done fi diff --git a/modules.d/00uird/module-setup.sh b/modules.d/00uird/module-setup.sh index be6a710..ebcfe21 100755 --- a/modules.d/00uird/module-setup.sh +++ b/modules.d/00uird/module-setup.sh @@ -29,6 +29,8 @@ install() { [ -x "$initdir/bin/bash" ] || inst $(type -p bash) "/bin/bash" inst $(type -p blkid) /sbin/blkid.real inst $(type -p losetup) /sbin/losetup.real + [ "$(uname -i)" = "x86_64" -a -x /usr/lib/magos/bin64/losetup ] && inst $(type -p /usr/lib/magos/bin64/losetup ) /sbin/losetup.crypto + [ "$(uname -i)" != "x86_64" -a -x /usr/lib/magos/bin/losetup ] && inst $(type -p /usr/lib/magos/bin/losetup ) /sbin/losetup.crypto _binaries="locale dialog gettext loadkeys resume rsync fsck fsck.ext2 fsck.ext3 fsck.ext4 fsck.exfat fsck.vfat fsck.xfs fsck.btrfs btrfsck ntfsfix" for _i in $_binaries; do