boot2

Playing with the boostrap
git clone https://git.ryansepassi.com/git/boot2.git
Log | Files | Refs | README

boot.sh (1716B)


      1 #!/bin/sh
      2 ## boot.sh — drive boot0 → boot6 end-to-end under one driver.
      3 
      4 set -eu
      5 
      6 case "${1:-}" in
      7     -h|--help)
      8         cat <<'EOF'
      9 boot.sh — drive boot0 → boot6 end-to-end under one driver.
     10 
     11 Usage:
     12   boot/boot.sh <aarch64|amd64|riscv64>
     13 
     14 Environment variables (all optional):
     15   DRIVER                          podman (default) | seed.
     16                                   podman: containerised builds.
     17                                   seed:   builds run inside the tcc-built
     18                                           seed kernel under qemu (requires
     19                                           one prior DRIVER=podman pass to
     20                                           mint build/$ARCH/podman/boot6/).
     21   BOOT3_TIMEOUT (default 1800)    boot3 (scheme1)   wall-clock seconds.
     22   BOOT4_TIMEOUT (default 5400)    boot4 (tcc1/2/3)  wall-clock seconds.
     23   BOOT5_TIMEOUT (default 7200)    boot5 (musl)      wall-clock seconds.
     24   BOOT6_TIMEOUT (default 1200)    boot6 (kernel)    wall-clock seconds.
     25   QEMU_MEM      (default 3072M)   guest RAM passed to the seed-driver qemu.
     26 EOF
     27         exit 0
     28         ;;
     29 esac
     30 
     31 . boot/lib-arch.sh
     32 bootlib_init boot "${1:-}"
     33 
     34 if [ "$DRIVER" = seed ]; then
     35     KERNEL=build/$ARCH/podman/boot6/$KERNEL_NAME
     36     if [ ! -f "$KERNEL" ]; then
     37         echo "[$BOOT_TAG] missing $KERNEL" >&2
     38         echo "[$BOOT_TAG]   run './boot/boot.sh $ARCH' first (default DRIVER=podman) to produce it" >&2
     39         exit 1
     40     fi
     41 fi
     42 
     43 
     44 # Boot stages read source from build/$ARCH/src/ exclusively.
     45 ./bootprep/prep-src.sh $ARCH
     46 
     47 rm -rf build/$ARCH/$DRIVER
     48 ./boot/boot0.sh $ARCH
     49 ./boot/boot1.sh $ARCH
     50 ./boot/boot2.sh $ARCH
     51 ./boot/boot3.sh $ARCH
     52 ./boot/boot4.sh $ARCH
     53 ./boot/boot5.sh $ARCH
     54 ./boot/boot6.sh $ARCH