Merge branch 'master' of https://gitlab.redox-os.org/redox-os/redox
This commit is contained in:
commit
87a4b14cd9
53
scripts/dual-boot.sh
Executable file
53
scripts/dual-boot.sh
Executable file
|
@ -0,0 +1,53 @@
|
||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
set -e
|
||||||
|
|
||||||
|
if [ -n "$1" ]
|
||||||
|
then
|
||||||
|
DISK="$1"
|
||||||
|
else
|
||||||
|
DISK=/dev/disk/by-partlabel/REDOX_INSTALL
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ ! -b "${DISK}" ]
|
||||||
|
then
|
||||||
|
echo "$0: '${DISK}' is not a block device" >&2
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ -z "${ARCH}" ]
|
||||||
|
then
|
||||||
|
export ARCH=x86_64
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ -z "${CONFIG_NAME}" ]
|
||||||
|
then
|
||||||
|
export CONFIG_NAME=demo
|
||||||
|
fi
|
||||||
|
|
||||||
|
IMAGE="build/${ARCH}/${CONFIG_NAME}/filesystem.img"
|
||||||
|
set -x
|
||||||
|
make "${IMAGE}"
|
||||||
|
sudo popsicle "${IMAGE}" "${DISK}"
|
||||||
|
set +x
|
||||||
|
|
||||||
|
ESP="$(bootctl --print-esp-path)"
|
||||||
|
if [ -z "${ESP}" ]
|
||||||
|
then
|
||||||
|
echo "$0: no ESP found" >&2
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
BOOTLOADER="cookbook/recipes/bootloader/target/${ARCH}-unknown-redox/stage/boot/bootloader.efi"
|
||||||
|
set -x
|
||||||
|
sudo mkdir -pv "${ESP}/EFI" "${ESP}/loader/entries"
|
||||||
|
sudo cp -v "${BOOTLOADER}" "${ESP}/EFI/redox.efi"
|
||||||
|
sudo tee "${ESP}/loader/entries/redox.conf" <<EOF
|
||||||
|
title Redox OS
|
||||||
|
efi /EFI/redox.efi
|
||||||
|
EOF
|
||||||
|
set +x
|
||||||
|
|
||||||
|
sync
|
||||||
|
|
||||||
|
echo "Finished installing Redox OS dual boot"
|
Loading…
Reference in a new issue