diff -pruN 3.0~a57-1/debian/changelog 3.0~a57-1ubuntu43/debian/changelog
--- 3.0~a57-1/debian/changelog	2012-08-10 20:44:17.000000000 +0000
+++ 3.0~a57-1ubuntu43/debian/changelog	2022-11-22 20:02:44.000000000 +0000
@@ -1,3 +1,326 @@
+live-build (3.0~a57-1ubuntu43) lunar; urgency=medium
+
+  * scripts/build/lb_binary_memtest:
+    - update inspired from Debian #15e78a3e to handle the memtest86+.bin
+      naming changes in the newest version of the package
+
+ -- Sebastien Bacher <seb128@ubuntu.com>  Tue, 22 Nov 2022 21:02:44 +0100
+
+live-build (3.0~a57-1ubuntu41) groovy; urgency=medium
+
+  * Drop bzip2 from bootstrap package set, this is a long-obsolete
+    workaround for Debian bug #657560.
+
+ -- Steve Langasek <steve.langasek@ubuntu.com>  Thu, 08 Oct 2020 10:09:20 -0700
+
+live-build (3.0~a57-1ubuntu40) groovy; urgency=medium
+
+  * Add GENISOIMAGE_OPTIONS_EXTRA. Make the genisoimage option more flexible.
+
+ -- hugh chao <hugh.chao@canonical.com>  Mon, 18 May 2020 22:49:31 +0800
+
+live-build (3.0~a57-1ubuntu39) groovy; urgency=medium
+
+  * Add riscv64 support.
+
+ -- Dimitri John Ledkov <xnox@ubuntu.com>  Thu, 30 Apr 2020 16:10:34 +0100
+
+live-build (3.0~a57-1ubuntu38) eoan; urgency=medium
+
+  * Stop setting LB_INITRAMFS_COMPRESSION default, and instead fallback to
+    using initramfs-tools default. LB_INITRAMFS_COMPRESSION is now only to
+    override whatever initramfs-tools' default compression is. This thus
+    makes live-build default to lz4. LP: #1831736
+
+ -- Dimitri John Ledkov <xnox@ubuntu.com>  Wed, 05 Jun 2019 13:34:29 +0100
+
+live-build (3.0~a57-1ubuntu37) disco; urgency=medium
+
+  * Cherrypick Debian's patches for handling binary/chroot includes with
+    merged-usr.
+
+ -- Dimitri John Ledkov <xnox@ubuntu.com>  Mon, 12 Nov 2018 20:11:36 +0000
+
+live-build (3.0~a57-1ubuntu36) cosmic; urgency=medium
+
+  * debian/control: Need to depend on initramfs-tools which isn't in chroots.
+
+ -- Adam Conrad <adconrad@ubuntu.com>  Tue, 26 Jun 2018 22:39:47 -0600
+
+live-build (3.0~a57-1ubuntu35) cosmic; urgency=medium
+
+  * ubuntu-initramfs-handling.patch: Use initramfs-tools to work with initrds,
+    instead of trying to naively repack and unpack them blindly (LP: #1778811)
+
+ -- Adam Conrad <adconrad@ubuntu.com>  Tue, 26 Jun 2018 16:36:32 -0600
+
+live-build (3.0~a57-1ubuntu34) bionic; urgency=medium
+
+  * Handle late installation of systemd/resolvconf gracefully, by not
+    reverting /etc/resolv.conf symlink to a backup of the backup.
+
+ -- Dimitri John Ledkov <xnox@ubuntu.com>  Thu, 15 Mar 2018 12:52:26 +0000
+
+live-build (3.0~a57-1ubuntu33) bionic; urgency=medium
+
+  * Stop using apt-key to setup secure apt, and instead copy the gpg key
+    snippet.
+
+ -- Dimitri John Ledkov <xnox@ubuntu.com>  Wed, 07 Mar 2018 11:35:41 +0100
+
+live-build (3.0~a57-1ubuntu32) bionic; urgency=medium
+
+  * Don't force inclusion of gnupg, which is now a metapackage that pulls in
+    bits inappropriate for the base system.
+
+ -- Steve Langasek <steve.langasek@ubuntu.com>  Fri, 02 Mar 2018 09:11:17 -0800
+
+live-build (3.0~a57-1ubuntu31) artful; urgency=medium
+
+  * Don't fail when initramfs is not used (LP: #1720217)
+
+ -- Balint Reczey <rbalint@ubuntu.com>  Thu, 28 Sep 2017 18:01:04 +0000
+
+live-build (3.0~a57-1ubuntu30) artful; urgency=medium
+
+  * Drop fix-up code for sysvinit, which has not been essential in Ubuntu in
+    a decade.
+
+ -- Steve Langasek <steve.langasek@ubuntu.com>  Mon, 07 Aug 2017 22:08:45 -0700
+
+live-build (3.0~a57-1ubuntu29) zesty; urgency=medium
+
+  * Drop ubuntu-debootstrap-demotions.patch, this should have been a
+    one-time hack for xenial demotions, not a feature (LP: #1678042)
+
+ -- Adam Conrad <adconrad@ubuntu.com>  Fri, 31 Mar 2017 05:52:24 -0600
+
+live-build (3.0~a57-1ubuntu28) zesty; urgency=medium
+
+  * debian/patches/ubuntu-debootstrap-demotions.patch: remove packages
+    after bootstrap that have been demoted.  Closes LP: #1668847.
+
+ -- Steve Langasek <steve.langasek@ubuntu.com>  Tue, 28 Feb 2017 21:02:05 -0800
+
+live-build (3.0~a57-1ubuntu27) yakkety; urgency=medium
+
+  * Use the generic kernel for the powerpc64 flavor (LP: #1625368)
+
+ -- Adam Conrad <adconrad@ubuntu.com>  Mon, 19 Sep 2016 16:48:45 -0600
+
+live-build (3.0~a57-1ubuntu26) yakkety; urgency=medium
+
+  * Avoid recompressing initrd.img symlinks (LP: #1539157).
+
+ -- Colin Watson <cjwatson@ubuntu.com>  Tue, 28 Jun 2016 15:45:10 +0100
+
+live-build (3.0~a57-1ubuntu25) xenial; urgency=medium
+
+  * ubuntu-chroot_headers_tidy.: re-add support for 3.x linux kernels (trusty)
+    in dpkg -l statement.
+
+ -- Loïc Minier <loic.minier@ubuntu.com>  Thu, 18 Feb 2016 00:23:47 +0100
+
+live-build (3.0~a57-1ubuntu24) xenial; urgency=medium
+
+  * Attempt s390x builds.
+
+ -- Dimitri John Ledkov <xnox@ubuntu.com>  Tue, 01 Dec 2015 13:25:01 +0000
+
+live-build (3.0~a57-1ubuntu23) xenial; urgency=medium
+
+  [ Daniel Watkins ]
+  * debian/patches/ubuntu-ppc64el-support.patch:
+    - Handle different /boot kernel naming on ppc64el, matching powerpc
+      (LP: #1510095).
+
+ -- Colin Watson <cjwatson@ubuntu.com>  Mon, 26 Oct 2015 13:57:31 +0000
+
+live-build (3.0~a57-1ubuntu22) wily; urgency=medium
+
+  * ubuntu-chroot_headers_tidy.patch: We're using 4.x kernels now, adjust.
+
+ -- Adam Conrad <adconrad@ubuntu.com>  Wed, 14 Oct 2015 13:28:16 -0600
+
+live-build (3.0~a57-1ubuntu21) wily; urgency=medium
+
+  * Remove debian/patches/ubuntu-remove-non-release-lists.patch:
+    - We actually want to have all package lists for bug reporting purposes.
+      As per Adam's recommendation, remove the patch altogether.
+
+ -- Łukasz 'sil2100' Zemczak <lukasz.zemczak@canonical.com>  Thu, 13 Aug 2015 20:40:25 +0200
+
+live-build (3.0~a57-1ubuntu20) wily; urgency=medium
+
+  * debian/patches/upstart-not-in-bootstrap: Rewrite the old user-sessions
+    patch to handle when upstart isn't in the bootstrap set (LP: #1477051)
+
+ -- Adam Conrad <adconrad@ubuntu.com>  Wed, 22 Jul 2015 09:29:54 -0600
+
+live-build (3.0~a57-1ubuntu19) wily; urgency=medium
+
+  * debian/patches/dpkg-divert-{initctl,others}: Pull two commits from git
+    upstream to resolve issues where we would end up with files from their
+    release version packages rather than -updates (LP: #1363519, #1150737)
+  * debian/patches/upstart-user-sessions: Dropped, obsoleted by the above.
+
+ -- Adam Conrad <adconrad@ubuntu.com>  Tue, 21 Jul 2015 13:51:28 -0600
+
+live-build (3.0~a57-1ubuntu18) wily; urgency=medium
+
+  * ubuntu-label-disks.patch
+   - Apply LB_HDD_LABEL to disk images produced by lb_binary_rootfs
+  * ubuntu-chroot-fs-opts.patch
+   - Add options for tuning disk images produced by lb_binary_rootfs
+
+ -- Daniel Watkins <daniel.watkins@canonical.com>  Mon, 15 Dec 2014 10:07:52 +0000
+
+live-build (3.0~a57-1ubuntu17) wily; urgency=medium
+
+  * debian/patches/fix-preferences-copying: Fix copying apt preferences.
+  * debian/patches/ubuntu-allow-downgrades: Allow base system downgrades.
+
+ -- Adam Conrad <adconrad@ubuntu.com>  Wed, 29 Apr 2015 14:29:09 -0600
+
+live-build (3.0~a57-1ubuntu16) vivid; urgency=medium
+
+  * cpio needs to be a dependency, not a recommends; various core scripts
+    (e.g., /usr/lib/live/build/lb_chroot_includes) fail if it's not
+    installed.
+
+ -- Steve Langasek <steve.langasek@ubuntu.com>  Fri, 03 Apr 2015 22:14:47 -0700
+
+live-build (3.0~a57-1ubuntu15) vivid; urgency=medium
+
+  * debian/patches/upstart-user-sessions: Only do the upstart initctl
+    dance if initcl was in the debootstrapped system, so we don't end
+    up deleting the initctl from the desktop package set install pass
+
+ -- Adam Conrad <adconrad@ubuntu.com>  Tue, 10 Mar 2015 15:08:59 -0600
+
+live-build (3.0~a57-1ubuntu14) vivid; urgency=medium
+
+  * ubuntu-pack-bootlogo.patch:
+    - At the end of lb_binary_syslinux pack all relevant files into the
+      bootlogo archive as utopic+ gfxboot refuses to load assets from outside
+    LP: #1387709
+
+ -- Harald Sitter <apachelogger@kubuntu.org>  Thu, 30 Oct 2014 15:55:47 +0100
+
+live-build (3.0~a57-1ubuntu13) vivid; urgency=medium
+
+  * debian/patches/chroot-resolv-conf-allow-symlinks:
+    - allow symlinks in config/includes.chroot/etc/resolv.conf
+  * debian/patches/remove-etc-machineid:
+    - truncate /etc/machine-id to ensure a unique version is
+      generated by systemd on startup
+
+ -- Michael Vogt <michael.vogt@ubuntu.com>  Wed, 29 Oct 2014 10:28:55 +0100
+
+live-build (3.0~a57-1ubuntu12) utopic; urgency=medium
+
+  * Add a new .chroot_early hook type which is run after debootstrap and
+    prior to package installation. (LP: #1332538)
+
+ -- Stéphane Graber <stgraber@ubuntu.com>  Mon, 22 Sep 2014 15:53:38 -0400
+
+live-build (3.0~a57-1ubuntu11) trusty; urgency=low
+
+  * add release version for ubuntu saucy and trusty to fix a failure of
+    creating an usb startup disk with usb-creator (LP: #1300400)
+
+ -- Paolo Sammicheli <xdatap1@ubuntu.com>  Mon, 31 Mar 2014 21:36:20 +0200
+
+live-build (3.0~a57-1ubuntu10) trusty; urgency=medium
+
+  * Add basic ppc64el support.
+
+ -- Colin Watson <cjwatson@ubuntu.com>  Fri, 31 Jan 2014 10:34:15 +0000
+
+live-build (3.0~a57-1ubuntu9) saucy; urgency=low
+
+  * Add skeleton arm64 support, so that ubuntu-core can build.
+  * Mount devpts with gid=5,mode=620 to work without pt_chown.
+
+ -- Adam Conrad <adconrad@ubuntu.com>  Tue, 15 Oct 2013 18:35:58 +0100
+
+live-build (3.0~a57-1ubuntu8) saucy; urgency=low
+
+  * Drop etc/adjtime from scripts/build/lb_chroot_hacks.  /etc/adjtime is not
+    needed and should not be used in Ubuntu.
+
+ -- Steve Langasek <steve.langasek@ubuntu.com>  Fri, 27 Sep 2013 11:20:17 -0700
+
+live-build (3.0~a57-1ubuntu7) saucy; urgency=low
+
+  * add release version for ubuntu raring to fix a failure of
+    creating an usb startup disk with usb-creator (LP: #1174791)
+
+ -- Nobuto MURATA <nobuto@ubuntu.com>  Wed, 01 May 2013 01:07:26 +0900
+
+live-build (3.0~a57-1ubuntu6) raring; urgency=low
+
+  * Drop e500 and e500mc kernel images and headers from powerpc images.
+
+ -- Adam Conrad <adconrad@ubuntu.com>  Tue, 23 Apr 2013 04:45:57 -0600
+
+live-build (3.0~a57-1ubuntu5) raring; urgency=low
+
+  * Update ubuntu-powerpc-smp.patch to include e500/e500mc
+
+ -- Ben Collins <ben.c@servergy.com>  Tue, 13 Nov 2012 13:31:33 -0500
+
+live-build (3.0~a57-1ubuntu4) quantal; urgency=low
+
+  * Don't turn on xz compression in mksquashfs for ubuntu builds.
+
+ -- Adam Conrad <adconrad@ubuntu.com>  Fri, 24 Aug 2012 15:05:30 -0600
+
+live-build (3.0~a57-1ubuntu3) quantal; urgency=low
+
+  * Fix execution of binary hooks.
+
+ -- Colin Watson <cjwatson@ubuntu.com>  Fri, 24 Aug 2012 08:42:56 +0100
+
+live-build (3.0~a57-1ubuntu2) quantal; urgency=low
+
+  * Fix default for LB_PARENT_MIRROR_BINARY_VOLATILE.
+  * Fix handling of --bootstrap-flavour with debootstrap.
+
+ -- Colin Watson <cjwatson@ubuntu.com>  Thu, 23 Aug 2012 11:07:39 +0100
+
+live-build (3.0~a57-1ubuntu1) quantal; urgency=low
+
+  * Resynchronise with Debian.  Remaining changes:
+    - Add wubildr build support.
+    - Fix up live.cfg for casper.
+    - Drop Recommends on live-boot-doc and live-config-doc for now, until
+      such time as we switch away from casper.
+    - Mimic livecd-rootfs's handling of inodes on ext* filesystems to reduce
+      the pain of resizing preinstalled images.
+    - Drop gnu-fdisk from Recommends to Suggests; it's only used for USB
+      images.
+    - Generate an initramfs that uses the framebuffer for Wubi disk image
+      installs.
+    - Use i386 -generic-pae kernel flavour on Ubuntu precise.
+    - If chroot/etc/resolvconf/resolv.conf.d exists, tidy up the original
+      and tail files, which are artifacts of the build (and leak the host
+      system's resolv.conf).
+    - Switch from powerpc to powerpc-smp kernel.
+    - Always set 'do_bootloader = no' in /etc/kernel-img.conf, and on some
+      architectures (notably powerpc) set 'link_on_boot = yes'.  This
+      matches the behaviour of base-installer/library.sh more closely.
+    - Mark all the linux-headers-$(ABI) packages as autoinstalled, and then
+      autoremove cruft.
+    - Remove APT lists for non-release pockets.
+  * If --build-with-chroot is false, run ! lines in package-lists in the
+    host system.
+  * Fix hook execution.
+  * Break livecd-rootfs (<< 2.75), since there have been many interface
+    changes.
+
+ -- Colin Watson <cjwatson@ubuntu.com>  Wed, 22 Aug 2012 13:20:30 +0100
+
 live-build (3.0~a57-1) unstable; urgency=low
 
   [ Daniel Baumann ]
@@ -984,6 +1307,294 @@ live-build (3.0~a25-1) experimental; urg
 
  -- Daniel Baumann <daniel@debian.org>  Fri, 15 Jul 2011 20:33:24 +0200
 
+live-build (3.0~a24-1ubuntu40) quantal; urgency=low
+
+  * Fix the previous change being canceled by a later apt-get update call.
+    Move the code to scripts/build/lb_chroot_archives (LP: #1034118)
+
+ -- Stéphane Graber <stgraber@ubuntu.com>  Tue, 07 Aug 2012 17:06:56 -0400
+
+live-build (3.0~a24-1ubuntu39) quantal; urgency=low
+
+  * ubuntu-remove-non-release-lists.patch: Remove APT lists for non-release
+    pockets. (LP: #1034118)
+
+ -- Stéphane Graber <stgraber@ubuntu.com>  Tue, 07 Aug 2012 15:06:51 -0400
+
+live-build (3.0~a24-1ubuntu38) quantal; urgency=low
+
+  * Clean up the binary.headers temp file from the previous change.
+
+ -- Adam Conrad <adconrad@ubuntu.com>  Sat, 28 Jul 2012 23:43:34 -0600
+
+live-build (3.0~a24-1ubuntu37) quantal; urgency=low
+
+  * Rewrite ubuntu-chroot_headers_tidy.patch to not attempt subshells
+    in Chroot() calls, as there's no sane way to escape arguments.
+
+ -- Adam Conrad <adconrad@ubuntu.com>  Sat, 28 Jul 2012 23:27:08 -0600
+
+live-build (3.0~a24-1ubuntu36) quantal; urgency=low
+
+  * Add a "|| true" to the apt-mark call, for images with no headers.
+
+ -- Adam Conrad <adconrad@ubuntu.com>  Thu, 26 Jul 2012 18:35:30 -0600
+
+live-build (3.0~a24-1ubuntu35) quantal; urgency=low
+
+  * ubuntu-chroot_headers_tidy.patch: Mark all the linux-headers-$(ABI)
+    packages as autoinstalled, and then autoremove cruft (LP: #1029556)
+
+ -- Adam Conrad <adconrad@ubuntu.com>  Thu, 26 Jul 2012 18:09:23 -0600
+
+live-build (3.0~a24-1ubuntu34) quantal; urgency=low
+
+  * Make sure /etc/kernel-img.conf always has "do_bootloader = no".
+
+ -- Colin Watson <cjwatson@ubuntu.com>  Mon, 23 Jul 2012 17:56:56 +0100
+
+live-build (3.0~a24-1ubuntu33) quantal; urgency=low
+
+  * Only use i386 -generic-pae kernel flavour on Ubuntu precise; quantal
+    switched back to -generic.
+
+ -- Colin Watson <cjwatson@ubuntu.com>  Wed, 23 May 2012 01:58:13 +0100
+
+live-build (3.0~a24-1ubuntu32) precise; urgency=low
+
+  * Revert 3.0~a24-1ubuntu31; Wubi uses an old resize2fs which apparently
+    can't handle ext4.
+
+ -- Colin Watson <cjwatson@ubuntu.com>  Fri, 20 Apr 2012 17:45:27 +0100
+
+live-build (3.0~a24-1ubuntu31) precise; urgency=low
+
+  * build-wubildr.patch: Switch wubi from ext3 to ext4 (LP: #859552)
+
+ -- Adam Conrad <adconrad@ubuntu.com>  Wed, 18 Apr 2012 14:54:48 -0600
+
+live-build (3.0~a24-1ubuntu30) precise; urgency=low
+
+  * ubuntu-kernel-img-conf.patch: On some architectures (notably powerpc),
+    create /etc/kernel-img.conf with the default contents plus 'link_on_boot
+    yes'.  This matches the behaviour of base-installer/library.sh more
+    closely (LP: #958839).
+
+ -- Colin Watson <cjwatson@ubuntu.com>  Wed, 18 Apr 2012 13:10:04 +0100
+
+live-build (3.0~a24-1ubuntu29) precise; urgency=low
+
+  * ubuntu-powerpc-smp.patch: Switch from powerpc to powerpc-smp kernel.
+
+ -- Adam Conrad <adconrad@ubuntu.com>  Tue, 20 Mar 2012 10:07:07 -0600
+
+live-build (3.0~a24-1ubuntu28) precise; urgency=low
+
+  * Add 00git_precise_release.patch: Add "precise" release version to
+    releases.sh. Backported from current Debian version. (LP: #941604)
+
+ -- Martin Pitt <martin.pitt@ubuntu.com>  Mon, 12 Mar 2012 11:18:41 +0100
+
+live-build (3.0~a24-1ubuntu27) precise; urgency=low
+
+  * debian/patches/examples-auto-config-typo.patch: Fixing left over
+    use of --packages-lists in examples/auto/config (LP: #923355)
+
+ -- Rigved Rakshit <r.phate@gmail.com>  Fri, 24 Feb 2012 16:10:47 +0530
+
+live-build (3.0~a24-1ubuntu26) precise; urgency=low
+
+  * build-wubildr.patch: Revert wubi ext4 switch, until the buildds
+    are running kernels that can actually mount ext4 filesystems.
+
+ -- Adam Conrad <adconrad@ubuntu.com>  Thu, 23 Feb 2012 09:26:02 -0700
+
+live-build (3.0~a24-1ubuntu25) precise; urgency=low
+
+  * build-wubildr.patch: Switch wubi from ext3 to ext4 (LP: #859552)
+
+ -- Adam Conrad <adconrad@ubuntu.com>  Wed, 22 Feb 2012 12:18:53 -0700
+
+live-build (3.0~a24-1ubuntu24) precise; urgency=low
+
+  * Revert ubuntu-chroot_hacks-clean-tmpdirs.patch for now, since
+    chroot_hacks clearly runs too early in the build, before we
+    umount various filesystems; need to rethink this (LP: #938867)
+
+ -- Adam Conrad <adconrad@ubuntu.com>  Wed, 22 Feb 2012 11:42:53 -0700
+
+live-build (3.0~a24-1ubuntu23) precise; urgency=low
+
+  * ubuntu-resolvconf.patch: If chroot/etc/resolvconf/resolv.conf.d
+    exists, tidy up the original and tail files, which are artifacts
+    of the build (and leak the host system's resolv.conf)
+  * ubuntu-chroot_hacks-clean-tmpdirs.patch: Clean out more cruft
+    in chroot/run, chroot/tmp, chroot/var/run, and chroot/var/tmp
+
+ -- Adam Conrad <adconrad@ubuntu.com>  Tue, 21 Feb 2012 16:33:43 -0700
+
+live-build (3.0~a24-1ubuntu22) precise; urgency=low
+
+  * Add ubuntu-resolvconf.patch: If /etc/resolv.conf is a dangling symlink,
+    test -e will return 1 and so lb_chroot_resolv won't move it to .orig.
+    This then causes cp to fail copying the buildd /etc/resolv.conf and
+    makes the whole build fail.
+    Instead, make it also do a test -L to detect symlinks. In such case,
+    also move it to .orig but don't Truncate it as that'd fail.
+
+ -- Stéphane Graber <stgraber@ubuntu.com>  Thu, 26 Jan 2012 22:15:54 -0500
+
+live-build (3.0~a24-1ubuntu21) precise; urgency=low
+
+  * Backport from upstream:
+    - Print the current time before starting a command with the lb wrapper
+      script (closes: #630089).
+
+ -- Colin Watson <cjwatson@ubuntu.com>  Thu, 12 Jan 2012 23:17:19 +0000
+
+live-build (3.0~a24-1ubuntu20) precise; urgency=low
+
+  * Use i386 -generic-pae kernel flavour on Ubuntu >= precise (LP: #897786).
+
+ -- Colin Watson <cjwatson@ubuntu.com>  Thu, 15 Dec 2011 16:24:29 +0000
+
+live-build (3.0~a24-1ubuntu19) precise; urgency=low
+
+  * ubuntu-armhf-support.patch: Mirror armel (non-)support as armhf
+
+ -- Adam Conrad <adconrad@ubuntu.com>  Fri, 02 Dec 2011 11:29:36 -0700
+
+live-build (3.0~a24-1ubuntu18) precise; urgency=low
+
+  * Generate an initramfs that uses the framebuffer for Wubi disk image
+    installs.
+
+ -- Evan Dandrea <ev@ubuntu.com>  Mon, 17 Oct 2011 11:15:06 +0100
+
+live-build (3.0~a24-1ubuntu17) oneiric; urgency=low
+
+  * Remove /var/lib/dbus/machine-id in lb_chroot_hacks to prevent every
+    machine installed from our media having the same ID.  This is a 
+    regression from the previous livecd-rootfs behaviour (LP: #322830)
+
+ -- Adam Conrad <adconrad@ubuntu.com>  Wed, 12 Oct 2011 12:11:16 +0100
+
+live-build (3.0~a24-1ubuntu16) oneiric; urgency=low
+
+  * Add ubuntu-chroot_packages_install.patch: Our current live-build version
+    only half-transitioned away from the *_local() functions. Put back the
+    call to lb chroot_local-packages, so that packages installed into
+    chroot/root/packages/ actually get installed. This is fixed properly in
+    3.0~a25-1, so this can be dropped again at the next merge. (LP: #857494)
+
+ -- Martin Pitt <martin.pitt@ubuntu.com>  Wed, 28 Sep 2011 11:34:06 +0200
+
+live-build (3.0~a24-1ubuntu15) oneiric; urgency=low
+
+  * Backport from upstream:
+    - Add support for ext4 for binary and chroot filesystems (LP: #803547).
+
+ -- Colin Watson <cjwatson@ubuntu.com>  Mon, 19 Sep 2011 18:26:17 +0100
+
+live-build (3.0~a24-1ubuntu14) oneiric; urgency=low
+
+  * Drop gnu-fdisk from Recommends to Suggests; it's only used for USB
+    images.
+
+ -- Colin Watson <cjwatson@ubuntu.com>  Wed, 14 Sep 2011 14:02:26 +0100
+
+live-build (3.0~a24-1ubuntu13) oneiric; urgency=low
+
+  * Mimic livecd-rootfs's handling of inodes on ext* filesystems to
+    reduce the pain of resizing preinstalled images. (LP: #836810)
+
+ -- Adam Conrad <adconrad@ubuntu.com>  Mon, 29 Aug 2011 10:34:20 -0600
+
+live-build (3.0~a24-1ubuntu12) oneiric; urgency=low
+
+  * Look for the proper filename for the Wubi disk image in GRUB.
+
+ -- Evan Dandrea <ev@ubuntu.com>  Wed, 17 Aug 2011 12:32:10 +0100
+
+live-build (3.0~a24-1ubuntu11) oneiric; urgency=low
+
+  * Make sure the root disk appears in ubuntu/disks for Wubi.
+
+ -- Evan Dandrea <ev@ubuntu.com>  Tue, 16 Aug 2011 18:08:53 +0100
+
+live-build (3.0~a24-1ubuntu10) oneiric; urgency=low
+
+  * Copy gfxboot theme when building for Ubuntu.
+  * Only modify live.cfg for casper if it exists.
+  * Drop Recommends on live-boot-doc and live-config-doc for now, until such
+    time as we switch away from casper.
+
+ -- Colin Watson <cjwatson@ubuntu.com>  Thu, 11 Aug 2011 18:58:41 +0100
+
+live-build (3.0~a24-1ubuntu9) oneiric; urgency=low
+
+  * set -e the Wubi hook.
+
+ -- Evan Dandrea <ev@ubuntu.com>  Tue, 26 Jul 2011 15:11:51 +0100
+
+live-build (3.0~a24-1ubuntu8) oneiric; urgency=low
+
+  * Make sure /host exists for Wubi.
+
+ -- Evan Dandrea <ev@ubuntu.com>  Tue, 26 Jul 2011 15:00:07 +0100
+
+live-build (3.0~a24-1ubuntu7) oneiric; urgency=low
+
+  * Revert previous change. That won't work at all.
+
+ -- Evan Dandrea <ev@ubuntu.com>  Mon, 25 Jul 2011 18:34:31 +0100
+
+live-build (3.0~a24-1ubuntu6) oneiric; urgency=low
+
+  * Generate the grub.cfg file for Wubi.
+
+ -- Evan Dandrea <ev@ubuntu.com>  Mon, 25 Jul 2011 18:03:48 +0100
+
+live-build (3.0~a24-1ubuntu5) oneiric; urgency=low
+
+  * There's no need for a wubi prefix on the resulting archive, and it
+    would require special-casing in cdimage.
+
+ -- Evan Dandrea <ev@ubuntu.com>  Mon, 18 Jul 2011 14:26:43 +0100
+
+live-build (3.0~a24-1ubuntu4) oneiric; urgency=low
+
+  * Forgot to move filesystem.ext3 to root.disk. Oops.
+
+ -- Evan Dandrea <ev@ubuntu.com>  Mon, 18 Jul 2011 09:21:18 +0100
+
+live-build (3.0~a24-1ubuntu3) oneiric; urgency=low
+
+  * Compress wubildr and the ext3 disk image for Wubi.
+
+ -- Evan Dandrea <ev@ubuntu.com>  Mon, 18 Jul 2011 01:02:39 +0100
+
+live-build (3.0~a24-1ubuntu2) oneiric; urgency=low
+
+  * Add stop-looking-for-kernels.patch, to stop trying to fiddle with
+    non-existent kernels when we explicitely didn't install any.
+
+ -- Adam Conrad <adconrad@ubuntu.com>  Fri, 15 Jul 2011 00:15:56 -0600
+
+live-build (3.0~a24-1ubuntu1) oneiric; urgency=low
+
+  * Resynchronise with Debian.  Remaining changes:
+    - Update the mlocate database (Debian #627332).
+    - Update the Apt Xapian index (Debian #627716).
+    - Add Kubuntu hook to remove GNOME icon cache (Debian #630088).
+    - Add hook to remove .pyc files (Debian #631281).
+    - Add wubildr build support.
+    - Use the correct mirror locations for Ubuntu ports.
+    - Fix up live.cfg for casper.
+  * Fix spelling of ubuntu-casper-normalisation patch.
+
+ -- Colin Watson <cjwatson@ubuntu.com>  Wed, 13 Jul 2011 18:57:48 +0100
+
 live-build (3.0~a24-1) experimental; urgency=low
 
   [ Richard Nelson ]
@@ -1056,6 +1667,73 @@ live-build (3.0~a22-1) experimental; urg
 
  -- Daniel Baumann <daniel@debian.org>  Wed, 29 Jun 2011 06:18:11 +0200
 
+live-build (3.0~a21-1ubuntu9) oneiric; urgency=low
+
+  * drop patch to lb_binary_disk. According to upstream
+    (http://tinyurl.com/5vu3wpj), this needs to be done via some hook if
+    desired. Otherwise it becomes impossible to create images with more
+    than one kernel.
+
+ -- Reinhard Tartler <siretart@tauware.de>  Sun, 10 Jul 2011 19:22:55 +0200
+
+live-build (3.0~a21-1ubuntu8) oneiric; urgency=low
+
+  * lb_binary_disk: Rename kernel paths to match what live.cfg in the
+    themes packages refer to.
+  * Fixup live.cfg for casper.
+  
+ -- Reinhard Tartler <siretart@tauware.de>  Sun, 10 Jul 2011 10:31:44 +0200
+
+live-build (3.0~a21-1ubuntu7) oneiric; urgency=low
+
+  * Link wubildr so BuildLiveCD can find it.
+
+ -- Evan Dandrea <ev@ubuntu.com>  Wed, 06 Jul 2011 12:40:21 +0100
+
+live-build (3.0~a21-1ubuntu6) oneiric; urgency=low
+
+  * Use the correct mirror locations for Ubuntu ports.
+
+ -- Adam Conrad <adconrad@ubuntu.com>  Wed, 06 Jul 2011 10:34:28 +0000
+
+live-build (3.0~a21-1ubuntu5) oneiric; urgency=low
+
+  * Add wubildr build support.
+
+ -- Evan Dandrea <ev@ubuntu.com>  Mon, 04 Jul 2011 17:37:03 +0100
+
+live-build (3.0~a21-1ubuntu4) oneiric; urgency=low
+
+  * Add hook to remove .pyc files (Debian #631281).
+
+ -- Colin Watson <cjwatson@ubuntu.com>  Wed, 22 Jun 2011 15:36:51 +0100
+
+live-build (3.0~a21-1ubuntu3) oneiric; urgency=low
+
+  * Fix default for LB_PARENT_ARCHIVE_AREAS (Debian #630604).
+
+ -- Colin Watson <cjwatson@ubuntu.com>  Wed, 15 Jun 2011 22:37:03 +0100
+
+live-build (3.0~a21-1ubuntu2) oneiric; urgency=low
+
+  * Make --architectures armel only fail if --linux-flavours was not passed
+    (Debian #630464).
+
+ -- Colin Watson <cjwatson@ubuntu.com>  Tue, 14 Jun 2011 09:11:02 +0100
+
+live-build (3.0~a21-1ubuntu1) oneiric; urgency=low
+
+  [ Colin Watson ]
+  * Resynchronise with Debian.  Remaining changes:
+    - Update the mlocate database (Debian #627332).
+    - Update the Apt Xapian index (Debian #627716).
+    - Add Kubuntu hook to remove GNOME icon cache (Debian #630088).
+
+  [ Daniel Baumann ]
+  * Using -wildcards option when calling mksquashfs with an excludes file.
+
+ -- Colin Watson <cjwatson@ubuntu.com>  Mon, 13 Jun 2011 20:41:17 +0100
+
 live-build (3.0~a21-1) unstable; urgency=low
 
   [ Daniel Baumann ]
@@ -1074,6 +1752,26 @@ live-build (3.0~a21-1) unstable; urgency
 
  -- Daniel Baumann <daniel@debian.org>  Mon, 13 Jun 2011 20:42:13 +0200
 
+live-build (3.0~a20-1ubuntu1) oneiric; urgency=low
+
+  [ Daniel Baumann ]
+  * Obtaining the live passes package selection information at the latest
+    point to catch all other modifications in the package selection.
+  * Moving installation of live packages to second pass.
+  * Removing now unnecessary stagefile check in lb_source.
+
+  [ Colin Watson ]
+  * Update the mlocate database (Debian #627332).
+  * Add an option to remove the kernel and initrd from the compressed
+    filesystem (Debian #627665).
+  * Add --initramfs-compression option (Debian #627677).
+  * Update the Apt Xapian index (Debian #627716).
+  * Add --swap-file-path and --swap-file-size options (Debian #629637).
+  * Add Kubuntu hook to remove GNOME icon cache (Debian #630088).
+  * Divert flash-kernel aside while building the chroot (Debian #630350).
+
+ -- Colin Watson <cjwatson@ubuntu.com>  Mon, 13 Jun 2011 10:36:46 +0100
+
 live-build (3.0~a20-1) unstable; urgency=low
 
   [ Daniel Baumann ]
diff -pruN 3.0~a57-1/debian/control 3.0~a57-1ubuntu43/debian/control
--- 3.0~a57-1/debian/control	2012-08-10 20:44:17.000000000 +0000
+++ 3.0~a57-1ubuntu43/debian/control	2018-06-27 04:39:45.000000000 +0000
@@ -1,7 +1,8 @@
 Source: live-build
 Section: misc
 Priority: optional
-Maintainer: Debian Live Project <debian-live@lists.debian.org>
+Maintainer: Ubuntu Developers <ubuntu-devel-discuss@lists.ubuntu.com>
+XSBC-Original-Maintainer: Debian Live Project <debian-live@lists.debian.org>
 Uploaders: Daniel Baumann <daniel@debian.org>
 Build-Depends: debhelper (>= 9)
 Standards-Version: 3.9.3
@@ -11,14 +12,12 @@ Vcs-Git: git://live.debian.net/git/live-
 
 Package: live-build
 Architecture: all
-Depends: ${misc:Depends}, debootstrap | cdebootstrap | cdebootstrap-static
-Recommends:
- live-boot-doc, live-config-doc, live-manual-html | live-manual, cpio,
- gnu-fdisk
+Depends: ${misc:Depends}, debootstrap | cdebootstrap | cdebootstrap-static, cpio, initramfs-tools
 Suggests:
  dosfstools, genisoimage, git, memtest86+ | memtest86, mtools, parted,
  squashfs-tools | mtd-tools, sudo | fakeroot, syslinux | grub,
- uuid-runtime, win32-loader
+ uuid-runtime, win32-loader, gnu-fdisk
+Breaks: livecd-rootfs (<< 2.75)
 Description: Debian Live - System build scripts
  live-build contains the scripts that build a Debian Live system image from a
  configuration directory.
diff -pruN 3.0~a57-1/debian/patches/0001-Handle-includes.chroot-files-installed-over-symlinke.patch 3.0~a57-1ubuntu43/debian/patches/0001-Handle-includes.chroot-files-installed-over-symlinke.patch
--- 3.0~a57-1/debian/patches/0001-Handle-includes.chroot-files-installed-over-symlinke.patch	1970-01-01 00:00:00.000000000 +0000
+++ 3.0~a57-1ubuntu43/debian/patches/0001-Handle-includes.chroot-files-installed-over-symlinke.patch	2018-11-12 20:11:36.000000000 +0000
@@ -0,0 +1,57 @@
+From 52908422880f8d5cfa18c577d4138d5449af37f6 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Rapha=C3=ABl=20Hertzog?= <hertzog@debian.org>
+Date: Fri, 27 Jul 2018 09:46:55 +0200
+Subject: [PATCH] Handle includes.chroot files installed over symlinked
+ directories
+
+With the merged /usr feature now enabled in debootstrap, we have
+/bin and /lib which are symlinks to /usr/bin and /usr/lib. If
+the live-build configuration provides files in
+config/includes.chroot/lib/ or config/includes.chroot/bin/ then
+lb chroot_includes will replace the /lib or /bin symlink with real
+directories having only the content provided in chroot.includes and
+problems will follow... the build will usually fail later with a
+cryptic error message (for example a hook failing to execute
+/usr/bin/env).
+
+Work around the issue by creating a tarball of the files to install
+and by unpacking that tarball from within the chroot with appropriate
+options.
+---
+ xnox: adapted for Ubuntu's livebuild
+
+ scripts/build/chroot_includes | 6 +++++-
+ 1 file changed, 5 insertions(+), 1 deletion(-)
+
+--- a/scripts/build/lb_binary_includes
++++ b/scripts/build/lb_binary_includes
+@@ -42,8 +42,12 @@
+ then
+ 	# Copying includes
+ 	cd config/includes.binary
+-	find . | cpio -dmpu --no-preserve-owner "${OLDPWD}"/binary
++	Echo_message "Creating a tarball with files from includes.binary..."
++	tar cf "${OLDPWD}"/binary/includes.binary.tar .
+ 	cd "${OLDPWD}"
++	Echo_message "Extracting the tarball in the chroot..."
++	tar -C binary -xvf binary/includes.binary.tar --no-same-owner --keep-directory-symlink --overwrite
++	rm binary/includes.binary.tar
+ 
+ 	# Removing symlinks
+ 	case "${LB_BINARY_IMAGES}" in
+--- a/scripts/build/lb_chroot_includes
++++ b/scripts/build/lb_chroot_includes
+@@ -42,8 +42,12 @@
+ then
+ 	# Copying includes
+ 	cd config/includes.chroot
+-	find . | cpio -dmpu --no-preserve-owner "${OLDPWD}"/chroot
++	Echo_message "Creating a tarball with files from includes.chroot..."
++	tar cf "${OLDPWD}"/chroot/includes.chroot.tar .
+ 	cd "${OLDPWD}"
++	Echo_message "Extracting the tarball in the chroot..."
++	Chroot chroot "tar -xvf includes.chroot.tar --no-same-owner --keep-directory-symlink --overwrite"
++	rm chroot/includes.chroot.tar
+ 
+ 	# Creating stage file
+ 	Create_stagefile .build/chroot_includes
diff -pruN 3.0~a57-1/debian/patches/add-chroot-early 3.0~a57-1ubuntu43/debian/patches/add-chroot-early
--- 3.0~a57-1/debian/patches/add-chroot-early	1970-01-01 00:00:00.000000000 +0000
+++ 3.0~a57-1ubuntu43/debian/patches/add-chroot-early	2014-09-22 19:57:46.000000000 +0000
@@ -0,0 +1,88 @@
+Adds a new chroot_early hook type allowing actions prior to package
+installation. This is required by Ubuntu Touch and possibly other
+system-image type images where we want to force a pre-defined user/group
+sets.
+
+--- live-build-3.0~a57.orig/scripts/build/lb_chroot
++++ live-build-3.0~a57/scripts/build/lb_chroot
+@@ -54,6 +54,7 @@ lb chroot_archives chroot install ${*}
+ # Customizing chroot
+ lb chroot_linux-image ${*}
+ lb chroot_preseed ${*}
++lb chroot_early_hooks ${*}
+ 
+ for _PASS in install live
+ do
+--- /dev/null
++++ live-build-3.0~a57/scripts/build/lb_chroot_early_hooks
+@@ -0,0 +1,70 @@
++#!/bin/sh
++
++## live-build(7) - System Build Scripts
++## Copyright (C) 2006-2012 Daniel Baumann <daniel@debian.org>
++##
++## This program comes with ABSOLUTELY NO WARRANTY; for details see COPYING.
++## This is free software, and you are welcome to redistribute it
++## under certain conditions; see COPYING for details.
++
++
++set -e
++
++# Including common functions
++( . "${LIVE_BUILD}/scripts/build.sh" > /dev/null 2>&1 || true ) || . /usr/lib/live/build.sh
++
++# Setting static variables
++DESCRIPTION="$(Echo 'execute hooks in chroot (early stage)')"
++HELP=""
++USAGE="${PROGRAM} [--force]"
++
++Arguments "${@}"
++
++# Reading configuration files
++Read_conffiles config/all config/common config/bootstrap config/chroot config/binary config/source
++Set_defaults
++
++Echo_message "Begin executing early chroot hooks..."
++
++# Requiring stage file
++Require_stagefile .build/config .build/bootstrap
++
++# Checking stage file
++Check_stagefile .build/chroot_early_hooks
++
++# Checking lock file
++Check_lockfile .lock
++
++# Creating lock file
++Create_lockfile .lock
++
++## Processing local hooks
++if Find_files config/hooks/*.chroot_early
++then
++	# Restoring cache
++	Restore_cache cache/packages.chroot
++
++	for _HOOK in config/hooks/*.chroot_early
++	do
++		# Copying hook
++		cp "${_HOOK}" chroot/root
++
++		# Making hook executable
++		if [ ! -x chroot/root/"$(basename ${_HOOK})" ]
++		then
++			chmod +x chroot/root/"$(basename ${_HOOK})"
++		fi
++
++		# Executing hook
++		Chroot chroot "/root/$(basename ${_HOOK})" || { Echo_error "${_HOOK} failed (exit non-zero). You should check for errors."; exit 1 ;}
++
++		# Removing hook
++		rm -f chroot/root/"$(basename ${_HOOK})"
++	done
++
++	# Saving cache
++	Save_cache cache/packages.chroot
++
++	# Creating stage file
++	Create_stagefile .build/chroot_early_hooks
++fi
diff -pruN 3.0~a57-1/debian/patches/add-riscv64.patch 3.0~a57-1ubuntu43/debian/patches/add-riscv64.patch
--- 3.0~a57-1/debian/patches/add-riscv64.patch	1970-01-01 00:00:00.000000000 +0000
+++ 3.0~a57-1ubuntu43/debian/patches/add-riscv64.patch	2020-04-30 15:10:34.000000000 +0000
@@ -0,0 +1,38 @@
+Description: <short summary of the patch>
+ TODO: Put a short summary on the line above and replace this paragraph
+ with a longer explanation of this change. Complete the meta-information
+ with other relevant fields (see below for details). To make it easier, the
+ information below has been extracted from the changelog. Adjust it or drop
+ it.
+ .
+ live-build (3.0~a57-1ubuntu39) groovy; urgency=medium
+ .
+   * Add riscv64 support.
+Author: Dimitri John Ledkov <xnox@ubuntu.com>
+
+---
+The information above should follow the Patch Tagging Guidelines, please
+checkout http://dep.debian.net/deps/dep3/ to learn about the format. Here
+are templates for supplementary fields that you might want to add:
+
+Origin: <vendor|upstream|other>, <url of original patch>
+Bug: <url in upstream bugtracker>
+Bug-Debian: https://bugs.debian.org/<bugnumber>
+Bug-Ubuntu: https://launchpad.net/bugs/<bugnumber>
+Forwarded: <no|not-needed|url proving that it has been forwarded>
+Reviewed-By: <name and email of someone who approved the patch>
+Last-Update: 2020-04-30
+
+--- live-build-3.0~a57.orig/functions/defaults.sh
++++ live-build-3.0~a57/functions/defaults.sh
+@@ -824,6 +824,10 @@ Set_defaults ()
+ 			LB_LINUX_FLAVOURS="${LB_LINUX_FLAVOURS:-generic}"
+ 			;;
+ 
++		riscv64)
++			LB_LINUX_FLAVOURS="${LB_LINUX_FLAVOURS:-generic}"
++			;;
++
+ 		s390x)
+ 			LB_LINUX_FLAVOURS="${LB_LINUX_FLAVOURS:-generic}"
+ 			;;
diff -pruN 3.0~a57-1/debian/patches/chroot-resolv-conf-allow-symlinks 3.0~a57-1ubuntu43/debian/patches/chroot-resolv-conf-allow-symlinks
--- 3.0~a57-1/debian/patches/chroot-resolv-conf-allow-symlinks	1970-01-01 00:00:00.000000000 +0000
+++ 3.0~a57-1ubuntu43/debian/patches/chroot-resolv-conf-allow-symlinks	2014-10-29 09:40:02.000000000 +0000
@@ -0,0 +1,24 @@
+Description: Allow symlinks for config/includes.chroot/etc/resolv.conf
+ Backport from the 4.0 branch to allow symlinks for 
+ config/includes.chroot/etc/resolv.conf so that a image can have a
+ symlink to /run/resolvconf/resolv.conf
+Author: Michael Vogt <michael.vogt@ubuntu.com>
+
+---
+Origin: vendor
+Forwarded: not-needed
+Last-Update: 2014-10-29
+
+Index: live-build-3.0~a57/scripts/build/lb_chroot_resolv
+===================================================================
+--- live-build-3.0~a57.orig/scripts/build/lb_chroot_resolv
++++ live-build-3.0~a57/scripts/build/lb_chroot_resolv
+@@ -76,7 +76,7 @@ case "${1}" in
+ 		# Creating lock file
+ 		Create_lockfile .lock
+ 
+-		if [ -e config/includes.chroot/etc/resolv.conf ]
++		if [ -e config/includes.chroot/etc/resolv.conf ] ||  [ -L config/includes.chroot/etc/resolv.conf ];
+ 		then
+ 			# Copying local resolv.conf
+ 			cp -a config/includes.chroot/etc/resolv.conf chroot/etc/resolv.conf
diff -pruN 3.0~a57-1/debian/patches/dpkg-divert-initctl 3.0~a57-1ubuntu43/debian/patches/dpkg-divert-initctl
--- 3.0~a57-1/debian/patches/dpkg-divert-initctl	1970-01-01 00:00:00.000000000 +0000
+++ 3.0~a57-1ubuntu43/debian/patches/dpkg-divert-initctl	2015-07-21 19:39:59.000000000 +0000
@@ -0,0 +1,57 @@
+commit 20f042f923d25772cb87515a184308e2d2dec084
+Author: Daniel Baumann <mail@daniel-baumann.ch>
+Date:   Mon Mar 11 09:26:37 2013 +0100
+
+    Using dpkg-divert in chroot_upstart script to handle upgrades of upstart during the build (Closes: #702537).
+
+diff --git a/scripts/build/chroot_upstart b/scripts/build/chroot_upstart
+index 47d68c2..88dc3b2 100755
+--- a/scripts/build/lb_chroot_upstart
++++ b/scripts/build/lb_chroot_upstart
+@@ -27,6 +27,12 @@ Set_defaults
+ # Requiring stage file
+ Require_stagefile .build/config .build/bootstrap
+ 
++# Check if system uses upstart
++if [ ! -e chroot/sbin/initctl ]
++then
++	exit 0
++fi
++
+ case "${1}" in
+ 	install)
+ 		Echo_message "Configuring file /sbin/initctl"
+@@ -40,13 +46,9 @@ case "${1}" in
+ 		# Creating lock file
+ 		Create_lockfile .lock
+ 
+-		if [ -f chroot/sbin/initctl ]
+-		then
+-			# Save initctl file
+-			mv chroot/sbin/initctl chroot/sbin/initctl.orig
+-		fi
++		# Create custom initctl file
++		Chroot chroot dpkg-divert --rename --quiet --add /sbin/initctl
+ 
+-		# Create initctl file
+ cat > chroot/sbin/initctl << EOF
+ #!/bin/sh
+ echo "All runlevel operations denied by policy" >&2
+@@ -68,14 +70,9 @@ EOF
+ 		# Creating lock file
+ 		Create_lockfile .lock
+ 
+-		if [ -f chroot/sbin/initctl.orig ]
+-		then
+-			# Restore initctl file
+-			mv chroot/sbin/initctl.orig chroot/sbin/initctl
+-		else
+-			# Remove initctl file
+-			rm -f chroot/sbin/initctl
+-		fi
++		# Remove custom initctl file
++		rm -f chroot/sbin/initctl
++		Chroot chroot dpkg-divert --rename --quiet --remove /sbin/initctl
+ 
+ 		# Removing stage file
+ 		rm -f .build/chroot_upstart
diff -pruN 3.0~a57-1/debian/patches/dpkg-divert-others 3.0~a57-1ubuntu43/debian/patches/dpkg-divert-others
--- 3.0~a57-1/debian/patches/dpkg-divert-others	1970-01-01 00:00:00.000000000 +0000
+++ 3.0~a57-1ubuntu43/debian/patches/dpkg-divert-others	2015-07-21 19:40:26.000000000 +0000
@@ -0,0 +1,122 @@
+commit 5a00aa44827cd477e13470b4ce417b7b6fff62f9
+Author: Daniel Baumann <mail@daniel-baumann.ch>
+Date:   Mon Mar 11 09:49:07 2013 +0100
+
+    Using dpkg-divert for other diversions too to handle upgrades of the diverted stuff during build.
+
+diff --git a/scripts/build/chroot_dpkg b/scripts/build/chroot_dpkg
+index b199cdf..07ef966 100755
+--- a/scripts/build/lb_chroot_dpkg
++++ b/scripts/build/lb_chroot_dpkg
+@@ -40,10 +40,8 @@ case "${1}" in
+ 		# Creating lock file
+ 		Create_lockfile .lock
+ 
+-		# Save start-stop-daemon program
+-		mv chroot/sbin/start-stop-daemon chroot/sbin/start-stop-daemon.orig
+-
+-		# Create start-stop-daemon program
++		# Create custom start-stop-daemon program
++		Chroot chroot dpkg-divert --rename --quiet --add /sbin/start-stop-daemon
+ 
+ cat > chroot/sbin/start-stop-daemon << EOF
+ #!/bin/sh
+@@ -103,11 +101,9 @@ EOF
+ 			rmdir --ignore-fail-on-non-empty /var/state/samhain || true
+ 		fi
+ 
+-		# Restore start-stop-daemon program
+-		if [ -e chroot/sbin/start-stop-daemon.orig ]
+-		then
+-			mv chroot/sbin/start-stop-daemon.orig chroot/sbin/start-stop-daemon
+-		fi
++		# Remove custom start-stop-daemon program
++		rm -f chroot/sbin/start-stop-daemon
++		Chroot chroot dpkg-divert --rename --quiet --remove /sbin/start-stop-daemon
+ 
+ 		# Remove dpkg sync configuration
+ 		rm -f chroot/etc/dpkg/dpkg.cfg.d/live-build
+diff --git a/scripts/build/chroot_hostname b/scripts/build/chroot_hostname
+index edc38a1..c42b1a7 100755
+--- a/scripts/build/lb_chroot_hostname
++++ b/scripts/build/lb_chroot_hostname
+@@ -29,8 +29,6 @@ Require_stagefile .build/config .build/bootstrap
+ 
+ case "${1}" in
+ 	install)
+-		Echo_message "Configuring file /etc/hostname"
+-
+ 		# Checking stage file
+ 		Check_stagefile .build/chroot_hostname
+ 
+@@ -40,15 +38,15 @@ case "${1}" in
+ 		# Creating lock file
+ 		Create_lockfile .lock
+ 
+-		# Save hostname
+-		mv chroot/bin/hostname chroot/bin/hostname.orig
+-
+ 		# Create hostname file
++		Echo_message "Configuring file /etc/hostname"
++
+ 		echo "localhost.localdomain" > chroot/etc/hostname
+ 
++		# Create custom hostname
+ 		Echo_message "Configuring file /bin/hostname"
+ 
+-		# Create hostname program
++		Chroot chroot dpkg-divert --rename --quiet --add /bin/hostname
+ 
+ cat > chroot/bin/hostname << EOF
+ #!/bin/sh
+@@ -79,11 +77,9 @@ EOF
+ 
+ 		Echo_message "Deconfiguring file /bin/hostname"
+ 
+-		# Restore hostname file
+-		if [ -e chroot/bin/hostname.orig ]
+-		then
+-			mv chroot/bin/hostname.orig chroot/bin/hostname
+-		fi
++		# Remove custom hostname
++		rm -f chroot/bin/hostname
++		Chroot chroot dpkg-divert --rename --quiet --remove /bin/hostname
+ 
+ 		# Removing stage file
+ 		rm -f .build/chroot_hostname
+diff --git a/scripts/build/chroot_sysv-rc b/scripts/build/chroot_sysv-rc
+index 247290e..4dea100 100755
+--- a/scripts/build/lb_chroot_sysv-rc
++++ b/scripts/build/lb_chroot_sysv-rc
+@@ -40,10 +40,10 @@ case "${1}" in
+ 		# Creating lock file
+ 		Create_lockfile .lock
+ 
+-		if [ -f chroot/usr/sbin/policy-rc.d ]
++		if [ -e chroot/usr/sbin/policy-rc.d ]
+ 		then
+ 			# Save policy-rc.d file
+-			mv chroot/usr/sbin/policy-rc.d chroot/usr/sbin/policy-rc.d.orig
++			Chroot chroot dpkg-divert --rename --quiet --add /usr/sbin/policy-rc.d
+ 		fi
+ 
+ 		# Create policy-rc.d file
+@@ -68,13 +68,13 @@ EOF
+ 		# Creating lock file
+ 		Create_lockfile .lock
+ 
+-		if [ -f chroot/usr/sbin/policy-rc.d.orig ]
++		# Remove custom policy-rc.d file
++		rm -f chroot/usr/sbin/policy-rc.d
++
++		if [ -e chroot/usr/sbin/policy-rc.d.distrib ]
+ 		then
+ 			# Restore policy-rc.d file
+-			mv chroot/usr/sbin/policy-rc.d.orig chroot/usr/sbin/policy-rc.d
+-		else
+-			# Remove policy-rc.d file
+-			rm -f chroot/usr/sbin/policy-rc.d
++			Chroot chroot dpkg-divert --rename --quiet --remove /usr/sbin/policy-rc.d
+ 		fi
+ 
+ 		# Removing stage file
diff -pruN 3.0~a57-1/debian/patches/drop-default-initramfs-compression-override.patch 3.0~a57-1ubuntu43/debian/patches/drop-default-initramfs-compression-override.patch
--- 3.0~a57-1/debian/patches/drop-default-initramfs-compression-override.patch	1970-01-01 00:00:00.000000000 +0000
+++ 3.0~a57-1ubuntu43/debian/patches/drop-default-initramfs-compression-override.patch	2019-06-05 12:34:29.000000000 +0000
@@ -0,0 +1,20 @@
+Description:
+   * Stop setting LB_INITRAMFS_COMPRESSION default, and instead fallback to
+     using initramfs-tools default. LB_INITRAMFS_COMPRESSION is now only to
+     override whatever initramfs-tools' default compression is. This thus
+     makes live-build default to lz4. LP: #1831736
+Author: Dimitri John Ledkov <xnox@ubuntu.com>
+Bug-Ubuntu: https://bugs.launchpad.net/bugs/1831736
+
+
+--- live-build-3.0~a57.orig/functions/defaults.sh
++++ live-build-3.0~a57/functions/defaults.sh
+@@ -220,8 +220,6 @@ Set_defaults ()
+ 			;;
+ 	esac
+ 
+-	LB_INITRAMFS_COMPRESSION="${LB_INITRAMFS_COMPRESSION:-gzip}"
+-
+ 	# Setting initsystem
+ 	case "${LB_MODE}" in
+ 		ubuntu|kubuntu)
diff -pruN 3.0~a57-1/debian/patches/fix-preferences-copying 3.0~a57-1ubuntu43/debian/patches/fix-preferences-copying
--- 3.0~a57-1/debian/patches/fix-preferences-copying	1970-01-01 00:00:00.000000000 +0000
+++ 3.0~a57-1ubuntu43/debian/patches/fix-preferences-copying	2015-04-29 21:01:43.000000000 +0000
@@ -0,0 +1,25 @@
+Description: Fix copying apt preferences snippets into chroots
+Author: Adam Conrad <adconrad@ubuntu.com>
+
+Index: live-build-3.0~a57/scripts/build/lb_chroot_archives
+===================================================================
+--- live-build-3.0~a57.orig/scripts/build/lb_chroot_archives
++++ live-build-3.0~a57/scripts/build/lb_chroot_archives
+@@ -291,7 +291,7 @@ EOF
+ 			do
+ 				if [ -e "${FILE}" ]
+ 				then
+-					cp config/archives/$(basename ${_FILE} .chroot) chroot/etc/apt/preferences.d
++					cp ${FILE} chroot/etc/apt/preferences.d/$(basename ${FILE} .chroot)
+ 				fi
+ 			done
+ 		fi
+@@ -846,7 +846,7 @@ EOF
+ 			do
+ 				if [ -e "${FILE}" ]
+ 				then
+-					cp config/archives/$(basename ${_FILE} .binary) chroot/etc/apt/preferences.d
++					cp ${FILE} chroot/etc/apt/preferences.d/$(basename ${FILE} .binary)
+ 				fi
+ 			done
+ 		fi
diff -pruN 3.0~a57-1/debian/patches/late-resolv.conf-symlink.patch 3.0~a57-1ubuntu43/debian/patches/late-resolv.conf-symlink.patch
--- 3.0~a57-1/debian/patches/late-resolv.conf-symlink.patch	1970-01-01 00:00:00.000000000 +0000
+++ 3.0~a57-1ubuntu43/debian/patches/late-resolv.conf-symlink.patch	2018-03-15 12:52:26.000000000 +0000
@@ -0,0 +1,22 @@
+Description: Handle late installation of systemd/resolvconf gracefully, by not
+ reverting /etc/resolv.conf symlink to a backup of the backup.
+Author: Dimitri John Ledkov <xnox@ubuntu.com>
+
+--- live-build-3.0~a57.orig/scripts/build/lb_chroot_resolv
++++ live-build-3.0~a57/scripts/build/lb_chroot_resolv
+@@ -81,6 +81,15 @@ case "${1}" in
+ 			# Copying local resolv.conf
+ 			cp -a config/includes.chroot/etc/resolv.conf chroot/etc/resolv.conf
+ 			rm -f chroot/etc/resolv.conf.orig
++		elif [ -L chroot/etc/resolv.conf ] && [ -e chroot/etc/resolv.conf.orig ]
++		then
++			# After debootstrap (which copied resolv.conf from
++			# the host) and after we backed that up, something
++			# converted /etc/resolv.conf into a
++			# symlink. E.g. a late installation of
++			# systemd-resolved or resolvconf. Do not touch the
++			# new symlink, but do clean up our backup.
++			rm -f chroot/etc/resolv.conf.orig
+ 		elif [ -e chroot/etc/resolv.conf.orig ] || [ -L chroot/etc/resolv.conf.orig ]
+ 		then
+ 			# Restoring resolv file or symlink
diff -pruN 3.0~a57-1/debian/patches/new-memtest-version 3.0~a57-1ubuntu43/debian/patches/new-memtest-version
--- 3.0~a57-1/debian/patches/new-memtest-version	1970-01-01 00:00:00.000000000 +0000
+++ 3.0~a57-1ubuntu43/debian/patches/new-memtest-version	2022-11-22 20:02:44.000000000 +0000
@@ -0,0 +1,54 @@
+Origin: updated from https://salsa.debian.org/live-team/live-build/-/commit/15e78a3e
+Forwarded: not-needed
+--- live-build-3.0~a57.orig/scripts/build/lb_binary_memtest
++++ live-build-3.0~a57/scripts/build/lb_binary_memtest
+@@ -62,13 +62,14 @@ then
+ fi
+ 
+ # Checking depends
++MEMTEST_BIN="${LB_MEMTEST}"
+ case "${LB_MEMTEST}" in
+ 	memtest86)
+ 		Check_package chroot/boot/memtest86.bin memtest86
+ 		;;
+ 
+ 	memtest86+)
+-		Check_package chroot/boot/memtest86+.bin memtest86+
++		Check_package chroot/usr/share/doc/memtest86+/copyright memtest86+
+ 		;;
+ esac
+ 
+@@ -78,6 +79,19 @@ Restore_cache cache/packages.binary
+ # Installing depends
+ Install_package
+ 
++case "${LB_MEMTEST}" in
++	memtest86+)
++		case "${LB_BUILD_WITH_CHROOT}" in
++			true)
++				[ -e "chroot/boot/${LB_MEMTEST}x64.bin" ] && _MEMTEST_BIN="${LB_MEMTEST}x64"
++				;;
++			false)
++				[ -e "/boot/${LB_MEMTEST}x64.bin" ] && _MEMTEST_BIN="${LB_MEMTEST}x64"
++				;;
++		esac
++		;;
++esac
++
+ # Setting destination directory
+ case "${LB_INITRAMFS}" in
+ 	casper)
+@@ -101,11 +115,11 @@ mkdir -p "${DESTDIR}"
+ # Installing memtest
+ case "${LB_BUILD_WITH_CHROOT}" in
+ 	true)
+-		cp chroot/boot/${LB_MEMTEST}.bin "${DESTDIR}"/memtest
++		cp "chroot/boot/${_MEMTEST_BIN}.bin" "${DESTDIR}"/memtest
+ 		;;
+ 
+ 	false)
+-		cp /boot/${LB_MEMTEST}.bin "${DESTDIR}"/memtest
++		cp "/boot/${_MEMTEST_BIN}.bin" "${DESTDIR}"/memtest
+ 		;;
+ esac
+ 
diff -pruN 3.0~a57-1/debian/patches/no-apt-key.patch 3.0~a57-1ubuntu43/debian/patches/no-apt-key.patch
--- 3.0~a57-1/debian/patches/no-apt-key.patch	1970-01-01 00:00:00.000000000 +0000
+++ 3.0~a57-1ubuntu43/debian/patches/no-apt-key.patch	2018-03-07 10:35:41.000000000 +0000
@@ -0,0 +1,45 @@
+Description: Stop using apt-key to setup secure apt, and instead copy the gpg key snippet.
+Author: Dimitri John Ledkov <xnox@ubuntu.com>
+
+
+Index: live-build-3.0~a57/scripts/build/lb_chroot_archives
+===================================================================
+--- live-build-3.0~a57.orig/scripts/build/lb_chroot_archives
++++ live-build-3.0~a57/scripts/build/lb_chroot_archives
+@@ -249,10 +249,10 @@ EOF
+ 					# Adding archive signing keys (chroot)
+ 					if [ -e "${_BASE}/archives/${REPOSITORY}.key.chroot" ]
+ 					then
+-						cat "${_BASE}/archives/${REPOSITORY}.key.chroot" | Chroot chroot "apt-key add -"
++					    cp "${_BASE}/archives/${REPOSITORY}.key.chroot" chroot/etc/apt/trusted.gpg.d/${REPOSITORY}.gpg
+ 					elif [ -e "${_BASE}/archives/${REPOSITORY}.key" ]
+ 					then
+-						cat "${_BASE}/archives/${REPOSITORY}.key" | Chroot chroot "apt-key add -"
++					    cp "${_BASE}/archives/${REPOSITORY}.key" chroot/etc/apt/trusted.gpg.d/${REPOSITORY}.gpg
+ 					fi
+ 				fi
+ 			done
+@@ -516,9 +516,7 @@ EOF
+ 				do
+ 					if [ -e "${FILE}" ]
+ 					then
+-						cp ${FILE} chroot/root
+-						Chroot chroot "apt-key add /root/$(basename ${FILE})"
+-						rm -f chroot/root/$(basename ${FILE})
++						cp ${FILE} chroot/etc/apt/trusted.gpg.d/$(basename ${FILE}).gpg
+ 					fi
+ 				done
+ 			fi
+@@ -804,10 +802,10 @@ EOF
+ 					# Adding archive signing keys (binary)
+ 					if [ -e "${_BASE}/archives/${REPOSITORY}.key.binary" ]
+ 					then
+-						cat "${_BASE}/archives/${REPOSITORY}.key.binary" | Chroot chroot "apt-key add -"
++						cp "${_BASE}/archives/${REPOSITORY}.key.binary" chroot/etc/apt/trusted.gpg.d/${REPOSITORY}.gpg
+ 					elif [ -e "${_BASE}/archives/${REPOSITORY}.key" ]
+ 					then
+-						cat "${_BASE}/archives/${REPOSITORY}.key" | Chroot chroot "apt-key add -"
++						cat "${_BASE}/archives/${REPOSITORY}.key" chroot/etc/apt/trusted.gpg.d/${REPOSITORY}.gpg
+ 					fi
+ 				fi
+ 			done
diff -pruN 3.0~a57-1/debian/patches/remove-etc-machineid 3.0~a57-1ubuntu43/debian/patches/remove-etc-machineid
--- 3.0~a57-1/debian/patches/remove-etc-machineid	1970-01-01 00:00:00.000000000 +0000
+++ 3.0~a57-1ubuntu43/debian/patches/remove-etc-machineid	2014-10-29 09:38:41.000000000 +0000
@@ -0,0 +1,20 @@
+Description: Truncate /etc/machine-id (in addition to /var/lib/dbus/machine-id)
+ Systemd is using a /etc/machine-id file that needs to be unique to the
+ local system. Just like we remove /var/lib/dbus/machine-id we truncate
+ /etc/machine-id. This will make systemd generate a new one on each boot.
+Author: Michael Vogt <michael.vogt@ubuntu.com>
+
+---
+Origin: vendor
+Forwarded: no
+Last-Update: 2014-10-29
+
+--- live-build-3.0~a57.orig/share/hooks/004-remove-dbus-machine-id.chroot
++++ live-build-3.0~a57/share/hooks/004-remove-dbus-machine-id.chroot
+@@ -7,3 +7,6 @@ set -e
+ # This removes dbus machine id that cache that makes each system unique.
+ 
+ rm -f /var/lib/dbus/machine-id
++
++# truncate, do not remove otherwise systemd is unhappy
++printf "" > /etc/machine-id
diff -pruN 3.0~a57-1/debian/patches/series 3.0~a57-1ubuntu43/debian/patches/series
--- 3.0~a57-1/debian/patches/series	1970-01-01 00:00:00.000000000 +0000
+++ 3.0~a57-1ubuntu43/debian/patches/series	2022-11-22 20:02:44.000000000 +0000
@@ -0,0 +1,46 @@
+ubuntu-build-wubildr.patch
+ubuntu-casper-normalisation.patch
+ubuntu-ext-inodes.patch
+ubuntu-wubi-initramfs-framebuffer.patch
+ubuntu-i386-generic-pae.patch
+ubuntu-resolvconf.patch
+ubuntu-powerpc-smp.patch
+ubuntu-kernel-img-conf.patch
+ubuntu-chroot_headers_tidy.patch
+ubuntu-package-lists-without-chroot.patch
+ubuntu-fix-hooks.patch
+ubuntu-parent-mirror-binary-volatile.patch
+ubuntu-debootstrap-variants.patch
+ubuntu-fix-binary-hooks.patch
+ubuntu-no-xz-squashfs.patch
+ubuntu-add-raring-version.patch
+ubuntu-no-adjtime.patch
+ubuntu-arm64-support.patch
+ubuntu-pt_chown.patch
+ubuntu-ppc64el-support.patch
+ubuntu-add-saucy-trusty-version.patch
+add-chroot-early
+remove-etc-machineid
+chroot-resolv-conf-allow-symlinks
+ubuntu-pack-bootlogo.patch
+fix-preferences-copying
+ubuntu-allow-downgrades
+ubuntu-label-disks.patch
+ubuntu-chroot-fs-opts.patch
+dpkg-divert-initctl
+dpkg-divert-others
+upstart-not-in-bootstrap
+ubuntu-s390x-support.patch
+ubuntu-initramfs-compression-symlinks.patch
+ubuntu-no-sysvinit-fixups.patch
+skip-missing-initrd.patch
+ubuntu-no-gnupg-hardcode.patch
+no-apt-key.patch
+late-resolv.conf-symlink.patch
+ubuntu-initramfs-handling.patch
+0001-Handle-includes.chroot-files-installed-over-symlinke.patch
+drop-default-initramfs-compression-override.patch
+add-riscv64.patch
+ubuntu-make-genisoimage-more-flexible.patch
+ubuntu-no-bzip2-bootstrap.patch
+new-memtest-version
diff -pruN 3.0~a57-1/debian/patches/skip-missing-initrd.patch 3.0~a57-1ubuntu43/debian/patches/skip-missing-initrd.patch
--- 3.0~a57-1/debian/patches/skip-missing-initrd.patch	1970-01-01 00:00:00.000000000 +0000
+++ 3.0~a57-1ubuntu43/debian/patches/skip-missing-initrd.patch	2017-09-28 18:01:04.000000000 +0000
@@ -0,0 +1,20 @@
+Description: Skip installing missing initrd
+ ... instead of failing.
+ .
+Author: Balint Reczey <rbalint@ubuntu.com>
+
+Bug-Ubuntu: https://launchpad.net/bugs/1720217
+Forwarded: no
+Last-Update: 2017-09-28
+
+--- live-build-3.0~a57.orig/scripts/build/lb_binary_linux-image
++++ live-build-3.0~a57/scripts/build/lb_binary_linux-image
+@@ -76,7 +76,7 @@ mkdir -p "${DESTDIR}"
+ if [ "${LB_LINUX_PACKAGES}" != "none" ]
+ then
+ 	cp chroot/boot/"${LINUX}"-* "${DESTDIR}"
+-	cp chroot/boot/initrd.img-* "${DESTDIR}"
++	cp chroot/boot/initrd.img-* "${DESTDIR}" 2>&1 || Echo_message "Skipped installing missing initrd."
+ fi
+ 
+ case "${LB_INITRAMFS}" in
diff -pruN 3.0~a57-1/debian/patches/ubuntu-add-raring-version.patch 3.0~a57-1ubuntu43/debian/patches/ubuntu-add-raring-version.patch
--- 3.0~a57-1/debian/patches/ubuntu-add-raring-version.patch	1970-01-01 00:00:00.000000000 +0000
+++ 3.0~a57-1ubuntu43/debian/patches/ubuntu-add-raring-version.patch	2013-05-15 11:52:50.000000000 +0000
@@ -0,0 +1,14 @@
+Description: add raring version number as a known release
+Origin: backport, http://live.debian.net/gitweb/?p=live-build.git;a=commit;h=d766063e128b6f51df58e90956f462343ca3808d
+Bug-Ubuntu: https://launchpad.net/bugs/1174791
+Forwarded: not-needed
+---
+Index: live-build-3.0~a57/functions/releases.sh
+===================================================================
+--- live-build-3.0~a57.orig/functions/releases.sh	2012-08-09 20:32:51.000000000 +0900
++++ live-build-3.0~a57/functions/releases.sh	2013-05-01 00:42:31.044073697 +0900
+@@ -26,3 +26,4 @@
+ RELEASE_oneiric="11.10"		# 2013-04-01
+ RELEASE_precise="12.04"		# LTS: 2017-04-01
+ RELEASE_quantal="12.10"		# 2014-04-01
++RELEASE_raring="13.04"		# 2014-01-01
diff -pruN 3.0~a57-1/debian/patches/ubuntu-add-saucy-trusty-version.patch 3.0~a57-1ubuntu43/debian/patches/ubuntu-add-saucy-trusty-version.patch
--- 3.0~a57-1/debian/patches/ubuntu-add-saucy-trusty-version.patch	1970-01-01 00:00:00.000000000 +0000
+++ 3.0~a57-1ubuntu43/debian/patches/ubuntu-add-saucy-trusty-version.patch	2014-04-03 15:18:53.000000000 +0000
@@ -0,0 +1,15 @@
+Description: add saucy and trusty version number as a known release
+Author: Paolo Sammicheli <xdatap1@ubuntu.com>
+Bug-Ubuntu: https://bugs.launchpad.net/bugs/1300400
+Forwarded: not-needed
+---
+Index: live-build-3.0~a57/functions/releases.sh
+===================================================================
+--- live-build-3.0~a57.orig/functions/releases.sh
++++ live-build-3.0~a57/functions/releases.sh
+@@ -27,3 +27,5 @@ RELEASE_oneiric="11.10"		# 2013-04-01
+ RELEASE_precise="12.04"		# LTS: 2017-04-01
+ RELEASE_quantal="12.10"		# 2014-04-01
+ RELEASE_raring="13.04"		# 2014-01-01
++RELEASE_saucy="13.10"		# 2014-07-01 
++RELEASE_trusty="14.04"		# LTS: 2019-04-01
diff -pruN 3.0~a57-1/debian/patches/ubuntu-allow-downgrades 3.0~a57-1ubuntu43/debian/patches/ubuntu-allow-downgrades
--- 3.0~a57-1/debian/patches/ubuntu-allow-downgrades	1970-01-01 00:00:00.000000000 +0000
+++ 3.0~a57-1ubuntu43/debian/patches/ubuntu-allow-downgrades	2015-04-29 23:10:12.000000000 +0000
@@ -0,0 +1,16 @@
+Description: Allow base system downgrades.
+Author: Adam Conrad <adconrad@ubuntu.com>
+
+--- live-build-3.0~a57.orig/scripts/build/lb_chroot_archives
++++ live-build-3.0~a57/scripts/build/lb_chroot_archives
+@@ -564,8 +564,8 @@ EOF
+ 			rm -rf chroot/var/cache/apt/*.bin
+ 
+ 			Apt chroot update
+-			Apt chroot "upgrade"
+-			Apt chroot "dist-upgrade"
++			Apt chroot "--force-yes" "upgrade"
++			Apt chroot "--force-yes" "dist-upgrade"
+ 
+ 			if [ "${LB_CACHE_INDICES}" = "true" ]
+ 			then
diff -pruN 3.0~a57-1/debian/patches/ubuntu-arm64-support.patch 3.0~a57-1ubuntu43/debian/patches/ubuntu-arm64-support.patch
--- 3.0~a57-1/debian/patches/ubuntu-arm64-support.patch	1970-01-01 00:00:00.000000000 +0000
+++ 3.0~a57-1ubuntu43/debian/patches/ubuntu-arm64-support.patch	2013-10-15 17:36:55.000000000 +0000
@@ -0,0 +1,16 @@
+Description: Add skeleton arm64 support, so that ubuntu-core can build.
+Author: Adam Conrad <adconrad@ubuntu.com>
+
+--- live-build-3.0~a57.orig/functions/defaults.sh
++++ live-build-3.0~a57/functions/defaults.sh
+@@ -702,6 +702,10 @@ Set_defaults ()
+ 
+ 	# Setting linux flavour string
+ 	case "${LB_ARCHITECTURES}" in
++		arm64)
++			# Assume we'll have a generic kernel for arm64 some day:
++			LB_LINUX_FLAVOURS="${LB_LINUX_FLAVOURS:-generic}"
++			;;
+ 		armel)
+ 			case "${LB_MODE}" in
+                                 ubuntu|kubuntu)
diff -pruN 3.0~a57-1/debian/patches/ubuntu-build-wubildr.patch 3.0~a57-1ubuntu43/debian/patches/ubuntu-build-wubildr.patch
--- 3.0~a57-1/debian/patches/ubuntu-build-wubildr.patch	1970-01-01 00:00:00.000000000 +0000
+++ 3.0~a57-1ubuntu43/debian/patches/ubuntu-build-wubildr.patch	2012-08-20 15:43:54.000000000 +0000
@@ -0,0 +1,45 @@
+Description: Build the wubildr bootloader for Wubi
+Author: Evan Dandrea <ev@ubuntu.com>
+Last-Update: 2012-08-20
+
+Index: b/share/hooks/100-build-wubildr.binary
+===================================================================
+--- /dev/null
++++ b/share/hooks/100-build-wubildr.binary
+@@ -0,0 +1,36 @@
++#! /bin/sh
++
++set -e
++
++# Build the wubildr bootloader for Wubi.
++
++cd ..
++CHROOT="$(mktemp -d)"
++# grub-mkimage needs to be able to find the source file of the loopback image
++# in the location that losetup knows it is; however, in a chroot this file wont
++# be present, so we need to make it so by the magic of bind mounts:
++mkdir -p "ubuntu/disks"
++# FIXME: swap these next two lines around when the buildds can handle ext4:
++# mv "binary/boot/filesystem.ext4" "ubuntu/disks/root.disk"
++mv "binary/boot/filesystem.ext3" "ubuntu/disks/root.disk"
++mount -o loop "ubuntu/disks/root.disk" "$CHROOT"
++# Save the directory structure mkdir created, so that it can be removed later.
++REMOVE="$(mkdir -pv "$CHROOT$PWD" | head -n1 | sed "s,.*\`\(.*\)',\1,")"
++mount -o bind "$PWD" "$CHROOT$PWD"
++chroot "$CHROOT" mount -t proc proc /proc
++# Expected to already exist.
++touch wubildr
++# grub-install cries unless you point it at something.
++chroot "$CHROOT" grub-install /dev/null
++umount "$CHROOT/proc"
++umount "$CHROOT$PWD"
++rm -rf "$REMOVE"
++# /host is normally created by partman-auto-loop.
++mkdir "$CHROOT/host"
++umount "$CHROOT"
++mv wubildr binary/boot
++# Link output files somewhere BuildLiveCD will be able to find them.
++PREFIX="livecd.$PROJECT${SUBARCH:+-$SUBARCH}"
++mv ubuntu/disks/root.disk binary/boot/root.disk
++rmdir -p ubuntu/disks
++tar cf - -C binary/boot root.disk wubildr | xz -9 > "$PREFIX.tar.xz"
diff -pruN 3.0~a57-1/debian/patches/ubuntu-casper-normalisation.patch 3.0~a57-1ubuntu43/debian/patches/ubuntu-casper-normalisation.patch
--- 3.0~a57-1/debian/patches/ubuntu-casper-normalisation.patch	1970-01-01 00:00:00.000000000 +0000
+++ 3.0~a57-1ubuntu43/debian/patches/ubuntu-casper-normalisation.patch	2012-08-20 15:43:42.000000000 +0000
@@ -0,0 +1,25 @@
+Description: Fixup live.cfg for casper
+Author: Reinhard Tartler <siretart@tauware.de>
+Last-Update: 2012-08-20
+
+live.cfg from the themes package include a 'boot=live' parameter, which works only
+for live-config. casper OTOH requires 'boot=casper'
+
+Index: b/scripts/build/lb_binary_syslinux
+===================================================================
+--- a/scripts/build/lb_binary_syslinux
++++ b/scripts/build/lb_binary_syslinux
+@@ -254,6 +254,13 @@
+ 	sed -i  -e "s|@LB_BOOTAPPEND_LIVE@|${LB_BOOTAPPEND_LIVE}|g" \
+ 		-e "s|@LB_BOOTAPPEND_FAILSAFE@|${LB_BOOTAPPEND_FAILSAFE}|g" \
+ 	${_TARGET}/live.cfg
++
++	case "${LB_INITRAMFS}" in
++		casper)
++			sed -i -e "s|boot=live|boot=casper|" \
++			    ${_SUFFIX}/live.cfg
++			;;
++	esac
+ fi
+ 
+ if [ -e ${_TARGET}/install.cfg ]
diff -pruN 3.0~a57-1/debian/patches/ubuntu-chroot-fs-opts.patch 3.0~a57-1ubuntu43/debian/patches/ubuntu-chroot-fs-opts.patch
--- 3.0~a57-1/debian/patches/ubuntu-chroot-fs-opts.patch	1970-01-01 00:00:00.000000000 +0000
+++ 3.0~a57-1ubuntu43/debian/patches/ubuntu-chroot-fs-opts.patch	2015-05-11 15:34:47.000000000 +0000
@@ -0,0 +1,99 @@
+Description: Add options to tune the EXT FS produced in lb_binary_rootfs
+ Adds --ext-block-size, --ext-resize-blocks and --ext-fudge-factor to
+ enable building filesystem images with 4K blocks that can be
+ online-resized to a configurable length.
+Author: Daniel Watkins <daniel.watkins@canonical.com>
+
+--- a/scripts/build/lb_binary_rootfs
++++ b/scripts/build/lb_binary_rootfs
+@@ -129,7 +129,7 @@
+ 					FAKE_MTAB="true"
+ 				fi
+ 
+-				Chroot chroot "mkfs.${LB_CHROOT_FILESYSTEM} -F -b 1024 -i 8192 -m 0 -L ${LB_HDD_LABEL} filesystem.${LB_CHROOT_FILESYSTEM}"
++				Chroot chroot "mkfs.${LB_CHROOT_FILESYSTEM} -F -b ${LB_EXT_BLOCKSIZE:-1024} -i 8192 -m 0 -L ${LB_HDD_LABEL} ${LB_EXT_RESIZEBLOCKS:+-E resize=${LB_EXT_RESIZEBLOCKS}} filesystem.${LB_CHROOT_FILESYSTEM}"
+ 
+ 				mkdir -p filesystem.tmp
+ 				${LB_ROOT_COMMAND} mount -o loop chroot/filesystem.${LB_CHROOT_FILESYSTEM} filesystem.tmp
+@@ -199,7 +199,7 @@
+ 
+ 			false)
+ 				dd if=/dev/zero of=binary/${INITFS}/filesystem.${LB_CHROOT_FILESYSTEM} bs=1024k count=0 seek=${REAL_DIM}
+-				mkfs.${LB_CHROOT_FILESYSTEM} -F -b 1024 -i 8192 -m 0 -L ${LB_HDD_LABEL} binary/${INITFS}/filesystem.${LB_CHROOT_FILESYSTEM}
++				mkfs.${LB_CHROOT_FILESYSTEM} -F -b ${LB_EXT_BLOCKSIZE:-1024} -i 8192 -m 0 -L ${LB_HDD_LABEL} ${LB_EXT_RESIZEBLOCKS:+-E resize=${LB_EXT_RESIZEBLOCKS}} binary/${INITFS}/filesystem.${LB_CHROOT_FILESYSTEM}
+ 
+ 				mkdir -p filesystem.tmp
+ 				${LB_ROOT_COMMAND} mount -o loop binary/${INITFS}/filesystem.${LB_CHROOT_FILESYSTEM} filesystem.tmp
+--- a/scripts/build/lb_config
++++ b/scripts/build/lb_config
+@@ -57,6 +57,9 @@
+ \t    [--debian-installer-gui true|false]\n\
+ \t    [--debug]\n\
+ \t    [-d|--distribution CODENAME]\n\
++\t    [--ext-block-size 1024|2048|4096]\n\
++\t    [--ext-resize-blocks N]\n\
++\t    [--ext-fudge-factor PERCENTAGE]\n\
+ \t    [--parent-distribution CODENAME]\n\
+ \t    [--parent-debian-installer-distribution CODENAME]\n\
+ \t    [--dump]\n\
+@@ -157,7 +160,7 @@
+ 		apt-indices:,bootappend-install:,bootappend-live:,bootappend-failsafe:,bootloader:,checksums:,compression:,config:,zsync:,build-with-chroot:,
+ 		debian-installer:,debian-installer-distribution:,debian-installer-preseedfile:,debian-installer-gui:,
+ 		grub-splash:,isohybrid-options:,hdd-label:,hdd-size:,iso-application:,iso-preparer:,iso-publisher:,
+-		iso-volume:,jffs2-eraseblock:,memtest:,net-root-filesystem:,net-root-mountoptions:,
++		iso-volume:,jffs2-eraseblock:,ext-block-size:,ext-resize-blocks:,ext-fudge-factor:,memtest:,net-root-filesystem:,net-root-mountoptions:,
+ 		net-root-path:,net-root-server:,net-cow-filesystem:,net-cow-mountoptions:,net-cow-path:,
+ 		net-cow-server:,net-tarball:,firmware-binary:,firmware-chroot:,swap-file-path:,swap-file-size:,syslinux-theme:,
+ 		win32-loader:,source:,source-images:,breakpoints,conffile:,debug,force,
+@@ -683,6 +686,21 @@
+ 				shift 2
+ 				;;
+ 
++			--ext-block-size)
++				LB_EXT_BLOCKSIZE="${2}"
++				shift 2
++				;;
++
++			--ext-resize-blocks)
++				LB_EXT_RESIZEBLOCKS="${2}"
++				shift 2
++				;;
++
++			--ext-fudge-factor)
++				LB_EXT_FUDGEFACTOR="${2}"
++				shift 2
++				;;
++
+ 			--jffs2-eraseblock)
+ 				LB_JFFS2_ERASEBLOCK="${2}"
+ 				shift 2
+@@ -1392,6 +1410,18 @@
+ # (Default: ${LB_ISO_VOLUME})
+ LB_ISO_VOLUME="${LB_ISO_VOLUME}"
+ 
++# \$LB_EXT_BLOCKSIZE: set EXT block size
++# (Default: unset)
++LB_EXT_BLOCKSIZE="${LB_EXT_BLOCKSIZE}"
++
++# \$LB_EXT_RESIZEBLOCKS: set EXT resize parameter
++# (Default: unset)
++LB_EXT_RESIZEBLOCKS="${LB_EXT_RESIZEBLOCKS}"
++
++# \$LB_EXT_FUDGEFACTOR: set extra size of EXT images (in %)
++# (Default: unset)
++LB_EXT_FUDGEFACTOR="${LB_EXT_FUDGEFACTOR}"
++
+ # \$LB_JFFS2_ERASEBLOCK: set jffs2 eraseblock size
+ # (Default: unset)
+ LB_JFFS2_ERASEBLOCK=""
+--- a/functions/losetup.sh
++++ b/functions/losetup.sh
+@@ -68,7 +68,7 @@
+ 
+ 	case "${FILESYSTEM}" in
+ 		ext2|ext3|ext4)
+-			PERCENT="5"
++			PERCENT="${LB_EXT_FUDGEFACTOR:-5}"
+ 			;;
+ 		*)
+ 			PERCENT="3"
diff -pruN 3.0~a57-1/debian/patches/ubuntu-chroot_headers_tidy.patch 3.0~a57-1ubuntu43/debian/patches/ubuntu-chroot_headers_tidy.patch
--- 3.0~a57-1/debian/patches/ubuntu-chroot_headers_tidy.patch	1970-01-01 00:00:00.000000000 +0000
+++ 3.0~a57-1ubuntu43/debian/patches/ubuntu-chroot_headers_tidy.patch	2016-02-17 23:23:41.000000000 +0000
@@ -0,0 +1,37 @@
+Description: Tidy up linux-headers installation and duplication
+ ubuntu-chroot_headers_tidy.patch: Mark all the linux-headers-$(ABI)
+ packages as autoinstalled, and then autoremove cruft (LP: #1029556)
+Author: Adam Conrad <adconrad@ubuntu.com>
+Bug-Ubuntu: https://bugs.launchpad.net/bugs/1029556
+Forwarded: no
+Last-Update: 2012-08-20
+
+Index: b/scripts/build/lb_chroot
+===================================================================
+--- a/scripts/build/lb_chroot
++++ b/scripts/build/lb_chroot
+@@ -62,6 +62,12 @@
+ 
+ 	if [ "${_PASS}" = install ]
+ 	then
++		Chroot chroot "dpkg -l linux-headers-3* linux-headers-4*" 2>/dev/null \
++			| awk '/^i/ {print $2}' > chroot.headers
++		for i in $(cat chroot.headers); do
++			Chroot chroot "apt-mark auto $i"
++		done
++		Chroot chroot "apt-get --purge -y autoremove"
+ 		Chroot chroot "dpkg-query -W" > chroot.packages.install
+ 	fi
+ done
+Index: b/scripts/build/lb_clean
+===================================================================
+--- a/scripts/build/lb_clean
++++ b/scripts/build/lb_clean
+@@ -88,6 +88,7 @@
+ 			${LB_ROOT_COMMAND} rm -rf chroot chroot.tmp
+ 
+ 			rm -f chroot.packages.live chroot.packages.install
++			rm -f chroot.headers
+ 
+ 			rm -f .build/chroot*
+ 			;;
diff -pruN 3.0~a57-1/debian/patches/ubuntu-debootstrap-variants.patch 3.0~a57-1ubuntu43/debian/patches/ubuntu-debootstrap-variants.patch
--- 3.0~a57-1/debian/patches/ubuntu-debootstrap-variants.patch	1970-01-01 00:00:00.000000000 +0000
+++ 3.0~a57-1ubuntu43/debian/patches/ubuntu-debootstrap-variants.patch	2012-08-23 09:09:41.000000000 +0000
@@ -0,0 +1,29 @@
+Description: Fix handling of --bootstrap-flavour with debootstrap
+Author: Colin Watson <cjwatson@ubuntu.com>
+Bug-Debian: http://bugs.debian.org/685675
+Last-Update: 2012-08-23
+
+Index: b/scripts/build/lb_bootstrap_debootstrap
+===================================================================
+--- a/scripts/build/lb_bootstrap_debootstrap
++++ b/scripts/build/lb_bootstrap_debootstrap
+@@ -84,7 +84,18 @@
+ 	false)
+ 		if [ -n "${LB_BOOTSTRAP_FLAVOUR}" ]
+ 		then
+-			DEBOOTSTRAP_OPTIONS="${DEBOOTSTRAP_OPTIONS} --variant=${LB_BOOTSTRAP_FLAVOUR}"
++			case "${LB_BOOTSTRAP_FLAVOUR}" in
++				minimal)
++					DEBOOTSTRAP_OPTIONS="${DEBOOTSTRAP_OPTIONS} --variant=minbase"
++					;;
++
++				standard)
++					;;
++
++				*)
++					DEBOOTSTRAP_OPTIONS="${DEBOOTSTRAP_OPTIONS} --variant=${LB_BOOTSTRAP_FLAVOUR}"
++					;;
++			esac
+ 		fi
+ 		;;
+ esac
diff -pruN 3.0~a57-1/debian/patches/ubuntu-ext-inodes.patch 3.0~a57-1ubuntu43/debian/patches/ubuntu-ext-inodes.patch
--- 3.0~a57-1/debian/patches/ubuntu-ext-inodes.patch	1970-01-01 00:00:00.000000000 +0000
+++ 3.0~a57-1ubuntu43/debian/patches/ubuntu-ext-inodes.patch	2012-08-20 16:09:09.000000000 +0000
@@ -0,0 +1,33 @@
+Description: Upstream changes introduced in version 3.0~a24-1ubuntu13
+ .
+   * Mimic livecd-rootfs's handling of inodes on ext* filesystems to
+     reduce the pain of resizing preinstalled images. (LP: #836810)
+ .
+   * This patch is a dirty hack, and needs some TLC and generalisation
+     before it's reasonably upstreamable.
+Author: Adam Conrad <adconrad@ubuntu.com>
+Bug-Ubuntu: https://bugs.launchpad.net/bugs/836810
+Last-Update: 2012-08-20
+
+Index: b/scripts/build/lb_binary_rootfs
+===================================================================
+--- a/scripts/build/lb_binary_rootfs
++++ b/scripts/build/lb_binary_rootfs
+@@ -129,7 +129,7 @@
+ 					FAKE_MTAB="true"
+ 				fi
+ 
+-				Chroot chroot "mkfs.${LB_CHROOT_FILESYSTEM} -F -b 1024 -N ${REAL_INODES} -m 0 filesystem.${LB_CHROOT_FILESYSTEM}"
++				Chroot chroot "mkfs.${LB_CHROOT_FILESYSTEM} -F -b 1024 -i 8192 -m 0 filesystem.${LB_CHROOT_FILESYSTEM}"
+ 
+ 				mkdir -p filesystem.tmp
+ 				${LB_ROOT_COMMAND} mount -o loop chroot/filesystem.${LB_CHROOT_FILESYSTEM} filesystem.tmp
+@@ -199,7 +199,7 @@
+ 
+ 			false)
+ 				dd if=/dev/zero of=binary/${INITFS}/filesystem.${LB_CHROOT_FILESYSTEM} bs=1024k count=0 seek=${REAL_DIM}
+-				mkfs.${LB_CHROOT_FILESYSTEM} -F -b 1024 -N ${REAL_INODES} -m 0 binary/${INITFS}/filesystem.${LB_CHROOT_FILESYSTEM}
++				mkfs.${LB_CHROOT_FILESYSTEM} -F -b 1024 -i 8192 -m 0 binary/${INITFS}/filesystem.${LB_CHROOT_FILESYSTEM}
+ 
+ 				mkdir -p filesystem.tmp
+ 				${LB_ROOT_COMMAND} mount -o loop binary/${INITFS}/filesystem.${LB_CHROOT_FILESYSTEM} filesystem.tmp
diff -pruN 3.0~a57-1/debian/patches/ubuntu-fix-binary-hooks.patch 3.0~a57-1ubuntu43/debian/patches/ubuntu-fix-binary-hooks.patch
--- 3.0~a57-1/debian/patches/ubuntu-fix-binary-hooks.patch	1970-01-01 00:00:00.000000000 +0000
+++ 3.0~a57-1ubuntu43/debian/patches/ubuntu-fix-binary-hooks.patch	2012-08-24 07:42:29.000000000 +0000
@@ -0,0 +1,17 @@
+Description: Fix execution of binary hooks
+Author: Colin Watson <cjwatson@ubuntu.com>
+Last-Update: 2012-08-24
+
+Index: b/scripts/build/lb_binary_hooks
+===================================================================
+--- a/scripts/build/lb_binary_hooks
++++ b/scripts/build/lb_binary_hooks
+@@ -50,7 +50,7 @@
+ 			if [ -e "${FILE}" ]
+ 			then
+ 				cd binary
+-				./"${FILE}" || { Echo_error "${_HOOK} failed (exit non-zero). You should check for errors."; exit 1 ;}
++				"${FILE}" || { Echo_error "${_HOOK} failed (exit non-zero). You should check for errors."; exit 1 ;}
+ 				cd "${OLDPWD}"
+ 			fi
+ 		done
diff -pruN 3.0~a57-1/debian/patches/ubuntu-fix-hooks.patch 3.0~a57-1ubuntu43/debian/patches/ubuntu-fix-hooks.patch
--- 3.0~a57-1/debian/patches/ubuntu-fix-hooks.patch	1970-01-01 00:00:00.000000000 +0000
+++ 3.0~a57-1ubuntu43/debian/patches/ubuntu-fix-hooks.patch	2012-08-22 10:50:43.000000000 +0000
@@ -0,0 +1,58 @@
+Description: Fix hook execution
+Author: Colin Watson <cjwatson@ubuntu.com>
+Bug-Debian: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=685534
+Last-Update: 2012-08-21
+
+Index: b/scripts/build/lb_chroot_hooks
+===================================================================
+--- a/scripts/build/lb_chroot_hooks
++++ b/scripts/build/lb_chroot_hooks
+@@ -54,12 +54,14 @@
+ do
+ 	for LOCATION in "${LIVE_BUILD}/hooks" /usr/share/live/build/hooks
+ 	do
+-		if [ -e "${LOCATION}/hooks/???-${_HOOK}.binary" ]
+-		then
+-			mkdir -p chroot/root/lb_chroot_hooks
+-			cp "${LOCATION}"/hooks/???-"${_HOOK}".chroot chroot/root/lb_chroot_hooks
+-			continue
+-		fi
++		for FILE in "${LOCATION}"/???-"${_HOOK}".chroot
++		do
++			if [ -e "${FILE}" ]
++			then
++				mkdir -p chroot/root/lb_chroot_hooks
++				cp "${FILE}" chroot/root/lb_chroot_hooks
++			fi
++		done
+ 	done
+ done
+ 
+Index: b/scripts/build/lb_binary_hooks
+===================================================================
+--- a/scripts/build/lb_binary_hooks
++++ b/scripts/build/lb_binary_hooks
+@@ -43,17 +43,18 @@
+ # Running hooks
+ for _HOOK in ${LB_BINARY_HOOKS}
+ do
+-		for LOCATION in "${LIVE_BUILD}/hooks" /usr/share/live/build/hooks
++	for LOCATION in "${LIVE_BUILD}/hooks" /usr/share/live/build/hooks
++	do
++		for FILE in "${LOCATION}"/???-"${_HOOK}".binary
+ 		do
+-			if [ -e "${LOCATION}/hooks/???-${_HOOK}.binary" ]
++			if [ -e "${FILE}" ]
+ 			then
+ 				cd binary
+-				./"${LOCATION}/hooks/???-${_HOOK}.binary" || { Echo_error "${_HOOK} failed (exit non-zero). You should check for errors."; exit 1 ;}
++				./"${FILE}" || { Echo_error "${_HOOK} failed (exit non-zero). You should check for errors."; exit 1 ;}
+ 				cd "${OLDPWD}"
+-
+-				continue
+ 			fi
+ 		done
++	done
+ done
+ 
+ ## Processing local hooks
diff -pruN 3.0~a57-1/debian/patches/ubuntu-i386-generic-pae.patch 3.0~a57-1ubuntu43/debian/patches/ubuntu-i386-generic-pae.patch
--- 3.0~a57-1/debian/patches/ubuntu-i386-generic-pae.patch	1970-01-01 00:00:00.000000000 +0000
+++ 3.0~a57-1ubuntu43/debian/patches/ubuntu-i386-generic-pae.patch	2012-08-20 16:44:38.000000000 +0000
@@ -0,0 +1,46 @@
+Description: Use i386 -generic-pae kernel flavour on Ubuntu precise
+Author: Colin Watson <cjwatson@ubuntu.com>
+Bug-Ubuntu: https://bugs.launchpad.net/bugs/897786
+Forwarded: no
+Last-Update: 2012-08-20
+
+Index: b/functions/defaults.sh
+===================================================================
+--- a/functions/defaults.sh
++++ b/functions/defaults.sh
+@@ -748,7 +748,14 @@
+ 					;;
+ 
+ 				ubuntu|kubuntu)
+-					LB_LINUX_FLAVOURS="${LB_LINUX_FLAVOURS:-generic}"
++					case "${LB_DISTRIBUTION}" in
++						precise)
++							LB_LINUX_FLAVOURS="${LB_LINUX_FLAVOURS:-generic-pae}"
++							;;
++						*)
++							LB_LINUX_FLAVOURS="${LB_LINUX_FLAVOURS:-generic}"
++							;;
++					esac
+ 					;;
+ 
+ 				*)
+Index: b/scripts/build/lb_binary_debian-installer
+===================================================================
+--- a/scripts/build/lb_binary_debian-installer
++++ b/scripts/build/lb_binary_debian-installer
+@@ -362,7 +362,14 @@
+ 
+ 			case "${LB_MODE}" in
+ 				ubuntu|kubuntu)
+-					DI_PACKAGES="${DI_REQ_PACKAGES} linux-generic"
++					case "${LB_DISTRIBUTION}" in
++						precise)
++							DI_PACKAGES="${DI_REQ_PACKAGES} linux-generic-pae"
++							;;
++						*)
++							DI_PACKAGES="${DI_REQ_PACKAGES} linux-generic"
++							;;
++					esac
+ 					;;
+ 
+ 				*)
diff -pruN 3.0~a57-1/debian/patches/ubuntu-initramfs-compression-symlinks.patch 3.0~a57-1ubuntu43/debian/patches/ubuntu-initramfs-compression-symlinks.patch
--- 3.0~a57-1/debian/patches/ubuntu-initramfs-compression-symlinks.patch	1970-01-01 00:00:00.000000000 +0000
+++ 3.0~a57-1ubuntu43/debian/patches/ubuntu-initramfs-compression-symlinks.patch	2016-06-28 12:39:59.000000000 +0000
@@ -0,0 +1,28 @@
+Description: Avoid recompressing initrd.img symlinks
+Author: Colin Watson <cjwatson@ubuntu.com>
+Forwarded: no
+Bug-Ubuntu: https://bugs.launchpad.net/bugs/1539157
+Last-Update: 2016-06-28
+
+Index: b/scripts/build/lb_chroot_hacks
+===================================================================
+--- a/scripts/build/lb_chroot_hacks
++++ b/scripts/build/lb_chroot_hacks
+@@ -195,7 +195,7 @@
+ 		;;
+ 
+ 	bzip2)
+-		for INITRAMFS in $(find chroot/boot -name 'initrd*'); do
++		for INITRAMFS in $(find chroot/boot -name 'initrd*' -not -type l); do
+ 			zcat "${INITRAMFS}" | bzip2 -c ${BZIP2_OPTIONS} > "${INITRAMFS}.new"
+ 			mv "${INITRAMFS}.new" "${INITRAMFS}"
+ 		done
+@@ -205,7 +205,7 @@
+ 		# We probably ought to use COMPRESS= in a temporary file in
+ 		# /etc/initramfs-tools/conf.d/ instead, but it's hard to
+ 		# pass options that way.
+-		for INITRAMFS in $(find chroot/boot -name 'initrd*'); do
++		for INITRAMFS in $(find chroot/boot -name 'initrd*' -not -type l); do
+ 			zcat "${INITRAMFS}" | lzma -c ${LZMA_OPTIONS} > "${INITRAMFS}.new"
+ 			mv "${INITRAMFS}.new" "${INITRAMFS}"
+ 		done
diff -pruN 3.0~a57-1/debian/patches/ubuntu-initramfs-handling.patch 3.0~a57-1ubuntu43/debian/patches/ubuntu-initramfs-handling.patch
--- 3.0~a57-1/debian/patches/ubuntu-initramfs-handling.patch	1970-01-01 00:00:00.000000000 +0000
+++ 3.0~a57-1ubuntu43/debian/patches/ubuntu-initramfs-handling.patch	2018-06-26 23:07:39.000000000 +0000
@@ -0,0 +1,79 @@
+Description: Use initramfs-tools to work with initrds instead of being silly.
+Author: Adam Conrad <adconrad@ubuntu.com>
+Bug-Ubuntu: https://bugs.launchpad.net/bugs/1778811
+Last-Update: 2018-06-26
+
+--- live-build-3.0~a57.orig/scripts/build/lb_binary_disk
++++ live-build-3.0~a57/scripts/build/lb_binary_disk
+@@ -97,24 +97,14 @@ case "${LB_INITRAMFS}" in
+ 		do
+ 			mkdir -p binary/uuid
+ 			cd binary/uuid
+-
+-			case "${LB_INITRAMFS_COMPRESSION}" in
+-				gzip)
+-					zcat "../../${INITRD}" | cpio --quiet -id conf/uuid.conf
+-					;;
+-
+-				bzip2)
+-					bzcat "../../${INITRD}" | cpio --quiet -id conf/uuid.conf
+-					;;
+-
+-				lzma)
+-					lzcat -S "" "../../${INITRD}" | cpio --quiet -id conf/uuid.conf
+-					;;
+-			esac
+-
++			unmkinitramfs "../../${INITRD}" .
+ 			if [ -e conf/uuid.conf ]
+ 			then
+ 				mv conf/uuid.conf "../.disk/casper-uuid${INITRD#binary/casper/initrd.img}"
++			# Multipart gets extracted as early/main:
++			elif [ -e main/conf/uuid.conf ]
++			then
++				mv main/conf/uuid.conf "../.disk/casper-uuid${INITRD#binary/casper/initrd.img}"
+ 			else
+ 				Echo_warning "Failed to find casper uuid.conf in '${INITRD}'"
+ 			fi
+--- live-build-3.0~a57.orig/scripts/build/lb_chroot_hacks
++++ live-build-3.0~a57/scripts/build/lb_chroot_hacks
+@@ -184,34 +184,14 @@ esac
+ 
+ if [ "${LB_INITRAMFS}" != "none" ]
+ then
++	if [ -n "${LB_INITRAMFS_COMPRESSION}" ]; then
++		echo "COMPRESS=${LB_INITRAMFS_COMPRESSION}" \
++			> chroot/etc/initramfs-tools/conf.d/live-build.conf
++	fi
+ 	Chroot chroot "${UPDATE_INITRAMFS_OPTIONS} update-initramfs -k all -t -u"
++	rm -f chroot//etc/initramfs-tools/conf.d/live-build.conf
+ fi
+ 
+-# We probably ought to use COMPRESS= in a temporary file in
+-# /etc/initramfs-tools/conf.d/ instead, but it's hard to pass options that
+-# way.
+-case "${LB_INITRAMFS_COMPRESSION}" in
+-	gzip)
+-		;;
+-
+-	bzip2)
+-		for INITRAMFS in $(find chroot/boot -name 'initrd*' -not -type l); do
+-			zcat "${INITRAMFS}" | bzip2 -c ${BZIP2_OPTIONS} > "${INITRAMFS}.new"
+-			mv "${INITRAMFS}.new" "${INITRAMFS}"
+-		done
+-		;;
+-
+-	lzma)
+-		# We probably ought to use COMPRESS= in a temporary file in
+-		# /etc/initramfs-tools/conf.d/ instead, but it's hard to
+-		# pass options that way.
+-		for INITRAMFS in $(find chroot/boot -name 'initrd*' -not -type l); do
+-			zcat "${INITRAMFS}" | lzma -c ${LZMA_OPTIONS} > "${INITRAMFS}.new"
+-			mv "${INITRAMFS}.new" "${INITRAMFS}"
+-		done
+-		;;
+-esac
+-
+ # Ensure readable permissions on initramfs. loop-aes-utils sets umask to
+ # protect GPG keys, which live-build does not support.
+ # Note: Use find rather than chmod on the wildcard, one never knows what
diff -pruN 3.0~a57-1/debian/patches/ubuntu-kernel-img-conf.patch 3.0~a57-1ubuntu43/debian/patches/ubuntu-kernel-img-conf.patch
--- 3.0~a57-1/debian/patches/ubuntu-kernel-img-conf.patch	1970-01-01 00:00:00.000000000 +0000
+++ 3.0~a57-1ubuntu43/debian/patches/ubuntu-kernel-img-conf.patch	2012-08-20 16:15:10.000000000 +0000
@@ -0,0 +1,36 @@
+Description: Put kernel symlinks in /boot on some architectures
+ This matches base-installer/library.sh more closely.
+Author: Colin Watson <cjwatson@ubuntu.com>
+Bug-Ubuntu: https://bugs.launchpad.net/bugs/958839
+Forwarded: no
+Last-Update: 2012-04-18
+
+Index: b/scripts/build/lb_chroot_linux-image
+===================================================================
+--- a/scripts/build/lb_chroot_linux-image
++++ b/scripts/build/lb_chroot_linux-image
+@@ -118,6 +118,24 @@
+ 
+ 	fi
+ 
++	cat > chroot/etc/kernel-img.conf << EOF
++# Kernel Image management overrides
++# See kernel-img.conf(5) for details
++do_symlinks = yes
++do_bootloader = no
++EOF
++
++	case "${LB_ARCHITECTURES}" in
++		alpha|amd64|hppa|i386|ia64|m68k|mips|mipsel)
++			;;
++
++		*)
++			cat >> chroot/etc/kernel-img.conf << EOF
++link_in_boot = yes
++EOF
++			;;
++	esac
++
+ 	# Creating stage file
+ 	Create_stagefile .build/chroot_linux-image
+ fi
diff -pruN 3.0~a57-1/debian/patches/ubuntu-label-disks.patch 3.0~a57-1ubuntu43/debian/patches/ubuntu-label-disks.patch
--- 3.0~a57-1/debian/patches/ubuntu-label-disks.patch	1970-01-01 00:00:00.000000000 +0000
+++ 3.0~a57-1ubuntu43/debian/patches/ubuntu-label-disks.patch	2015-05-11 15:34:47.000000000 +0000
@@ -0,0 +1,23 @@
+Description: Apply LB_HDD_LABEL to disks produced in lb_binary_rootfs.
+Author: Daniel Watkins <daniel.watkins@canonical.com>
+
+--- live-build-3.0~a57.orig/scripts/build/lb_binary_rootfs
++++ live-build-3.0~a57/scripts/build/lb_binary_rootfs
+@@ -129,7 +129,7 @@ case "${LB_CHROOT_FILESYSTEM}" in
+ 					FAKE_MTAB="true"
+ 				fi
+ 
+-				Chroot chroot "mkfs.${LB_CHROOT_FILESYSTEM} -F -b 1024 -i 8192 -m 0 filesystem.${LB_CHROOT_FILESYSTEM}"
++				Chroot chroot "mkfs.${LB_CHROOT_FILESYSTEM} -F -b 1024 -i 8192 -m 0 -L ${LB_HDD_LABEL} filesystem.${LB_CHROOT_FILESYSTEM}"
+ 
+ 				mkdir -p filesystem.tmp
+ 				${LB_ROOT_COMMAND} mount -o loop chroot/filesystem.${LB_CHROOT_FILESYSTEM} filesystem.tmp
+@@ -199,7 +199,7 @@ case "${LB_CHROOT_FILESYSTEM}" in
+ 
+ 			false)
+ 				dd if=/dev/zero of=binary/${INITFS}/filesystem.${LB_CHROOT_FILESYSTEM} bs=1024k count=0 seek=${REAL_DIM}
+-				mkfs.${LB_CHROOT_FILESYSTEM} -F -b 1024 -i 8192 -m 0 binary/${INITFS}/filesystem.${LB_CHROOT_FILESYSTEM}
++				mkfs.${LB_CHROOT_FILESYSTEM} -F -b 1024 -i 8192 -m 0 -L ${LB_HDD_LABEL} binary/${INITFS}/filesystem.${LB_CHROOT_FILESYSTEM}
+ 
+ 				mkdir -p filesystem.tmp
+ 				${LB_ROOT_COMMAND} mount -o loop binary/${INITFS}/filesystem.${LB_CHROOT_FILESYSTEM} filesystem.tmp
diff -pruN 3.0~a57-1/debian/patches/ubuntu-make-genisoimage-more-flexible.patch 3.0~a57-1ubuntu43/debian/patches/ubuntu-make-genisoimage-more-flexible.patch
--- 3.0~a57-1/debian/patches/ubuntu-make-genisoimage-more-flexible.patch	1970-01-01 00:00:00.000000000 +0000
+++ 3.0~a57-1ubuntu43/debian/patches/ubuntu-make-genisoimage-more-flexible.patch	2020-05-18 14:49:31.000000000 +0000
@@ -0,0 +1,30 @@
+## Description: Make genisoimage more flexible.
+##   For currently version of live build, the image has been built without the support of uefi boot,
+##   so I will like to upstream a patch which using by OEM team which extended an extra option for mkisoimage.
+## Origin/Author: Hugh Chao (hugh.chao@canonical.com)
+## Bug: https://bugs.launchpad.net/oem-priority/+bug/1864426
+Index: live-build-3.0~a57/scripts/build/lb_binary_iso
+===================================================================
+--- live-build-3.0~a57.orig/scripts/build/lb_binary_iso
++++ live-build-3.0~a57/scripts/build/lb_binary_iso
+@@ -193,7 +193,7 @@ fi
+ 
+ cat >> binary.sh << EOF
+ 
+-genisoimage ${GENISOIMAGE_OPTIONS} -o ${IMAGE} binary
++genisoimage ${GENISOIMAGE_OPTIONS} ${GENISOIMAGE_OPTIONS_EXTRA} -o ${IMAGE} binary
+ EOF
+ 
+ if [ "${LB_BINARY_IMAGES}" = "iso-hybrid" ]
+Index: live-build-3.0~a57/scripts/build/lb_config
+===================================================================
+--- live-build-3.0~a57.orig/scripts/build/lb_config
++++ live-build-3.0~a57/scripts/build/lb_config
+@@ -1107,6 +1107,7 @@ APT_OPTIONS="${APT_OPTIONS}"
+ APTITUDE_OPTIONS="${APTITUDE_OPTIONS}"
+ GZIP_OPTIONS="${GZIP_OPTIONS}"
+ ISOHYBRID_OPTIONS="${ISOHYBRID_OPTIONS}"
++GENISOIMAGE_OPTIONS_EXTRA="${GENISOIMAGE_OPTIONS_EXTRA}"
+ EOF
+ 
+ # Creating lb_bootstrap_* configuration
diff -pruN 3.0~a57-1/debian/patches/ubuntu-no-adjtime.patch 3.0~a57-1ubuntu43/debian/patches/ubuntu-no-adjtime.patch
--- 3.0~a57-1/debian/patches/ubuntu-no-adjtime.patch	1970-01-01 00:00:00.000000000 +0000
+++ 3.0~a57-1ubuntu43/debian/patches/ubuntu-no-adjtime.patch	2013-09-27 18:21:11.000000000 +0000
@@ -0,0 +1,35 @@
+Description: Drop etc/adjtime from scripts/build/lb_chroot_hacks.
+ /etc/adjtime is not  needed and should not be used in Ubuntu.
+Author: Steve Langasek <steve.langasek@ubuntu.com>
+Forwarded: no
+Last-Update: 2013-09-27
+
+--- live-build-3.0~a57.orig/scripts/build/lb_chroot_hacks
++++ live-build-3.0~a57/scripts/build/lb_chroot_hacks
+@@ -218,9 +218,6 @@ esac
+ # people might do in local hooks, and there might be no initrds at all.
+ find chroot/boot -name 'initrd*' -print0 | xargs -r -0 chmod go+r
+ 
+-# Remove build systems clock drift
+-echo "0.0 0 0.0" > chroot/etc/adjtime
+-
+ # Remove cruft
+ rm -f chroot/boot/initrd*bak*
+ rm -f chroot/etc/apt/trusted.gpg~
+@@ -229,6 +226,7 @@ rm -f chroot/etc/gshadow- chroot/etc/sha
+ rm -f chroot/var/cache/debconf/*-old
+ rm -f chroot/var/lib/dpkg/*-old
+ rm -f chroot/var/log/apt/term.log
++rm -f chroot/etc/adjtime
+ 
+ # Delete and re-create temporary directories
+ TEMP_DIRS="/tmp /var/tmp"
+@@ -277,7 +275,7 @@ then
+ 	done
+ 
+ 	# Config files which need to be RW
+-	COW_FILES="/etc/adjtime /etc/fstab /etc/hostname /etc/hosts /etc/live.conf /etc/network/interfaces /etc/resolv.conf /etc/udev/rules.d/*persistent-net.rules /etc/udev/rules.d/*persistent-cd.rules /etc/X11/xorg.conf"
++	COW_FILES="/etc/fstab /etc/hostname /etc/hosts /etc/live.conf /etc/network/interfaces /etc/resolv.conf /etc/udev/rules.d/*persistent-net.rules /etc/udev/rules.d/*persistent-cd.rules /etc/X11/xorg.conf"
+ 
+ 	# Where we will store RW config files
+ 	RW_DIRECTORY="/var/lib/live"
diff -pruN 3.0~a57-1/debian/patches/ubuntu-no-bzip2-bootstrap.patch 3.0~a57-1ubuntu43/debian/patches/ubuntu-no-bzip2-bootstrap.patch
--- 3.0~a57-1/debian/patches/ubuntu-no-bzip2-bootstrap.patch	1970-01-01 00:00:00.000000000 +0000
+++ 3.0~a57-1ubuntu43/debian/patches/ubuntu-no-bzip2-bootstrap.patch	2020-10-08 17:09:20.000000000 +0000
@@ -0,0 +1,18 @@
+Description: Don't special-case bzip2 in bootstrap.
+ Fixed upstream in live-build 3.0~a67-1 (in 2012).
+Author: Steve Langasek <steve.langasek@ubuntu.com>
+Forwarded: not-needed
+Last-Update: 2020-10-08
+
+--- live-build-3.0~a57.orig/scripts/build/lb_bootstrap_debootstrap
++++ live-build-3.0~a57/scripts/build/lb_bootstrap_debootstrap
+@@ -52,9 +52,6 @@ Create_lockfile .lock
+ # Creating chroot directory
+ mkdir -p chroot
+ 
+-# Temporarily including bzip2 manually until #657560 has been fixed in unstable
+-DEBOOTSTRAP_OPTIONS="${DEBOOTSTRAP_OPTIONS} --include=bzip2"
+-
+ # Setting debootstrap options
+ if [ -n "${LB_ARCHITECTURES}" ]
+ then
diff -pruN 3.0~a57-1/debian/patches/ubuntu-no-gnupg-hardcode.patch 3.0~a57-1ubuntu43/debian/patches/ubuntu-no-gnupg-hardcode.patch
--- 3.0~a57-1/debian/patches/ubuntu-no-gnupg-hardcode.patch	1970-01-01 00:00:00.000000000 +0000
+++ 3.0~a57-1ubuntu43/debian/patches/ubuntu-no-gnupg-hardcode.patch	2018-03-02 17:11:17.000000000 +0000
@@ -0,0 +1,24 @@
+Description: Don't force inclusion of gnupg in debootstrap
+ gnupg is now a metapackage depending on large numbers of extraneous
+ libraries.  It should not be pulled into the base system; we should only
+ be pulling in the gpgv package instead.
+Author: Steve Langasek <steve.langasek@ubuntu.com>
+Last-Update: 2018-03-02
+
+--- live-build-3.0~a57.orig/functions/defaults.sh
++++ live-build-3.0~a57/functions/defaults.sh
+@@ -377,14 +377,6 @@ Set_defaults ()
+ 		fi
+ 	fi
+ 
+-	# Include packages on base
+-	case "${LB_MODE}" in
+-		ubuntu|kubuntu)
+-			LB_BOOTSTRAP_INCLUDE="${LB_BOOTSTRAP_INCLUDE:-gnupg}"
+-			;;
+-
+-	esac
+-
+ 	# Exclude packages on base
+ 	# LB_BOOTSTRAP_EXCLUDE
+ 
diff -pruN 3.0~a57-1/debian/patches/ubuntu-no-sysvinit-fixups.patch 3.0~a57-1ubuntu43/debian/patches/ubuntu-no-sysvinit-fixups.patch
--- 3.0~a57-1/debian/patches/ubuntu-no-sysvinit-fixups.patch	1970-01-01 00:00:00.000000000 +0000
+++ 3.0~a57-1ubuntu43/debian/patches/ubuntu-no-sysvinit-fixups.patch	2017-08-08 05:08:45.000000000 +0000
@@ -0,0 +1,30 @@
+Description: Drop fix-up code for sysvinit
+ SysVinit has not been essential in Ubuntu in a decade, and now it's
+ sufficiently gone that dpkg-query fails.
+Author: Steve Langasek <steve.langasek@ubuntu.com>
+Forwarded: not-needed
+Last-Update: 2017-08-08
+
+--- live-build-3.0~a57.orig/scripts/build/lb_chroot_live-packages
++++ live-build-3.0~a57/scripts/build/lb_chroot_live-packages
+@@ -48,20 +48,6 @@ then
+ 	_PACKAGES="${_PACKAGES} live-config live-config-${LB_INITSYSTEM}"
+ fi
+ 
+-# Do initsystem specific hacks
+-if [ -n "${LB_INITSYSTEM}" ] && [ "${LB_INITSYSTEM}" != "sysvinit" ]
+-then
+-	# lets see if we still need the squeeze's "pre init system policy discussion" hack:
+-	IS_SYSVINIT_ESSENTIAL="$(Chroot chroot dpkg-query --show --showformat='${Essential}\n' sysvinit)"
+-	RC="$?"
+-
+-	if [ "${IS_SYSVINIT_ESSENTIAL}" != "no" ] && [ "${RC}" = "0" ]
+-	then
+-		# sysvinit is both installed and essential, ugly hack to remove it
+-		Chroot chroot dpkg --force-remove-essential --remove sysvinit || true
+-	fi
+-fi
+-
+ # Install live packages
+ if [ -n "${_PACKAGES}" ]
+ then
diff -pruN 3.0~a57-1/debian/patches/ubuntu-no-xz-squashfs.patch 3.0~a57-1ubuntu43/debian/patches/ubuntu-no-xz-squashfs.patch
--- 3.0~a57-1/debian/patches/ubuntu-no-xz-squashfs.patch	1970-01-01 00:00:00.000000000 +0000
+++ 3.0~a57-1ubuntu43/debian/patches/ubuntu-no-xz-squashfs.patch	2012-08-24 21:07:40.000000000 +0000
@@ -0,0 +1,25 @@
+Description: Don't turn on xz compression in mksquashfs for ubuntu builds.
+Author: Adam Conrad <adconrad@ubuntu.com>
+Forwarded: no
+Last-Update: 2012-08-24
+
+--- live-build-3.0~a57.orig/scripts/build/lb_binary_rootfs
++++ live-build-3.0~a57/scripts/build/lb_binary_rootfs
+@@ -363,8 +363,15 @@ case "${LB_CHROOT_FILESYSTEM}" in
+ 				;;
+ 
+ 			*)
+-				# FIXME: artax-backports too, once d-i has catched up
+-				MKSQUASHFS_OPTIONS="${MKSQUASHFS_OPTIONS} -comp xz"
++				case "${LB_MODE}" in
++					ubuntu|kubuntu)
++
++						;;
++					*)
++						# FIXME: artax-backports too, once d-i has catched up
++						MKSQUASHFS_OPTIONS="${MKSQUASHFS_OPTIONS} -comp xz"
++						;;
++				esac
+ 				;;
+ 		esac
+ 
diff -pruN 3.0~a57-1/debian/patches/ubuntu-package-lists-without-chroot.patch 3.0~a57-1ubuntu43/debian/patches/ubuntu-package-lists-without-chroot.patch
--- 3.0~a57-1/debian/patches/ubuntu-package-lists-without-chroot.patch	1970-01-01 00:00:00.000000000 +0000
+++ 3.0~a57-1ubuntu43/debian/patches/ubuntu-package-lists-without-chroot.patch	2012-08-21 14:22:56.000000000 +0000
@@ -0,0 +1,161 @@
+Description: If --build-with-chroot is false, run ! lines in package-lists in the host system
+Author: Colin Watson <cjwatson@ubuntu.com>
+Last-Update: 2012-08-21
+
+Index: b/functions/packagelists.sh
+===================================================================
+--- a/functions/packagelists.sh
++++ b/functions/packagelists.sh
+@@ -43,7 +43,15 @@
+ 				\!*)
+ 					_EXEC="$(echo ${_LB_LINE} | sed -e 's|^!||')"
+ 
+-					chroot chroot ${_EXEC}
++					case "${LB_BUILD_WITH_CHROOT}" in
++						true)
++							chroot chroot sh -c "${_EXEC}"
++							;;
++
++						false)
++							eval ${_EXEC}
++							;;
++					esac
+ 					;;
+ 
+ 				\#if\ *)
+Index: b/scripts/build/lb_binary_package-lists
+===================================================================
+--- a/scripts/build/lb_binary_package-lists
++++ b/scripts/build/lb_binary_package-lists
+@@ -41,15 +41,33 @@
+ if ls config/package-lists/*.list > /dev/null 2>&1 || \
+    ls config/package-lists/*.list.binary > /dev/null 2>&1
+ then
+-	# Restoring cache
+-	Restore_cache cache/packages.chroot
+-
+-	# Check depends
+-	Check_package chroot/usr/bin/apt-ftparchive apt-utils
+-	Check_package chroot/usr/bin/grep-aptavail dctrl-tools
+-
+-	# Installing depends
+-	Install_package
++	case "${LB_BUILD_WITH_CHROOT}" in
++		true)
++			# Restoring cache
++			Restore_cache cache/packages.chroot
++
++			# Check depends
++			Check_package chroot/usr/bin/apt-ftparchive apt-utils
++			Check_package chroot/usr/bin/grep-aptavail dctrl-tools
++
++			# Installing depends
++			Install_package
++			;;
++
++		false)
++			if [ ! -e /usr/bin/apt-ftparchive ]; then
++				# apt-utils
++				Echo_error "/usr/bin/apt-ftparchive - no such file."
++				exit 1
++			fi
++
++			if [ ! -e /usr/bin/grep-aptavail ]; then
++				# dctrl-tools
++				Echo_error "/usr/bin/grep-aptavail - no such file."
++				exit 1
++			fi
++			;;
++	esac
+ 
+ 	if [ -e "${LIVE_BUILD}/share/bin/Packages" ]
+ 	then
+@@ -133,11 +151,15 @@
+ 	rm -rf chroot/binary.deb
+ 	mv chroot/var/lib/dpkg/status.tmp chroot/var/lib/dpkg/status
+ 
+-	# Removing depends
+-	Remove_package
+-
+-	# Saving cache
+-	Save_cache cache/packages.chroot
++	case "${LB_BUILD_WITH_CHROOT}" in
++		true)
++			# Removing depends
++			Remove_package
++
++			# Saving cache
++			Save_cache cache/packages.chroot
++			;;
++	esac
+ 
+ 	# Creating stage file
+ 	Create_stagefile .build/binary_package-lists
+Index: b/scripts/build/lb_chroot_package-lists
+===================================================================
+--- a/scripts/build/lb_chroot_package-lists
++++ b/scripts/build/lb_chroot_package-lists
+@@ -46,14 +46,26 @@
+    ls config/package-lists/*.list.chroot > /dev/null 2>&1 || \
+    ls config/package-lists/*.list.chroot_${_PASS} > /dev/null 2>&1
+ then
+-	# Checking depends
+-	Check_package chroot/usr/bin/grep-aptavail dctrl-tools
+-
+-	# Restoring cache
+-	Restore_cache cache/packages.chroot
+-
+-	# Installing depends
+-	Install_package
++	case "${LB_BUILD_WITH_CHROOT}" in
++		true)
++			# Checking depends
++			Check_package chroot/usr/bin/grep-aptavail dctrl-tools
++
++			# Restoring cache
++			Restore_cache cache/packages.chroot
++
++			# Installing depends
++			Install_package
++			;;
++
++		false)
++			if [ ! -e /usr/bin/grep-aptavail ]; then
++				# dctrl-tools
++				Echo_error "/usr/bin/grep-aptavail - no such file."
++				exit 1
++			fi
++			;;
++	esac
+ 
+ 	if [ -e "${LIVE_BUILD}/share/bin/Packages" ]
+ 	then
+@@ -76,15 +88,19 @@
+ 
+ 	rm -f chroot/bin/Packages
+ 
+-	# Removing dctrl-tools again if the user has not installed it
+-	if ! grep -qs dctrl-tools chroot/root/packages.chroot
+-	then
+-		# Removing depends
+-		Remove_package
+-	fi
+-
+-	# Saving cache
+-	Save_cache cache/packages.binary
++	case "${LB_BUILD_WITH_CHROOT}" in
++		true)
++			# Removing dctrl-tools again if the user has not installed it
++			if ! grep -qs dctrl-tools chroot/root/packages.chroot
++			then
++				# Removing depends
++				Remove_package
++			fi
++
++			# Saving cache
++			Save_cache cache/packages.binary
++			;;
++	esac
+ 
+ 	# Creating stage file
+ 	Create_stagefile .build/chroot_package-lists.${_PASS}
diff -pruN 3.0~a57-1/debian/patches/ubuntu-pack-bootlogo.patch 3.0~a57-1ubuntu43/debian/patches/ubuntu-pack-bootlogo.patch
--- 3.0~a57-1/debian/patches/ubuntu-pack-bootlogo.patch	1970-01-01 00:00:00.000000000 +0000
+++ 3.0~a57-1ubuntu43/debian/patches/ubuntu-pack-bootlogo.patch	2014-10-30 15:04:25.000000000 +0000
@@ -0,0 +1,38 @@
+Description: carry over hack from ubuntu-cdimage to update bootlogo with contents
+ New gfxboot in utopic does no longer support loading assets from outside the
+ bootlogo archive, so we pack everything together and update bootlogo as part of the
+ syslinux build part.
+Author: Harald Sitter <apachelogger@kubuntu.org>
+Origin: vendor
+Bug-Ubuntu: https://bugs.launchpad.net/ubuntu/+source/live-build/+bug/1387709
+Forwarded: no
+Reviewed-by: Rohan Garg <rohangarg@kubuntu.org>
+---
+This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
+Index: live-build-3.0~a57/scripts/build/lb_binary_syslinux
+===================================================================
+--- live-build-3.0~a57.orig/scripts/build/lb_binary_syslinux
++++ live-build-3.0~a57/scripts/build/lb_binary_syslinux
+@@ -359,6 +359,22 @@ case "${LB_MODE}" in
+ 		;;
+ esac
+ 
++# Hack around the removal of support in gfxboot for reading from outside
++# the bootlogo archive.  This makes customisation harder and is not ideal.
++tmpdir="$(mktemp -d)"
++(cd "$tmpdir" && cpio -i) < ${_TARGET}/bootlogo
++cp -a -f	${_TARGET}/*.fnt \
++		${_TARGET}/*.hlp \
++		${_TARGET}/*.jpg \
++		${_TARGET}/*.pcx \
++		${_TARGET}/*.tr \
++		${_TARGET}/*.cfg \
++		$(test -e ${_TARGET}/lang && echo ${_TARGET}/lang) \
++		${_TARGET}/langlist \
++		"$tmpdir/" || true
++(cd "$tmpdir" && ls -1 | cpio --quiet -o) > ${_TARGET}/bootlogo
++rm -rf "$tmpdir"
++
+ case "${LB_BUILD_WITH_CHROOT}" in
+ 	true)
+ 		# Saving cache
diff -pruN 3.0~a57-1/debian/patches/ubuntu-parent-mirror-binary-volatile.patch 3.0~a57-1ubuntu43/debian/patches/ubuntu-parent-mirror-binary-volatile.patch
--- 3.0~a57-1/debian/patches/ubuntu-parent-mirror-binary-volatile.patch	1970-01-01 00:00:00.000000000 +0000
+++ 3.0~a57-1ubuntu43/debian/patches/ubuntu-parent-mirror-binary-volatile.patch	2012-08-23 08:22:19.000000000 +0000
@@ -0,0 +1,18 @@
+Description: Fix default for LB_PARENT_MIRROR_BINARY_VOLATILE
+Author: Colin Watson <cjwatson@ubuntu.com>
+Bug-Debian: http://bugs.debian.org/685669
+Last-Update: 2012-08-23
+
+Index: b/functions/defaults.sh
+===================================================================
+--- a/functions/defaults.sh
++++ b/functions/defaults.sh
+@@ -596,7 +596,7 @@
+ 					;;
+ 			esac
+ 
+-			LB_PARENT_MIRROR_BINARY_VOLATILE="${LB_PARENT_MIRROR_BINARY_VOLATILE:-${LB_PARENT_MIRROR}}"
++			LB_PARENT_MIRROR_BINARY_VOLATILE="${LB_PARENT_MIRROR_BINARY_VOLATILE:-${LB_PARENT_MIRROR_BINARY}}"
+ 			;;
+ 
+ 		*)
diff -pruN 3.0~a57-1/debian/patches/ubuntu-powerpc-smp.patch 3.0~a57-1ubuntu43/debian/patches/ubuntu-powerpc-smp.patch
--- 3.0~a57-1/debian/patches/ubuntu-powerpc-smp.patch	1970-01-01 00:00:00.000000000 +0000
+++ 3.0~a57-1ubuntu43/debian/patches/ubuntu-powerpc-smp.patch	2016-09-19 22:46:56.000000000 +0000
@@ -0,0 +1,35 @@
+Description: Switch Ubuntu from powerpc to powerpc-smp kernel
+Author: Adam Conrad <adconrad@ubuntu.com>
+Forwarded: no
+
+Index: b/scripts/build/lb_binary_debian-installer
+===================================================================
+--- a/scripts/build/lb_binary_debian-installer
++++ b/scripts/build/lb_binary_debian-installer
+@@ -395,7 +395,7 @@
+ 			DI_REQ_PACKAGES="yaboot"
+ 			case "${LB_MODE}" in
+ 				ubuntu|kubuntu)
+-					DI_PACKAGES="${DI_REQ_PACKAGES} linux-image-powerpc linux-image-powerpc64-smp"
++					DI_PACKAGES="${DI_REQ_PACKAGES} linux-image-powerpc-smp linux-image-generic"
+ 					;;
+ 
+ 				*)
+Index: b/functions/defaults.sh
+===================================================================
+--- a/functions/defaults.sh
++++ b/functions/defaults.sh
+@@ -803,11 +803,11 @@
+ 				ubuntu|kubuntu)
+ 					case "${LIST}" in
+ 						stripped|minimal)
+-							LB_LINUX_FLAVOURS="${LB_LINUX_FLAVOURS:-powerpc}"
++							LB_LINUX_FLAVOURS="${LB_LINUX_FLAVOURS:-powerpc-smp}"
+ 							;;
+ 
+ 						*)
+-							LB_LINUX_FLAVOURS="${LB_LINUX_FLAVOURS:-powerpc powerpc64-smp}"
++							LB_LINUX_FLAVOURS="${LB_LINUX_FLAVOURS:-powerpc-smp generic}"
+ 							;;
+ 					esac
+ 					;;
diff -pruN 3.0~a57-1/debian/patches/ubuntu-ppc64el-support.patch 3.0~a57-1ubuntu43/debian/patches/ubuntu-ppc64el-support.patch
--- 3.0~a57-1/debian/patches/ubuntu-ppc64el-support.patch	1970-01-01 00:00:00.000000000 +0000
+++ 3.0~a57-1ubuntu43/debian/patches/ubuntu-ppc64el-support.patch	2015-10-26 13:56:48.000000000 +0000
@@ -0,0 +1,47 @@
+Description: Add basic ppc64el support
+Author: Colin Watson <cjwatson@ubuntu.com>
+Author: Daniel Watkins <daniel.watkins@canonical.com>
+Forwarded: no
+Last-Update: 2015-10-26
+
+Index: b/functions/defaults.sh
+===================================================================
+--- a/functions/defaults.sh
++++ b/functions/defaults.sh
+@@ -830,6 +830,10 @@
+ 			esac
+ 			;;
+ 
++		ppc64el)
++			LB_LINUX_FLAVOURS="${LB_LINUX_FLAVOURS:-generic}"
++			;;
++
+ 		s390)
+ 			case "${LB_MODE}" in
+ 				progress|ubuntu|kubuntu)
+Index: b/scripts/build/lb_binary_linux-image
+===================================================================
+--- a/scripts/build/lb_binary_linux-image
++++ b/scripts/build/lb_binary_linux-image
+@@ -58,7 +58,7 @@
+ esac
+ 
+ case "${LB_ARCHITECTURES}" in
+-	powerpc)
++	powerpc|ppc64el)
+ 		LINUX="vmlinux"
+ 		;;
+ 
+Index: b/scripts/build/lb_binary_rootfs
+===================================================================
+--- a/scripts/build/lb_binary_rootfs
++++ b/scripts/build/lb_binary_rootfs
+@@ -43,7 +43,7 @@
+ 		LINUX="vmlinuz"
+ 		;;
+ 
+-	powerpc)
++	powerpc|ppc64el)
+ 		LINUX="vmlinux"
+ 		;;
+ esac
diff -pruN 3.0~a57-1/debian/patches/ubuntu-pt_chown.patch 3.0~a57-1ubuntu43/debian/patches/ubuntu-pt_chown.patch
--- 3.0~a57-1/debian/patches/ubuntu-pt_chown.patch	1970-01-01 00:00:00.000000000 +0000
+++ 3.0~a57-1ubuntu43/debian/patches/ubuntu-pt_chown.patch	2013-10-15 17:47:05.000000000 +0000
@@ -0,0 +1,14 @@
+Description: Mount devpts with gid=5,mode=620 to work without pt_chown.
+Author: Adam Conrad <adconrad@ubuntu.com>
+
+--- live-build-3.0~a57.orig/scripts/build/lb_chroot_devpts
++++ live-build-3.0~a57/scripts/build/lb_chroot_devpts
+@@ -49,7 +49,7 @@ case "${1}" in
+ 			mkdir -p chroot/dev/pts
+ 
+ 			# Mounting /dev/pts
+-			${LB_ROOT_COMMAND} mount devpts-live -t devpts chroot/dev/pts || true
++			${LB_ROOT_COMMAND} mount devpts-live -t devpts -o gid=5,mode=620 chroot/dev/pts || true
+ 		fi
+ 
+ 		# Creating stage file
diff -pruN 3.0~a57-1/debian/patches/ubuntu-resolvconf.patch 3.0~a57-1ubuntu43/debian/patches/ubuntu-resolvconf.patch
--- 3.0~a57-1/debian/patches/ubuntu-resolvconf.patch	1970-01-01 00:00:00.000000000 +0000
+++ 3.0~a57-1ubuntu43/debian/patches/ubuntu-resolvconf.patch	2012-08-20 16:13:00.000000000 +0000
@@ -0,0 +1,24 @@
+Description: Remove resolvconf artifacts
+  If chroot/etc/resolvconf/resolv.conf.d exists, tidy up the original and
+  tail files, which are artifacts of the build (and leak the host system's
+  resolv.conf).
+Author: Adam Conrad <adconrad@ubuntu.com>
+Last-Update: 2012-08-20
+
+Index: b/scripts/build/lb_chroot_resolv
+===================================================================
+--- a/scripts/build/lb_chroot_resolv
++++ b/scripts/build/lb_chroot_resolv
+@@ -90,6 +90,12 @@
+ 			Truncate chroot/etc/resolv.conf
+ 		fi
+ 
++		# Clean up resolvconf's pollution
++		if [ -d chroot/etc/resolvconf/resolv.conf.d ]; then
++			rm -f chroot/etc/resolvconf/resolv.conf.d/original
++			rm -f chroot/etc/resolvconf/resolv.conf.d/tail
++		fi
++
+ 		# Removing stage file
+ 		rm -f .build/chroot_resolv
+ 		;;
diff -pruN 3.0~a57-1/debian/patches/ubuntu-s390x-support.patch 3.0~a57-1ubuntu43/debian/patches/ubuntu-s390x-support.patch
--- 3.0~a57-1/debian/patches/ubuntu-s390x-support.patch	1970-01-01 00:00:00.000000000 +0000
+++ 3.0~a57-1ubuntu43/debian/patches/ubuntu-s390x-support.patch	2015-12-01 13:24:55.000000000 +0000
@@ -0,0 +1,16 @@
+Description: attempt s390x builds
+Author: Dimitri John Ledkov <xnox@ubuntu.com>
+
+--- live-build-3.0~a57.orig/functions/defaults.sh
++++ live-build-3.0~a57/functions/defaults.sh
+@@ -834,6 +834,10 @@ Set_defaults ()
+ 			LB_LINUX_FLAVOURS="${LB_LINUX_FLAVOURS:-generic}"
+ 			;;
+ 
++		s390x)
++			LB_LINUX_FLAVOURS="${LB_LINUX_FLAVOURS:-generic}"
++			;;
++
+ 		s390)
+ 			case "${LB_MODE}" in
+ 				progress|ubuntu|kubuntu)
diff -pruN 3.0~a57-1/debian/patches/ubuntu-wubi-initramfs-framebuffer.patch 3.0~a57-1ubuntu43/debian/patches/ubuntu-wubi-initramfs-framebuffer.patch
--- 3.0~a57-1/debian/patches/ubuntu-wubi-initramfs-framebuffer.patch	1970-01-01 00:00:00.000000000 +0000
+++ 3.0~a57-1ubuntu43/debian/patches/ubuntu-wubi-initramfs-framebuffer.patch	2012-08-20 16:09:18.000000000 +0000
@@ -0,0 +1,22 @@
+Description: Use a framebuffer in the initramfs
+ Wubi disk image installs do a fair amount of work in the initramfs.
+Author: Evan Dandrea <ev@ubuntu.com>
+Last-Update: 2012-08-20
+
+Index: b/scripts/build/lb_chroot_hacks
+===================================================================
+--- a/scripts/build/lb_chroot_hacks
++++ b/scripts/build/lb_chroot_hacks
+@@ -176,6 +176,12 @@
+ 		;;
+ esac
+ 
++case "${SUBPROJECT}" in
++	wubi)
++		UPDATE_INITRAMFS_OPTIONS="$UPDATE_INITRAMFS_OPTIONS FRAMEBUFFER=y"
++		;;
++esac
++
+ if [ "${LB_INITRAMFS}" != "none" ]
+ then
+ 	Chroot chroot "${UPDATE_INITRAMFS_OPTIONS} update-initramfs -k all -t -u"
diff -pruN 3.0~a57-1/debian/patches/upstart-not-in-bootstrap 3.0~a57-1ubuntu43/debian/patches/upstart-not-in-bootstrap
--- 3.0~a57-1/debian/patches/upstart-not-in-bootstrap	1970-01-01 00:00:00.000000000 +0000
+++ 3.0~a57-1ubuntu43/debian/patches/upstart-not-in-bootstrap	2015-07-22 15:29:37.000000000 +0000
@@ -0,0 +1,36 @@
+Description: Fix lb_chroot_upstart to work when upstart's not in bootstrap
+Author: Adam Conrad <adconrad@ubuntu.com>
+Bug-Ubuntu: https://bugs.launchpad.net/bugs/1477051
+
+--- live-build-3.0~a57.orig/scripts/build/lb_chroot_upstart
++++ live-build-3.0~a57/scripts/build/lb_chroot_upstart
+@@ -27,12 +27,6 @@ Set_defaults
+ # Requiring stage file
+ Require_stagefile .build/config .build/bootstrap
+ 
+-# Check if system uses upstart
+-if [ ! -e chroot/sbin/initctl ]
+-then
+-	exit 0
+-fi
+-
+ case "${1}" in
+ 	install)
+ 		Echo_message "Configuring file /sbin/initctl"
+@@ -49,6 +43,8 @@ case "${1}" in
+ 		# Create custom initctl file
+ 		Chroot chroot dpkg-divert --rename --quiet --add /sbin/initctl
+ 
++		# Only create stub if we actually diverted something
++		if [ -e chroot/sbin/initctl.distrib ]; then
+ cat > chroot/sbin/initctl << EOF
+ #!/bin/sh
+ echo "All runlevel operations denied by policy" >&2
+@@ -56,6 +52,7 @@ exit 101
+ EOF
+ 
+ 		chmod 0755 chroot/sbin/initctl
++		fi
+ 
+ 		# Creating stage file
+ 		Create_stagefile .build/chroot_upstart
diff -pruN 3.0~a57-1/debian/rules 3.0~a57-1ubuntu43/debian/rules
--- 3.0~a57-1/debian/rules	2012-08-10 20:44:17.000000000 +0000
+++ 3.0~a57-1ubuntu43/debian/rules	2014-09-23 15:45:45.000000000 +0000
@@ -3,8 +3,13 @@
 %:
 	dh ${@}
 
+override_dh_auto_build:
+	chmod +x share/hooks/100-build-wubildr.binary
+	dh_auto_build
+
 override_dh_auto_install:
 	dh_auto_install -- DESTDIR=debian/live-build
+	chmod +x debian/live-build/usr/lib/live/build/*
 
 	# Removing unused files
 	rm -f debian/live-build/usr/share/doc/live-build/COPYING
