Make it explicit that we run before sysroot.mount, otherwise it may be
launched in parallel and fails as immucore hasnt mount the sysroot
already
Signed-off-by: Itxaka <itxaka.garcia@spectrocloud.com>
* Full rework
- Extract steps to a different file
- Simplify dag for easy understanding
- Load dag based on our boot process
- Simplify steps to not depend on useless stuff
- Better logging
Signed-off-by: Itxaka <itxaka.garcia@spectrocloud.com>
* Move sentinel file to the dag
Signed-off-by: Itxaka <itxaka.garcia@spectrocloud.com>
* Adapt tests
Signed-off-by: Itxaka <itxaka.garcia@spectrocloud.com>
---------
Signed-off-by: Itxaka <itxaka.garcia@spectrocloud.com>
Unfortunately ghw detects mountpoint only by device, thus kairos-agent
does the same.
If we expect to make this work we need to mount the devices by the dev
instead of label until ghw supports detecting the devices mountpoint
ALSO via label.
Signed-off-by: Itxaka <itxaka.garcia@spectrocloud.com>
- Set debug from ENV var as well
- Only set sentinel if we are not on a dry-run so we can examine the
DAG
- Set the DAG with Init so tmpfs is part of it
Signed-off-by: Itxaka <itxaka.garcia@spectrocloud.com>
Looks like we need to have the oem partition loaded for some cases, and
during rootfs we should pick it up.
Currently we only mount it under /sysroot/oem. IIRC in
cos-immutable-rootfs it was mounted under /oem directly, the rootfs
stage service run and then when cos-layout was launched it made sure to
unmount /oem so it could mount it under /sysroot/oem
In our case its a bit more complicated, we may need to mount it under
/oem before the rootfs run, then unmount it and mount it in the proper
place. Im hoping we can get away with just creating the symlink
Signed-off-by: Itxaka <itxaka.garcia@spectrocloud.com>
* Add extra files needed for dracut
If we are dropping cos-immutable-rootfs then we have to include the
missing files that the package already added.
For example, the several dracut configs of modules for the initramfs
stage, or the general config for the dracut file.
We also need to install and link the initramfs elemental stage service
as that its no longer provided by the cos-immutable-rootfs package and
not integrated into immucore yet
Signed-off-by: Itxaka <itxaka.garcia@spectrocloud.com>
* Minor improvements
Signed-off-by: Itxaka <itxaka.garcia@spectrocloud.com>
---------
Signed-off-by: Itxaka <itxaka.garcia@spectrocloud.com>
- Set global debug log
- Set caller in the log if debug
- Fatal if cannot get target image
- clean up slices from cos-layoout.env
- Add generic log with more context info
- dump runtime to log on start
- Set proper default paths if overlay is empty (fixes recovery)
- Fix ErrAlreadyMounted to not trigger failures
Signed-off-by: Itxaka <itxaka@spectrocloud.com>
It was nice when things break all over but its much more stable now.
Lets add logging with head and with proper enrichment of the data being
sent
Signed-off-by: Itxaka <itxaka@spectrocloud.com>
- set debug level via cmdline
- set default RW paths needed ALWAYS to boot a working system, even
with no config files(recovery)
- Check for loop device before mounting it to avoid duplicated mounts
- Force overlay and bind arrays to uniqueness
- Rename OverlayDir to OverlayDirs to better represent the content
Signed-off-by: Itxaka <itxaka@spectrocloud.com>