Repository navigation
os: a boot chain mounts its own data partition and says LIVE from USB or INSTALLED on <disk> (#711) - #727
Conversation
f318dfa to
25d035a
Compare
e0e8ae1 to
e1f0ebc
Compare
25d035a to
a4689c8
Compare
11a47b7 to
c671fdc
Compare
… or INSTALLED on <disk> (#711) Two 1BIT-DATA partitions are normal once a machine is installed, and LABEL=1BIT-DATA answered with whichever the kernel found first: the first install's fallback boot ran the stick's kernel over the NVMe's data and said 'live usb' while the banner facts came from the NVMe. mkimage now makes a data UUID and names it on the kernel command line (1bit.data=UUID=...), which lives in the grub.cfg of the ESP the firmware just loaded; 1bit-install gives the target disk its own UUID and rewrites the copied grub.cfg after the byte-for-byte verification. init mounts that partition and nothing else, and the chooser, the MODE lines and 1bit-menu's header name the device: LIVE from USB /dev/sda, or INSTALLED on nvme0n1. The QEMU gate asserts the installed banner names the disk.
…ading digit is not a shell assignment (#710) The gate passed '1BIT_INSTALL_NO_REBOOT=1 1bit-install …' over ssh and the remote sh answered 'sh: 1BIT_INSTALL_NO_REBOOT=1: not found' (rc=127): a name that starts with a digit is not a valid variable assignment, so the shell read it as a command. Renamed in install.sh and vmtest.sh.
… as the machine's own address (#711, #705) The QEMU live boot said 'LIVE from the internal disk /dev/sda' for a usb-storage stick (QEMU reports removable=0 for it), and 'Lemonade: up on http://0.0.0.0:13305/' which is not an address anyone can open. The bus the disk sits on decides USB, and a 0.0.0.0/:: bind is shown as the first global IPv4.
a4689c8 to
1969c94
Compare
5ec6111 to
b3d215a
Compare
bong-water-water-bong
left a comment
There was a problem hiding this comment.
VERDICT: READY
At 5ec6111f (+81 −16, 5 files). The last of the stack, and the bug it fixes is the nastiest one in it.
The fix is wired at both ends, which is what makes it real. init.sh reads its own data partition from the cmdline:
dataspec=$(sed -n 's/.*[[:space:]]1bit\.data=\([^[:space:]]*\).*/\1/p' /proc/cmdline)
… if [ -n "$dataspec" ]; then data=$(findfs "$dataspec"); else data=$(findfs LABEL=1BIT-DATA); fi
and the two writers both produce that token: mkimage.sh:685 appends 1bit.data=UUID=$datauuid to the live grub cmdline, install.sh:318 rewrites 1bit.data=UUID=… in the installed ESP's grub.cfg to the UUID it just created (and logs it). So the boot chain names its own data partition instead of a label that two partitions can share — the 2026-10-31 failure (stick kernel + installed system's /data, banner saying "live usb" while the facts came from the NVMe) cannot recur, and the LABEL= lookup stays as the fallback rather than the rule.
Both gate strings survive, which is the check this stack exists to protect:
MODE: INSTALLED on ${disk:-an unknown disk}still containsINSTALLED, and the new gate assertion wantsINSTALLED on nvme, which is exactly what the banner now prints;- the live line keeps
LIVE: runs from RAMverbatim, with[from $WHERE]appended.
bash -n clean on all five files, and the partition node → parent disk derivation (/sys/class/block/<node>/..) is the right way to name the disk for the banner.
Not verified: the two-partition case itself needs the QEMU install gate (install, then boot with the stick still attached) — deferred while another lane's VM is live. That is the run this PR deserves, since it is the exact scenario it was written for; it belongs with #726's boot-entry check in one gate run.
tprs-ready applied. Stack note: #719 and #720 are still the two items holding this whole chain.
PR Reviewer Guide 🔍Here are some key observations to aid the review process:
|
1b1f937
into
osv2/709-efivarfs-bootentry
|
Superseded by #742 — the same reviewed content as one commit on |
Fixes #711. After the first install the firmware fell back to the stick, and init mounted the internal NVMe's
data partition (same label), ran the stick's kernel over the installed system's data and said "live usb" while
the banner facts came from the NVMe.
The boot chain now says where its data lives: mkimage makes a data-partition UUID and puts
1bit.data=UUID=...on the kernel command line, which lives in the grub.cfg of the ESP the firmware just loaded;
1bit-installgivesthe target disk its own UUID and rewrites the copied grub.cfg - after step 6 has verified the copy byte-for-byte.
init mounts exactly that partition, derives the parent disk and whether it is removable, and the chooser, the
MODE lines and 1bit-menu's header say
LIVE from USB /dev/sdaorINSTALLED on nvme0n1. The QEMU gate assertsthe installed banner names the disk.
PR-READY.