redox/scripts/dual-boot.sh
Ojus Chugh 6f30dc5f3e Added mount script for RedoxFS partitions in dual-boot
this Creates mount-redoxfs.sh to handle mounting RedoxFS partitions with
FUSE3 support. Auto-detects redoxfs binary and works with both block
devices and image files. Updates dual-boot.sh to reference the script.

Fixes #1579

Signed-off-by: Ojus Chugh <ojuschugh@gmail.com>
2025-12-07 19:14:05 +05:30

61 lines
1.1 KiB
Bash
Executable File

#!/usr/bin/env bash
# This script install Redox in the free space of your storage device
# and add a boot entry (if you are using the systemd-boot boot loader)
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="$(uname -m)"
fi
if [ -z "${CONFIG_NAME}" ]
then
export CONFIG_NAME=desktop
fi
IMAGE="build/${ARCH}/${CONFIG_NAME}/filesystem.img"
set -x
rm -f "${IMAGE}"
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="recipes/core/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"
echo ""
echo "To mount the RedoxFS partition, run:"
echo " ./scripts/mount-redoxfs.sh ${DISK}"