Debian

Available patches from Ubuntu

To see Ubuntu differences wrt. to Debian, write down a grep-dctrl query identifying the packages you're interested in:
grep-dctrl -n -sPackage Sources.Debian
(e.g. -FPackage linux-ntfs or linux-ntfs)

Modified packages are listed below:

Debian ( Changelog | PTS | Bugs ) Ubuntu ( Changelog | txt | LP | Bugs ) | Diff from Ubuntu

Source: live-build

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

Modifications :
  1. Download patch 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-1ubuntu38/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
  2. Download patch 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-1ubuntu38/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 + ;; + + *)
  3. Download patch 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-1ubuntu38/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"
  4. Download patch 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-1ubuntu38/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
  5. Download patch debian/rules

    --- 3.0~a57-1/debian/rules 2012-08-10 20:44:17.000000000 +0000 +++ 3.0~a57-1ubuntu38/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
  6. Download patch 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-1ubuntu38/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
  7. Download patch debian/patches/chroot-resolv-conf-allow-symlinks
  8. Download patch 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-1ubuntu38/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 +
  9. Download patch 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-1ubuntu38/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
  10. Download patch 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-1ubuntu38/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"
  11. Download patch 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-1ubuntu38/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 + ;;
  12. Download patch debian/control

    --- 3.0~a57-1/debian/control 2012-08-10 20:44:17.000000000 +0000 +++ 3.0~a57-1ubuntu38/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.
  13. Download patch 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-1ubuntu38/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
  14. Download patch 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-1ubuntu38/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
  15. Download patch 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-1ubuntu38/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}}" + ;; + + *)
  16. Download patch 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-1ubuntu38/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"
  17. Download patch 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-1ubuntu38/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
  18. Download patch 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-1ubuntu38/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 + ;;
  19. Download patch 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-1ubuntu38/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
  20. Download patch 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-1ubuntu38/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
  21. Download patch 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-1ubuntu38/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
  22. Download patch 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-1ubuntu38/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)
  23. Download patch 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-1ubuntu38/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
  24. Download patch 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-1ubuntu38/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}
  25. Download patch debian/patches/series

    --- 3.0~a57-1/debian/patches/series 1970-01-01 00:00:00.000000000 +0000 +++ 3.0~a57-1ubuntu38/debian/patches/series 2019-06-05 12:34:29.000000000 +0000 @@ -0,0 +1,42 @@ +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
  26. Download patch 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-1ubuntu38/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
  27. Download patch 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-1ubuntu38/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
  28. Download patch 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-1ubuntu38/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* + ;;
  29. Download patch 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-1ubuntu38/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
  30. Download patch 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-1ubuntu38/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
  31. Download patch 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-1ubuntu38/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"
  32. Download patch 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-1ubuntu38/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
  33. Download patch 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-1ubuntu38/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)
  34. Download patch 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-1ubuntu38/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 +
  35. Download patch 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-1ubuntu38/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
  36. Download patch 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-1ubuntu38/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
  37. Download patch 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-1ubuntu38/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 ]
  38. Download patch 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-1ubuntu38/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)
  39. Download patch 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-1ubuntu38/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
  40. Download patch 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-1ubuntu38/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
  41. Download patch 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-1ubuntu38/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
  42. Download patch 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-1ubuntu38/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
  43. Download patch 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-1ubuntu38/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
  44. Download patch 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-1ubuntu38/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
  45. Download patch 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-1ubuntu38/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
  1. live-build