From bd9c261534c19ccf6f6a7ca4ce7f31b21c55005d Mon Sep 17 00:00:00 2001 From: Jarrod Johnson Date: Tue, 16 Nov 2021 11:33:58 -0500 Subject: [PATCH] Implement initramfs customization for debian build The initramfstools are extended to naturally create the materials needed to do diskless. --- imgutil/imgutil | 6 ++++++ imgutil/ubuntu/initramfs-tools/conf.d/confluent.conf | 4 ++++ 2 files changed, 10 insertions(+) create mode 100644 imgutil/ubuntu/initramfs-tools/conf.d/confluent.conf diff --git a/imgutil/imgutil b/imgutil/imgutil index 0b6a328e..6c5816fa 100644 --- a/imgutil/imgutil +++ b/imgutil/imgutil @@ -526,6 +526,12 @@ class DebHandler(OsHandler): self.targpath = targpath def prep_root_premount(self, args): + mkdirp(os.path.join(self.targpath, 'etc')) + mydir = get_mydir(self.oscategory) + srcdir = os.path.join(mydir, 'initramfs-tools') + targdir = os.path.join(self.targpath, 'etc/initramfs-tools') + shutil.copytree(srcdir, targdir) + os.chmod(0o755, os.path.join(targdir, 'hooks/confluent')) cmd = ['debootstrap', '--include={0}'.format(','.join(self.includepkgs)), self.codename, self.targpath] subprocess.check_call(cmd) diff --git a/imgutil/ubuntu/initramfs-tools/conf.d/confluent.conf b/imgutil/ubuntu/initramfs-tools/conf.d/confluent.conf new file mode 100644 index 00000000..add54522 --- /dev/null +++ b/imgutil/ubuntu/initramfs-tools/conf.d/confluent.conf @@ -0,0 +1,4 @@ +MODULES=list +COMPRESS=xz +FRAMEBUFFER=n +CONFLUENTDISKLESS=y