-
Notifications
You must be signed in to change notification settings - Fork 25
A/B Update #556
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
A/B Update #556
Conversation
8260275 to
7a405bf
Compare
daemon/Makefile
Outdated
| endif | ||
|
|
||
| ifeq ($(A_B_UPDATE),y) | ||
| SRC_CMODULES += \ |
There was a problem hiding this comment.
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
daemon/a_b_update.c
Outdated
|
|
||
| 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); |
There was a problem hiding this comment.
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", |
There was a problem hiding this comment.
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
e580867 to
c0bb3ed
Compare
Signed-off-by: Johannes Wiesböck <[email protected]>
Signed-off-by: Johannes Wiesböck <[email protected]>
daemon/a_b_update.c
Outdated
| } | ||
|
|
||
| /*****************************************************************************/ | ||
| /* EFI specific functions */ |
There was a problem hiding this comment.
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
b53eeb9 to
1f30791
Compare
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]>
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]>
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]>
No description provided.