Merge lp:~sil2100/livecd-rootfs/raspi3-u-i-classic into lp:livecd-rootfs

Proposed by Łukasz Zemczak
Status: Merged
Merged at revision: 1723
Proposed branch: lp:~sil2100/livecd-rootfs/raspi3-u-i-classic
Merge into: lp:livecd-rootfs
Prerequisite: lp:~sil2100/livecd-rootfs/dangling-vmlinuz
Diff against target: 113 lines (+50/-31)
3 files modified
debian/changelog (+3/-0)
live-build/auto/build (+46/-30)
live-build/auto/config (+1/-1)
To merge this branch: bzr merge lp:~sil2100/livecd-rootfs/raspi3-u-i-classic
Reviewer Review Type Date Requested Status
Steve Langasek Needs Fixing
Review via email: mp+355185@code.launchpad.net

Commit message

Add support for raspi3 rootfs generation for ubuntu-image consumption with all the additional changes required.

Description of the change

Add support for raspi3 rootfs generation for ubuntu-image consumption with all the additional changes required.

This is based on https://code.launchpad.net/~fo0bar/livecd-rootfs/raspi2-rpi3/+merge/293959 but with only the rootfs bits.

It depends on the dangling-vmlinuz branch.

The additional change for copying the initrd and kernel into image/boot/uboot is to keep 'feature parity' with what snap prepare does when generating the rootfs.

To post a comment you must log in.
1672. By Łukasz Zemczak

Merge latest prerequisite branch

Revision history for this message
Steve Langasek (vorlon) :
review: Needs Information
Revision history for this message
Łukasz Zemczak (sil2100) wrote :

Thanks for the review Steve! So the reason why I added raspi3 even to the deprecated bits was for (possibly unneeded) consistency. As for the duplicated code, this comes from Ryan's original MP but I left it in case I needed to tweak some parts specifically for the pi3. Nothing like that ended up being necessary, so I'll merge those into one thing then.

1673. By Łukasz Zemczak

Merge latest prerequisite branch

1674. By Łukasz Zemczak

Remove unneeded code and code duplication, add comments.

Revision history for this message
Steve Langasek (vorlon) :
review: Needs Fixing
1675. By Łukasz Zemczak

