feat(guanghu-os): add pre-root supervisor source slice
This commit is contained in:
parent
0a39761bed
commit
29bb023455
13 changed files with 403 additions and 3 deletions
|
|
@ -0,0 +1,6 @@
|
|||
schema=guanghu.first-boot-supervisor/v1
|
||||
node_id=JD-FD-PRIMARY
|
||||
instance_id=f3d4b730-7f02-452f-975b-7091a4800431
|
||||
root_uuid=9e4550a0-452b-4f28-b5a5-d5364aa450f6
|
||||
linux_rescue_entry=gnulinux-simple-9e4550a0-452b-4f28-b5a5-d5364aa450f6
|
||||
linux_code_bridge=hlcc-jd-candidate.service
|
||||
|
|
@ -0,0 +1,17 @@
|
|||
#!/bin/sh
|
||||
set -eu
|
||||
|
||||
PREREQ=""
|
||||
prereqs() { echo "${PREREQ}"; }
|
||||
case "${1:-}" in prereqs) prereqs; exit 0 ;; esac
|
||||
|
||||
. /usr/share/initramfs-tools/hook-functions
|
||||
|
||||
: "${GUANGHU_FIRST_BOOT_SUPERVISOR_SOURCE:?supervisor source is required}"
|
||||
: "${GUANGHU_FIRST_BOOT_CONFIG_SOURCE:?configuration source is required}"
|
||||
: "${GUANGHU_FIRST_BOOT_GRUB_SOURCE:?GRUB snapshot source is required}"
|
||||
|
||||
copy_exec "${GUANGHU_FIRST_BOOT_SUPERVISOR_SOURCE}" /usr/lib/guanghu/guanghu-first-boot-supervisor
|
||||
copy_file config "${GUANGHU_FIRST_BOOT_CONFIG_SOURCE}" /etc/guanghu/first-boot-supervisor.conf
|
||||
copy_file config "${GUANGHU_FIRST_BOOT_GRUB_SOURCE}" /etc/guanghu/grub.cfg.snapshot
|
||||
chmod 0600 "${DESTDIR}/etc/guanghu/first-boot-supervisor.conf"
|
||||
|
|
@ -0,0 +1,13 @@
|
|||
#!/bin/sh
|
||||
set -eu
|
||||
|
||||
PREREQ=""
|
||||
prereqs() { echo "${PREREQ}"; }
|
||||
case "${1:-}" in prereqs) prereqs; exit 0 ;; esac
|
||||
|
||||
. /scripts/functions
|
||||
|
||||
if ! /usr/lib/guanghu/guanghu-first-boot-supervisor pre-root; then
|
||||
panic "Guanghu pre-root authority validation failed; refusing root handoff"
|
||||
exit 1
|
||||
fi
|
||||
Loading…
Reference in a new issue