limine/qloader2-install
2020-04-07 07:24:19 +02:00

22 lines
417 B
Bash
Executable File

#!/bin/sh
set -e
# We take 1 argument, the device to use.
if [ -z "$2" ]; then
echo "Usage: $0 <path to qloader2 binary> <device>"
exit 1
fi
# Variables.
DEVICE="$2"
MBR="$(mktemp)"
QLOADER2="$1"
# Copy the loader to the device.
dd if="$DEVICE" of="$MBR" bs=1 count=64 skip=446
dd if="$QLOADER2" of="$DEVICE" conv=notrunc
dd if="$MBR" of="$DEVICE" conv=notrunc bs=1 count=64 seek=446
rm "$MBR"