50b731f1b7
Derivative of Redox OS (https://www.redox-os.org) adding: - AMD GPU driver (amdgpu) via LinuxKPI compat layer - ext4 filesystem support (ext4d scheme daemon) - ACPI fixes for AMD bare metal (x2APIC, DMAR, IVRS, MCFG) - Custom branding (hostname, os-release, boot identity) Build system is full upstream Redox with RBOS overlay in local/. Patches for kernel, base, and relibc are symlinked from local/patches/ and protected from make clean/distclean. Custom recipes live in local/recipes/ with symlinks into the recipes/ search path. Build: make all CONFIG_NAME=redbear-full Sync: ./local/scripts/sync-upstream.sh
53 lines
1.5 KiB
Bash
Executable File
53 lines
1.5 KiB
Bash
Executable File
#!/usr/bin/env bash
|
|
|
|
# Your host must use the static IP ${NETWORK}.1 and subnet mask 255.255.255.0
|
|
# 'Rx' in ascii is 82 and 120, adjust to taste
|
|
NETWORK=10.82.120
|
|
|
|
set -ex
|
|
|
|
trap 'kill -HUP 0' EXIT
|
|
|
|
eval $(make setenv)
|
|
make "${BUILD}/rbos-live.iso"
|
|
|
|
echo "Allowing packet forwarding"
|
|
echo 1 | sudo tee /proc/sys/net/ipv4/ip_forward
|
|
|
|
iface="$(route | grep '^default ' | grep -o '[^ ]*$' | head -n 1)"
|
|
echo "Forwarding packets to '$iface'"
|
|
if ! sudo iptables -t nat -C POSTROUTING -o "$iface" -j MASQUERADE
|
|
then
|
|
echo "Forwarding rule does not exist, adding"
|
|
sudo iptables -t nat -A POSTROUTING -o "$iface" -j MASQUERADE
|
|
else
|
|
echo "Forwarding rule already exists"
|
|
fi
|
|
|
|
ARGS=(
|
|
"--no-daemon"
|
|
"--bind-interfaces"
|
|
"--listen-address=${NETWORK}.1"
|
|
"--port=0"
|
|
"--dhcp-range=${NETWORK}.3,${NETWORK}.254,255.255.255.0,1h"
|
|
"--dhcp-option=6,1.1.1.1,1.0.0.1"
|
|
"--enable-tftp"
|
|
"--tftp-root=$(realpath "${BUILD}")"
|
|
# BIOS
|
|
"--dhcp-match=set:bios,option:client-arch,0"
|
|
"--dhcp-boot=tag:!ipxe,tag:bios,undionly.kpxe"
|
|
# EFI x86_64
|
|
"--dhcp-match=set:efi-x86_64,option:client-arch,7"
|
|
"--dhcp-match=set:efi-x86_64,option:client-arch,9"
|
|
"--dhcp-boot=tag:!ipxe,tag:efi-x86_64,ipxe-x86_64.efi"
|
|
# EFI aarch64
|
|
"--dhcp-match=set:efi-aarch64,option:client-arch,11"
|
|
"--dhcp-boot=tag:!ipxe,tag:efi-aarch64,ipxe-aarch64.efi"
|
|
# IPXE
|
|
"--dhcp-userclass=set:ipxe,iPXE"
|
|
"--dhcp-boot=tag:ipxe,rbos.ipxe"
|
|
)
|
|
|
|
sudo dnsmasq "${ARGS[@]}"&
|
|
python3 -m http.server -b "${NETWORK}.1" -d "${BUILD}" "8080"
|