Merge lp:~sergiusens/snappy-hub/pc-on-snapcraft into lp:~snappy-dev/snappy-hub/snappy-systems

Proposed by Sergio Schvezov on 2016-11-03
Status: Needs review
Proposed branch: lp:~sergiusens/snappy-hub/pc-on-snapcraft
Merge into: lp:~snappy-dev/snappy-hub/snappy-systems
Diff against target: 268 lines (+118/-108)
6 files modified
generic-amd64/Makefile (+71/-0)
generic-amd64/gadget.yaml (+28/-0)
generic-amd64/meta/gadget.yaml (+0/-28)
generic-amd64/meta/snap.yaml (+0/-8)
generic-amd64/notes.txt (+0/-72)
generic-amd64/snapcraft.yaml (+19/-0)
To merge this branch: bzr merge lp:~sergiusens/snappy-hub/pc-on-snapcraft
Reviewer Review Type Date Requested Status
Steve Langasek 2016-11-03 Pending
Review via email: mp+309926@code.launchpad.net
To post a comment you must log in.

Unmerged revisions

107. By Sergio Schvezov on 2016-11-03

Move generic-amd64 (aka pc) to snapcraft

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== added file 'generic-amd64/Makefile'
2--- generic-amd64/Makefile 1970-01-01 00:00:00 +0000
3+++ generic-amd64/Makefile 2016-11-03 09:59:43 +0000
4@@ -0,0 +1,71 @@
5+define NONSNAP_GRUB_MODULES =
6+btrfs
7+hfsplus
8+iso9660
9+part_apple
10+part_msdos
11+password_pbkdf2
12+zfs
13+zfscrypt
14+zfsinfo
15+lvm
16+mdraid09
17+mdraid1x
18+raid5rec
19+raid6rec
20+endef
21+
22+GRUB_MODULES = \
23+ all_video \
24+ biosdisk \
25+ boot \
26+ cat \
27+ chain \
28+ configfile \
29+ echo \
30+ ext2 \
31+ fat \
32+ font \
33+ gettext \
34+ gfxmenu \
35+ gfxterm \
36+ gfxterm_background \
37+ gzio \
38+ halt \
39+ jpeg \
40+ keystatus \
41+ loadenv \
42+ loopback \
43+ linux \
44+ memdisk \
45+ minicmd \
46+ normal \
47+ part_gpt \
48+ png \
49+ reboot \
50+ search \
51+ search_fs_uuid \
52+ search_fs_file \
53+ search_label \
54+ sleep \
55+ squash4 \
56+ test \
57+ true \
58+ video
59+
60+all:
61+ cp /usr/lib/grub/i386-pc/boot.img pc-boot.img
62+ echo -n -e '\x90\x90' | dd of=pc-boot.img seek=102 bs=1 conv=notrunc
63+ grub-mkimage -O i386-pc -o pc-core.img -p '(,gpt2)/EFI/ubuntu' $(GRUB_MODULES)
64+ # The first sector of the core image requires an absolute pointer to the
65+ # second sector of the image. Since this is always hard-coded, it means our
66+ # BIOS boot partition must be defined with an absolute offset. The
67+ # particular value here is 2049, or 0x01 0x08 0x00 0x00 in little-endian.
68+ echo -n -e '\x01\x08' | dd of=pc-core.img seek=500 bs=1 conv=notrunc
69+ cp /usr/lib/shim/shim.efi.signed shim.efi.signed
70+ cp /usr/lib/grub/x86_64-efi-signed/grubx64.efi.signed grubx64.efi
71+
72+
73+install:
74+ install -m 644 pc-boot.img pc-core.img shim.efi.signed grubx64.efi $(DESTDIR)/
75+ install -m 644 grub.conf grub.cfg $(DESTDIR)/
76
77=== added file 'generic-amd64/gadget.yaml'
78--- generic-amd64/gadget.yaml 1970-01-01 00:00:00 +0000
79+++ generic-amd64/gadget.yaml 2016-11-03 09:59:43 +0000
80@@ -0,0 +1,28 @@
81+volumes:
82+ pc:
83+ bootloader: grub
84+ structure:
85+ - name: mbr
86+ type: mbr
87+ size: 440
88+ content:
89+ - image: pc-boot.img
90+ - name: BIOS Boot
91+ type: DA,21686148-6449-6E6F-744E-656564454649
92+ size: 1M
93+ offset: 1M
94+ offset-write: mbr+92
95+ content:
96+ - image: pc-core.img
97+ - name: EFI System
98+ type: EF,C12A7328-F81F-11D2-BA4B-00A0C93EC93B
99+ filesystem: vfat
100+ filesystem-label: system-boot
101+ size: 50M
102+ content:
103+ - source: grubx64.efi
104+ target: EFI/boot/grubx64.efi
105+ - source: shim.efi.signed
106+ target: EFI/boot/bootx64.efi
107+ - source: grub.cfg
108+ target: EFI/ubuntu/grub.cfg
109
110=== removed file 'generic-amd64/grubx64.efi'
111Binary files generic-amd64/grubx64.efi 2016-07-28 09:16:42 +0000 and generic-amd64/grubx64.efi 1970-01-01 00:00:00 +0000 differ
112=== added file 'generic-amd64/icon.png'
113Binary files generic-amd64/icon.png 1970-01-01 00:00:00 +0000 and generic-amd64/icon.png 2016-11-03 09:59:43 +0000 differ
114=== removed directory 'generic-amd64/meta'
115=== removed file 'generic-amd64/meta/gadget.yaml'
116--- generic-amd64/meta/gadget.yaml 2016-09-02 07:53:31 +0000
117+++ generic-amd64/meta/gadget.yaml 1970-01-01 00:00:00 +0000
118@@ -1,28 +0,0 @@
119-volumes:
120- pc:
121- bootloader: grub
122- structure:
123- - name: mbr
124- type: mbr
125- size: 440
126- content:
127- - image: pc-boot.img
128- - name: BIOS Boot
129- type: DA,21686148-6449-6E6F-744E-656564454649
130- size: 1M
131- offset: 1M
132- offset-write: mbr+92
133- content:
134- - image: pc-core.img
135- - name: EFI System
136- type: EF,C12A7328-F81F-11D2-BA4B-00A0C93EC93B
137- filesystem: vfat
138- filesystem-label: system-boot
139- size: 50M
140- content:
141- - source: grubx64.efi
142- target: EFI/boot/grubx64.efi
143- - source: shim.efi.signed
144- target: EFI/boot/bootx64.efi
145- - source: grub.cfg
146- target: EFI/ubuntu/grub.cfg
147
148=== removed file 'generic-amd64/meta/icon.png'
149Binary files generic-amd64/meta/icon.png 2016-02-02 06:42:33 +0000 and generic-amd64/meta/icon.png 1970-01-01 00:00:00 +0000 differ
150=== removed file 'generic-amd64/meta/snap.yaml'
151--- generic-amd64/meta/snap.yaml 2016-09-02 06:26:36 +0000
152+++ generic-amd64/meta/snap.yaml 1970-01-01 00:00:00 +0000
153@@ -1,8 +0,0 @@
154-name: pc
155-version: 16.04-0.8
156-summary: AMD64 generic package
157-description: |
158- This package contains a simple OEM snappy package for system configuration
159-type: gadget
160-architectures:
161- - amd64
162
163=== removed file 'generic-amd64/notes.txt'
164--- generic-amd64/notes.txt 2016-08-26 20:00:53 +0000
165+++ generic-amd64/notes.txt 1970-01-01 00:00:00 +0000
166@@ -1,72 +0,0 @@
167-# How this snap is prepared (to be turned into snapcraft.yaml eventually):
168-
169-sudo apt install shim-signed grub-pc-bin grub-efi-amd64-signed
170-cp /usr/lib/shim/shim.efi.signed shim.efi.signed
171-cp /usr/lib/grub/x86_64-efi-signed/grubx64.efi.signed grubx64.efi
172-
173-cp /usr/lib/grub/i386-pc/boot.img pc-boot.img
174-echo -n -e '\x90\x90' | dd of=pc-boot.img seek=102 bs=1 conv=notrunc
175-
176-NONSNAP_GRUB_MODULES="
177- btrfs
178- hfsplus
179- iso9660
180- part_apple
181- part_msdos
182- password_pbkdf2
183- zfs
184- zfscrypt
185- zfsinfo
186- lvm
187- mdraid09
188- mdraid1x
189- raid5rec
190- raid6rec
191- "
192-
193-# filtered list of modules included in the signed EFI grub image, excluding
194-# ones that we don't think are useful in snappy.
195-GRUB_MODULES="
196- all_video
197- biosdisk
198- boot
199- cat
200- chain
201- configfile
202- echo
203- ext2
204- fat
205- font
206- gettext
207- gfxmenu
208- gfxterm
209- gfxterm_background
210- gzio
211- halt
212- jpeg
213- keystatus
214- loadenv
215- loopback
216- linux
217- memdisk
218- minicmd
219- normal
220- part_gpt
221- png
222- reboot
223- search
224- search_fs_uuid
225- search_fs_file
226- search_label
227- sleep
228- squash4
229- test
230- true
231- video
232- "
233-grub-mkimage -O i386-pc -o pc-core.img -p '(,gpt2)/EFI/ubuntu' $GRUB_MODULES
234-# The first sector of the core image requires an absolute pointer to the
235-# second sector of the image. Since this is always hard-coded, it means our
236-# BIOS boot partition must be defined with an absolute offset. The
237-# particular value here is 2049, or 0x01 0x08 0x00 0x00 in little-endian.
238-echo -n -e '\x01\x08' | dd of=pc-core.img seek=500 bs=1 conv=notrunc
239
240=== removed file 'generic-amd64/pc-boot.img'
241Binary files generic-amd64/pc-boot.img 2016-08-23 06:18:21 +0000 and generic-amd64/pc-boot.img 1970-01-01 00:00:00 +0000 differ
242=== removed file 'generic-amd64/pc-core.img'
243Binary files generic-amd64/pc-core.img 2016-08-26 20:00:53 +0000 and generic-amd64/pc-core.img 1970-01-01 00:00:00 +0000 differ
244=== removed file 'generic-amd64/shim.efi.signed'
245Binary files generic-amd64/shim.efi.signed 2016-06-16 12:48:44 +0000 and generic-amd64/shim.efi.signed 1970-01-01 00:00:00 +0000 differ
246=== added file 'generic-amd64/snapcraft.yaml'
247--- generic-amd64/snapcraft.yaml 1970-01-01 00:00:00 +0000
248+++ generic-amd64/snapcraft.yaml 2016-11-03 09:59:43 +0000
249@@ -0,0 +1,19 @@
250+name: pc
251+version: '16.04-0.8'
252+type: gadget
253+summary: PC gadget for generic devices
254+description: |
255+ This gadget enables generic pc devices to work with Ubuntu Core
256+grade: stable
257+confinement: strict
258+icon: icon.png
259+
260+parts:
261+ grub:
262+ source: .
263+ plugin: make
264+ build-packages:
265+ - grub-efi-amd64-signed
266+ - grub-pc-bin
267+ - shim-signed
268+

Subscribers

People subscribed via source and target branches