From 63924fa8bd05d2354de35d078142c89ca4b6bcec Mon Sep 17 00:00:00 2001 From: longpanda Date: Wed, 9 Jun 2021 22:40:08 +0800 Subject: [PATCH] optimize for CRUX --- IMG/cpio/ventoy/hook/crux/disk_hook.sh | 9 +++++---- IMG/cpio/ventoy/hook/ventoy-hook-lib.sh | 7 +++++++ 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/IMG/cpio/ventoy/hook/crux/disk_hook.sh b/IMG/cpio/ventoy/hook/crux/disk_hook.sh index eae7bc04..a4a6ed0a 100644 --- a/IMG/cpio/ventoy/hook/crux/disk_hook.sh +++ b/IMG/cpio/ventoy/hook/crux/disk_hook.sh @@ -31,10 +31,11 @@ done ventoy_extract_vtloopex ${vtdiskname}2 crux + +vtKver=$(uname -r) vtLoopExDir=$VTOY_PATH/vtloopex/crux/vtloopex -$BUSYBOX_PATH/xz -d $vtLoopExDir/dm-mod/$(uname -r)/64/dax.ko.xz -$BUSYBOX_PATH/xz -d $vtLoopExDir/dm-mod/$(uname -r)/64/dm-mod.ko.xz -$BUSYBOX_PATH/insmod $vtLoopExDir/dm-mod/$(uname -r)/64/dax.ko -$BUSYBOX_PATH/insmod $vtLoopExDir/dm-mod/$(uname -r)/64/dm-mod.ko + +ventoy_check_install_module_xz $vtLoopExDir/dm-mod/$vtKver/64/dax.ko +ventoy_check_install_module_xz $vtLoopExDir/dm-mod/$vtKver/64/dm-mod.ko ventoy_udev_disk_common_hook "${vtdiskname#/dev/}2" diff --git a/IMG/cpio/ventoy/hook/ventoy-hook-lib.sh b/IMG/cpio/ventoy/hook/ventoy-hook-lib.sh index 7a3a982e..dde05a0d 100644 --- a/IMG/cpio/ventoy/hook/ventoy-hook-lib.sh +++ b/IMG/cpio/ventoy/hook/ventoy-hook-lib.sh @@ -610,3 +610,10 @@ ventoy_extract_vtloopex() { cd $vtCurPwd } + +ventoy_check_install_module_xz() { + if [ -f "${1}.xz" ]; then + $BUSYBOX_PATH/xz -d "${1}.xz" + $BUSYBOX_PATH/insmod "$1" + fi +}