* WIP
Signed-off-by: Dimitris Karakasilis <dimitris@karakasilis.me>
* WIP
Signed-off-by: Dimitris Karakasilis <dimitris@spectrocloud.com>
Signed-off-by: Dimitris Karakasilis <dimitris@karakasilis.me>
* WIP add logs everywhere (EOD wip)
Signed-off-by: Dimitris Karakasilis <dimitris@karakasilis.me>
* Do the livecd check as late as possible
because the herd condition is evaluated too early before the /sys
is mounted and thus we don't detect the installed system correctly in
UKI mode.
Signed-off-by: Dimitris Karakasilis <dimitris@karakasilis.me>
* Wrap NewRuntime to allow passing down a logger
so that kairos-sdk logs make it to the immucore.log file
Signed-off-by: Dimitris Karakasilis <dimitris@karakasilis.me>
* Add TODOs and remove redundant check in code
the livecd check already happens some lines above
Signed-off-by: Dimitris Karakasilis <dimitris@karakasilis.me>
* Replace the "replace" with an actual tag
Signed-off-by: Dimitris Karakasilis <dimitris@karakasilis.me>
* Remoce "replace" directive and use wrapper method for UnlockAll
Signed-off-by: Dimitris Karakasilis <dimitris@karakasilis.me>
* Remove unecessary TODO
the log message describes what happened
* Re-use the method from kairos-sdk for uki boot detection
Signed-off-by: Dimitris Karakasilis <dimitris@karakasilis.me>
* Move messages from Info() to Debug() (PR review request)
Signed-off-by: Dimitris Karakasilis <dimitris@karakasilis.me>
---------
Signed-off-by: Dimitris Karakasilis <dimitris@karakasilis.me>
Signed-off-by: Dimitris Karakasilis <dimitris@spectrocloud.com>
Co-authored-by: Mauro Morales <mauro.morales@spectrocloud.com>
- Mount the needed base mounts (/proc /dev /sys /tmp)
- Use our own console for yip (required to add the PATH under uki)
- Order the DAG in a proper way (was out of order and not working)
Signed-off-by: Itxaka <itxaka.garcia@spectrocloud.com>
This makes immucore run more in parallel rather than block everything
else. We just tell sysroot.mount that eventually it will be mounted and
to wait for a bit.
This allows us to be more flexible where to run and run in parallel in
cases like cdrom in which we may do things but we need the sysroot to be
mounted already but not from us.
Also adds the initramfs stage directly in immucore and merges all the dracut config into one
Dont create sysroot, just add a timeout override so it waits for us
Dont block on the service, just make sure to finish before
initrd.target
Fix mounts from cmdline
More proper log
Store logs under the /run/immucore dir
Store rootfs and initramfs logs separated
Do not log the full stages in INFO level
Run initramfs stage in immucore directly on boot and cd/netboot
Drop systemd requirement from dracut module
Signed-off-by: Itxaka itxaka.garcia@spectrocloud.com
* Add tests and fix some issues that arised from testing
Mainly around the cmdargs and how many items it returns.
Also drop the iso target and jobs as its not necessary now
Signed-off-by: Itxaka <itxaka.garcia@spectrocloud.com>
* Lint
Signed-off-by: Itxaka <itxaka.garcia@spectrocloud.com>
---------
Signed-off-by: Itxaka <itxaka.garcia@spectrocloud.com>
* Be more careful with commandWithPaths PATHS
Signed-off-by: Itxaka <itxaka.garcia@spectrocloud.com>
* Do not mount all the things :/
Signed-off-by: Itxaka <itxaka.garcia@spectrocloud.com>
* Only mount /proc otherwise we break stuff
Signed-off-by: Itxaka <itxaka.garcia@spectrocloud.com>
---------
Signed-off-by: Itxaka <itxaka.garcia@spectrocloud.com>
* Fix recovery
- change TargetLabel into TargetDevice to hav ethe full device instead
of just the label
- log error if we cant mount
- Get state partition to mount depending on recovery or active/passive
- Get state patition fs on the fly
- Set proper label device to mount on sysroot based on our boot state
Signed-off-by: Itxaka <itxaka.garcia@spectrocloud.com>
* Fix test
Signed-off-by: Itxaka <itxaka.garcia@spectrocloud.com>
---------
Signed-off-by: Itxaka <itxaka.garcia@spectrocloud.com>
This patch allows setting the root mount as RW indicated by setting
rd.cos.debugrw in the cmdline
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>
- 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>
- 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>
- drop vfs
- less hardcoded stuff, use the runtime status
- Remove things that syscalls dont understand (defaults, auto)
Signed-off-by: Itxaka <itxaka@spectrocloud.com>