Merge lp:~sil2100/livecd-rootfs/bionic-raspi3-backport into lp:~ubuntu-core-dev/livecd-rootfs/bionic-proposed

Proposed by Łukasz Zemczak
Status: Merged
Merged at revision: 1690
Proposed branch: lp:~sil2100/livecd-rootfs/bionic-raspi3-backport
Merge into: lp:~ubuntu-core-dev/livecd-rootfs/bionic-proposed
Diff against target: 291 lines (+136/-55)
4 files modified
debian/changelog (+17/-0)
debian/control (+3/-0)
live-build/auto/build (+73/-38)
live-build/auto/config (+43/-17)
To merge this branch: bzr merge lp:~sil2100/livecd-rootfs/bionic-raspi3-backport
Reviewer Review Type Date Requested Status
Łukasz Zemczak Approve
Review via email: mp+359858@code.launchpad.net

Commit message

Backport all the necessary livecd-rootfs changes for raspi3 armhf/arm64 support.

Description of the change

Backport all the necessary livecd-rootfs changes for raspi3 armhf/arm64 support.

To post a comment you must log in.
Revision history for this message
Łukasz Zemczak (sil2100) wrote :

I tested it in a PPA and performed a livefs build of raspi3+arm64 - resulting image works as expected. Apologies for the self-approval but we're short on time..!

