FDS/OS 1.0
This commit is contained in:
Executable
+24
@@ -0,0 +1,24 @@
|
||||
#!/usr/bin/env bash
|
||||
source "$(dirname -- "${BASH_SOURCE[0]}")/lib.sh"
|
||||
[[ $# == 0 ]] || die 'Usage: tools/prepare-vm'
|
||||
use_xbps
|
||||
check_void_pin
|
||||
need mkfs.ext4
|
||||
cd "$FDS_ROOT"
|
||||
source config/vm-test.conf
|
||||
mkdir -p .host/vm-input/{var/db/xbps/keys,config} out/cache/vm out/vm-kernel
|
||||
cp "$FDS_VOID/common/repo-keys/"*.plist .host/vm-input/var/db/xbps/keys/
|
||||
package="out/cache/vm/$VM_KERNEL_PACKAGE-$VM_KERNEL_VERSION.aarch64.xbps"
|
||||
if [[ ! -f $package ]]; then
|
||||
[[ ${FDS_OFFLINE:-0} != 1 ]] || die "Missing offline VM kernel: $package"
|
||||
XBPS_ARCH=aarch64 xbps-install -r "$FDS_ROOT/.host/vm-input" \
|
||||
-C "$FDS_ROOT/.host/vm-input/config" -c "$FDS_ROOT/out/cache/vm" \
|
||||
-i -R "$VM_REPOSITORY" -SyD "$VM_KERNEL_PACKAGE-$VM_KERNEL_VERSION"
|
||||
fi
|
||||
printf '%s %s\n' "$VM_KERNEL_SHA256" "$package" | sha256sum -c -
|
||||
tar -xf "$package" -C out/vm-kernel ./boot
|
||||
[[ -s out/vm-kernel/boot/vmlinux-$VM_KERNEL_VERSION ]] || die 'Missing VM kernel image'
|
||||
for symbol in CONFIG_SATA_AHCI CONFIG_EXT4_FS CONFIG_SERIAL_AMBA_PL011_CONSOLE CONFIG_PCI_HOST_GENERIC CONFIG_DEVTMPFS_MOUNT; do
|
||||
grep -qx "$symbol=y" "out/vm-kernel/boot/config-$VM_KERNEL_VERSION" || die "VM kernel needs built-in $symbol"
|
||||
done
|
||||
printf 'PASS: signed, pinned generic ARM test kernel prepared\n'
|
||||
Reference in New Issue
Block a user