Skip to content

Commit 903fd7a

Browse files
authored
Support booting T2SDE ISOs better (#3468)
T2 uses zstd compressed kernel modules, where dm-mod also depends on dax module. So the default fallback to only decompress dm-mod isn't sufficient. So we manually uncompress dax.ko and dm-mod.ko and insmod this, as default busybox modprobe/insmod doesn't support zstd modules.
1 parent 81728a8 commit 903fd7a

1 file changed

Lines changed: 13 additions & 1 deletion

File tree

IMG/cpio/ventoy/hook/t2/disk_hook.sh

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,19 @@ fi
2525

2626
VTPATH_OLD=$PATH; PATH=$BUSYBOX_PATH:$VTOY_PATH/tool:$PATH
2727

28-
modprobe dm-mod
28+
vtlog "Loading dax and dm-mod module ..."
29+
$BUSYBOX_PATH/modprobe dax > /dev/null 2>&1
30+
$BUSYBOX_PATH/modprobe dm-mod > /dev/null 2>&1
31+
32+
if $GREP -q 'device-mapper' /proc/devices; then
33+
vtlog "dm-mod module check success ..."
34+
else
35+
vtlog "Need to extract dax and dm-mod module ..."
36+
$VTOY_PATH/tool/zstdcat /lib/modules/$(uname -r)/drivers/dax/dax.ko.zst > $VTOY_PATH/extract_dax.ko
37+
$BUSYBOX_PATH/insmod $VTOY_PATH/extract_dax.ko
38+
$VTOY_PATH/tool/zstdcat /lib/modules/$(uname -r)/drivers/md/dm-mod.ko.zst > $VTOY_PATH/extract_dm_mod.ko
39+
$BUSYBOX_PATH/insmod $VTOY_PATH/extract_dm_mod.ko
40+
fi
2941

3042
wait_for_usb_disk_ready
3143

0 commit comments

Comments
 (0)