Skip to content

Commit e266e49

Browse files
authored
feat: [NODE-1650] Resurrect dfinity.system kernel arg (#6072)
1 parent 400e4f4 commit e266e49

File tree

19 files changed

+46
-37
lines changed

19 files changed

+46
-37
lines changed

ic-os/bootloader/build-bootloader-tree.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/bin/bash
22

33
# This builds the filesystem tree for the /boot hierarchy containing
4-
# the /grub and /boot/efi portions. From this, the grub and
4+
# the /boot/grub and /boot/efi portions. From this, the grub and
55
# efi partitions of the disk image can be built.
66

77
set -exo pipefail
@@ -37,8 +37,8 @@ sudo podman --root "${TMPFS}" build --iidfile "${TMPDIR}/iidfile" - <<<"
3737
FROM $BASE_IMAGE
3838
USER root:root
3939
RUN apt-get -y update && apt-get -y --no-install-recommends install grub-efi faketime
40-
RUN mkdir -p /build/grub
41-
RUN cp -r /usr/lib/grub/x86_64-efi /build/grub
40+
RUN mkdir -p /build/boot/grub
41+
RUN cp -r /usr/lib/grub/x86_64-efi /build/boot/grub
4242
RUN mkdir -p /build/boot/efi/EFI/Boot
4343
RUN grub-mkimage --version
4444
RUN apt list --installed | grep grub
@@ -55,4 +55,4 @@ IMAGE_ID=$(cut -d':' -f2 <"${TMPDIR}/iidfile")
5555
CONTAINER=$(sudo podman --root "${TMPFS}" run --network=host --cgroupns=host -d "${IMAGE_ID}")
5656

5757
sudo podman --root "${TMPFS}" export "${CONTAINER}" | tar --strip-components=1 -C "${TMPDIR}" -x build
58-
tar cf "${OUT_FILE}" --sort=name --owner=root:0 --group=root:0 "--mtime=UTC 1970-01-01 00:00:00" -C "${TMPDIR}" boot grub
58+
tar cf "${OUT_FILE}" --sort=name --owner=root:0 --group=root:0 "--mtime=UTC 1970-01-01 00:00:00" -C "${TMPDIR}" boot

ic-os/bootloader/defs.bzl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,11 @@ def build_grub_partition(name, grub_config, visibility = None, tags = None):
1919
name = name,
2020
src = Label("//ic-os/bootloader:bootloader-tree.tar"),
2121
extra_files = {
22-
grub_config: "/grub/grub.cfg:0644",
23-
"//ic-os/bootloader:grubenv": "/grub/grubenv:0644",
22+
grub_config: "/boot/grub/grub.cfg:0644",
23+
"//ic-os/bootloader:grubenv": "/boot/grub/grubenv:0644",
2424
},
2525
partition_size = "100M",
26-
subdir = "grub",
26+
subdir = "boot/grub",
2727
target_compatible_with = [
2828
"@platforms//os:linux",
2929
],

ic-os/bootloader/guestos_boot_args.template

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,5 @@
55
# the system will use SELinux and keep track of operations that would
66
# be prohibited, but will only log but not actually deny them. This is
77
# useful for debug and policy development.
8-
BOOT_ARGS_A="root=/dev/vda5 console=ttyS0 nomodeset security=selinux selinux=1 enforcing=1 root_hash=ROOT_HASH"
9-
BOOT_ARGS_B="root=/dev/vda8 console=ttyS0 nomodeset security=selinux selinux=1 enforcing=1 root_hash=ROOT_HASH"
8+
BOOT_ARGS_A="root=/dev/vda5 console=ttyS0 nomodeset dfinity.system=A security=selinux selinux=1 enforcing=1 root_hash=ROOT_HASH"
9+
BOOT_ARGS_B="root=/dev/vda8 console=ttyS0 nomodeset dfinity.system=B security=selinux selinux=1 enforcing=1 root_hash=ROOT_HASH"
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
# Kernel cmdline parameters for launching the HostOS.
22
# BOOT_ARGS_A targets partition set "A" while BOOT_ARGS_B targets partition set "B"
3-
BOOT_ARGS_A="root=/dev/hostlvm/A_root console=ttyS0,115200 console=tty0 nomodeset video=1024x768 security=selinux selinux=1 enforcing=0"
4-
BOOT_ARGS_B="root=/dev/hostlvm/B_root console=ttyS0,115200 console=tty0 nomodeset video=1024x768 security=selinux selinux=1 enforcing=0"
3+
BOOT_ARGS_A="root=/dev/hostlvm/A_root console=ttyS0,115200 console=tty0 nomodeset video=1024x768 dfinity.system=A security=selinux selinux=1 enforcing=0"
4+
BOOT_ARGS_B="root=/dev/hostlvm/B_root console=ttyS0,115200 console=tty0 nomodeset video=1024x768 dfinity.system=B security=selinux selinux=1 enforcing=0"

ic-os/components/early-boot/fstab/fstab-guestos

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/dev/rootfs / ext4 ro,errors=remount-ro 0 1
22
tmpfs /tmp tmpfs defaults 0 2
33
/dev/vda1 /boot/efi vfat defaults 0 2
4-
/dev/vda2 /grub vfat defaults 0 2
4+
/dev/vda2 /boot/grub vfat defaults 0 2
55
/dev/vda3 /boot/config ext4 defaults,sync 0 2
66
/dev/mapper/var_crypt /var ext4 defaults 0 2
77
/dev/mapper/store-shared--backup /var/lib/ic/backup ext4 defaults,context=system_u:object_r:ic_data_t:s0 0 2
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/dev/rootfs / ext4 ro,errors=remount-ro 0 1
22
tmpfs /tmp tmpfs defaults 0 2
33
PARTUUID=f46600e3-d0e6-4258-9607-e64b13cf7595 /boot/efi vfat defaults 0 2
4-
PARTUUID=1a7c28b7-efe0-4f17-9230-678cf2df8db2 /grub vfat defaults 0 2
4+
PARTUUID=1a7c28b7-efe0-4f17-9230-678cf2df8db2 /boot/grub vfat defaults 0 2
55
/dev/hostlvm/config /boot/config ext4 defaults,sync 0 2

ic-os/components/early-boot/fstab/fstab-setupos

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
PARTUUID=7c0a626e-e5ea-e543-b5c5-300eb8304db7 / ext4 ro,errors=remount-ro 0 1
22
tmpfs /tmp tmpfs defaults 0 2
33
PARTUUID=b78084e2-3363-1346-8c25-d426f26b8928 /boot/efi vfat defaults 0 2
4-
PARTUUID=6788e4cf-f456-104e-9a34-a2c58cfb0ee6 /grub vfat defaults 0 2
4+
PARTUUID=6788e4cf-f456-104e-9a34-a2c58cfb0ee6 /boot/grub vfat defaults 0 2
55
PARTUUID=a5ba3816-beaa-d74d-993e-cfa5aa6ba1f6 /config vfat defaults 0 2
66
PARTUUID=ddf618fe-7244-b446-a175-3296e6b9d02e /boot ext4 defaults,sync 0 2
77
PARTUUID=e97bf7b1-9400-439f-93d0-13276111f989 /data ext4 defaults,sync 0 2

ic-os/components/hostos-scripts/grub-upgrader/grub-upgrader.service

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[Unit]
22
Description=Upgrade grub.cfg file
3-
RequiresMountsFor=/boot /grub
3+
RequiresMountsFor=/boot/grub
44

55
[Service]
66
Type=oneshot

ic-os/components/hostos-scripts/grub-upgrader/grub-upgrader.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22
set -euo pipefail
33

44
SRC="/boot/grub.cfg"
5-
DST="/grub/grub.cfg"
5+
DST="/boot/grub/grub.cfg"
66

77
read_boot_state() {
8-
local grubenv_file="/grub/grubenv"
8+
local grubenv_file="/boot/grub/grubenv"
99

1010
if [ ! -f "${grubenv_file}" ]; then
1111
echo "Grubenv file ${grubenv_file} not found. Cannot determine boot cycle state." >&2

ic-os/components/monitoring/grub-version/grub-version.service

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
[Unit]
22
Description=Grub version
33
Before=node_exporter.service
4+
RequiresMountsFor=/boot/grub
45

56
[Service]
67
Type=oneshot

0 commit comments

Comments
 (0)