diff options
author | Eric Hameleers <alien@slackware.com> | 2023-01-03 22:16:28 +0100 |
---|---|---|
committer | Eric Hameleers <alien@slackware.com> | 2023-01-03 22:16:28 +0100 |
commit | db70f3856f1245207c2521d90075575b675c10c4 (patch) | |
tree | 92df80f1abb90bdcc03e6bf38b759fd8f7bb60bd | |
parent | bf892f2c7fc89cc7f63abfa18f669b4aa24211a9 (diff) | |
download | liveslak-db70f3856f1245207c2521d90075575b675c10c4.tar.gz liveslak-db70f3856f1245207c2521d90075575b675c10c4.tar.xz |
Make Ventoy detection compatible with Slackware 14.2
Diffstat (limited to '')
-rw-r--r-- | liveinit.tpl | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/liveinit.tpl b/liveinit.tpl index 6d24184..32c7986 100644 --- a/liveinit.tpl +++ b/liveinit.tpl @@ -823,8 +823,15 @@ if [ "$RESCUE" = "" ]; then # Detect Ventoy in memory (don't use the provided hooks), see # https://www.ventoy.net/en/doc_compatible_format.html: dd if=/dev/mem of=/vent.dmp bs=1 skip=$((0x80000)) count=$((0xA0000-0x80000)) 2>/dev/null + # Use 'strings' to find the decimal offset of the magic string; # With 'xargs' we remove leading and ending spaces: - OFFSET=$(strings -t d /vent.dmp |grep ' www.ventoy.net' |xargs |cut -d' ' -f1) + if strings -t d /vent.dmp 1>/dev/null 2>/dev/null ; then + # Busybox in Slackware 15.0 or newer: + OFFSET=$(strings -t d /vent.dmp |grep ' www.ventoy.net' |xargs |cut -d' ' -f1) + else + # Busybox in Slackware 14.2 or older: + OFFSET=$(strings -o /vent.dmp |grep ' www.ventoy.net' |xargs |cut -d' ' -f1) + fi if [ -n "${OFFSET}" ]; then echo "${MARKER}: (BIOS) Ventoy ISO boot detected..." ISOBOOT="ventoy" |