Merge lp:~sil2100/livecd-rootfs/bionic-raspi3-backport into lp:~ubuntu-core-dev/livecd-rootfs/bionic-proposed
- bionic-raspi3-backport
- Merge into 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 |
Related bugs: |
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 : | # |
Preview Diff
[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1 | === modified file 'debian/changelog' | |||
2 | --- debian/changelog 2018-11-26 20:55:29 +0000 | |||
3 | +++ debian/changelog 2018-11-29 16:44:19 +0000 | |||
4 | @@ -1,3 +1,20 @@ | |||
5 | 1 | livecd-rootfs (2.525.11) UNRELEASED; urgency=medium | ||
6 | 2 | |||
7 | 3 | * Backport all the required changes to enable Raspberry Pi 3 armhf and arm64 | ||
8 | 4 | preinstalled image builds. (LP: #1805668) | ||
9 | 5 | - Add support for raspi3 rootfs builds (based on Ryan Finnie's changes). | ||
10 | 6 | - For ubuntu-image consumption, export the kernel and initrd to | ||
11 | 7 | image/boot/uboot for raspi*. | ||
12 | 8 | - Avoid issues of hard-linking to a symbolic vmlinuz as this can lead to a | ||
13 | 9 | dangling symlink. | ||
14 | 10 | - Add raspi3 arm64 rootfs build support. | ||
15 | 11 | - Add git to the build dependencies for the gadget tree pull. | ||
16 | 12 | - Minor fixes to raspi3 builds: add arm64+raspi3 to the supported model | ||
17 | 13 | list, pass SUITE on to the build stage and use the git:// url for the | ||
18 | 14 | gadget tree. | ||
19 | 15 | |||
20 | 16 | -- Łukasz 'sil2100' Zemczak <lukasz.zemczak@ubuntu.com> Thu, 29 Nov 2018 16:24:23 +0100 | ||
21 | 17 | |||
22 | 1 | livecd-rootfs (2.525.10) bionic; urgency=medium | 18 | livecd-rootfs (2.525.10) bionic; urgency=medium |
23 | 2 | 19 | ||
24 | 3 | [ Cody Shepherd ] | 20 | [ Cody Shepherd ] |
25 | 4 | 21 | ||
26 | === modified file 'debian/control' | |||
27 | --- debian/control 2018-10-26 21:01:17 +0000 | |||
28 | +++ debian/control 2018-11-29 16:44:19 +0000 | |||
29 | @@ -17,12 +17,14 @@ | |||
30 | 17 | gdisk, | 17 | gdisk, |
31 | 18 | genisoimage, | 18 | genisoimage, |
32 | 19 | germinate (>= 1.25.1), | 19 | germinate (>= 1.25.1), |
33 | 20 | git, | ||
34 | 20 | gnupg, | 21 | gnupg, |
35 | 21 | grep-dctrl, | 22 | grep-dctrl, |
36 | 22 | kpartx, | 23 | kpartx, |
37 | 23 | live-build (>= 3.0~a57-1ubuntu31~), | 24 | live-build (>= 3.0~a57-1ubuntu31~), |
38 | 24 | lsb-release, | 25 | lsb-release, |
39 | 25 | lzma, | 26 | lzma, |
40 | 27 | make, | ||
41 | 26 | parted, | 28 | parted, |
42 | 27 | procps, | 29 | procps, |
43 | 28 | python-minimal | python, | 30 | python-minimal | python, |
44 | @@ -32,6 +34,7 @@ | |||
45 | 32 | snapd, | 34 | snapd, |
46 | 33 | squashfs-tools (>= 1:3.3-1), | 35 | squashfs-tools (>= 1:3.3-1), |
47 | 34 | sudo, | 36 | sudo, |
48 | 37 | u-boot-tools [armhf arm64], | ||
49 | 35 | ubuntu-image, | 38 | ubuntu-image, |
50 | 36 | vmdk-stream-converter [amd64 i386], | 39 | vmdk-stream-converter [amd64 i386], |
51 | 37 | xz-utils, | 40 | xz-utils, |
52 | 38 | 41 | ||
53 | === modified file 'live-build/auto/build' | |||
54 | --- live-build/auto/build 2018-08-27 22:32:07 +0000 | |||
55 | +++ live-build/auto/build 2018-11-29 16:44:19 +0000 | |||
56 | @@ -23,12 +23,31 @@ | |||
57 | 23 | if [ "${IMAGEFORMAT:-}" = "ubuntu-image" ]; then | 23 | if [ "${IMAGEFORMAT:-}" = "ubuntu-image" ]; then |
58 | 24 | # Use ubuntu-image instead of live-build | 24 | # Use ubuntu-image instead of live-build |
59 | 25 | 25 | ||
66 | 26 | CHANNEL="${CHANNEL:-edge}" | 26 | if [ "$PROJECT" = "ubuntu-core"]; then |
67 | 27 | env SNAPPY_STORE_NO_CDN=1 \ | 27 | CHANNEL="${CHANNEL:-edge}" |
68 | 28 | ubuntu-image -c "$CHANNEL" $UBUNTU_IMAGE_ARGS \ | 28 | env SNAPPY_STORE_NO_CDN=1 \ |
69 | 29 | -o "$PREFIX".img "$PREFIX".model-assertion | 29 | ubuntu-image snap -c "$CHANNEL" $UBUNTU_IMAGE_ARGS \ |
70 | 30 | xz -0 -T4 "$PREFIX".img | 30 | -O output "$PREFIX".model-assertion |
71 | 31 | mv seed.manifest "$PREFIX".manifest | 31 | # XXX: currently we only have one image generated, but really |
72 | 32 | # we should be supporting more than one for models that | ||
73 | 33 | # define those. | ||
74 | 34 | mv output/*.img "$PREFIX".img | ||
75 | 35 | xz -0 -T4 "$PREFIX".img | ||
76 | 36 | mv output/seed.manifest "$PREFIX".manifest | ||
77 | 37 | else | ||
78 | 38 | # First we need to build the gadget tree | ||
79 | 39 | make -C "config/$PREFIX-gadget" ARCH=$ARCH SERIES=$SUITE | ||
80 | 40 | ubuntu-image classic $UBUNTU_IMAGE_ARGS \ | ||
81 | 41 | -s $SUITE -p $PROJECT -a $ARCH --subarch $SUBARCH \ | ||
82 | 42 | -O output config/$PREFIX-gadget/install | ||
83 | 43 | # XXX: currently we only have one image generated, but really | ||
84 | 44 | # we should be supporting more than one for models that | ||
85 | 45 | # define those. | ||
86 | 46 | mv output/*.img "$PREFIX".img | ||
87 | 47 | xz -0 -T4 "$PREFIX".img | ||
88 | 48 | mv output/filesystem.manifest "$PREFIX".manifest | ||
89 | 49 | fi | ||
90 | 50 | |||
91 | 32 | exit 0 | 51 | exit 0 |
92 | 33 | fi | 52 | fi |
93 | 34 | 53 | ||
94 | @@ -800,13 +819,13 @@ | |||
95 | 800 | NUMFLAVOURS="$(set -- $LB_LINUX_FLAVOURS; echo $#)" | 819 | NUMFLAVOURS="$(set -- $LB_LINUX_FLAVOURS; echo $#)" |
96 | 801 | if [ "$NUMFLAVOURS" = 1 ] && [ "$LB_LINUX_FLAVOURS" != "none" ]; then | 820 | if [ "$NUMFLAVOURS" = 1 ] && [ "$LB_LINUX_FLAVOURS" != "none" ]; then |
97 | 802 | # only one kernel flavour | 821 | # only one kernel flavour |
99 | 803 | if [ -e "binary/$INITFS/vmlinuz" ]; then | 822 | if [ -f "binary/$INITFS/vmlinuz" ] && ! [ -h "binary/$INITFS/vmlinuz" ]; then |
100 | 804 | ln "binary/$INITFS/vmlinuz" "$PREFIX.kernel" | 823 | ln "binary/$INITFS/vmlinuz" "$PREFIX.kernel" |
101 | 805 | chmod 644 "$PREFIX.kernel" | 824 | chmod 644 "$PREFIX.kernel" |
102 | 806 | else | 825 | else |
103 | 807 | ln -sf "$PREFIX.kernel-$LB_LINUX_FLAVOURS" "$PREFIX.kernel" | 826 | ln -sf "$PREFIX.kernel-$LB_LINUX_FLAVOURS" "$PREFIX.kernel" |
104 | 808 | fi | 827 | fi |
106 | 809 | if [ -e "binary/$INITFS/initrd.lz" ]; then | 828 | if [ -f "binary/$INITFS/initrd.lz" ] && ! [ -h "binary/$INITFS/initrd.lz" ]; then |
107 | 810 | ln "binary/$INITFS/initrd.lz" "$PREFIX.initrd" | 829 | ln "binary/$INITFS/initrd.lz" "$PREFIX.initrd" |
108 | 811 | chmod 644 "$PREFIX.initrd" | 830 | chmod 644 "$PREFIX.initrd" |
109 | 812 | else | 831 | else |
110 | @@ -814,36 +833,52 @@ | |||
111 | 814 | fi | 833 | fi |
112 | 815 | fi | 834 | fi |
113 | 816 | 835 | ||
144 | 817 | if [ "$SUBARCH" = "ac100" ]; then | 836 | case $SUBARCH in |
145 | 818 | # create the md5sum and size files for which we are actually doing all this | 837 | ac100) |
146 | 819 | md5sum $PREFIX.rootfs.tar.gz >chroot/installer.md5 | 838 | # create the md5sum and size files for which we are actually doing all this |
147 | 820 | wc -c $PREFIX.rootfs.tar.gz >chroot/installer.size | 839 | md5sum $PREFIX.rootfs.tar.gz >chroot/installer.md5 |
148 | 821 | 840 | wc -c $PREFIX.rootfs.tar.gz >chroot/installer.size | |
149 | 822 | INFO_DESC="$(lsb_release -d -s)" | 841 | |
150 | 823 | INFO_STAMP=$(date +20%y%m%d-%H:%M) | 842 | INFO_DESC="$(lsb_release -d -s)" |
151 | 824 | 843 | INFO_STAMP=$(date +20%y%m%d-%H:%M) | |
152 | 825 | echo "$INFO_DESC - $ARCH ($INFO_STAMP)" >chroot/media-info | 844 | |
153 | 826 | 845 | echo "$INFO_DESC - $ARCH ($INFO_STAMP)" >chroot/media-info | |
154 | 827 | # make sure update-initramfs feels cosy and warm in the environment | 846 | |
155 | 828 | lb chroot_proc install "$@" | 847 | # make sure update-initramfs feels cosy and warm in the environment |
156 | 829 | lb chroot_sysfs install "$@" | 848 | lb chroot_proc install "$@" |
157 | 830 | lb chroot_devpts install "$@" | 849 | lb chroot_sysfs install "$@" |
158 | 831 | 850 | lb chroot_devpts install "$@" | |
159 | 832 | # re-create initrd to contain the installer.md5 file | 851 | |
160 | 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 |
161 | 834 | 853 | Chroot chroot "env FLASH_KERNEL_SKIP=1 update-initramfs -k all -t -u -v" | |
162 | 835 | # create boot.img | 854 | |
163 | 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 |
164 | 837 | 856 | Chroot chroot "abootimg --create /boot/installer-${KVERS}.img -f /boot/bootimg.cfg-$SUBARCH -r /boot/initrd.img-${KVERS} -k /boot/vmlinuz-${KVERS}" | |
165 | 838 | # clean up | 857 | |
166 | 839 | lb chroot_devpts remove "$@" | 858 | # clean up |
167 | 840 | lb chroot_sysfs remove "$@" | 859 | lb chroot_devpts remove "$@" |
168 | 841 | lb chroot_proc remove "$@" | 860 | lb chroot_sysfs remove "$@" |
169 | 842 | 861 | lb chroot_proc remove "$@" | |
170 | 843 | cp "chroot/boot/installer-${KVERS}.img" "$PREFIX.bootimg-$FLAVOUR" | 862 | |
171 | 844 | ln -sf "$PREFIX.bootimg-$FLAVOUR" "$PREFIX.bootimg" | 863 | cp "chroot/boot/installer-${KVERS}.img" "$PREFIX.bootimg-$FLAVOUR" |
172 | 845 | 864 | ln -sf "$PREFIX.bootimg-$FLAVOUR" "$PREFIX.bootimg" | |
173 | 846 | fi | 865 | ;; |
174 | 866 | |||
175 | 867 | raspi2|raspi3) | ||
176 | 868 | # copy the kernel and initrd to a predictable directory for | ||
177 | 869 | # ubuntu-image consumption. In some cases, like in pi2/3 | ||
178 | 870 | # u-boot, the bootloader needs to contain the kernel and initrd, | ||
179 | 871 | # so during rootfs build we copy it over to a directory that | ||
180 | 872 | # ubuntu-image looks for and shoves into the bootloader | ||
181 | 873 | # partition. | ||
182 | 874 | UBOOT_BOOT="image/boot/uboot" | ||
183 | 875 | |||
184 | 876 | mkdir -p $UBOOT_BOOT | ||
185 | 877 | |||
186 | 878 | cp $PREFIX.initrd $UBOOT_BOOT/initrd.img || true | ||
187 | 879 | cp $PREFIX.kernel $UBOOT_BOOT/vmlinuz || true | ||
188 | 880 | ;; | ||
189 | 881 | esac | ||
190 | 847 | 882 | ||
191 | 848 | if [ "$PROJECT" = "ubuntu-touch" ] || [ "$PROJECT" = "ubuntu-touch-custom" ]; then | 883 | if [ "$PROJECT" = "ubuntu-touch" ] || [ "$PROJECT" = "ubuntu-touch-custom" ]; then |
192 | 849 | sourceslist="chroot/etc/apt/sources.list" | 884 | sourceslist="chroot/etc/apt/sources.list" |
193 | 850 | 885 | ||
194 | === modified file 'live-build/auto/config' | |||
195 | --- live-build/auto/config 2018-10-24 19:18:36 +0000 | |||
196 | +++ live-build/auto/config 2018-11-29 16:44:19 +0000 | |||
197 | @@ -175,7 +175,7 @@ | |||
198 | 175 | MODEL=dragonboard ;; | 175 | MODEL=dragonboard ;; |
199 | 176 | armhf+raspi2) | 176 | armhf+raspi2) |
200 | 177 | MODEL=pi2 ;; | 177 | MODEL=pi2 ;; |
202 | 178 | armhf+raspi3) | 178 | armhf+raspi3|arm64+raspi3) |
203 | 179 | MODEL=pi3 ;; | 179 | MODEL=pi3 ;; |
204 | 180 | armhf+cm3) | 180 | armhf+cm3) |
205 | 181 | MODEL=cm3 ;; | 181 | MODEL=cm3 ;; |
206 | @@ -184,20 +184,39 @@ | |||
207 | 184 | exit 1 | 184 | exit 1 |
208 | 185 | ;; | 185 | ;; |
209 | 186 | esac | 186 | esac |
224 | 187 | case $MODEL in | 187 | |
225 | 188 | pc-amd64|pc-i386) | 188 | if [ $PROJECT = "ubuntu-core" ]; then |
226 | 189 | UBUNTU_IMAGE_ARGS="--image-size 3700M" ;; | 189 | # snap-based core images |
227 | 190 | *) | 190 | |
228 | 191 | UBUNTU_IMAGE_ARGS="" ;; | 191 | case $MODEL in |
229 | 192 | esac | 192 | pc-amd64|pc-i386) |
230 | 193 | 193 | UBUNTU_IMAGE_ARGS="--image-size 3700M" ;; | |
231 | 194 | echo "IMAGEFORMAT=$IMAGEFORMAT" >> config/common | 194 | *) |
232 | 195 | echo "UBUNTU_IMAGE_ARGS=\"$UBUNTU_IMAGE_ARGS\"" >> config/common | 195 | UBUNTU_IMAGE_ARGS="" ;; |
233 | 196 | # Store model assertion in top dir to get it picked up later as a build artifact | 196 | esac |
234 | 197 | env SNAPPY_STORE_NO_CDN=1 snap known --remote model series=16 model="$MODEL" brand-id=canonical > "$PREFIX".model-assertion | 197 | |
235 | 198 | echo "Configured ubuntu-image for the following model assertion:" | 198 | echo "IMAGEFORMAT=$IMAGEFORMAT" >> config/common |
236 | 199 | cat "$PREFIX".model-assertion | 199 | echo "UBUNTU_IMAGE_ARGS=\"$UBUNTU_IMAGE_ARGS\"" >> config/common |
237 | 200 | echo "----------------------------------------------------------" | 200 | # Store model assertion in top dir to get it picked up later as a build artifact |
238 | 201 | env SNAPPY_STORE_NO_CDN=1 snap known --remote model series=16 model="$MODEL" brand-id=canonical > "$PREFIX".model-assertion | ||
239 | 202 | echo "Configured ubuntu-image for the following model assertion:" | ||
240 | 203 | cat "$PREFIX".model-assertion | ||
241 | 204 | echo "----------------------------------------------------------" | ||
242 | 205 | else | ||
243 | 206 | # classic images | ||
244 | 207 | |||
245 | 208 | UBUNTU_IMAGE_ARGS="" | ||
246 | 209 | UBUNTU_IMAGE_ARGS="$UBUNTU_IMAGE_ARGS${PROPOSED:+ --with-proposed}" | ||
247 | 210 | UBUNTU_IMAGE_ARGS="$UBUNTU_IMAGE_ARGS${EXTRA_PPAS:+ --extra-ppas \"$EXTRA_PPAS\"}" | ||
248 | 211 | |||
249 | 212 | git clone git://git.launchpad.net/~canonical-foundations/snap-$MODEL/+git/github-mirror -b classic config/$PREFIX-gadget | ||
250 | 213 | |||
251 | 214 | echo "IMAGEFORMAT=$IMAGEFORMAT" >> config/common | ||
252 | 215 | echo "SUITE=$SUITE" >> config/common | ||
253 | 216 | echo "UBUNTU_IMAGE_ARGS=\"$UBUNTU_IMAGE_ARGS\"" >> config/common | ||
254 | 217 | |||
255 | 218 | echo "Configured ubuntu-image for the following gadget model: $MODEL" | ||
256 | 219 | fi | ||
257 | 201 | # Fake finished configuration for lb build | 220 | # Fake finished configuration for lb build |
258 | 202 | mkdir -p .build | 221 | mkdir -p .build |
259 | 203 | touch .build/config | 222 | touch .build/config |
260 | @@ -751,7 +770,7 @@ | |||
261 | 751 | esac | 770 | esac |
262 | 752 | 771 | ||
263 | 753 | case $ARCH in | 772 | case $ARCH in |
265 | 754 | armel|armhf) | 773 | armel|armhf|arm64) |
266 | 755 | KERNEL_FLAVOURS="${SUBARCH:-$KERNEL_FLAVOURS}" | 774 | KERNEL_FLAVOURS="${SUBARCH:-$KERNEL_FLAVOURS}" |
267 | 756 | case $SUBARCH in | 775 | case $SUBARCH in |
268 | 757 | dove) | 776 | dove) |
269 | @@ -789,6 +808,13 @@ | |||
270 | 789 | add_package install linux-firmware-raspi2 u-boot-rpi flash-kernel u-boot-tools | 808 | add_package install linux-firmware-raspi2 u-boot-rpi flash-kernel u-boot-tools |
271 | 790 | BINARY_REMOVE_LINUX=false | 809 | BINARY_REMOVE_LINUX=false |
272 | 791 | ;; | 810 | ;; |
273 | 811 | raspi3) | ||
274 | 812 | COMPONENTS='main restricted universe multiverse' | ||
275 | 813 | KERNEL_FLAVOURS=raspi2 | ||
276 | 814 | add_package install raspi3-firmware u-boot-rpi flash-kernel u-boot-tools | ||
277 | 815 | BINARY_REMOVE_LINUX=false | ||
278 | 816 | ;; | ||
279 | 817 | |||
280 | 792 | esac | 818 | esac |
281 | 793 | ;; | 819 | ;; |
282 | 794 | esac | 820 | esac |
283 | @@ -854,7 +880,7 @@ | |||
284 | 854 | echo "LB_DISTRIBUTION=\"$SUITE\"" >> config/binary | 880 | echo "LB_DISTRIBUTION=\"$SUITE\"" >> config/binary |
285 | 855 | 881 | ||
286 | 856 | case $ARCH+$SUBARCH in | 882 | case $ARCH+$SUBARCH in |
288 | 857 | armhf+raspi2) | 883 | armhf+raspi2|armhf+raspi3|arm64+raspi3) |
289 | 858 | cat > config/hooks/01-firmware-directory.chroot_early <<EOF | 884 | cat > config/hooks/01-firmware-directory.chroot_early <<EOF |
290 | 859 | #!/bin/sh -ex | 885 | #!/bin/sh -ex |
291 | 860 | mkdir -p /boot/firmware | 886 | mkdir -p /boot/firmware |
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..!