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
diff --git a/.gitignore b/.gitignore
0new file mode 1006440new file mode 100644
index 0000000..16a573c
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,4 @@
1parts/
2prime/
3stage/
4pi3_*.snap
diff --git a/Makefile b/Makefile
0new file mode 1006445new file mode 100644
index 0000000..260a93a
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,53 @@
1STAGEDIR := $(CURDIR)/stage
2DESTDIR := $(CURDIR)/install
3
4ARCH ?= $(shell dpkg --print-architecture)
5SERIES ?= 'bionic'
6UBOOT_TARGET := 'nitrogen6q2g'
7UBOOT_BIN := 'u-boot.imx'
8
9SOURCES_HOST ?= "/etc/apt/sources.list"
10SOURCES_MULTIVERSE := "$(STAGEDIR)/apt/mulitverse.sources.list"
11
12define stage_package
13 (cd $(2)/debs && apt-get download -o Dir::Etc::sourcelist=$(SOURCES_MULTIVERSE) -oAPT::Architecture=$(3) $(1);)
14 dpkg-deb --vextract $$(ls $(2)/debs/$(1)*.deb | tail -1) $(2)/unpack
15endef
16
17define enable_multiverse
18 mkdir -p $(STAGEDIR)/apt
19 cp $(SOURCES_HOST) $(SOURCES_MULTIVERSE)
20 sed -i "s/^\(deb.*\)\$$/\1 multiverse/" $(SOURCES_MULTIVERSE)
21 apt-get update -o Dir::Etc::sourcelist=$(SOURCES_MULTIVERSE) -oAPT::Architecture=$(ARCH) 2>/dev/null
22endef
23
24all: clean
25 # The only supported architecture is armhf
26 if [ "$(ARCH)" != "armhf" ] ; then \
27 echo "Build architecture is not supported."; \
28 exit 1; \
29 fi
30 apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 3850E699B57D9F62
31 # XXX: This is a hack that we can hopefully get rid of once. Currently
32 # the livefs Launchpad builders don't have multiverse enabled.
33 # We wanto to work-around that by actually enabling multiverse just
34 # for this one build here as we need it for linux-firmware-raspi2.
35 $(call enable_multiverse)
36 # Preparation stage
37 mkdir -p $(STAGEDIR)/debs $(STAGEDIR)/unpack
38 # u-boot
39 $(call stage_package,u-boot-imx,$(STAGEDIR),$(ARCH))
40 cp uboot.env.in $(STAGEDIR)/
41 mkenvimage -r -s 131072 -o $(STAGEDIR)/uboot.env $(STAGEDIR)/uboot.env.in
42 # Staging stage
43 mkdir -p $(DESTDIR)/boot-assets
44 # u-boot
45 cp $(STAGEDIR)/unpack/usr/lib/u-boot/$(UBOOT_TARGET)/$(UBOOT_BIN) $(DESTDIR)/boot-assets/$(UBOOT_BIN)
46 cp $(STAGEDIR)/uboot.env $(DESTDIR)
47 # gadget.yaml
48 mkdir -p $(DESTDIR)/meta
49 cp gadget.yaml $(DESTDIR)/meta/
50
51clean:
52 -rm -rf $(DESTDIR)
53 -rm -rf $(STAGEDIR)
diff --git a/README.md b/README.md
0new file mode 10064454new file mode 100644
index 0000000..a441e59
--- /dev/null
+++ b/README.md
@@ -0,0 +1,41 @@
1# Nitrogen6x Gadget Tree
2
3This repository contains the source for an Ubuntu classic gadget tree for the Nitrogen6x.
4
5Building it with snapcraft or make will automatically pull all the required
6binaries from the Ubuntu archive and stage it to a directory for ubuntu-image
7to consume.
8
9## Gadget Snaps
10
11Gadget snaps are a special type of snaps that contain device specific support
12code and data. You can read more about them in the snapd wiki
13https://github.com/snapcore/snapd/wiki/Gadget-snap
14
15## Gadget Trees
16
17Gadget trees are nothing more than gadget snaps before they have been packed
18into a snap. These compiled gadget trees are used by ubuntu-image in the classic
19mode when a classic image is to be built using this tool.
20
21## Reporting Issues
22
23Please report all issues on the Launchpad project page
24https://bugs.launchpad.net/snap-imx/+filebug
25
26We use Launchpad to track issues as this allows us to coordinate multiple
27projects better than what is available with Github issues.
28
29## Building
30
31To build the gadget tree locally on an armhf system please use `snapcraft prime`
32or by using `make`.
33
34To cross build this gadget tree on an amd64 machine please run
35`snapcraft prime --target-arch=armhf`.
36
37## Launchpad Mirror.
38
39All commits from the master branch of https://github.com/CanonicalLtd/imx are
40automatically mirrored by Launchpad to the https://launchpad.net/snap-imx
41project.
diff --git a/gadget.yaml b/gadget.yaml
0new file mode 10064442new file mode 100644
index 0000000..0404338
--- /dev/null
+++ b/gadget.yaml
@@ -0,0 +1,27 @@
1device-tree-origin: kernel
2device-tree: imx6q-nitrogen6x.dtb
3volumes:
4 nitrogen6x-image:
5 bootloader: u-boot
6 schema: mbr
7 structure:
8 - type: 0C
9 filesystem: vfat
10 filesystem-label: system-boot
11 size: 256M
12 content:
13 - source: boot-assets/
14 target: /
15 - type: 83
16 filesystem: ext4
17 filesystem-label: writable
18 size: 512M
19 role: system-data
20 u-boot-nitrogen6x:
21 structure:
22 - name: u-boot
23 type: bare
24 size: 786432
25 offset: 1024
26 content:
27 - image: boot-assets/u-boot.imx
diff --git a/helpers/sources.list.cross b/helpers/sources.list.cross
0new file mode 10064428new file mode 100644
index 0000000..9a3d575
--- /dev/null
+++ b/helpers/sources.list.cross
@@ -0,0 +1,8 @@
1deb [arch=armhf] http://ports.ubuntu.com/ubuntu-ports/ bionic main universe multiverse restricted
2deb-src [arch=armhf] http://ports.ubuntu.com/ubuntu-ports/ bionic main universe multiverse restricted
3deb [arch=armhf] http://ports.ubuntu.com/ubuntu-ports/ bionic-updates main universe multiverse restricted
4deb-src [arch=armhf] http://ports.ubuntu.com/ubuntu-ports/ bionic-updates main universe multiverse restricted
5deb [arch=armhf] http://ports.ubuntu.com/ubuntu-ports/ bionic-security main universe multiverse restricted
6deb-src [arch=armhf] http://ports.ubuntu.com/ubuntu-ports/ bionic-security main universe multiverse restricted
7deb [arch=armhf] http://ports.ubuntu.com/ubuntu-ports/ bionic-proposed main universe multiverse restricted
8deb-src [arch=armhf] http://ports.ubuntu.com/ubuntu-ports/ bionic-proposed main universe multiverse restricted
diff --git a/helpers/sources.list.ppa b/helpers/sources.list.ppa
0new file mode 1006449new file mode 100644
index 0000000..e60381e
--- /dev/null
+++ b/helpers/sources.list.ppa
@@ -0,0 +1,2 @@
1deb [arch=armhf] http://ppa.launchpad.net/shrirang-bagul/hwe/ubuntu bionic main
2deb-src [arch=armhf] http://ppa.launchpad.net/shrirang-bagul/hwe/ubuntu bionic main
diff --git a/snap/gui/icon.png b/snap/gui/icon.png
0new file mode 1006443new file mode 100644
index 0000000..6aa523a
1Binary files /dev/null and b/snap/gui/icon.png differ4Binary files /dev/null and b/snap/gui/icon.png differ
diff --git a/snap/hooks/configure b/snap/hooks/configure
2new file mode 1007555new file mode 100755
index 0000000..38371e1
--- /dev/null
+++ b/snap/hooks/configure
@@ -0,0 +1,3 @@
1#!/bin/sh
2
3# do nothing for now
diff --git a/snapcraft.yaml b/snapcraft.yaml
0new file mode 1006444new file mode 100644
index 0000000..c52bcc1
--- /dev/null
+++ b/snapcraft.yaml
@@ -0,0 +1,35 @@
1name: nitrogen6x
2version: 18
3summary: Nitrogen6x support package
4description: |
5 Support files for booting Boundary devices Nitrogen6x
6type: gadget
7base: core18
8architectures:
9 - armhf
10confinement: strict
11grade: stable
12parts:
13 gadget:
14 source: .
15 plugin: nil
16 override-build: |
17 use_test_ppa="true"
18 if [ "$(arch)" = "x86_64" ]; then
19 echo "Cross-compilation detected, using pre-defined sources.list."
20 OPTIONAL_ARGUMENTS="SOURCES_HOST=\"./helpers/sources.list.cross\""
21 fi
22 if [ ! -z "$use_test_ppa" ]; then
23 echo "Use test ppa for u-boot-imx package using pre-defined sources.list.ppa"
24 OPTIONAL_ARGUMENTS="SOURCES_HOST=\"./helpers/sources.list.ppa\""
25 fi
26 fakeroot make ARCH=$(dpkg-architecture -t$SNAPCRAFT_ARCH_TRIPLET -qDEB_HOST_ARCH) \
27 ${OPTIONAL_ARGUMENTS:-}
28 cp -a install/* $SNAPCRAFT_PART_INSTALL/
29 override-prime: |
30 snapcraftctl prime
31 ln -s uboot.env uboot.conf
32 build-packages:
33 - u-boot-tools
34 - fakeroot
35 - dirmngr
diff --git a/uboot.env.in b/uboot.env.in
0new file mode 10064436new file mode 100644
index 0000000..ee34b08
--- /dev/null
+++ b/uboot.env.in
@@ -0,0 +1,23 @@
1arch=arm
2baudrate=115200
3stderr=serial,lcd
4stdin=serial,usbkbd
5stdout=serial,lcd
6fdt_file=imx6q-nitrogen6x.dtb
7kernel_file=kernel.img
8initrd_file=initrd.img
9fdt_addr_r=0x13000000
10kernel_addr_r=0x10800000
11ramdisk_addr_r=0x13800000
12initrd_addr_r=0x13a00000
13fdt_high=0xffffffff
14loadfdt=fatload mmc 0:1 ${fdt_addr_r} ${snap_kernel}/dtbs/${fdt_file}
15loadfiles=run loadkernel; run loadinitrd; run loadfdt
16loadinitrd=fatload mmc 0:1 ${initrd_addr_r} ${snap_kernel}/${initrd_file}; setenv initrd_size ${filesize}
17loadkernel=fatload mmc 0:1 ${kernel_addr_r} ${snap_kernel}/${kernel_file}
18snappy_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}
19snappy_cmdline=rng_core.default_quality=700 net.ifnames=0 init=/lib/systemd/systemd ro panic=-1 fixrtc usbcore.autosuspend=-1
20mmcargs=setenv bootargs "console=ttymxc1,115200 consoleblank=0 clk_ignore_unused root=${mmcroot}"
21snappy_mode=
22uenvcmd=echo ENVCMD; run snappy_boot
23bootcmd=run uenvcmd

Subscribers

People subscribed via source and target branches

to all changes: