Merge ~mwhudson/ubuntu-cdimage:local-artifacts into ubuntu-cdimage:main

Proposed by Michael Hudson-Doyle
Status: Needs review
Proposed branch: ~mwhudson/ubuntu-cdimage:local-artifacts
Merge into: ubuntu-cdimage:main
Diff against target: 53 lines (+17/-0)
2 files modified
lib/cdimage/build.py (+1/-0)
lib/cdimage/livefs.py (+16/-0)
Reviewer Review Type Date Requested Status
Ubuntu CD Image Team Pending
Review via email: mp+456803@code.launchpad.net

Commit message

add a way to use a local download of a livefs

Description of the change

A slightly prettied up version of the hacks I've always been using to run cdimage locally.

To post a comment you must log in.
Revision history for this message
Michael Hudson-Doyle (mwhudson) wrote :

fwiw I've built an ISO with this (and a hack to mirror.py)

934febf... by Michael Hudson-Doyle

fix unbound local in build_image_set_locked

Unmerged commits

934febf... by Michael Hudson-Doyle

fix unbound local in build_image_set_locked

Succeeded
[SUCCEEDED] run-tests:0 (build)
[SUCCEEDED] lint:0 (build)
12 of 2 results
c1af884... by Michael Hudson-Doyle

add a way to use a local download of a livefs

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
diff --git a/lib/cdimage/build.py b/lib/cdimage/build.py
index e60da8d..58baceb 100644
--- a/lib/cdimage/build.py
+++ b/lib/cdimage/build.py
@@ -636,6 +636,7 @@ def build_image_set_locked(config, options):
636 config.limit_arches(live_successful)636 config.limit_arches(live_successful)
637 else:637 else:
638 tracker_set_rebuild_status(config, [0, 1], 2)638 tracker_set_rebuild_status(config, [0, 1], 2)
639 builds = []
639640
640 if not is_live_fs_only(config):641 if not is_live_fs_only(config):
641 sync_local_mirror(config)642 sync_local_mirror(config)
diff --git a/lib/cdimage/livefs.py b/lib/cdimage/livefs.py
index 45265be..0f12c94 100644
--- a/lib/cdimage/livefs.py
+++ b/lib/cdimage/livefs.py
@@ -23,6 +23,7 @@ from gzip import GzipFile
23import io23import io
24import os24import os
25import re25import re
26import shutil
26import subprocess27import subprocess
27from textwrap import dedent28from textwrap import dedent
28import time29import time
@@ -613,6 +614,9 @@ def live_output_directory(config):
613614
614615
615def download_live_items(config, builds, arch, item):616def download_live_items(config, builds, arch, item):
617 if config['CDIMAGE_LOCAL_LIVEFS_ARTIFACTS']:
618 return True
619
616 output_dir = live_output_directory(config)620 output_dir = live_output_directory(config)
617 found = False621 found = False
618622
@@ -708,6 +712,18 @@ def download_live_filesystems(config, builds):
708 output_dir = live_output_directory(config)712 output_dir = live_output_directory(config)
709 osextras.mkemptydir(output_dir)713 osextras.mkemptydir(output_dir)
710714
715 if config["CDIMAGE_LOCAL_LIVEFS_ARTIFACTS"]:
716 assert len(config.arches) == 1
717 arch = config.arches[0]
718 artifacts_dir = config["CDIMAGE_LOCAL_LIVEFS_ARTIFACTS"]
719 for srcname in os.listdir(artifacts_dir):
720 destname = srcname.replace(
721 f'livecd.{config["PROJECT"]}.', f'{arch}.')
722 srcpath = os.path.join(artifacts_dir, srcname)
723 destpath = os.path.join(output_dir, destname)
724 logger.info("copying %r to %r", srcpath, destpath)
725 shutil.copy(srcpath, destpath)
726
711 if (config["CDIMAGE_LIVE"] or config["CDIMAGE_SQUASHFS_BASE"] or727 if (config["CDIMAGE_LIVE"] or config["CDIMAGE_SQUASHFS_BASE"] or
712 config["CDIMAGE_PREINSTALLED"]):728 config["CDIMAGE_PREINSTALLED"]):
713 got_image = False729 got_image = False

Subscribers

People subscribed via source and target branches