Skip to content

Conversation

@jwsbck
Copy link
Member

@jwsbck jwsbck commented Nov 13, 2025

No description provided.

@jwsbck jwsbck marked this pull request as ready for review November 13, 2025 14:59
@jwsbck jwsbck force-pushed the a_b_update branch 6 times, most recently from 8260275 to 7a405bf Compare November 13, 2025 16:00
daemon/Makefile Outdated
endif

ifeq ($(A_B_UPDATE),y)
SRC_CMODULES += \
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add this to SRC_FILES, this is not a c_* module


IF_FALSE_GOTO(file_exists("/boot/EFI/BOOT/GYROIDOS.EFI.A"), out);
IF_FALSE_GOTO(file_exists("/boot/EFI/BOOT/GYROIDOS.EFI.B"), out);
IF_FALSE_GOTO(file_exists("/data/cml/device.conf.A"), out);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

use DEFAULT_CONF_BASE_PATH (defined in cmld.h) instead of using "/data/cml/"

common/efivars.c Outdated
const char *const argv_clear_boot_0001[] = { "efibootmgr", "-b", "1", "-B", NULL };
// efibootmgr --create --disk /dev/sda --part 1 --label 'Gyroidos0000' --loader \\EFI\\BOOT\\gyroidos.efi.0000
const char *const argv_set_boot_0000[] = { "efibootmgr", "--create-only",
"--disk", "/dev/sda",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We have to get this dynamically, e.g., by udevd generated by-label

@jwsbck jwsbck marked this pull request as draft November 14, 2025 11:01
@jwsbck jwsbck force-pushed the a_b_update branch 2 times, most recently from e580867 to c0bb3ed Compare November 28, 2025 22:59
}

/*****************************************************************************/
/* EFI specific functions */
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should put this in an own c file which is added in the Makefile if A_B_UPDATE_BACKEND is set to 'y'.
Also all a_b_update files should then go into a sub dir like we have for seccomp

@jwsbck jwsbck force-pushed the a_b_update branch 5 times, most recently from b53eeb9 to 1f30791 Compare December 2, 2025 15:26
These provide generic functionality s.t. a similar mechanism can also be
implemented on systems that do not have UEFI boot options.

Signed-off-by: Johannes Wiesböck <[email protected]>
verify_flash_mount_entry() will check if the guestos is the kernel
update and, if so, configure A/B update paths for flashed images. After
flash the A/B update mechanism is instucted to boot into the new
kernel once at the next reboot.

Signed-off-by: Johannes Wiesböck <[email protected]>
Instead of using the plain device.conf path, calculate the path for the
current boot option (device.conf.A or device.conf.B) using the A/B
update mechanism.

Signed-off-by: Johannes Wiesböck <[email protected]>
On every start, run the check routine to find whether A/B update is
completely set up. This will automatically migrate classical
installations to the redundant setup, when started for the first time.

Signed-off-by: Johannes Wiesböck <[email protected]>
A/B update requires keeping more than only the latest version of the
kernel guestos in the guestos store. Usually (if everything works fine)
these are the last two versions, however, this may change if an update
was not successful and was rolled back to the previous version. Then the
'oldold' version on the backup must be kept.

Add an additional check that keeps a guestos if one of the redundant
mount options points corresponds to the kernel image of the guestos.

Signed-off-by: Johannes Wiesböck <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants