Merge lp:~dannf/ubuntu/wily/grub2-signed/arm64-support into lp:ubuntu/wily/grub2-signed

Proposed by dann frazier
Status: Merged
Merge reported by: Adam Conrad
Merged at revision: not available
Proposed branch: lp:~dannf/ubuntu/wily/grub2-signed/arm64-support
Merge into: lp:ubuntu/wily/grub2-signed
Diff against target: 160 lines (+66/-15)
5 files modified
Makefile (+20/-5)
debian/changelog (+7/-0)
debian/control (+19/-1)
debian/rules (+7/-3)
download-grub2 (+13/-6)
To merge this branch: bzr merge lp:~dannf/ubuntu/wily/grub2-signed/arm64-support
Reviewer Review Type Date Requested Status
Adam Conrad (community) Approve
dann frazier Needs Resubmitting
Mathieu Trudel-Lapierre Approve
Review via email: mp+259667@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Mathieu Trudel-Lapierre (cyphermox) wrote :

Looks appropriate; but will obviously explode unless grub2 already builds the new grub-efi-arm64 package, and so needs to wait to be merged/uploaded until after it.

It's up to you whether you want to fixup changelog now or wait until grub2 is ready as well; since it's a requirement to upload grub2-signed with grub2 anyway, we can do the changelog fixes just before merging.

review: Approve
Revision history for this message
dann frazier (dannf) wrote :

Sorry, can you elaborate on what you mean by "fixup changelog" - just going UNRELEASED->wily?

Also, I should note that this will also require a control file update to make the grub2 versioned build-deps match the version of grub2 that eventually gets uploaded w/ arm64 image support.

Revision history for this message
Adam Conrad (adconrad) wrote :

You should never use "dpkg --print-architecture" to determine the arch you're building FOR. What you're looking for (in both places) is dpkg-architecture -qDEB_HOST_ARCH

Other oddities:

1) Why do we need .install files when we didn't seem to before?
2) symlinking to arch-specific bits in clean doesn't seem clever, you'll get different source cruft depending on the arch you clean/upload on.

review: Needs Fixing
49. By dann frazier

Use 'dpkg-architecture -qDEB_HOST_ARCH' instead of dpkg --print-architecture

Correctly identifies the architecture of the host we are building for vs.
the host we happen to be building on.

50. By dann frazier

Stop doing postinst symlink generation during clean.

Just include all necessary symlinks to avoid different source package contents
when generated on different architectures.

51. By dann frazier

Override destdir during install instead of adding .install files

Revision history for this message
dann frazier (dannf) wrote :

> You should never use "dpkg --print-architecture" to determine the arch you're
> building FOR. What you're looking for (in both places) is dpkg-architecture
> -qDEB_HOST_ARCH

Fixed.

> Other oddities:
>
> 1) Why do we need .install files when we didn't seem to before?

It is just how I chose to handle the single-binary -> multi-binary conversion. But it does seem like a pain to have to add that file for every new architecture. I switched this to just overriding destdir during install.

> 2) symlinking to arch-specific bits in clean doesn't seem clever, you'll get
> different source cruft depending on the arch you clean/upload on.

Fixed.

review: Needs Resubmitting
52. By dann frazier

Use dpkg built-in make snippet instead of populating variables manually

53. By dann frazier

Merge lp:ubuntu/grub2-signed

54. By dann frazier

Merge lp:ubuntu/grub2-signed

55. By dann frazier

Rebuild against grub-efi-amd64 2.02~beta2-26ubuntu4.

