Merge lp:~sil2100/livecd-rootfs/pocket-desktop into lp:livecd-rootfs

Proposed by Łukasz Zemczak on 2015-09-17
Status: Merged
Merged at revision: 1206
Proposed branch: lp:~sil2100/livecd-rootfs/pocket-desktop
Merge into: lp:livecd-rootfs
Diff against target: 100 lines (+21/-13)
2 files modified
live-build/auto/build (+9/-7)
live-build/auto/config (+12/-6)
To merge this branch: bzr merge lp:~sil2100/livecd-rootfs/pocket-desktop
Reviewer Review Type Date Requested Status
Colin Watson Approve on 2015-09-21
Michael Vogt 2015-09-17 Approve on 2015-09-21
Łukasz Zemczak Needs Fixing on 2015-09-18
Review via email: mp+271448@code.launchpad.net

Commit Message

Add support for pocket-desktop. We do this through SUBPROJECT right now as adding a new project would require modifying multiple lines and copy-pasting the whole hook list - which is complete boilerplate and makes maintenance troublesome, as any change to ubuntu-touch hooks would have to be duplicated in ubuntu-pd (symlinks don't work).

Description of the Change

Add support for pocket-desktop. We do this through SUBPROJECT right now as adding a new project would require modifying multiple lines and copy-pasting the whole hook list - which is complete boilerplate and makes maintenance troublesome, as any change to ubuntu-touch hooks would have to be duplicated in ubuntu-pd (symlinks don't work).

Steve said he would prefer to have it as a separate project, and I can surely make it a separate project, but... It would pain me very much to add so much unnecessary changes for something that can be done with a 3 line diff with SUBPROJECT. I leave it up to the reviewers.

Another reason to keep it as a subproject: if we add a new project, we need to modify cdimage code. Subprojects do not require any real changes.

To post a comment you must log in.
Łukasz Zemczak (sil2100) wrote :

I know I already had a similar branch before and marked it as rejected, but now I want to re-try a similar approach just with the meta-package instead.

I can change it to doing a separate project (like ubuntu-touch) if the reviewers decide it's a better choice.

Łukasz Zemczak (sil2100) wrote :

From what I saw in the ubuntu-cdimage code, it seems that new subprojects are handled automatically, simply using everything from the base project + appending the subproject name. I wonder if I saw that right. Anyway, if yes, then that's another good reason for using subproject.

Michael Vogt (mvo) wrote :

I'm ok with this change, I would rather see a two lines diff like this than to duplicate all the boilerplate. If it turns out to be a problem we can always revert these two lines here and revert to the full project.

review: Approve
1206. By Łukasz Zemczak on 2015-09-18

Fix indent

Colin Watson (cjwatson) wrote :

I can see why this looks tempting, but it's going to cause a lot of problems in cdimage. We have a hardwired assumption there that subprojects are only used for a very few things, and that they always have a different image type from the master project (so ubuntu-core/system-image gets away with it at the publication level because it's daily-preinstalled rather than daily). That isn't the case here. I realise that a separate project is a much larger diff, but hopefully it's largely mechanical, and it would avoid getting into trouble in cdimage.

Colin Watson (cjwatson) wrote :

Also, symlinking the whole directory will work fine. Symlinking individual files might not, but that could easily be fixed by changing "cp -af" to "cp -Rf --preserve=all".

Michael Vogt (mvo) wrote :

Ok, thanks for explaining the underlying issue(s).

review: Abstain
Łukasz Zemczak (sil2100) wrote :

ACK! After discussion with Colin I can see the possible problems, changing to the project approach. I'll use a symlink and hope for the best ;)

review: Needs Fixing
1207. By Łukasz Zemczak on 2015-09-18

Switch to the project approach, add a symlink for the hooks

Michael Vogt (mvo) wrote :

Looks good.

review: Approve
Colin Watson (cjwatson) wrote :

Mostly looks OK, but I think the metapackage handling needs to be fixed. See below.

review: Approve
1208. By Łukasz Zemczak on 2015-09-21

As suggested by Colin, first add the meta packages, then the other deps.

1209. By Łukasz Zemczak on 2015-09-21

Install the meta package as part of one add_package install call.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'live-build/auto/build'
2--- live-build/auto/build 2015-08-12 10:19:01 +0000
3+++ live-build/auto/build 2015-09-21 14:01:16 +0000
4@@ -238,11 +238,13 @@
5 > chroot/etc/apt/sources.list
6 rm chroot/etc/apt/sources.list.preinstall chroot/etc/apt/sources.list.orig
7 fi
8- if [ "$PROJECT" = "ubuntu-touch" ] && [ "$ARCH" = "armhf" ]; then
9- INFO_DESC="$(lsb_release -d -s)"
10- echo "$INFO_DESC - $ARCH ($BUILDSTAMP)" >chroot/etc/media-info
11- mkdir -p chroot/var/log/installer
12- Chroot chroot "ln -s /etc/media-info /var/log/installer/media-info"
13+ if [ "$PROJECT" = "ubuntu-touch" ] || [ "$PROJECT" = "ubuntu-pd" ]; then
14+ if [ "$ARCH" = "armhf" ]; then
15+ INFO_DESC="$(lsb_release -d -s)"
16+ echo "$INFO_DESC - $ARCH ($BUILDSTAMP)" >chroot/etc/media-info
17+ mkdir -p chroot/var/log/installer
18+ Chroot chroot "ln -s /etc/media-info /var/log/installer/media-info"
19+ fi
20 fi
21 if [ "$PROJECT" = "ubuntu-cpc" ]; then
22 cat > chroot/etc/apt/sources.list << EOF
23@@ -313,7 +315,7 @@
24 cp -a binary-tar.tar.gz "$PREFIX.rootfs.tar.gz"
25 fi
26
27-if [ "$PROJECT" = "ubuntu-touch" ]; then
28+if [ "$PROJECT" = "ubuntu-touch" ] || [ "$PROJECT" = "ubuntu-pd" ]; then
29 (cd "binary/$INITFS/custom.dir/" && tar -c *) | \
30 gzip -9 --rsyncable > "$PREFIX.custom.tar.gz"
31 chmod 644 "$PREFIX.custom.tar.gz"
32@@ -436,7 +438,7 @@
33
34 fi
35
36-if [ "$PROJECT" = "ubuntu-touch" ]; then
37+if [ "$PROJECT" = "ubuntu-touch" ] || [ "$PROJECT" = "ubuntu-pd" ]; then
38 sourceslist="chroot/etc/apt/sources.list"
39
40 lb chroot_proc install "$@"
41
42=== modified file 'live-build/auto/config'
43--- live-build/auto/config 2015-09-17 22:17:52 +0000
44+++ live-build/auto/config 2015-09-21 14:01:16 +0000
45@@ -129,7 +129,7 @@
46
47 *)
48 case $PROJECT in
49- ubuntu-server|ubuntu-touch)
50+ ubuntu-server|ubuntu-touch|ubuntu-pd)
51 ;;
52 *)
53 add_package live lupin-casper
54@@ -162,7 +162,7 @@
55 ubuntu-server)
56 add_package live oem-config-debconf ubiquity-frontend-debconf
57 ;;
58- ubuntu-core|base|ubuntu-touch|ubuntu-cpc|ubuntu-desktop-next)
59+ ubuntu-core|base|ubuntu-touch|ubuntu-pd|ubuntu-cpc|ubuntu-desktop-next)
60 ;;
61 *)
62 add_package live oem-config-gtk ubiquity-frontend-gtk
63@@ -420,8 +420,14 @@
64 OPTS="${OPTS:+$OPTS }--bootstrap-flavour=minimal"
65 ;;
66
67- ubuntu-touch)
68- add_package install ubuntu-minimal ubuntu-touch systemd-sysv- packagekit ubuntu-system-settings-online-accounts
69+ ubuntu-touch|ubuntu-pd)
70+ if [ "$PROJECT" = "ubuntu-touch" ]; then
71+ meta_package=ubuntu-touch
72+ else
73+ meta_package=ubuntu-pocket-desktop
74+ fi
75+ add_package install ubuntu-minimal $meta_package systemd-sysv- packagekit ubuntu-system-settings-online-accounts
76+
77 COMPONENTS='main restricted universe'
78 BOOTAPPEND_LIVE='hostname=ubuntu-phablet username=ubuntu'
79 export LB_BOOTSTRAP_INCLUDE='apt-transport-https gnupg'
80@@ -524,7 +530,7 @@
81 esac
82
83 case $PROJECT in
84- ubuntu-server|ubuntu-core|ubuntu-touch)
85+ ubuntu-server|ubuntu-core|ubuntu-touch|ubuntu-pd)
86 case $SUBPROJECT in
87 system-image)
88 # keep the kernel for the system-image build
89@@ -665,7 +671,7 @@
90 fi
91 ;;
92
93- ubuntu-touch:*|ubuntu-core:system-image|ubuntu-desktop-next:system-image|ubuntu-cpc:*)
94+ ubuntu-touch:*|ubuntu-pd:*|ubuntu-core:system-image|ubuntu-desktop-next:system-image|ubuntu-cpc:*)
95 cp -af /usr/share/livecd-rootfs/live-build/${PROJECT}/* \
96 config/
97 ;;
98
99=== added symlink 'live-build/ubuntu-pd'
100=== target is u'ubuntu-touch/'

Subscribers

People subscribed via source and target branches