patches and low-level development discussion
 help / color / mirror / code / Atom feed
e6236bc2d31348f6be08577e3e798993761bda78 blob 1199 bytes (raw)

 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
 
#!/bin/execlineb -S0
# SPDX-FileCopyrightText: 2021 Alyssa Ross <hi@alyssa.is>
# SPDX-License-Identifier: EUPL-1.2

export PATH /bin

if { mount -a }

piperw 3 4
if { fdmove 1 4 /etc/getuuids }
fdclose 4
# head -1 would be clearer, but it might use buffered I/O and consume
# too much from the fifo.  Ideally we'd have line(1) from illumos.
backtick ROOTFS_UUID { fdmove 0 3 dd count=1 bs=37 status=none }
backtick VERITY_UUID { fdmove 0 3 dd count=1 bs=37 status=none }
fdclose 3

if { mkfifo /dev/rootfs.poll }

background {
  fdclose 3
  mdevd -C -b134217728
}
importas -iu mdevd_pid !

if { modprobe ext4 }

# Do a blocking read on the fifo to wait for mdevd to find the
# partition.
if {
  redirfd -r 0 /dev/rootfs.poll
  redirfd -w 1 /dev/null
  head -c 1
}
background { kill $mdevd_pid }
background { rm /dev/rootfs.poll }

if {
  importas -i roothash roothash
  veritysetup open /dev/rootfs root-verity /dev/verity $roothash
}

background { rm /dev/rootfs /dev/verity }

if { mount /dev/mapper/root-verity /mnt/root }
wait { $mdevd_pid }

if { mount --move /proc /mnt/root/proc }
if { mount --move /sys /mnt/root/sys }
if { mount --move /dev /mnt/root/dev }

switch_root /mnt/root
/etc/init
debug log:

solving e6236bc ...
found e6236bc in https://spectrum-os.org/lists/archives/spectrum-devel/20220423124630.749434-1-hi@alyssa.is/
found bb58c84 in https://spectrum-os.org/git/spectrum
preparing index
index prepared:
100755 bb58c84005f9435c4d81c7f97d215e1d52a06fee	host/initramfs/etc/init

applying [1/1] https://spectrum-os.org/lists/archives/spectrum-devel/20220423124630.749434-1-hi@alyssa.is/
diff --git a/host/initramfs/etc/init b/host/initramfs/etc/init
index bb58c84..e6236bc 100755

Checking patch host/initramfs/etc/init...
Applied patch host/initramfs/etc/init cleanly.

index at:
100755 e6236bc2d31348f6be08577e3e798993761bda78	host/initramfs/etc/init

Code repositories for project(s) associated with this public inbox

	https://spectrum-os.org/git/crosvm
	https://spectrum-os.org/git/doc
	https://spectrum-os.org/git/mktuntap
	https://spectrum-os.org/git/nixpkgs
	https://spectrum-os.org/git/spectrum
	https://spectrum-os.org/git/ucspi-vsock
	https://spectrum-os.org/git/www

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).