Revision history for this message
Adam Conrad (adconrad) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'Makefile'
2--- Makefile 2013-09-12 17:14:41 +0000
3+++ Makefile 2015-07-22 17:23:13 +0000
4@@ -1,7 +1,22 @@
5+include /usr/share/dpkg/default.mk
6+
7+PLATFORM := UNKNOWN-PLATFORM
8+EFI_NAME := UNKNOWN-EFI-NAME
9+
10+ifeq ($(DEB_HOST_ARCH),amd64)
11+PLATFORM := x86_64-efi
12+EFI_NAME := x64
13+endif
14+
15+ifeq ($(DEB_HOST_ARCH),arm64)
16+PLATFORM := arm64-efi
17+EFI_NAME := aa64
18+endif
19+
20 SIGNED := \
21- grubx64.efi.signed \
22- gcdx64.efi.signed \
23- grubnetx64.efi.signed
24+ grub$(EFI_NAME).efi.signed \
25+ gcd$(EFI_NAME).efi.signed \
26+ grubnet$(EFI_NAME).efi.signed
27
28 all: $(SIGNED)
29
30@@ -9,9 +24,9 @@
31 ./download-grub2
32
33 install: $(SIGNED)
34- install -d $(DESTDIR)/usr/lib/grub/x86_64-efi-signed
35+ install -d $(DESTDIR)/usr/lib/grub/$(PLATFORM)-signed
36 install -m0644 $(SIGNED) version \
37- $(DESTDIR)/usr/lib/grub/x86_64-efi-signed/
38+ $(DESTDIR)/usr/lib/grub/$(PLATFORM)-signed/
39
40 clean:
41 rm -f $(SIGNED) version
42
43=== modified file 'debian/changelog'
44--- debian/changelog 2015-07-06 18:24:53 +0000
45+++ debian/changelog 2015-07-22 17:23:13 +0000
46@@ -1,3 +1,10 @@
47+grub2-signed (1.53) UNRELEASED; urgency=medium
48+
49+ * Add arm64 support. (LP: #1457178)
50+ * Rebuild against grub-efi-amd64 2.02~beta2-26ubuntu4.
51+
52+ -- dann frazier <dannf@ubuntu.com> Wed, 22 Jul 2015 11:20:23 -0600
53+
54 grub2-signed (1.52) wily; urgency=medium
55
56 * Rebuild against grub-efi-amd64 2.02~beta2-26ubuntu3.
57
58=== modified file 'debian/control'
59--- debian/control 2015-07-06 18:24:53 +0000
60+++ debian/control 2015-07-22 17:23:13 +0000
61@@ -2,7 +2,7 @@
62 Section: utils
63 Priority: optional
64 Maintainer: Colin Watson <cjwatson@ubuntu.com>
65-Build-Depends: debhelper (>= 9), lsb-release, python3, python3-apt, grub-efi-amd64-bin (>= 2.02~beta2-26ubuntu3)
66+Build-Depends: debhelper (>= 9), lsb-release, python3, python3-apt, grub-efi-amd64-bin (>= 2.02~beta2-26ubuntu4) [amd64], grub-efi-arm64-bin (>= 2.02~beta2-26ubuntu4) [arm64]
67 Standards-Version: 3.9.5
68
69 Package: grub-efi-amd64-signed
70@@ -22,3 +22,21 @@
71 .
72 This package contains a version of GRUB built for use with the EFI-AMD64
73 architecture, signed with Canonical's UEFI signing key.
74+
75+Package: grub-efi-arm64-signed
76+Architecture: arm64
77+Depends: ${misc:Depends}, grub-efi-arm64 (= ${grub2:Version})
78+Recommends: secureboot-db
79+Built-Using: grub2 (= ${grub2:Version})
80+Description: GRand Unified Bootloader, version 2 (EFI-ARM64 version, signed)
81+ GRUB is a portable, powerful bootloader. This version of GRUB is based on a
82+ cleaner design than its predecessors, and provides the following new features:
83+ .
84+ - Scripting in grub.cfg using BASH-like syntax.
85+ - Support for modern partition maps such as GPT.
86+ - Modular generation of grub.cfg via update-grub. Packages providing GRUB
87+ add-ons can plug in their own script rules and trigger updates by invoking
88+ update-grub.
89+ .
90+ This package contains a version of GRUB built for use with the EFI-ARM64
91+ architecture, signed with Canonical's UEFI signing key.
92
93=== added symlink 'debian/grub-efi-amd64-signed.postinst'
94=== target is u'postinst.common'
95=== added symlink 'debian/grub-efi-arm64-signed.postinst'
96=== target is u'postinst.common'
97=== renamed file 'debian/grub-efi-amd64-signed.postinst' => 'debian/postinst.common'
98=== modified file 'debian/rules'
99--- debian/rules 2012-09-21 23:57:13 +0000
100+++ debian/rules 2015-07-22 17:23:13 +0000
101@@ -1,11 +1,12 @@
102 #! /usr/bin/make -f
103
104-VERSION := $(shell LC_ALL=C dpkg-parsechangelog | grep ^Version: | cut -d ' ' -f 2)
105+include /usr/share/dpkg/default.mk
106
107 %:
108 dh $@
109
110-docdir := debian/grub-efi-amd64-signed/usr/share/doc/grub-efi-amd64-signed
111+destdir := debian/grub-efi-$(DEB_HOST_ARCH)-signed
112+docdir := $(destdir)/usr/share/doc/grub-efi-$(DEB_HOST_ARCH)-signed
113
114 override_dh_installchangelogs:
115 dh_installchangelogs
116@@ -14,5 +15,8 @@
117 ln $(docdir)/changelog $(docdir)/changelog.Debian
118
119 override_dh_gencontrol:
120- dh_gencontrol -- -v$(VERSION)+$(shell cat version) \
121+ dh_gencontrol -- -v$(DEB_VERSION)+$(shell cat version) \
122 -Vgrub2:Version=$(shell cat version)
123+
124+override_dh_auto_install:
125+ dh_auto_install --destdir=$(destdir)
126
127=== modified file 'download-grub2'
128--- download-grub2 2013-09-12 17:14:41 +0000
129+++ download-grub2 2015-07-22 17:23:13 +0000
130@@ -6,17 +6,24 @@
131 from urllib.request import urlopen
132
133 import apt
134+import apt_pkg
135
136+ARCH_TO_EFI_NAME = {
137+ 'amd64': 'x64',
138+ 'arm64': 'aa64',
139+}
140+arch = apt_pkg.config['Apt::Architecture']
141+efi_name = ARCH_TO_EFI_NAME[arch]
142 cache = apt.Cache()
143-grub_efi_amd64 = cache["grub-efi-amd64"].candidate
144-pool_parsed = urlparse(grub_efi_amd64.uri)
145+grub_efi = cache["grub-efi-%s" % (arch)].candidate
146+pool_parsed = urlparse(grub_efi.uri)
147 dists_dir = "/dists/%s/main/uefi/grub2-%s/current/" % (
148- grub_efi_amd64.origins[0].archive, grub_efi_amd64.architecture)
149+ grub_efi.origins[0].archive, grub_efi.architecture)
150
151 for base in (
152- "gcdx64.efi.signed",
153- "grubx64.efi.signed",
154- "grubnetx64.efi.signed",
155+ "gcd%s.efi.signed" % (efi_name),
156+ "grub%s.efi.signed" % (efi_name),
157+ "grubnet%s.efi.signed" % (efi_name),
158 "version",
159 ):
160 dists_parsed = list(pool_parsed)

Subscribers

People subscribed via source and target branches

to all changes: