diff options
-rw-r--r-- | conf/distro/sota.conf.inc | 4 | ||||
-rw-r--r-- | conf/include/local/sota_minnowboard.inc | 2 | ||||
-rw-r--r-- | recipes-sota/ostree-initrd/files/init.sh | 3 | ||||
-rw-r--r-- | recipes-sota/ostree-initrd/ostree-initrd.bb | 5 | ||||
-rwxr-xr-x | scripts/envsetup.sh | 1 | ||||
-rwxr-xr-x | scripts/qa | 60 |
6 files changed, 70 insertions, 5 deletions
diff --git a/conf/distro/sota.conf.inc b/conf/distro/sota.conf.inc index 5ec1d18..e334df0 100644 --- a/conf/distro/sota.conf.inc +++ b/conf/distro/sota.conf.inc | |||
@@ -1,7 +1,7 @@ | |||
1 | DISTRO_FEATURES_append = " sota" | 1 | DISTRO_FEATURES_append = " sota" |
2 | OVERRIDES .= ":sota" | 2 | OVERRIDES .= ":sota" |
3 | 3 | ||
4 | IMAGE_INSTALL_append = " ostree os-release" | 4 | IMAGE_INSTALL_append = " ostree os-release rvi-sota-client" |
5 | 5 | ||
6 | # live image for OSTree-enabled systems | 6 | # live image for OSTree-enabled systems |
7 | IMAGE_CLASSES += "image_types_ostree image_types_ota" | 7 | IMAGE_CLASSES += "image_types_ostree image_types_ota" |
@@ -21,3 +21,5 @@ OSTREE_BRANCHNAME ?= "ota-${MACHINE}" | |||
21 | OSTREE_OSNAME ?= "poky" | 21 | OSTREE_OSNAME ?= "poky" |
22 | OSTREE_INITRAMFS_IMAGE ?= "initramfs-ostree-image" | 22 | OSTREE_INITRAMFS_IMAGE ?= "initramfs-ostree-image" |
23 | 23 | ||
24 | # Prelinking increases the size of downloads and causes build errors | ||
25 | USER_CLASSES_remove = "image-prelink" | ||
diff --git a/conf/include/local/sota_minnowboard.inc b/conf/include/local/sota_minnowboard.inc index d39f4d3..36d1a17 100644 --- a/conf/include/local/sota_minnowboard.inc +++ b/conf/include/local/sota_minnowboard.inc | |||
@@ -6,4 +6,4 @@ EFI_PROVIDER = "grub-efi" | |||
6 | WKS_FILE = "efiimage-sota.wks" | 6 | WKS_FILE = "efiimage-sota.wks" |
7 | IMAGE_BOOT_FILES = "" | 7 | IMAGE_BOOT_FILES = "" |
8 | 8 | ||
9 | OSTREE_KERNEL_ARGS ?= "ramdisk_size=16384 rw rootfstype=ext4 rootwait rootdelay=2 ostree_root=/dev/mmcblk2p2 console=ttyS0,115200 console=tty0" | 9 | OSTREE_KERNEL_ARGS ?= "ramdisk_size=16384 rw rootfstype=ext4 rootwait rootdelay=2 console=ttyS0,115200 console=tty0" |
diff --git a/recipes-sota/ostree-initrd/files/init.sh b/recipes-sota/ostree-initrd/files/init.sh index 806a7b1..1814ca3 100644 --- a/recipes-sota/ostree-initrd/files/init.sh +++ b/recipes-sota/ostree-initrd/files/init.sh | |||
@@ -29,10 +29,11 @@ get_ostree_sysroot() { | |||
29 | for opt in `cat /proc/cmdline`; do | 29 | for opt in `cat /proc/cmdline`; do |
30 | arg=`echo $opt | cut -d'=' -f1` | 30 | arg=`echo $opt | cut -d'=' -f1` |
31 | if [ $arg == "ostree_root" ]; then | 31 | if [ $arg == "ostree_root" ]; then |
32 | echo $opt | cut -d'=' -f2 | 32 | echo $opt | cut -d'=' -f2- |
33 | return | 33 | return |
34 | fi | 34 | fi |
35 | done | 35 | done |
36 | echo "LABEL=otaroot" | ||
36 | } | 37 | } |
37 | 38 | ||
38 | export PATH=/sbin:/usr/sbin:/bin:/usr/bin:/usr/lib/ostree | 39 | export PATH=/sbin:/usr/sbin:/bin:/usr/bin:/usr/lib/ostree |
diff --git a/recipes-sota/ostree-initrd/ostree-initrd.bb b/recipes-sota/ostree-initrd/ostree-initrd.bb index 5c85bee..b721405 100644 --- a/recipes-sota/ostree-initrd/ostree-initrd.bb +++ b/recipes-sota/ostree-initrd/ostree-initrd.bb | |||
@@ -5,15 +5,16 @@ SRC_URI = "file://init.sh" | |||
5 | 5 | ||
6 | S = "${WORKDIR}" | 6 | S = "${WORKDIR}" |
7 | 7 | ||
8 | PV = "2" | ||
9 | |||
8 | do_install() { | 10 | do_install() { |
9 | install -dm 0755 ${D}/etc | 11 | install -dm 0755 ${D}/etc |
10 | touch ${D}/etc/initrd-release | 12 | touch ${D}/etc/initrd-release |
11 | install -dm 0755 ${D}/dev | 13 | install -dm 0755 ${D}/dev |
12 | install -dm 0755 ${D}/sbin | 14 | install -dm 0755 ${D}/sbin |
13 | install -m 0755 ${WORKDIR}/init.sh ${D}/sbin/init | 15 | install -m 0755 ${WORKDIR}/init.sh ${D}/sbin/init |
14 | } | 16 | } |
15 | 17 | ||
16 | inherit allarch | 18 | inherit allarch |
17 | 19 | ||
18 | FILES_${PN} += " /dev /etc/initrd-release /sbin/init " | 20 | FILES_${PN} += " /dev /etc/initrd-release /sbin/init " |
19 | |||
diff --git a/scripts/envsetup.sh b/scripts/envsetup.sh index 316a782..6c01d5b 100755 --- a/scripts/envsetup.sh +++ b/scripts/envsetup.sh | |||
@@ -49,5 +49,6 @@ else | |||
49 | cat ${METADIR}/meta-updater/conf/include/bblayers/sota_${MACHINE}.inc >> conf/bblayers.conf | 49 | cat ${METADIR}/meta-updater/conf/include/bblayers/sota_${MACHINE}.inc >> conf/bblayers.conf |
50 | echo "include conf/include/local/sota_${MACHINE}.inc" >> conf/local.conf | 50 | echo "include conf/include/local/sota_${MACHINE}.inc" >> conf/local.conf |
51 | echo "include conf/distro/sota.conf.inc" >> conf/local.conf | 51 | echo "include conf/distro/sota.conf.inc" >> conf/local.conf |
52 | echo "DISTRO = \"poky-sota-systemd\"" >> conf/local.conf | ||
52 | fi | 53 | fi |
53 | 54 | ||
diff --git a/scripts/qa b/scripts/qa new file mode 100755 index 0000000..e5133f0 --- /dev/null +++ b/scripts/qa | |||
@@ -0,0 +1,60 @@ | |||
1 | #!/usr/bin/env python3 | ||
2 | |||
3 | from subprocess import Popen, PIPE | ||
4 | from glob import glob | ||
5 | from os.path import dirname, join, abspath, exists | ||
6 | from os import chdir | ||
7 | import signal | ||
8 | |||
9 | root = abspath(dirname(dirname(dirname(__file__)))) | ||
10 | print("Root dir is:" + root) | ||
11 | |||
12 | args = ['bitbake', 'core-image-minimal'] | ||
13 | |||
14 | |||
15 | class Runner(object): | ||
16 | UNKNOWN = 'unknown' | ||
17 | PASS = 'pass' | ||
18 | FAIL = 'fail' | ||
19 | SKIP = 'skipped' | ||
20 | |||
21 | def __init__(self, dirs): | ||
22 | self._dirs = dirs | ||
23 | self._child = None | ||
24 | self._results = {} | ||
25 | for d in dirs: | ||
26 | self._results[d] = self.UNKNOWN | ||
27 | |||
28 | def run(self): | ||
29 | for d in self._dirs: | ||
30 | chdir(d) | ||
31 | if exists(join(d, '.qaskip')): | ||
32 | print("Skipping %s because of .qaskip file" % d) | ||
33 | self._results[d] = self.SKIP | ||
34 | continue | ||
35 | print("Building in " + d) | ||
36 | self._child = Popen(args=args, cwd=d, stdin=PIPE) | ||
37 | retcode = self._child.wait() | ||
38 | self._child = None | ||
39 | if retcode == 0: | ||
40 | self._results[d] = self.PASS | ||
41 | else: | ||
42 | self._results[d] = self.FAIL | ||
43 | print("Error, stopping qa script at %s" % d) | ||
44 | break | ||
45 | for d, result in self._results.items(): | ||
46 | print("%20s %s" % (d, result)) | ||
47 | |||
48 | def handle_signal(self, signo, stack_frame): | ||
49 | if self._child: | ||
50 | self._child | ||
51 | |||
52 | |||
53 | def main(): | ||
54 | dirs = glob(join(root, 'build*')) | ||
55 | runner = Runner(dirs) | ||
56 | signal.signal(signalnum=signal.SIGINT, handler=runner.handle_signal) | ||
57 | runner.run() | ||
58 | |||
59 | if __name__ == "__main__": | ||
60 | main() | ||