livecd-rootfs/live-build/ubuntu-cpc/hooks/030-root-tarball.binary
Steve Langasek aee4e79c87 Import patches-unapplied version 2.408.15 to ubuntu/xenial-proposed
Imported using git-ubuntu import.

Changelog parent: 2473668b91bf1e0c83f8160377ba7de3364657b0

New changelog entries:
  [ Mathieu Trudel-Lapierre ]
  * Drop preloading of grub modules that are built into the grub signed
    image.  This is functionally a no-op, changed only to clean up the code.
  [ Steve Langasek ]
  * live-build/ubuntu-cpc/functions: mount tmpfs on /var/cache/apt and
    /var/lib/apt, so we don't have to leave empty space in our derivative
    images for packages that have been downloaded/installed/removed.  This
    normally isn't relevant for the installed system, since the root
    filesystem will auto-expand in place on the target disk, but lets us
    ship smaller images.
  * live-build/ubuntu-cpc/hooks/033-disk-image-uefi.binary: call apt-get
    update *before* installing packages, not after.
  [ Colin Watson ]
  * Mount and unmount /dev recursively, to cope with setups where there are
    interesting bind-mounts under /dev (e.g. loop devices bind-mounted by
    LXD).  LP: #1716465.
  [ Balint Reczey ]
  * Fix suppression of kpartx error.  LP: #1684090.
2017-09-11 22:23:17 +00:00

32 lines
1.2 KiB
Bash
Executable File

#!/bin/bash -ex
if [ -n "$SUBARCH" ]; then
echo "Skipping rootfs build for subarch flavor build"
exit 0
fi
. config/functions
mkdir binary/boot/filesystem.dir
cp -a chroot/* binary/boot/filesystem.dir
setup_mountpoint binary/boot/filesystem.dir
chroot binary/boot/filesystem.dir dpkg-divert --local --rename /usr/sbin/grub-probe
chroot binary/boot/filesystem.dir touch /usr/sbin/grub-probe
chroot binary/boot/filesystem.dir chmod +x /usr/sbin/grub-probe
env DEBIAN_FRONTEND=noninteractive chroot binary/boot/filesystem.dir apt-get --purge remove --assume-yes '^linux-.*' 'linux-base+'
env DEBIAN_FRONTEND=noninteractive chroot binary/boot/filesystem.dir apt-get --purge remove --assume-yes '^grub-.*'
env DEBIAN_FRONTEND=noninteractive chroot binary/boot/filesystem.dir apt-get autoremove --purge --assume-yes
chroot binary/boot/filesystem.dir mkdir /lib/modules
chroot binary/boot/filesystem.dir rm /usr/sbin/grub-probe
chroot binary/boot/filesystem.dir dpkg-divert --remove --local --rename /usr/sbin/grub-probe
mv resolv.conf.tmp "binary/boot/filesystem.dir/etc/resolv.conf"
umount "binary/boot/filesystem.dir/proc"
umount "binary/boot/filesystem.dir/sys"
umount -R "binary/boot/filesystem.dir/dev"
umount "binary/boot/filesystem.dir/tmp"