From 37e34908259db8c97a2bd09f64730828011c505e Mon Sep 17 00:00:00 2001
From: CloudBuilder <cloud-image-builders@lists.canonical.com>
Date: Mon, 16 Sep 2019 17:00:05 +0000
Subject: [PATCH] Imported 2.612

No reason for CPC update specified.
---
 debian/changelog                                          | 8 ++++++++
 live-build/auto/config                                    | 1 +
 .../hooks.d/chroot/999-ubuntu-image-customization.chroot  | 2 +-
 3 files changed, 10 insertions(+), 1 deletion(-)

diff --git a/debian/changelog b/debian/changelog
index 9cba752b..28a2ab9e 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,11 @@
+livecd-rootfs (2.612) eoan; urgency=medium
+
+  * Hopefully the last fix for 999-ubuntu-image-customization.chroot: use
+    config/chroot to pass IMAGEFORMAT instead of config/common, as only that
+    file is updated with the right contents when the chroot hooks are run.
+
+ -- Ɓukasz 'sil2100' Zemczak <lukasz.zemczak@ubuntu.com>  Mon, 16 Sep 2019 14:07:01 +0200
+
 livecd-rootfs (2.611) eoan; urgency=medium
 
   * Execute chroot_hacks in live layer only.
diff --git a/live-build/auto/config b/live-build/auto/config
index d851e453..86fbcf7d 100755
--- a/live-build/auto/config
+++ b/live-build/auto/config
@@ -974,6 +974,7 @@ fi
 echo "LB_CHROOT_HOOKS=\"$CHROOT_HOOKS\"" >> config/chroot
 echo "SUBPROJECT=\"${SUBPROJECT:-}\"" >> config/chroot
 echo "LB_DISTRIBUTION=\"$SUITE\"" >> config/chroot
+echo "IMAGEFORMAT=\"$IMAGEFORMAT\"" >> config/chroot
 if [ -n "$PASSES" ]; then
 	echo "PASSES=\"$PASSES\"" >> config/common
 fi
diff --git a/live-build/ubuntu-cpc/hooks.d/chroot/999-ubuntu-image-customization.chroot b/live-build/ubuntu-cpc/hooks.d/chroot/999-ubuntu-image-customization.chroot
index 75a5313f..57ddc00e 100755
--- a/live-build/ubuntu-cpc/hooks.d/chroot/999-ubuntu-image-customization.chroot
+++ b/live-build/ubuntu-cpc/hooks.d/chroot/999-ubuntu-image-customization.chroot
@@ -1,6 +1,6 @@
 #!/bin/bash -ex
 
-. /root/config/common
+. /root/config/chroot
 
 # Specific ubuntu-image chroot configuration goes here.
 # Currently the ubuntu-image IMAGEFORMAT is equivalent to building an image