Fix typo in error message
Unhardcode transport while pulling a composefs repository on
switch
Signed-off-by: Pragyan Poudyal <pragyanpoudyal41999@gmail.com>
Refactor to use `#[cfg(feature = "composefs-backend")]` to gate
composefs native features behind the flag.
Gate the following features
- `--composefs-native` and its corresponding cli args
- Installing/Switching/Upgrading/RollingBack of composefs native system
- Create separate install, rollback functions for ostree for a bit
cleaner of a setup
Signed-off-by: Pragyan Poudyal <pragyanpoudyal41999@gmail.com>
Move all composefs-native related stuff into `lib/src/bootc_composefs`.
This might help us to spot diff while merging into main, also should
hopefully create less conflicts
Signed-off-by: Pragyan Poudyal <pragyanpoudyal41999@gmail.com>
For bind mounting /etc we copy the contents of the EROFS' /etc to the
deployment's state directory
Mounting the EORFS requires help from the initramfs crate, so we also
turn it into a library crate.
Signed-off-by: Johan-Liebert1 <pragyanpoudyal41999@gmail.com>
Signed-off-by: Robert Sturla <robertsturla@outlook.com>
install: create temporary directory for ESP bls mount
Plus additional review comments:
- Created constant for EFI/LINUX
- Switched from Task to Command
- Create efi_dir as Utf8PathBuf
Signed-off-by: Robert Sturla <robertsturla@outlook.com>
The duplication between this and composefs-boot is high
and we need to squash it; an important step there
would probably be lowering the karg parsing.
Signed-off-by: Colin Walters <walters@verbum.org>
Instaed of writing all present menuentries, only write the menuentry for
switch/upgrade and the menuentry for the currently booted deployment.
Signed-off-by: Johan-Liebert1 <pragyanpoudyal41999@gmail.com>
Instead of `/sysroot/state/os/fedora` use `/sysroot/state/os/default` as
the default state directory.
Signed-off-by: Johan-Liebert1 <pragyanpoudyal41999@gmail.com>
If two deployments have the same VMLinuz + Initrd then, we can use the
same binaries for both the deployments.
Before writing the BLS entries to disk we calculate the SHA256Sum
of VMLinuz + Initrd combo, then test if any other deployment has the
same SHA256Sum for the binaries. Store the hash in the origin file under
`boot -> hash` for future lookups.
Signed-off-by: Johan-Liebert1 <pragyanpoudyal41999@gmail.com>
We parse the grub menuentries, get the rollback deployment then perform
the rollback, which basically consists of writing a new .staged
menuentry file then atomically swapping the staged and the current
menuentry.
Rollback while there is a staged deployment is still to be handled.
Signed-off-by: Johan-Liebert1 <pragyanpoudyal41999@gmail.com>
Returning a local reference to a `&str` is quite tricky with rust.
Update `title` and `chainloader`, the two dynamic fields in the grub
menuentry, to be `String` instead of `&str`
Signed-off-by: Johan-Liebert1 <pragyanpoudyal41999@gmail.com>
Parse the Grub menuentry file, `boot/grub2/user.cfg` to get a list of
bootable UKIs and figure out if a rollback is currently queued.
Signed-off-by: Johan-Liebert1 <pragyanpoudyal41999@gmail.com>
For image building, we want to be able to run this on a non-bootc host
or in a container. There we'll manipulate the composefs repo in a
provided tempdir.
Signed-off-by: John Eckersberg <jeckersb@redhat.com>
We debugged https://github.com/ostreedev/ostree/issues/3503 and
it's basically a systemd/Anaconda bug. So we can consider
soft reboots an available feature from our end (as systemd
does), but certainly one that will require integration testing on
the OS/distro side.
If you're building a system and you don't want to enable
soft reboots, just `rm /usr/lib/systemd/system/soft-reboot.target`
or so should do the trick.
Signed-off-by: Colin Walters <walters@verbum.org>
As part of the tracing-subscriber CVE I did a quick audit
for usages of `tracing::error!` and I noticed when
we updated the `main()` function in the primary
crate we missed also doing the same for system-reinstall-bootc.
Move the handling of that to utils.
xref: https://bugzilla.redhat.com/show_bug.cgi?id=2392017
Signed-off-by: Colin Walters <walters@verbum.org>
This appears to have been accidentally added somewhere along the way,
and I would like to use these in composefs-boot.
Also fixes duplicate docstring copy/paste error on
`require_value_of_utf8`.
Signed-off-by: John Eckersberg <jeckersb@redhat.com>