Merge ~fisterra-team/fisterra/+git/nitrogen6x-gadget:18 into ~fisterra-team/fisterra/+git/nitrogen6x-gadget:18-mp

Proposed by ethan.hsieh
Status: Needs review
Proposed branch: ~fisterra-team/fisterra/+git/nitrogen6x-gadget:18
Merge into: ~fisterra-team/fisterra/+git/nitrogen6x-gadget:18-mp
Diff against target: 254 lines (+196/-0)
9 files modified
.gitignore (+4/-0)
Makefile (+53/-0)
README.md (+41/-0)
gadget.yaml (+27/-0)
helpers/sources.list.cross (+8/-0)
helpers/sources.list.ppa (+2/-0)
snap/hooks/configure (+3/-0)
snapcraft.yaml (+35/-0)
uboot.env.in (+23/-0)
Reviewer Review Type Date Requested Status
Łukasz Zemczak Needs Information
Dave Jones Pending
Steve Langasek Pending
Patricia Gaughen Pending
ethan.hsieh Pending
Review via email: mp+371451@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Łukasz Zemczak (sil2100) wrote :
review: Needs Information

Unmerged commits

4213668... by ethan.hsieh

Update icon.png
Adding empty configure hook to enable configuration for gadget

f978c41... by ethan.hsieh

Update snapcraft.yaml and uboot.env.in
- Change gadget name to nitrogen6x
- Change versino to 18
- Change kernel_file to kernel.img
- Correct fdt_addr_r

b33ca23... by Shrirang Bagul

[gadget] u-boot-imx starts at offset of 1k in the image

Signed-off-by: Shrirang Bagul <email address hidden>

0d6c9c6... by Shrirang Bagul

[gadget] u-boot partition on spi nor-flash is 768k

Signed-off-by: Shrirang Bagul <email address hidden>

b0dbbfc... by Shrirang Bagul

uboot.env: autoboot to ubuntu core

Signed-off-by: Shrirang Bagul <email address hidden>

320c95c... by Shrirang Bagul

[Makefile] import keys for ppa:hwe

Signed-off-by: Shrirang Bagul <email address hidden>

b4c7e1c... by Shrirang Bagul

[snapcraft] use hwe test ppa for u-boot-imx

Signed-off-by: Shrirang Bagul <email address hidden>

1a17640... by Shrirang Bagul

[snapcraft] add support for hwe test ppa in sources.list

Signed-off-by: Shrirang Bagul <email address hidden>

0bed456... by Shrirang Bagul

[helpers] add hwe testing ppa for u-boot-imx package

Signed-off-by: Shrirang Bagul <email address hidden>

a6f4f05... by Shrirang Bagul

[Makefile] select nitrogen6q2g u-boot variant

