2016-02-06 23:31:54 -08:00
|
|
|
#!/bin/bash -ex
|
2015-11-12 14:48:01 -07:00
|
|
|
# vi: ts=4 noexpandtab
|
|
|
|
#
|
|
|
|
# Generate a squashfs root and manifest
|
|
|
|
|
2016-02-05 11:08:26 -08:00
|
|
|
if [ -n "$SUBARCH" ]; then
|
2016-06-09 10:47:25 +01:00
|
|
|
echo "Skipping rootfs build for subarch flavor build"
|
2016-02-05 11:08:26 -08:00
|
|
|
exit 0
|
|
|
|
fi
|
|
|
|
|
2016-06-09 10:47:25 +01:00
|
|
|
. /build/config/functions
|
|
|
|
|
|
|
|
mkdir binary/boot/squashfs.dir
|
|
|
|
cp -a chroot/* binary/boot/squashfs.dir
|
|
|
|
|
|
|
|
setup_mountpoint binary/boot/squashfs.dir
|
|
|
|
|
|
|
|
chroot binary/boot/squashfs.dir dpkg-divert --local --rename /usr/sbin/grub-probe
|
|
|
|
chroot binary/boot/squashfs.dir touch /usr/sbin/grub-probe
|
|
|
|
chroot binary/boot/squashfs.dir chmod +x /usr/sbin/grub-probe
|
|
|
|
|
|
|
|
env DEBIAN_FRONTEND=noninteractive chroot binary/boot/squashfs.dir apt-get --purge remove --assume-yes '^linux-.*' 'linux-base+'
|
|
|
|
env DEBIAN_FRONTEND=noninteractive chroot binary/boot/squashfs.dir apt-get --purge remove --assume-yes '^grub-.*'
|
|
|
|
env DEBIAN_FRONTEND=noninteractive chroot binary/boot/squashfs.dir apt-get autoremove --purge --assume-yes
|
|
|
|
chroot binary/boot/squashfs.dir mkdir /lib/modules
|
|
|
|
|
|
|
|
chroot binary/boot/squashfs.dir rm /usr/sbin/grub-probe
|
|
|
|
chroot binary/boot/squashfs.dir dpkg-divert --remove --local --rename /usr/sbin/grub-probe
|
|
|
|
|
|
|
|
mv resolv.conf.tmp "binary/boot/squashfs.dir/etc/resolv.conf"
|
|
|
|
umount "binary/boot/squashfs.dir/proc"
|
|
|
|
umount "binary/boot/squashfs.dir/sys"
|
|
|
|
umount "binary/boot/squashfs.dir/dev/pts"
|
|
|
|
umount "binary/boot/squashfs.dir/dev"
|
|
|
|
umount "binary/boot/squashfs.dir/tmp"
|
|
|
|
|
2015-11-12 14:48:01 -07:00
|
|
|
apt-get -qqy install squashfs-tools
|
|
|
|
|
|
|
|
squashfs_f="${PWD}/livecd.ubuntu-cpc.squashfs"
|
|
|
|
squashfs_f_manifest="${squashfs_f}.manifest"
|
|
|
|
|
2016-06-09 10:47:25 +01:00
|
|
|
dpkg-query --admindir=binary/boot/squashfs.dir/var/lib/dpkg -W > ${squashfs_f_manifest}
|
2015-11-12 14:48:01 -07:00
|
|
|
|
2016-06-09 10:47:25 +01:00
|
|
|
(cd "binary/boot/squashfs.dir/" &&
|
2015-11-12 14:48:01 -07:00
|
|
|
mksquashfs . ${squashfs_f} \
|
|
|
|
-no-progress -xattrs -comp xz )
|