[elbe-devel] [PATCH 5/6] cdrom: store and use initrd-cdrom.gz and vmlinuz in cdrom builds

Torben Hohn torben.hohn at linutronix.de
Tue Aug 28 18:41:29 CEST 2018


the new "elbe-bootstrap" implementation elbepack.debinstaller
downloads initrd-cdrom.gz and vmlinuz directly from the debian repo.

Store them in the initvm in /var/cache/elbe/installer.
Also put them on bin-cdrom.iso, and reuse them, when an elbe built
is run from cdrom.

Signed-off-by: Torben Hohn <torben.hohn at linutronix.de>
---
 elbepack/cdroms.py              | 7 +++++++
 elbepack/init/Makefile.mako     | 2 ++
 elbepack/init/init-elbe.sh.mako | 4 ++++
 3 files changed, 13 insertions(+)

diff --git a/elbepack/cdroms.py b/elbepack/cdroms.py
index 9e2dffda..89fb506e 100644
--- a/elbepack/cdroms.py
+++ b/elbepack/cdroms.py
@@ -7,6 +7,7 @@
 # SPDX-License-Identifier: GPL-3.0-or-later
 
 import os
+from shutil import copyfile
 
 from apt.package import FetchError
 from apt import Cache
@@ -259,6 +260,12 @@ def mk_binary_cdrom(
     # write source xml onto cdrom
     xml.xml.write(repo_fs.fname('source.xml'))
 
+    # copy initvm-cdrom.gz and vmlinuz
+    copyfile('/var/cache/elbe/installer/initrd-cdrom.gz',
+             repo_fs.fname('initrd-cdrom.gz'))
+    copyfile('/var/cache/elbe/installer/vmlinuz',
+             repo_fs.fname('vmlinuz'))
+
     target_repo_fs = Filesystem(target_repo_path)
     target_repo_fs.write_file(".aptignr", 0o644, "")
 
diff --git a/elbepack/init/Makefile.mako b/elbepack/init/Makefile.mako
index 06c0e0e5..4c2f323b 100644
--- a/elbepack/init/Makefile.mako
+++ b/elbepack/init/Makefile.mako
@@ -62,6 +62,8 @@ all: .stamps/stamp-install-initial-image
 	cp .elbe-in/source.xml tmp-tree/
 	mkdir -p tmp-tree/usr/share/keyrings
 	-cp .elbe-in/*.gpg tmp-tree/usr/share/keyrings
+	cp .elbe-in/initrd-cdrom.gz tmp-tree/
+	cp .elbe-in/vmlinuz tmp-tree/
 % if opt.devel:
 	cp .elbe-in/elbe-devel.tar.bz2 tmp-tree/
 % endif
diff --git a/elbepack/init/init-elbe.sh.mako b/elbepack/init/init-elbe.sh.mako
index 4234ec74..b29480dc 100644
--- a/elbepack/init/init-elbe.sh.mako
+++ b/elbepack/init/init-elbe.sh.mako
@@ -24,6 +24,10 @@ cp /etc/apt/apt.conf /buildenv/etc/apt/apt.conf.d/50elbe
 ln -s /lib/systemd/system/serial-getty at .service /buildenv/etc/systemd/system/getty.target.wants/serial-getty at ttyS0.service
 % endif
 
+mkdir /buildenv/var/cache/elbe/installer
+cp initrd-cdrom.gz /buildenv/var/cache/elbe/installer
+cp vmlinuz /buildenv/var/cache/elbe/installer
+
 % if opt.devel:
    mkdir /buildenv/var/cache/elbe/devel
    tar xj -f elbe-devel.tar.bz2 -C /buildenv/var/cache/elbe/devel
-- 
2.11.0




More information about the elbe-devel mailing list