Signed-off-by: Shrirang Bagul <email address hidden>

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/.gitignore b/.gitignore
2new file mode 100644
3index 0000000..16a573c
4--- /dev/null
5+++ b/.gitignore
6@@ -0,0 +1,4 @@
7+parts/
8+prime/
9+stage/
10+pi3_*.snap
11diff --git a/Makefile b/Makefile
12new file mode 100644
13index 0000000..260a93a
14--- /dev/null
15+++ b/Makefile
16@@ -0,0 +1,53 @@
17+STAGEDIR := $(CURDIR)/stage
18+DESTDIR := $(CURDIR)/install
19+
20+ARCH ?= $(shell dpkg --print-architecture)
21+SERIES ?= 'bionic'
22+UBOOT_TARGET := 'nitrogen6q2g'
23+UBOOT_BIN := 'u-boot.imx'
24+
25+SOURCES_HOST ?= "/etc/apt/sources.list"
26+SOURCES_MULTIVERSE := "$(STAGEDIR)/apt/mulitverse.sources.list"
27+
28+define stage_package
29+ (cd $(2)/debs && apt-get download -o Dir::Etc::sourcelist=$(SOURCES_MULTIVERSE) -oAPT::Architecture=$(3) $(1);)
30+ dpkg-deb --vextract $$(ls $(2)/debs/$(1)*.deb | tail -1) $(2)/unpack
31+endef
32+
33+define enable_multiverse
34+ mkdir -p $(STAGEDIR)/apt
35+ cp $(SOURCES_HOST) $(SOURCES_MULTIVERSE)
36+ sed -i "s/^\(deb.*\)\$$/\1 multiverse/" $(SOURCES_MULTIVERSE)
37+ apt-get update -o Dir::Etc::sourcelist=$(SOURCES_MULTIVERSE) -oAPT::Architecture=$(ARCH) 2>/dev/null
38+endef
39+
40+all: clean
41+ # The only supported architecture is armhf
42+ if [ "$(ARCH)" != "armhf" ] ; then \
43+ echo "Build architecture is not supported."; \
44+ exit 1; \
45+ fi
46+ apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 3850E699B57D9F62
47+ # XXX: This is a hack that we can hopefully get rid of once. Currently
48+ # the livefs Launchpad builders don't have multiverse enabled.
49+ # We wanto to work-around that by actually enabling multiverse just
50+ # for this one build here as we need it for linux-firmware-raspi2.
51+ $(call enable_multiverse)
52+ # Preparation stage
53+ mkdir -p $(STAGEDIR)/debs $(STAGEDIR)/unpack
54+ # u-boot
55+ $(call stage_package,u-boot-imx,$(STAGEDIR),$(ARCH))
56+ cp uboot.env.in $(STAGEDIR)/
57+ mkenvimage -r -s 131072 -o $(STAGEDIR)/uboot.env $(STAGEDIR)/uboot.env.in
58+ # Staging stage
59+ mkdir -p $(DESTDIR)/boot-assets
60+ # u-boot
61+ cp $(STAGEDIR)/unpack/usr/lib/u-boot/$(UBOOT_TARGET)/$(UBOOT_BIN) $(DESTDIR)/boot-assets/$(UBOOT_BIN)
62+ cp $(STAGEDIR)/uboot.env $(DESTDIR)
63+ # gadget.yaml
64+ mkdir -p $(DESTDIR)/meta
65+ cp gadget.yaml $(DESTDIR)/meta/
66+
67+clean:
68+ -rm -rf $(DESTDIR)
69+ -rm -rf $(STAGEDIR)
70diff --git a/README.md b/README.md
71new file mode 100644
72index 0000000..a441e59
73--- /dev/null
74+++ b/README.md
75@@ -0,0 +1,41 @@
76+# Nitrogen6x Gadget Tree
77+
78+This repository contains the source for an Ubuntu classic gadget tree for the Nitrogen6x.
79+
80+Building it with snapcraft or make will automatically pull all the required
81+binaries from the Ubuntu archive and stage it to a directory for ubuntu-image
82+to consume.
83+
84+## Gadget Snaps
85+
86+Gadget snaps are a special type of snaps that contain device specific support
87+code and data. You can read more about them in the snapd wiki
88+https://github.com/snapcore/snapd/wiki/Gadget-snap
89+
90+## Gadget Trees
91+
92+Gadget trees are nothing more than gadget snaps before they have been packed
93+into a snap. These compiled gadget trees are used by ubuntu-image in the classic
94+mode when a classic image is to be built using this tool.
95+
96+## Reporting Issues
97+
98+Please report all issues on the Launchpad project page
99+https://bugs.launchpad.net/snap-imx/+filebug
100+
101+We use Launchpad to track issues as this allows us to coordinate multiple
102+projects better than what is available with Github issues.
103+
104+## Building
105+
106+To build the gadget tree locally on an armhf system please use `snapcraft prime`
107+or by using `make`.
108+
109+To cross build this gadget tree on an amd64 machine please run
110+`snapcraft prime --target-arch=armhf`.
111+
112+## Launchpad Mirror.
113+
114+All commits from the master branch of https://github.com/CanonicalLtd/imx are
115+automatically mirrored by Launchpad to the https://launchpad.net/snap-imx
116+project.
117diff --git a/gadget.yaml b/gadget.yaml
118new file mode 100644
119index 0000000..0404338
120--- /dev/null
121+++ b/gadget.yaml
122@@ -0,0 +1,27 @@
123+device-tree-origin: kernel
124+device-tree: imx6q-nitrogen6x.dtb
125+volumes:
126+ nitrogen6x-image:
127+ bootloader: u-boot
128+ schema: mbr
129+ structure:
130+ - type: 0C
131+ filesystem: vfat
132+ filesystem-label: system-boot
133+ size: 256M
134+ content:
135+ - source: boot-assets/
136+ target: /
137+ - type: 83
138+ filesystem: ext4
139+ filesystem-label: writable
140+ size: 512M
141+ role: system-data
142+ u-boot-nitrogen6x:
143+ structure:
144+ - name: u-boot
145+ type: bare
146+ size: 786432
147+ offset: 1024
148+ content:
149+ - image: boot-assets/u-boot.imx
150diff --git a/helpers/sources.list.cross b/helpers/sources.list.cross
151new file mode 100644
152index 0000000..9a3d575
153--- /dev/null
154+++ b/helpers/sources.list.cross
155@@ -0,0 +1,8 @@
156+deb [arch=armhf] http://ports.ubuntu.com/ubuntu-ports/ bionic main universe multiverse restricted
157+deb-src [arch=armhf] http://ports.ubuntu.com/ubuntu-ports/ bionic main universe multiverse restricted
158+deb [arch=armhf] http://ports.ubuntu.com/ubuntu-ports/ bionic-updates main universe multiverse restricted
159+deb-src [arch=armhf] http://ports.ubuntu.com/ubuntu-ports/ bionic-updates main universe multiverse restricted
160+deb [arch=armhf] http://ports.ubuntu.com/ubuntu-ports/ bionic-security main universe multiverse restricted
161+deb-src [arch=armhf] http://ports.ubuntu.com/ubuntu-ports/ bionic-security main universe multiverse restricted
162+deb [arch=armhf] http://ports.ubuntu.com/ubuntu-ports/ bionic-proposed main universe multiverse restricted
163+deb-src [arch=armhf] http://ports.ubuntu.com/ubuntu-ports/ bionic-proposed main universe multiverse restricted
164diff --git a/helpers/sources.list.ppa b/helpers/sources.list.ppa
165new file mode 100644
166index 0000000..e60381e
167--- /dev/null
168+++ b/helpers/sources.list.ppa
169@@ -0,0 +1,2 @@
170+deb [arch=armhf] http://ppa.launchpad.net/shrirang-bagul/hwe/ubuntu bionic main
171+deb-src [arch=armhf] http://ppa.launchpad.net/shrirang-bagul/hwe/ubuntu bionic main
172diff --git a/snap/gui/icon.png b/snap/gui/icon.png
173new file mode 100644
174index 0000000..6aa523a
175Binary files /dev/null and b/snap/gui/icon.png differ
176diff --git a/snap/hooks/configure b/snap/hooks/configure
177new file mode 100755
178index 0000000..38371e1
179--- /dev/null
180+++ b/snap/hooks/configure
181@@ -0,0 +1,3 @@
182+#!/bin/sh
183+
184+# do nothing for now
185diff --git a/snapcraft.yaml b/snapcraft.yaml
186new file mode 100644
187index 0000000..c52bcc1
188--- /dev/null
189+++ b/snapcraft.yaml
190@@ -0,0 +1,35 @@
191+name: nitrogen6x
192+version: 18
193+summary: Nitrogen6x support package
194+description: |
195+ Support files for booting Boundary devices Nitrogen6x
196+type: gadget
197+base: core18
198+architectures:
199+ - armhf
200+confinement: strict
201+grade: stable
202+parts:
203+ gadget:
204+ source: .
205+ plugin: nil
206+ override-build: |
207+ use_test_ppa="true"
208+ if [ "$(arch)" = "x86_64" ]; then
209+ echo "Cross-compilation detected, using pre-defined sources.list."
210+ OPTIONAL_ARGUMENTS="SOURCES_HOST=\"./helpers/sources.list.cross\""
211+ fi
212+ if [ ! -z "$use_test_ppa" ]; then
213+ echo "Use test ppa for u-boot-imx package using pre-defined sources.list.ppa"
214+ OPTIONAL_ARGUMENTS="SOURCES_HOST=\"./helpers/sources.list.ppa\""
215+ fi
216+ fakeroot make ARCH=$(dpkg-architecture -t$SNAPCRAFT_ARCH_TRIPLET -qDEB_HOST_ARCH) \
217+ ${OPTIONAL_ARGUMENTS:-}
218+ cp -a install/* $SNAPCRAFT_PART_INSTALL/
219+ override-prime: |
220+ snapcraftctl prime
221+ ln -s uboot.env uboot.conf
222+ build-packages:
223+ - u-boot-tools
224+ - fakeroot
225+ - dirmngr
226diff --git a/uboot.env.in b/uboot.env.in
227new file mode 100644
228index 0000000..ee34b08
229--- /dev/null
230+++ b/uboot.env.in
231@@ -0,0 +1,23 @@
232+arch=arm
233+baudrate=115200
234+stderr=serial,lcd
235+stdin=serial,usbkbd
236+stdout=serial,lcd
237+fdt_file=imx6q-nitrogen6x.dtb
238+kernel_file=kernel.img
239+initrd_file=initrd.img
240+fdt_addr_r=0x13000000
241+kernel_addr_r=0x10800000
242+ramdisk_addr_r=0x13800000
243+initrd_addr_r=0x13a00000
244+fdt_high=0xffffffff
245+loadfdt=fatload mmc 0:1 ${fdt_addr_r} ${snap_kernel}/dtbs/${fdt_file}
246+loadfiles=run loadkernel; run loadinitrd; run loadfdt
247+loadinitrd=fatload mmc 0:1 ${initrd_addr_r} ${snap_kernel}/${initrd_file}; setenv initrd_size ${filesize}
248+loadkernel=fatload mmc 0:1 ${kernel_addr_r} ${snap_kernel}/${kernel_file}
249+snappy_boot=if test "${snap_mode}" = "try"; then setenv snap_mode "trying"; saveenv; if test "${snap_try_core}" != ""; then setenv snap_core "${snap_try_core}"; fi; if test "${snap_try_kernel}" != ""; then setenv snap_kernel "${snap_try_kernel}"; fi; elif test "${snap_mode}" = "trying"; then setenv snap_mode ""; saveenv; fi; run loadfiles; setenv mmcroot "/dev/disk/by-label/writable ${snappy_cmdline} snap_core=${snap_core} snap_kernel=${snap_kernel}"; run mmcargs; bootz ${kernel_addr_r} ${initrd_addr_r}:${initrd_size} ${fdt_addr_r}
250+snappy_cmdline=rng_core.default_quality=700 net.ifnames=0 init=/lib/systemd/systemd ro panic=-1 fixrtc usbcore.autosuspend=-1
251+mmcargs=setenv bootargs "console=ttymxc1,115200 consoleblank=0 clk_ignore_unused root=${mmcroot}"
252+snappy_mode=
253+uenvcmd=echo ENVCMD; run snappy_boot
254+bootcmd=run uenvcmd

Subscribers

People subscribed via source and target branches

to all changes: