From f1718bf3e48bf3dbc48ea287118231cf195ce142 Mon Sep 17 00:00:00 2001 From: Pat Viafore Date: Tue, 4 Jun 2019 10:52:49 -0500 Subject: [PATCH] Adding hooks and making replace_kernel function --- live-build/functions | 14 ++++++++++++++ live-build/ubuntu-cpc/hooks.d/base/series/base | 1 + live-build/ubuntu-cpc/hooks.d/base/series/kvm | 2 ++ 3 files changed, 17 insertions(+) create mode 100644 live-build/ubuntu-cpc/hooks.d/base/series/kvm diff --git a/live-build/functions b/live-build/functions index 72fdb056..2bdbb623 100644 --- a/live-build/functions +++ b/live-build/functions @@ -877,3 +877,17 @@ is_live_layer () { done return 1 } + +replace_kernel () { + mountpoint=$1 + new_kernel=$2 + + # Install custom kernel (N.B. the trailing + retains linux-base during this + # operation) + env DEBIAN_FRONTEND=noninteractive chroot "${mountpoint}" apt-get \ + remove --purge --assume-yes '^linux-.*' 'linux-base+' + env DEBIAN_FRONTEND=noninteractive chroot "${mountpoint}" apt-get \ + update --assume-yes + env DEBIAN_FRONTEND=noninteractive chroot "${mountpoint}" apt-get \ + install --assume-yes "${new_kernel}" +} \ No newline at end of file diff --git a/live-build/ubuntu-cpc/hooks.d/base/series/base b/live-build/ubuntu-cpc/hooks.d/base/series/base index f04bdec7..55333887 100644 --- a/live-build/ubuntu-cpc/hooks.d/base/series/base +++ b/live-build/ubuntu-cpc/hooks.d/base/series/base @@ -2,6 +2,7 @@ depends root-dir depends tarball depends squashfs depends disk-image +depends kvm depends qcow2 depends vmdk depends vagrant diff --git a/live-build/ubuntu-cpc/hooks.d/base/series/kvm b/live-build/ubuntu-cpc/hooks.d/base/series/kvm new file mode 100644 index 00000000..6c5d8b8c --- /dev/null +++ b/live-build/ubuntu-cpc/hooks.d/base/series/kvm @@ -0,0 +1,2 @@ +depends disk-image +base/kvm-image.binary \ No newline at end of file