mirror of
				https://git.launchpad.net/livecd-rootfs
				synced 2025-11-03 18:34:11 +00:00 
			
		
		
		
	Import patches-unapplied version 2.353 to ubuntu/xenial-proposed
Imported using git-ubuntu import.
Changelog parent: 131941df22c4e810eca8afb4e2468069aeecc951
New changelog entries:
  * drop input group from snappy images, adjust md5 sums in
    live-build/ubuntu-core/hooks/00-uid-gid-fix.chroot_early
  * completely separate the snappy device tarball creation from the snappy
    rootfs so one doesnt taint the other (which allows dropping a lot more from
    the rootfs we do not need in a snappy system, like initramfs creation
    tools and all its dependencies).
  * drop live-build/ubuntu-core/hooks/500-move-kernel-to-device-tar.binary
  * enable automated build of raspi2 device tarballs for snappy
			
			
This commit is contained in:
		
							parent
							
								
									131941df22
								
							
						
					
					
						commit
						3242ef6c59
					
				
							
								
								
									
										13
									
								
								debian/changelog
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										13
									
								
								debian/changelog
									
									
									
									
										vendored
									
									
								
							@ -1,3 +1,16 @@
 | 
			
		||||
livecd-rootfs (2.353) xenial; urgency=medium
 | 
			
		||||
 | 
			
		||||
  * drop input group from snappy images, adjust md5 sums in
 | 
			
		||||
    live-build/ubuntu-core/hooks/00-uid-gid-fix.chroot_early
 | 
			
		||||
  * completely separate the snappy device tarball creation from the snappy
 | 
			
		||||
    rootfs so one doesnt taint the other (which allows dropping a lot more from
 | 
			
		||||
    the rootfs we do not need in a snappy system, like initramfs creation
 | 
			
		||||
    tools and all its dependencies).
 | 
			
		||||
  * drop live-build/ubuntu-core/hooks/500-move-kernel-to-device-tar.binary
 | 
			
		||||
  * enable automated build of raspi2 device tarballs for snappy
 | 
			
		||||
 | 
			
		||||
 -- Oliver Grawert <ogra@ubuntu.com>  Mon, 09 Nov 2015 12:53:24 +0100
 | 
			
		||||
 | 
			
		||||
livecd-rootfs (2.352) xenial; urgency=medium
 | 
			
		||||
 | 
			
		||||
  * Move building of all architecture-specific CPC artifacts into Launchpad
 | 
			
		||||
 | 
			
		||||
@ -343,15 +343,137 @@ fi
 | 
			
		||||
# in a binary hook
 | 
			
		||||
