rust-kernel
Rustbelt: a hobby x86_64 kernel written in Rust
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 | #!/usr/bin/env bash
# Stage 21: boot contract v2, end to end. Boots the real (headless) kernel
# with the usual four data disks plus a writable copy of the GPT test disk
# (target/rootfs-gpt.img, made by build.rs), so main.rs finds the
# "Linux root (x86-64)" partition, mounts it at /, starts /sbin/init
# (user/inittest.c) as pid 1, and ends the run with init's exit status.
#
# inittest exits 7 when all its checks pass, and the kernel turns exit(n)
# into QEMU exit code 33 + 2n, so this script wants QEMU to exit with 47.
# Afterwards it runs e2fsck and fsck.exfat on the two partitions of the
# copy, which init wrote to.
#
# Usage: ./scripts/boot-v2-check.sh
T=""
# e2fsck, fsck.exfat
IMG=/x86_64-rust_kernel/debug/bootimage-rustbelt.bin
ROOT=/boot-v2-root.img
LOG=/boot-v2-serial.log
|
code=
ok=1
for; do
|| { ; ok=0; }
done
[ || { ; ok=0; }
# The partitions (start and size in 512-byte sectors, as build.rs made them).
|| { ; ok=0; }
|| { ; ok=0; }
if [; then
fi
|