review: Approve
Revision history for this message
Łukasz Zemczak (sil2100) wrote :

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'debian/changelog'
--- debian/changelog 2018-11-26 20:55:29 +0000
+++ debian/changelog 2018-11-29 16:44:19 +0000
@@ -1,3 +1,20 @@
1livecd-rootfs (2.525.11) UNRELEASED; urgency=medium
2
3 * Backport all the required changes to enable Raspberry Pi 3 armhf and arm64
4 preinstalled image builds. (LP: #1805668)
5 - Add support for raspi3 rootfs builds (based on Ryan Finnie's changes).
6 - For ubuntu-image consumption, export the kernel and initrd to
7 image/boot/uboot for raspi*.
8 - Avoid issues of hard-linking to a symbolic vmlinuz as this can lead to a
9 dangling symlink.
10 - Add raspi3 arm64 rootfs build support.
11 - Add git to the build dependencies for the gadget tree pull.
12 - Minor fixes to raspi3 builds: add arm64+raspi3 to the supported model
13 list, pass SUITE on to the build stage and use the git:// url for the
14 gadget tree.
15
16 -- Łukasz 'sil2100' Zemczak <lukasz.zemczak@ubuntu.com> Thu, 29 Nov 2018 16:24:23 +0100
17
1livecd-rootfs (2.525.10) bionic; urgency=medium18livecd-rootfs (2.525.10) bionic; urgency=medium
219
3 [ Cody Shepherd ]20 [ Cody Shepherd ]
421
=== modified file 'debian/control'
--- debian/control 2018-10-26 21:01:17 +0000
+++ debian/control 2018-11-29 16:44:19 +0000
@@ -17,12 +17,14 @@
17 gdisk,17 gdisk,
18 genisoimage,18 genisoimage,
19 germinate (>= 1.25.1),19 germinate (>= 1.25.1),
20 git,
20 gnupg,21 gnupg,
21 grep-dctrl,22 grep-dctrl,
22 kpartx,23 kpartx,
23 live-build (>= 3.0~a57-1ubuntu31~),24 live-build (>= 3.0~a57-1ubuntu31~),
24 lsb-release,25 lsb-release,
25 lzma,26 lzma,
27 make,
26 parted,28 parted,
27 procps,29 procps,
28 python-minimal | python,30 python-minimal | python,
@@ -32,6 +34,7 @@
32 snapd,34 snapd,
33 squashfs-tools (>= 1:3.3-1),35 squashfs-tools (>= 1:3.3-1),
34 sudo,36 sudo,
37 u-boot-tools [armhf arm64],
35 ubuntu-image,38 ubuntu-image,
36 vmdk-stream-converter [amd64 i386],39 vmdk-stream-converter [amd64 i386],
37 xz-utils,40 xz-utils,
3841
=== modified file 'live-build/auto/build'
--- live-build/auto/build 2018-08-27 22:32:07 +0000
+++ live-build/auto/build 2018-11-29 16:44:19 +0000
@@ -23,12 +23,31 @@
23if [ "${IMAGEFORMAT:-}" = "ubuntu-image" ]; then23if [ "${IMAGEFORMAT:-}" = "ubuntu-image" ]; then
24 # Use ubuntu-image instead of live-build24 # Use ubuntu-image instead of live-build
2525
26 CHANNEL="${CHANNEL:-edge}"26 if [ "$PROJECT" = "ubuntu-core"]; then
27 env SNAPPY_STORE_NO_CDN=1 \27 CHANNEL="${CHANNEL:-edge}"
28 ubuntu-image -c "$CHANNEL" $UBUNTU_IMAGE_ARGS \28 env SNAPPY_STORE_NO_CDN=1 \
29 -o "$PREFIX".img "$PREFIX".model-assertion29 ubuntu-image snap -c "$CHANNEL" $UBUNTU_IMAGE_ARGS \
30 xz -0 -T4 "$PREFIX".img30 -O output "$PREFIX".model-assertion
31 mv seed.manifest "$PREFIX".manifest31 # XXX: currently we only have one image generated, but really
32 # we should be supporting more than one for models that
33 # define those.
34 mv output/*.img "$PREFIX".img
35 xz -0 -T4 "$PREFIX".img
36 mv output/seed.manifest "$PREFIX".manifest
37 else
38 # First we need to build the gadget tree
39 make -C "config/$PREFIX-gadget" ARCH=$ARCH SERIES=$SUITE
40 ubuntu-image classic $UBUNTU_IMAGE_ARGS \
41 -s $SUITE -p $PROJECT -a $ARCH --subarch $SUBARCH \
42 -O output config/$PREFIX-gadget/install
43 # XXX: currently we only have one image generated, but really
44 # we should be supporting more than one for models that
45 # define those.
46 mv output/*.img "$PREFIX".img
47 xz -0 -T4 "$PREFIX".img
48 mv output/filesystem.manifest "$PREFIX".manifest
49 fi
50
32 exit 051 exit 0
33fi52fi
3453
@@ -800,13 +819,13 @@
800NUMFLAVOURS="$(set -- $LB_LINUX_FLAVOURS; echo $#)"819NUMFLAVOURS="$(set -- $LB_LINUX_FLAVOURS; echo $#)"
801if [ "$NUMFLAVOURS" = 1 ] && [ "$LB_LINUX_FLAVOURS" != "none" ]; then820if [ "$NUMFLAVOURS" = 1 ] && [ "$LB_LINUX_FLAVOURS" != "none" ]; then
802 # only one kernel flavour821 # only one kernel flavour
803 if [ -e "binary/$INITFS/vmlinuz" ]; then822 if [ -f "binary/$INITFS/vmlinuz" ] && ! [ -h "binary/$INITFS/vmlinuz" ]; then
804 ln "binary/$INITFS/vmlinuz" "$PREFIX.kernel"823 ln "binary/$INITFS/vmlinuz" "$PREFIX.kernel"
805 chmod 644 "$PREFIX.kernel"824 chmod 644 "$PREFIX.kernel"
806 else825 else
807 ln -sf "$PREFIX.kernel-$LB_LINUX_FLAVOURS" "$PREFIX.kernel"826 ln -sf "$PREFIX.kernel-$LB_LINUX_FLAVOURS" "$PREFIX.kernel"
808 fi827 fi
809 if [ -e "binary/$INITFS/initrd.lz" ]; then828 if [ -f "binary/$INITFS/initrd.lz" ] && ! [ -h "binary/$INITFS/initrd.lz" ]; then
810 ln "binary/$INITFS/initrd.lz" "$PREFIX.initrd"829 ln "binary/$INITFS/initrd.lz" "$PREFIX.initrd"
811 chmod 644 "$PREFIX.initrd"830 chmod 644 "$PREFIX.initrd"
812 else831 else
@@ -814,36 +833,52 @@
814 fi833 fi
815fi834fi
816835
817if [ "$SUBARCH" = "ac100" ]; then836case $SUBARCH in
818 # create the md5sum and size files for which we are actually doing all this837 ac100)
819 md5sum $PREFIX.rootfs.tar.gz >chroot/installer.md5838 # create the md5sum and size files for which we are actually doing all this
820 wc -c $PREFIX.rootfs.tar.gz >chroot/installer.size839 md5sum $PREFIX.rootfs.tar.gz >chroot/installer.md5
821840 wc -c $PREFIX.rootfs.tar.gz >chroot/installer.size
822 INFO_DESC="$(lsb_release -d -s)"841
823 INFO_STAMP=$(date +20%y%m%d-%H:%M)842 INFO_DESC="$(lsb_release -d -s)"
824843 INFO_STAMP=$(date +20%y%m%d-%H:%M)
825 echo "$INFO_DESC - $ARCH ($INFO_STAMP)" >chroot/media-info844
826845 echo "$INFO_DESC - $ARCH ($INFO_STAMP)" >chroot/media-info
827 # make sure update-initramfs feels cosy and warm in the environment846
828 lb chroot_proc install "$@"847 # make sure update-initramfs feels cosy and warm in the environment
829 lb chroot_sysfs install "$@"848 lb chroot_proc install "$@"
830 lb chroot_devpts install "$@"849 lb chroot_sysfs install "$@"
831850 lb chroot_devpts install "$@"
832 # re-create initrd to contain the installer.md5 file851
833 Chroot chroot "env FLASH_KERNEL_SKIP=1 update-initramfs -k all -t -u -v"852 # re-create initrd to contain the installer.md5 file
834853 Chroot chroot "env FLASH_KERNEL_SKIP=1 update-initramfs -k all -t -u -v"
835 # create boot.img854
836 Chroot chroot "abootimg --create /boot/installer-${KVERS}.img -f /boot/bootimg.cfg-$SUBARCH -r /boot/initrd.img-${KVERS} -k /boot/vmlinuz-${KVERS}"855 # create boot.img
837856 Chroot chroot "abootimg --create /boot/installer-${KVERS}.img -f /boot/bootimg.cfg-$SUBARCH -r /boot/initrd.img-${KVERS} -k /boot/vmlinuz-${KVERS}"
838 # clean up857
839 lb chroot_devpts remove "$@"858 # clean up
840 lb chroot_sysfs remove "$@"859 lb chroot_devpts remove "$@"
841 lb chroot_proc remove "$@"860 lb chroot_sysfs remove "$@"
842861 lb chroot_proc remove "$@"
843 cp "chroot/boot/installer-${KVERS}.img" "$PREFIX.bootimg-$FLAVOUR"862
844 ln -sf "$PREFIX.bootimg-$FLAVOUR" "$PREFIX.bootimg"863 cp "chroot/boot/installer-${KVERS}.img" "$PREFIX.bootimg-$FLAVOUR"
845864 ln -sf "$PREFIX.bootimg-$FLAVOUR" "$PREFIX.bootimg"
846fi865 ;;
866
867 raspi2|raspi3)
868 # copy the kernel and initrd to a predictable directory for
869 # ubuntu-image consumption. In some cases, like in pi2/3
870 # u-boot, the bootloader needs to contain the kernel and initrd,
871 # so during rootfs build we copy it over to a directory that
872 # ubuntu-image looks for and shoves into the bootloader
873 # partition.
874 UBOOT_BOOT="image/boot/uboot"
875
876 mkdir -p $UBOOT_BOOT
877
878 cp $PREFIX.initrd $UBOOT_BOOT/initrd.img || true
879 cp $PREFIX.kernel $UBOOT_BOOT/vmlinuz || true
880 ;;
881esac
847882
848if [ "$PROJECT" = "ubuntu-touch" ] || [ "$PROJECT" = "ubuntu-touch-custom" ]; then883if [ "$PROJECT" = "ubuntu-touch" ] || [ "$PROJECT" = "ubuntu-touch-custom" ]; then
849 sourceslist="chroot/etc/apt/sources.list"884 sourceslist="chroot/etc/apt/sources.list"
850885
=== modified file 'live-build/auto/config'
--- live-build/auto/config 2018-10-24 19:18:36 +0000
+++ live-build/auto/config 2018-11-29 16:44:19 +0000
@@ -175,7 +175,7 @@
175 MODEL=dragonboard ;;175 MODEL=dragonboard ;;
176 armhf+raspi2)176 armhf+raspi2)
177 MODEL=pi2 ;;177 MODEL=pi2 ;;
178 armhf+raspi3)178 armhf+raspi3|arm64+raspi3)
179 MODEL=pi3 ;;179 MODEL=pi3 ;;
180 armhf+cm3)180 armhf+cm3)
181 MODEL=cm3 ;;181 MODEL=cm3 ;;
@@ -184,20 +184,39 @@
184 exit 1184 exit 1
185 ;;185 ;;
186 esac186 esac
187 case $MODEL in187
188 pc-amd64|pc-i386)188 if [ $PROJECT = "ubuntu-core" ]; then
189 UBUNTU_IMAGE_ARGS="--image-size 3700M" ;;189 # snap-based core images
190 *)190
191 UBUNTU_IMAGE_ARGS="" ;;191 case $MODEL in
192 esac192 pc-amd64|pc-i386)
193193 UBUNTU_IMAGE_ARGS="--image-size 3700M" ;;
194 echo "IMAGEFORMAT=$IMAGEFORMAT" >> config/common194 *)
195 echo "UBUNTU_IMAGE_ARGS=\"$UBUNTU_IMAGE_ARGS\"" >> config/common195 UBUNTU_IMAGE_ARGS="" ;;
196 # Store model assertion in top dir to get it picked up later as a build artifact196 esac
197 env SNAPPY_STORE_NO_CDN=1 snap known --remote model series=16 model="$MODEL" brand-id=canonical > "$PREFIX".model-assertion197
198 echo "Configured ubuntu-image for the following model assertion:"198 echo "IMAGEFORMAT=$IMAGEFORMAT" >> config/common
199 cat "$PREFIX".model-assertion199 echo "UBUNTU_IMAGE_ARGS=\"$UBUNTU_IMAGE_ARGS\"" >> config/common
200 echo "----------------------------------------------------------"200 # Store model assertion in top dir to get it picked up later as a build artifact
201 env SNAPPY_STORE_NO_CDN=1 snap known --remote model series=16 model="$MODEL" brand-id=canonical > "$PREFIX".model-assertion
202 echo "Configured ubuntu-image for the following model assertion:"
203 cat "$PREFIX".model-assertion
204 echo "----------------------------------------------------------"
205 else
206 # classic images
207
208 UBUNTU_IMAGE_ARGS=""
209 UBUNTU_IMAGE_ARGS="$UBUNTU_IMAGE_ARGS${PROPOSED:+ --with-proposed}"
210 UBUNTU_IMAGE_ARGS="$UBUNTU_IMAGE_ARGS${EXTRA_PPAS:+ --extra-ppas \"$EXTRA_PPAS\"}"
211
212 git clone git://git.launchpad.net/~canonical-foundations/snap-$MODEL/+git/github-mirror -b classic config/$PREFIX-gadget
213
214 echo "IMAGEFORMAT=$IMAGEFORMAT" >> config/common
215 echo "SUITE=$SUITE" >> config/common
216 echo "UBUNTU_IMAGE_ARGS=\"$UBUNTU_IMAGE_ARGS\"" >> config/common
217
218 echo "Configured ubuntu-image for the following gadget model: $MODEL"
219 fi
201 # Fake finished configuration for lb build220 # Fake finished configuration for lb build
202 mkdir -p .build221 mkdir -p .build
203 touch .build/config222 touch .build/config
@@ -751,7 +770,7 @@
751esac770esac
752771
753case $ARCH in772case $ARCH in
754 armel|armhf)773 armel|armhf|arm64)
755 KERNEL_FLAVOURS="${SUBARCH:-$KERNEL_FLAVOURS}"774 KERNEL_FLAVOURS="${SUBARCH:-$KERNEL_FLAVOURS}"
756 case $SUBARCH in775 case $SUBARCH in
757 dove)776 dove)
@@ -789,6 +808,13 @@
789 add_package install linux-firmware-raspi2 u-boot-rpi flash-kernel u-boot-tools808 add_package install linux-firmware-raspi2 u-boot-rpi flash-kernel u-boot-tools
790 BINARY_REMOVE_LINUX=false809 BINARY_REMOVE_LINUX=false
791 ;;810 ;;
811 raspi3)
812 COMPONENTS='main restricted universe multiverse'
813 KERNEL_FLAVOURS=raspi2
814 add_package install raspi3-firmware u-boot-rpi flash-kernel u-boot-tools
815 BINARY_REMOVE_LINUX=false
816 ;;
817
792 esac818 esac
793 ;;819 ;;
794esac820esac
@@ -854,7 +880,7 @@
854echo "LB_DISTRIBUTION=\"$SUITE\"" >> config/binary880echo "LB_DISTRIBUTION=\"$SUITE\"" >> config/binary
855881
856case $ARCH+$SUBARCH in882case $ARCH+$SUBARCH in
857 armhf+raspi2)883 armhf+raspi2|armhf+raspi3|arm64+raspi3)
858 cat > config/hooks/01-firmware-directory.chroot_early <<EOF884 cat > config/hooks/01-firmware-directory.chroot_early <<EOF
859#!/bin/sh -ex885#!/bin/sh -ex
860mkdir -p /boot/firmware886mkdir -p /boot/firmware

Subscribers

People subscribed via source and target branches