Remove more unneeded raspi3 conditionals.

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-10-30 14:11:49 +0000
3+++ debian/changelog 2018-11-02 08:27:17 +0000
4@@ -10,6 +10,9 @@
5 [ Łukasz 'sil2100' Zemczak ]
6 * Avoid issues of hard-linking to a symbolic vmlinuz as this can lead to a
7 dangling symlink.
8+ * Add support for raspi3 rootfs builds (based on Ryan Finnie).
9+ * For ubuntu-image consumption, export the kernel and initrd to
10+ image/boot/uboot for raspi*.
11
12 -- Łukasz 'sil2100' Zemczak <lukasz.zemczak@ubuntu.com> Tue, 18 Sep 2018 10:21:30 +0200
13
14
15=== modified file 'live-build/auto/build'
16--- live-build/auto/build 2018-10-31 10:17:01 +0000
17+++ live-build/auto/build 2018-11-02 08:27:17 +0000
18@@ -863,36 +863,52 @@
19 fi
20 fi
21
22-if [ "$SUBARCH" = "ac100" ]; then
23- # create the md5sum and size files for which we are actually doing all this
24- md5sum $PREFIX.rootfs.tar.gz >chroot/installer.md5
25- wc -c $PREFIX.rootfs.tar.gz >chroot/installer.size
26-
27- INFO_DESC="$(lsb_release -d -s)"
28- INFO_STAMP=$(date +20%y%m%d-%H:%M)
29-
30- echo "$INFO_DESC - $ARCH ($INFO_STAMP)" >chroot/media-info
31-
32- # make sure update-initramfs feels cosy and warm in the environment
33- lb chroot_proc install "$@"
34- lb chroot_sysfs install "$@"
35- lb chroot_devpts install "$@"
36-
37- # re-create initrd to contain the installer.md5 file
38- Chroot chroot "env FLASH_KERNEL_SKIP=1 update-initramfs -k all -t -u -v"
39-
40- # create boot.img
41- Chroot chroot "abootimg --create /boot/installer-${KVERS}.img -f /boot/bootimg.cfg-$SUBARCH -r /boot/initrd.img-${KVERS} -k /boot/vmlinuz-${KVERS}"
42-
43- # clean up
44- lb chroot_devpts remove "$@"
45- lb chroot_sysfs remove "$@"
46- lb chroot_proc remove "$@"
47-
48- cp "chroot/boot/installer-${KVERS}.img" "$PREFIX.bootimg-$FLAVOUR"
49- ln -sf "$PREFIX.bootimg-$FLAVOUR" "$PREFIX.bootimg"
50-
51-fi
52+case $SUBARCH in
53+ ac100)
54+ # create the md5sum and size files for which we are actually doing all this
55+ md5sum $PREFIX.rootfs.tar.gz >chroot/installer.md5
56+ wc -c $PREFIX.rootfs.tar.gz >chroot/installer.size
57+
58+ INFO_DESC="$(lsb_release -d -s)"
59+ INFO_STAMP=$(date +20%y%m%d-%H:%M)
60+
61+ echo "$INFO_DESC - $ARCH ($INFO_STAMP)" >chroot/media-info
62+
63+ # make sure update-initramfs feels cosy and warm in the environment
64+ lb chroot_proc install "$@"
65+ lb chroot_sysfs install "$@"
66+ lb chroot_devpts install "$@"
67+
68+ # re-create initrd to contain the installer.md5 file
69+ Chroot chroot "env FLASH_KERNEL_SKIP=1 update-initramfs -k all -t -u -v"
70+
71+ # create boot.img
72+ Chroot chroot "abootimg --create /boot/installer-${KVERS}.img -f /boot/bootimg.cfg-$SUBARCH -r /boot/initrd.img-${KVERS} -k /boot/vmlinuz-${KVERS}"
73+
74+ # clean up
75+ lb chroot_devpts remove "$@"
76+ lb chroot_sysfs remove "$@"
77+ lb chroot_proc remove "$@"
78+
79+ cp "chroot/boot/installer-${KVERS}.img" "$PREFIX.bootimg-$FLAVOUR"
80+ ln -sf "$PREFIX.bootimg-$FLAVOUR" "$PREFIX.bootimg"
81+ ;;
82+
83+ raspi2|raspi3)
84+ # copy the kernel and initrd to a predictable directory for
85+ # ubuntu-image consumption. In some cases, like in pi2/3
86+ # u-boot, the bootloader needs to contain the kernel and initrd,
87+ # so during rootfs build we copy it over to a directory that
88+ # ubuntu-image looks for and shoves into the bootloader
89+ # partition.
90+ UBOOT_BOOT="image/boot/uboot"
91+
92+ mkdir -p $UBOOT_BOOT
93+
94+ cp $PREFIX.initrd $UBOOT_BOOT/initrd.img || true
95+ cp $PREFIX.kernel $UBOOT_BOOT/vmlinuz || true
96+ ;;
97+esac
98
99 if [ "$PROJECT" = "ubuntu-touch" ] || [ "$PROJECT" = "ubuntu-touch-custom" ]; then
100 sourceslist="chroot/etc/apt/sources.list"
101
102=== modified file 'live-build/auto/config'
103--- live-build/auto/config 2018-10-22 17:21:50 +0000
104+++ live-build/auto/config 2018-11-02 08:27:17 +0000
105@@ -801,7 +801,7 @@
106 add_package live ac100-tarball-installer
107 BINARY_REMOVE_LINUX=false
108 ;;
109- raspi2)
110+ raspi2|raspi3)
111 COMPONENTS='main restricted universe multiverse'
112 add_package install linux-firmware-raspi2 u-boot-rpi flash-kernel u-boot-tools
113 BINARY_REMOVE_LINUX=false

Subscribers

People subscribed via source and target branches