case $PROJECT:$SUBPROJECT in
 | 
			
		||||
        ubuntu-core:system-image|ubuntu-desktop-next:system-image)
 | 
			
		||||
    LB_LINUX_FLAVOURS=none
 | 
			
		||||
 | 
			
		||||
    # rename to have the right prefix etc
 | 
			
		||||
    mv device.tar.gz "$PREFIX.device.tar.gz"
 | 
			
		||||
    
 | 
			
		||||
    # azure specific tarball
 | 
			
		||||
    if [ -e device-azure.tar.gz ]; then
 | 
			
		||||
        mv device-azure.tar.gz "$PREFIX.azure.device.tar.gz"
 | 
			
		||||
    # create device tarball (for snappy only atm)
 | 
			
		||||
    if [ "$PROJECT:$SUBPROJECT" = "ubuntu-core:system-image" ]; then
 | 
			
		||||
      case $ARCH in
 | 
			
		||||
          armhf)
 | 
			
		||||
            subarches="generic raspi2"
 | 
			
		||||
            ;;
 | 
			
		||||
          i386|amd64|arm64|powerpc|ppc64el)
 | 
			
		||||
            subarches="generic"
 | 
			
		||||
            ;;
 | 
			
		||||
      esac
 | 
			
		||||
 | 
			
		||||
      # create a clean chroot
 | 
			
		||||
      debootstrap --variant=minbase $LB_DISTRIBUTION chroot-device $LB_PARENT_MIRROR_BOOTSTRAP
 | 
			
		||||
 | 
			
		||||
      # ... but keep the PPA setup
 | 
			
		||||
      cp -a chroot/etc/apt/* chroot-device/etc/apt/
 | 
			
		||||
 | 
			
		||||
      # ... and move it in place
 | 
			
		||||
      rm -rf chroot
 | 
			
		||||
      mv chroot-device chroot
 | 
			
		||||
 | 
			
		||||
      for devarch in $subarches; do
 | 
			
		||||
        (echo "I: creating $devarch device tarball for $ARCH"
 | 
			
		||||
        HERE="$(pwd)"
 | 
			
		||||
        set -x
 | 
			
		||||
 | 
			
		||||
        linux_package="linux-$devarch"
 | 
			
		||||
        case $ARCH in
 | 
			
		||||
            amd64)
 | 
			
		||||
              linux_package="linux-signed-generic"
 | 
			
		||||
              ;;
 | 
			
		||||
        esac
 | 
			
		||||
 | 
			
		||||
        # make sure all virtual filesystems are available
 | 
			
		||||
        lb chroot_proc install "$@"
 | 
			
		||||
        lb chroot_sysfs install "$@"
 | 
			
		||||
        lb chroot_devpts install "$@"
 | 
			
		||||
 | 
			
		||||
        # prepare the env
 | 
			
		||||
        Chroot chroot "apt-get -y update"
 | 
			
		||||
        Chroot chroot "apt-get -y purge linux-image-*"
 | 
			
		||||
        Chroot chroot "apt-get -y autoremove"
 | 
			
		||||
        rm -rf chroot/boot/initrd.img* chroot/boot/vmlinu?-* chroot/lib/modules/* \
 | 
			
		||||
            chroot/boot/abi-* chroot/boot/System.map-* chroot/boot/config-*
 | 
			
		||||
        mkdir -p chroot/etc/initramfs-tools/conf.d
 | 
			
		||||
        echo "COMPRESS=lzma" >chroot/etc/initramfs-tools/conf.d/snappy-device-tarball.conf
 | 
			
		||||
 | 
			
		||||
        # install needed packages and the kernel itself
 | 
			
		||||
        Chroot chroot "apt-get -y install initramfs-tools-ubuntu-core linux-firmware xz-utils"
 | 
			
		||||
        Chroot chroot "apt-get -y install $linux_package"
 | 
			
		||||
 | 
			
		||||
        # clean up
 | 
			
		||||
        lb chroot_devpts remove "$@"
 | 
			
		||||
        lb chroot_sysfs remove "$@"
 | 
			
		||||
        lb chroot_proc remove "$@"
 | 
			
		||||
 | 
			
		||||
        # now build the actual device tarball
 | 
			
		||||
        TMPDIR="$(mktemp -d)"
 | 
			
		||||
        mkdir -p $TMPDIR/system/
 | 
			
		||||
        mkdir -p $TMPDIR/assets/
 | 
			
		||||
 | 
			
		||||
        cd chroot
 | 
			
		||||
        cp -ar --parent lib/modules/ $TMPDIR/system/
 | 
			
		||||
        cp -ar --parent lib/firmware/ $TMPDIR/system/
 | 
			
		||||
 | 
			
		||||
        # new assets handling
 | 
			
		||||
        if [ -f boot/vmlinu?-*.signed ]; then
 | 
			
		||||
            kernel=boot/vmlinu?-*.signed
 | 
			
		||||
        else
 | 
			
		||||
            kernel=boot/vmlinu?-*
 | 
			
		||||
        fi
 | 
			
		||||
 | 
			
		||||
        initrd=boot/initrd.img-*
 | 
			
		||||
 | 
			
		||||
        cp -ar $initrd $TMPDIR/assets/
 | 
			
		||||
        cp -ar $kernel $TMPDIR/assets/
 | 
			
		||||
        cp -ar boot/abi-* boot/System.map-* boot/config-* $TMPDIR/assets/
 | 
			
		||||
 | 
			
		||||
        dtbs=$(find lib/firmware -type d -name 'device-tree' -print0)
 | 
			
		||||
        if [ -n "$dtbs" ]; then
 | 
			
		||||
           mv "$dtbs" $TMPDIR/assets/dtbs
 | 
			
		||||
        fi
 | 
			
		||||
 | 
			
		||||
        # create hardware.yaml
 | 
			
		||||
        # this assumes armhf == u-boot
 | 
			
		||||
        # and all others grub
 | 
			
		||||
        # common bits
 | 
			
		||||
        cat > $TMPDIR/hardware.yaml << EOF
 | 
			
		||||
kernel: assets/$(basename $kernel)
 | 
			
		||||
initrd: assets/$(basename $initrd)
 | 
			
		||||
partition-layout: system-AB
 | 
			
		||||
EOF
 | 
			
		||||
        # arch specific ones
 | 
			
		||||
        if [ "$ARCH" = "armhf" ]; then
 | 
			
		||||
          cat >> $TMPDIR/hardware.yaml << EOF
 | 
			
		||||
dtbs: assets/dtbs
 | 
			
		||||
bootloader: u-boot
 | 
			
		||||
EOF
 | 
			
		||||
        else
 | 
			
		||||
          cat >> $TMPDIR/hardware.yaml << EOF
 | 
			
		||||
bootloader: grub
 | 
			
		||||
EOF
 | 
			
		||||
        fi
 | 
			
		||||
 | 
			
		||||
        # compress everything
 | 
			
		||||
        cd $TMPDIR
 | 
			
		||||
        tarname="device.tar.gz"
 | 
			
		||||
        if [ "$devarch" = "raspi2" ];then
 | 
			
		||||
            tarname="raspi2.$tarname"
 | 
			
		||||
        fi
 | 
			
		||||
        tar -c -z -f $HERE/$PREFIX.$tarname system assets hardware.yaml
 | 
			
		||||
 | 
			
		||||
        # show size of initrd and kernel in the log
 | 
			
		||||
        ls -lh assets/
 | 
			
		||||
 | 
			
		||||
        # dump the content list into the log
 | 
			
		||||
        echo "I: device tarball contents for $PREFIX.$tarname:"
 | 
			
		||||
        find . -type f
 | 
			
		||||
 | 
			
		||||
        # azure wants its own device tarball
 | 
			
		||||
        if [ "$ARCH" = "amd64" ]; then
 | 
			
		||||
            cp $HERE/$PREFIX.$tarname $HERE/$PREFIX.azure.$tarname
 | 
			
		||||
        fi
 | 
			
		||||
        cd $HERE)
 | 
			
		||||
      done
 | 
			
		||||
    fi
 | 
			
		||||
 | 
			
		||||
    ls -l *device.tar.gz
 | 
			
		||||
 | 
			
		||||
    LB_LINUX_FLAVOURS=none
 | 
			
		||||
    ;;
 | 
			
		||||
esac
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@ -404,7 +404,7 @@ case $PROJECT in
 | 
			
		||||
			esac
 | 
			
		||||
 | 
			
		||||
			# generic kernel etc
 | 
			
		||||
			KERNEL_FLAVOURS=generic
 | 
			
		||||
			KERNEL_FLAVOURS=none
 | 
			
		||||
			case $ARCH in
 | 
			
		||||
				i386)
 | 
			
		||||
					add_package install grub-pc
 | 
			
		||||
@ -418,7 +418,7 @@ case $PROJECT in
 | 
			
		||||
					add_package install flash-kernel u-boot-tools
 | 
			
		||||
					;;
 | 
			
		||||
			esac
 | 
			
		||||
			OPTS="${OPTS:+$OPTS }--linux-packages=linux-image"
 | 
			
		||||
			OPTS="${OPTS:+$OPTS }--linux-packages=none --initramfs=none"
 | 
			
		||||
 | 
			
		||||
			# contains the framework definition
 | 
			
		||||
			add_package install ubuntu-core-libs
 | 
			
		||||
 | 
			
		||||
@ -3,10 +3,10 @@
 | 
			
		||||
ERRCNT=""
 | 
			
		||||
 | 
			
		||||
# Known good post-debootstrap values
 | 
			
		||||
passwd_bootstrap="c0d388ca626db569e13fdee7ad41c9bf"
 | 
			
		||||
passwd_bootstrap="bb040fdb457871cfd58cd46f5d805863"
 | 
			
		||||
shadow_bootstrap="1fd73103260cbe5a13a4a38320de4129"
 | 
			
		||||
group_bootstrap="d48601572a61e8db69854381392cd2f9"
 | 
			
		||||
gshadow_bootstrap="1dbb70f91959296a5a4c9841e21961ed"
 | 
			
		||||
group_bootstrap="ffbe05611b49480cb289f343a67d7e7b"
 | 
			
		||||
gshadow_bootstrap="46121fc1a7d95f37e7a3fb21db8061e8"
 | 
			
		||||
 | 
			
		||||
# Current post-debootstrap values
 | 
			
		||||
passwd_hash=$(set -- $(md5sum /etc/passwd) && echo $1)
 | 
			
		||||
@ -148,7 +148,6 @@ systemd-timesync:x:108:
 | 
			
		||||
systemd-network:x:109:
 | 
			
		||||
systemd-resolve:x:110:
 | 
			
		||||
systemd-bus-proxy:x:111:
 | 
			
		||||
input:x:112:
 | 
			
		||||
docker:x:113:ubuntu
 | 
			
		||||
syslog:x:114:
 | 
			
		||||
pkcs11:x:115:root
 | 
			
		||||
@ -214,7 +213,6 @@ systemd-timesync:!::
 | 
			
		||||
systemd-network:!::
 | 
			
		||||
systemd-resolve:!::
 | 
			
		||||
systemd-bus-proxy:!::
 | 
			
		||||
input:!::
 | 
			
		||||
docker:!::ubuntu
 | 
			
		||||
syslog:!::
 | 
			
		||||
pkcs11:!::root
 | 
			
		||||
 | 
			
		||||
@ -1,90 +0,0 @@
 | 
			
		||||
#!/bin/sh
 | 
			
		||||
#
 | 
			
		||||
# move the kernel out into a new device tarfile with system/boot 
 | 
			
		||||
 | 
			
		||||
set -ex
 | 
			
		||||
 | 
			
		||||
echo "I: Moving kernel into device tarball"
 | 
			
		||||
 | 
			
		||||
HERE="$(pwd)"
 | 
			
		||||
TMPDIR="$(mktemp -d)"
 | 
			
		||||
ARCH=$(dpkg --print-architecture)
 | 
			
		||||
mkdir -p $TMPDIR/system/
 | 
			
		||||
mkdir -p $TMPDIR/assets/
 | 
			
		||||
 | 
			
		||||
# cp files, we can't simply use tar --transform as it changes the symlink target
 | 
			
		||||
(
 | 
			
		||||
 cd binary/boot/filesystem.dir
 | 
			
		||||
 | 
			
		||||
 cp -ar --parent lib/modules/ $TMPDIR/system/
 | 
			
		||||
 cp -ar --parent lib/firmware/ $TMPDIR/system/
 | 
			
		||||
 | 
			
		||||
 # new assets handling
 | 
			
		||||
 if [ -f boot/vmlinu?-*.signed ]; then
 | 
			
		||||
    kernel=boot/vmlinu?-*.signed
 | 
			
		||||
 else
 | 
			
		||||
    kernel=boot/vmlinu?-*
 | 
			
		||||
 fi
 | 
			
		||||
 | 
			
		||||
 initrd=boot/initrd.img-*
 | 
			
		||||
 | 
			
		||||
 cp -ar $initrd $TMPDIR/assets/
 | 
			
		||||
 cp -ar $kernel $TMPDIR/assets/
 | 
			
		||||
 cp -ar boot/abi-* boot/System.map-* $TMPDIR/assets/
 | 
			
		||||
 | 
			
		||||
 dtbs=$(find lib/firmware -type d -name 'device-tree' -print0)
 | 
			
		||||
 if [ -n "$dtbs" ]; then
 | 
			
		||||
    mv "$dtbs" $TMPDIR/assets/dtbs
 | 
			
		||||
 fi
 | 
			
		||||
 | 
			
		||||
 # create hardware.yaml
 | 
			
		||||
 # this assumes armh == u-boot
 | 
			
		||||
 # and all others grub
 | 
			
		||||
 # common bits
 | 
			
		||||
 cat > $TMPDIR/hardware.yaml << EOF
 | 
			
		||||
kernel: assets/$(basename $kernel)
 | 
			
		||||
initrd: assets/$(basename $initrd)
 | 
			
		||||
partition-layout: system-AB
 | 
			
		||||
EOF
 | 
			
		||||
 | 
			
		||||
# arch specific ones
 | 
			
		||||
if [ "$ARCH" = "armhf" ]; then
 | 
			
		||||
 cat >> $TMPDIR/hardware.yaml << EOF
 | 
			
		||||
dtbs: assets/dtbs
 | 
			
		||||
bootloader: u-boot
 | 
			
		||||
EOF
 | 
			
		||||
else
 | 
			
		||||
 cat >> $TMPDIR/hardware.yaml << EOF
 | 
			
		||||
bootloader: grub
 | 
			
		||||
EOF
 | 
			
		||||
fi
 | 
			
		||||
)
 | 
			
		||||
 | 
			
		||||
# and tar it up
 | 
			
		||||
(
 | 
			
		||||
 cd $TMPDIR
 | 
			
		||||
 tar -c -z -f $HERE/device.tar.gz system assets hardware.yaml
 | 
			
		||||
)
 | 
			
		||||
 | 
			
		||||
# now build the azure device tarball
 | 
			
		||||
# this should go away once we have a custom grub.cfg for azure
 | 
			
		||||
cp $HERE/device.tar.gz $HERE/device-azure.tar.gz
 | 
			
		||||
 | 
			
		||||
rm -rf $TMPDIR
 | 
			
		||||
 | 
			
		||||
# remove files from the root filesystem
 | 
			
		||||
(cd binary/boot/filesystem.dir
 | 
			
		||||
 rm -f boot/vmlinu?-*
 | 
			
		||||
 rm -f boot/initrd.img-*
 | 
			
		||||
 rm -f boot/abi-*
 | 
			
		||||
 rm -f boot/System.map-*
 | 
			
		||||
 rm -f initrd.img
 | 
			
		||||
 rm -f vmlinu?
 | 
			
		||||
 rm -rf lib/modules
 | 
			
		||||
 rm -rf lib/firmware
 | 
			
		||||
 # lp: #1468469
 | 
			
		||||
 rm -rf boot/config-*
 | 
			
		||||
 rm -rf usr/share/doc/linux-image*
 | 
			
		||||
 rm -rf var/lib/initramfs-tools/*
 | 
			
		||||
 rm -rf lib/modprobe.d/blacklist_linux_*.conf
 | 
			
		||||
)
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user