* Chroot into a new dir before starting the system
Signed-off-by: Itxaka <itxaka@kairos.io>
* Use ReadDir and copy files int eh rootdir to the enw rootdir
Signed-off-by: Itxaka <itxaka@kairos.io>
* logggg
Signed-off-by: Itxaka <itxaka@kairos.io>
* Several fixes
Mount /dev at start so we can log to kmesg/ttyS0
Log more
Store the mountpoints found in root to bind them later to the new
sysroot
Signed-off-by: Itxaka <itxaka@kairos.io>
* debvuy
Signed-off-by: Itxaka <itxaka@kairos.io>
* Fix
Signed-off-by: Itxaka <itxaka@kairos.io>
* more debufg
Signed-off-by: Itxaka <itxaka@kairos.io>
* fix
Signed-off-by: Itxaka <itxaka@kairos.io>
* sfder
Signed-off-by: Itxaka <itxaka@kairos.io>
* Fix symlinks
Signed-off-by: Itxaka <itxaka@kairos.io>
* final
Signed-off-by: Itxaka <itxaka@kairos.io>
* disable mobving the / root mountpoint
Im not sure this works on our side or how, I just get errors
Signed-off-by: Itxaka <itxaka@kairos.io>
* Debug
Signed-off-by: Itxaka <itxaka@kairos.io>
* Disable remounting / as RO and enable remounting the new sysroot as RO
Signed-off-by: Itxaka <itxaka@kairos.io>
* Dont drop to bash like that
Signed-off-by: Itxaka <itxaka@kairos.io>
* Move "sysroot" to a constant, dry code and handle errors
Signed-off-by: Dimitris Karakasilis <dimitris@karakasilis.me>
* Fix linting errors by removing superflows `else` statements
because the `if`s end with `continue`
Signed-off-by: Dimitris Karakasilis <dimitris@karakasilis.me>
* Apply suggestions from code review
* Remove loggers that don't work
because `/dev` is not there yet (?). In any case, we need to switch to
the new logger
Signed-off-by: Dimitris Karakasilis <dimitris@karakasilis.me>
---------
Signed-off-by: Itxaka <itxaka@kairos.io>
Signed-off-by: Dimitris Karakasilis <dimitris@karakasilis.me>
Co-authored-by: Dimitris Karakasilis <dimitris@karakasilis.me>
* 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>
As overlay mounts its responsible of mounting some of the RW paths that
bind mounts are using (for example /etc) we need to depend on it and let
it finish before running ht ebind mounts
Signed-off-by: Itxaka <itxaka.garcia@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>
Introduce support for the same old cos stanzas but with immucore naming
so we can control them better in the future
Signed-off-by: Itxaka <itxaka.garcia@spectrocloud.com>
Load the base overlay config from the cos-layout.env file. This means we
have to depend the base overlay mount to the load-config step, which
moves things a bit in the DAG.
Signed-off-by: Itxaka <itxaka.garcia@spectrocloud.com>