From c6440fdfe5f95c3dba29992a1bed02c139e304e1 Mon Sep 17 00:00:00 2001 From: Daniel Watkins Date: Wed, 13 Jan 2016 10:19:09 +0000 Subject: [PATCH] Enable building of s390x cloud images. --- debian/changelog | 3 +++ .../ubuntu-cpc/hooks/032-disk-image.binary | 27 ++++++++++++++++++- .../ubuntu-cpc/hooks/999-cpc-fixes.chroot | 4 +++ 3 files changed, 33 insertions(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index 79c00704..a5cb6fc5 100644 --- a/debian/changelog +++ b/debian/changelog @@ -8,6 +8,9 @@ livecd-rootfs (2.369) UNRELEASED; urgency=medium * live-build/ubuntu-core/hooks/11-remove-extra-packages.chroot: - remove libicu52 hook + [ Daniel Watkins ] + * Enable building of s390x cloud images. + -- Ɓukasz 'sil2100' Zemczak Mon, 14 Dec 2015 10:13:31 +0100 livecd-rootfs (2.368) xenial; urgency=medium diff --git a/live-build/ubuntu-cpc/hooks/032-disk-image.binary b/live-build/ubuntu-cpc/hooks/032-disk-image.binary index 99514de4..eebd85f8 100755 --- a/live-build/ubuntu-cpc/hooks/032-disk-image.binary +++ b/live-build/ubuntu-cpc/hooks/032-disk-image.binary @@ -34,7 +34,7 @@ rmdir mountpoint should_install_grub() { case $architecture in - armhf|arm64) + armhf|arm64|s390x) return 1 ;; *) @@ -56,5 +56,30 @@ if should_install_grub; then rmdir mountpoint fi +if [ "$architecture" = "s390x" ]; then + # Do ZIPL install bits + mkdir mountpoint + mount_partition "${rootfs_dev_mapper}" mountpoint + + # Write out cloudy zipl.conf for future kernel updates + cat << EOF > mountpoint/etc/zipl.conf +# This has been modified by the cloud image build process +[defaultboot] +default=ubuntu + +[ubuntu] +target = /boot +image = /boot/vmlinuz +ramdisk = /boot/initrd.img +parameters = root=LABEL=cloudimg-rootfs +EOF + + # Create bootmap file + mountpoint/sbin/zipl -V --image=mountpoint/boot/vmlinuz --ramdisk=mountpoint/boot/initrd.img --parameters='root=LABEL=cloudimg-rootfs' --target=mountpoint/boot/ --targetbase=/dev/loop0 --targettype=SCSI --targetblocksize=512 --targetoffset=2048 + + umount_partition mountpoint + rmdir mountpoint +fi + clean_loops trap - EXIT diff --git a/live-build/ubuntu-cpc/hooks/999-cpc-fixes.chroot b/live-build/ubuntu-cpc/hooks/999-cpc-fixes.chroot index 7df8815b..535aaa31 100755 --- a/live-build/ubuntu-cpc/hooks/999-cpc-fixes.chroot +++ b/live-build/ubuntu-cpc/hooks/999-cpc-fixes.chroot @@ -142,6 +142,10 @@ if [[ "$arch" =~ (arm|arm64|aarch64) ]]; then exit 0 fi +if [ "$arch" = "s390x" ]; then + exit 0 +fi + ## Add ttyS0 for i386/amd64 for Trusty and newer if [ "$arch" = "i386" -o "$arch" = "amd64" ]; then add_serial_console ttyS0