mirror of
https://github.com/fosslinux/live-bootstrap.git
synced 2026-03-23 19:46:31 +01:00
fix(stage0-resume): avoid false /init guix handoff check and preserve steps-guix resume scripts
This commit is contained in:
parent
7253e3fb33
commit
b733cf2526
1 changed files with 10 additions and 13 deletions
17
rootfs.py
17
rootfs.py
|
|
@ -109,17 +109,14 @@ with open(config_path, "w", encoding="utf-8") as cfg:
|
||||||
cfg.writelines(lines)
|
cfg.writelines(lines)
|
||||||
|
|
||||||
if build_guix_also:
|
if build_guix_also:
|
||||||
init_path = os.path.join(mountpoint, "init")
|
|
||||||
if not os.path.isfile(init_path):
|
|
||||||
raise SystemExit(f"Missing /init in stage0 image: {init_path}")
|
|
||||||
with open(init_path, "r", encoding="utf-8") as init_file:
|
|
||||||
if "run_steps_guix_if_requested()" not in init_file.read():
|
|
||||||
raise SystemExit(
|
|
||||||
"Stage0 image /init does not include guix handoff. "
|
|
||||||
"Rebuild once with current steps/improve/make_bootable.sh."
|
|
||||||
)
|
|
||||||
|
|
||||||
dest_steps_guix = os.path.join(mountpoint, "steps-guix")
|
dest_steps_guix = os.path.join(mountpoint, "steps-guix")
|
||||||
|
has_resume_scripts = False
|
||||||
|
if os.path.isdir(dest_steps_guix):
|
||||||
|
for entry in os.listdir(dest_steps_guix):
|
||||||
|
if entry.endswith(".sh") and entry[:-3].isdigit():
|
||||||
|
has_resume_scripts = True
|
||||||
|
break
|
||||||
|
if not has_resume_scripts:
|
||||||
if os.path.exists(dest_steps_guix):
|
if os.path.exists(dest_steps_guix):
|
||||||
shutil.rmtree(dest_steps_guix)
|
shutil.rmtree(dest_steps_guix)
|
||||||
shutil.copytree(steps_guix_dir, dest_steps_guix)
|
shutil.copytree(steps_guix_dir, dest_steps_guix)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue