summaryrefslogtreecommitdiffstats
path: root/recipes
diff options
context:
space:
mode:
authorSamuli Piippo <samuli.piippo@theqtcompany.com>2016-03-15 08:43:38 +0200
committerSamuli Piippo <samuli.piippo@theqtcompany.com>2016-03-15 08:44:19 +0200
commit9eb4a4ca74de48387a794336df7bfd3076919ed8 (patch)
treedf047176185ff6e9428363d12cd160fe258319a6 /recipes
parent0a1b5fdeb2d91e28c8281f30b6e4957203a82994 (diff)
parentce704ae0105f6d17b4628d1e67bfb25a78289147 (diff)
downloadmeta-boot2qt-9eb4a4ca74de48387a794336df7bfd3076919ed8.tar.gz
Merge remote-tracking branch 'origin/fido' into dev
* origin/fido: (36 commits) qt5: update submodules b2qt-demos: update revision b2qt-appcontroller: update revision qt5: move mingw32 specific parts from meta-qt5 qt5: Use latest version of meta-qt5 b2qt-demos: update to new revision ostree: Mount boot partition from user space ostree: Do not use grub2-mkconfig. RPi2: add support for touch display Disable ethernet over usb on beaglebone. qtwayland: update SRCREV Move default sstate-cache dir from build dir Use distro specific sstate cache qtquickcompiler: add support for BYOS builds qtcharts: update revision qt5: update submodules democompositor: use correct path the SDK sources b2qt-demos: update SRCREV Add git SHA1 to b2qt addon package versions b2qt-utils: update SRCREV ... Conflicts: recipes-qt/qt5/qtconnectivity_git.bbappend Change-Id: I1c090c8f87e43664971e0381b93ccad5e4e48175
Diffstat (limited to 'recipes')
-rw-r--r--recipes/dracut/dracut_git.bbappend4
-rw-r--r--recipes/initramfs-basic/files/init.sh102
-rw-r--r--recipes/initramfs-basic/init-basic.bb34
-rw-r--r--recipes/initramfs-basic/initramfs-basic.bb40
-rw-r--r--recipes/os-release/os-release.bbappend39
-rw-r--r--recipes/ostree/ostree.bb1
-rw-r--r--recipes/ostree/ostree/0004-Mount-boot-partition.patch108
-rw-r--r--recipes/ostree/ostree/0005-Do-not-use-grub2-mkconfig.patch60
8 files changed, 323 insertions, 65 deletions
diff --git a/recipes/dracut/dracut_git.bbappend b/recipes/dracut/dracut_git.bbappend
index e33637a..ca3437c 100644
--- a/recipes/dracut/dracut_git.bbappend
+++ b/recipes/dracut/dracut_git.bbappend
@@ -19,6 +19,10 @@
19## 19##
20############################################################################## 20##############################################################################
21 21
22PV = "044+git${SRCREV}"
23SRCREV = "1bc3e733f96033a508841e97fe08da7a12851782"
24SRC_URI = "git://git.kernel.org/pub/scm/boot/dracut/dracut.git;protocol=http"
25
22# Upstream recipe mistakenly depends on systemd, we remove that dependency here. 26# Upstream recipe mistakenly depends on systemd, we remove that dependency here.
23RDEPENDS_${PN}_remove = "systemd" 27RDEPENDS_${PN}_remove = "systemd"
24REQUIRED_DISTRO_FEATURES_remove = "systemd" 28REQUIRED_DISTRO_FEATURES_remove = "systemd"
diff --git a/recipes/initramfs-basic/files/init.sh b/recipes/initramfs-basic/files/init.sh
new file mode 100644
index 0000000..3db235b
--- /dev/null
+++ b/recipes/initramfs-basic/files/init.sh
@@ -0,0 +1,102 @@
1#!/bin/sh
2
3PATH=/sbin:/bin:/usr/sbin:/usr/bin
4ROOT_MOUNT="/sysroot/"
5ROOT_DEVICE=""
6
7early_setup() {
8
9 mkdir -p /proc
10 mkdir -p /sys
11 mount -t proc proc /proc
12 mount -t sysfs sysfs /sys
13 mount -t devtmpfs none /dev
14
15 mkdir -p /run
16 mkdir -p /var/run
17}
18
19read_args() {
20
21 for arg in $(cat /proc/cmdline); do
22 value=$(echo ${arg} | cut -s -f2- -d '=')
23 case $arg in
24 root=*)
25 root=$value
26 ;;
27 debugshell*)
28 if [ -z "$value" ]; then
29 shelltimeout=30
30 else
31 shelltimeout=$value
32 fi
33 ;;
34 esac
35 done
36
37 if [ -z "$root" ] ; then
38 debug_shell "No root= specified via kernel command line."
39 else
40 case $root in
41 LABEL=*)
42 label=${root#LABEL=}
43 ;;
44 *)
45 debug_shell "This init script only supports root=LABEL=* for specifying root file system, but root=$root was provided."
46 ;;
47 esac
48 fi
49}
50
51mount_rootfs() {
52
53 mkdir -p $ROOT_MOUNT
54 mount $ROOT_DEVICE $ROOT_MOUNT
55 mount -n --move /proc $ROOT_MOUNT/proc
56 mount -n --move /sys $ROOT_MOUNT/sys
57 mount -n --move /dev $ROOT_MOUNT/dev
58
59 exec switch_root $ROOT_MOUNT /sbin/init || debug_shell "Couldn't switch_root."
60}
61
62switch_real_root() {
63
64 echo "Searching for media..."
65 C=0
66 while true
67 do
68
69 rootfs=$(findfs LABEL=$label)
70 if [ -n "$rootfs" ] ; then
71 ROOT_DEVICE=$rootfs
72 mount_rootfs
73 fi
74
75 # don't wait for more than $shelltimeout seconds, if it's set
76 if [ -n "$shelltimeout" ]; then
77 echo -n " " $(( $shelltimeout - $C ))
78 if [ $C -ge $shelltimeout ]; then
79 debug_shell "Cannot find root file system."
80 fi
81 C=$(( C + 1 ))
82 fi
83
84 sleep 1
85 done
86}
87
88debug_shell() {
89
90 echo ${1}
91 echo "Dropping to a shell."
92 exec sh
93}
94
95main() {
96
97 early_setup
98 read_args
99 switch_real_root
100}
101
102main
diff --git a/recipes/initramfs-basic/init-basic.bb b/recipes/initramfs-basic/init-basic.bb
new file mode 100644
index 0000000..674e683
--- /dev/null
+++ b/recipes/initramfs-basic/init-basic.bb
@@ -0,0 +1,34 @@
1##############################################################################
2##
3## Copyright (C) 2016 The Qt Company Ltd.
4## Contact: http://www.qt.io/licensing/
5##
6## This file is part of the Boot to Qt meta layer.
7##
8## $QT_BEGIN_LICENSE:COMM$
9##
10## Commercial License Usage
11## Licensees holding valid commercial Qt licenses may use this file in
12## accordance with the commercial license agreement provided with the
13## Software or, alternatively, in accordance with the terms contained in
14## a written agreement between you and The Qt Company. For licensing terms
15## and conditions see http://www.qt.io/terms-conditions. For further
16## information use the contact form at http://www.qt.io/contact-us.
17##
18## $QT_END_LICENSE$
19##
20##############################################################################
21
22SUMMARY = "Simple init script that mounts root filesystem by label."
23LICENSE = "CLOSED"
24SRC_URI = "file://init.sh"
25
26S = "${WORKDIR}"
27
28do_install () {
29 install -m 0755 ${WORKDIR}/init.sh ${D}/init
30}
31
32inherit allarch
33
34FILES_${PN} += "/init"
diff --git a/recipes/initramfs-basic/initramfs-basic.bb b/recipes/initramfs-basic/initramfs-basic.bb
new file mode 100644
index 0000000..4bef9c8
--- /dev/null
+++ b/recipes/initramfs-basic/initramfs-basic.bb
@@ -0,0 +1,40 @@
1##############################################################################
2##
3## Copyright (C) 2016 The Qt Company Ltd.
4## Contact: http://www.qt.io/licensing/
5##
6## This file is part of the Boot to Qt meta layer.
7##
8## $QT_BEGIN_LICENSE:COMM$
9##
10## Commercial License Usage
11## Licensees holding valid commercial Qt licenses may use this file in
12## accordance with the commercial license agreement provided with the
13## Software or, alternatively, in accordance with the terms contained in
14## a written agreement between you and The Qt Company. For licensing terms
15## and conditions see http://www.qt.io/terms-conditions. For further
16## information use the contact form at http://www.qt.io/contact-us.
17##
18## $QT_END_LICENSE$
19##
20##############################################################################
21
22DESCRIPTION = "Basic initramfs image. Useful as a template for more advanced functionality."
23LICENSE = "CLOSED"
24
25# findfs from busybox fails to do its jobs, the full version from util-linux-findfs works fine
26PACKAGE_INSTALL = "init-basic busybox util-linux-findfs ${ROOTFS_BOOTSTRAP_INSTALL}"
27
28# Do not pollute the initramfs image with rootfs features
29IMAGE_FEATURES = ""
30
31export IMAGE_BASENAME = "initramfs-basic"
32IMAGE_LINGUAS = ""
33
34IMAGE_FSTYPES = "cpio.gz"
35inherit core-image
36
37IMAGE_ROOTFS_SIZE = "8192"
38
39BAD_RECOMMENDATIONS += "busybox-syslog"
40
diff --git a/recipes/os-release/os-release.bbappend b/recipes/os-release/os-release.bbappend
new file mode 100644
index 0000000..98e2d16
--- /dev/null
+++ b/recipes/os-release/os-release.bbappend
@@ -0,0 +1,39 @@
1##############################################################################
2##
3## Copyright (C) 2016 The Qt Company Ltd.
4## Contact: http://www.qt.io/licensing/
5##
6## This file is part of the Boot to Qt meta layer.
7##
8## $QT_BEGIN_LICENSE:COMM$
9##
10## Commercial License Usage
11## Licensees holding valid commercial Qt licenses may use this file in
12## accordance with the commercial license agreement provided with the
13## Software or, alternatively, in accordance with the terms contained in
14## a written agreement between you and The Qt Company. For licensing terms
15## and conditions see http://www.qt.io/terms-conditions. For further
16## information use the contact form at http://www.qt.io/contact-us.
17##
18## $QT_END_LICENSE$
19##
20##############################################################################
21
22# Reported upstream https://bugzilla.yoctoproject.org/show_bug.cgi?id=9144
23python do_fix_quotes () {
24 with open(d.expand('${B}/os-release'), 'w') as f:
25 for field in d.getVar('OS_RELEASE_FIELDS', True).split():
26 value = d.getVar(field, True)
27 if value:
28 f.write('{0}="{1}"\n'.format(field, value))
29}
30
31do_verify_if_fixed_by_upstream () {
32 pretty_name_first_char=$(cat ${B}/os-release | grep "^PRETTY_NAME" | cut -f 2 -d '=' | cut -c1)
33 if [ "${pretty_name_first_char}" = "\"" ]] ; then
34 bbwarn "Issue appears to be fixed by upstream, remove this workaround."
35 fi
36}
37
38addtask do_verify_if_fixed_by_upstream after do_compile before do_install
39addtask do_fix_quotes after do_verify_if_fixed_by_upstream before do_install
diff --git a/recipes/ostree/ostree.bb b/recipes/ostree/ostree.bb
index a0a1b8a..4dbafd5 100644
--- a/recipes/ostree/ostree.bb
+++ b/recipes/ostree/ostree.bb
@@ -32,6 +32,7 @@ SRC_URI = " \
32 file://0002-u-boot-Merge-ostree-s-and-systems-uEnv.txt.patch \ 32 file://0002-u-boot-Merge-ostree-s-and-systems-uEnv.txt.patch \
33 file://0003-Allow-updating-files-in-root-of-boot.patch \ 33 file://0003-Allow-updating-files-in-root-of-boot.patch \
34 file://0004-Mount-boot-partition.patch \ 34 file://0004-Mount-boot-partition.patch \
35 file://0005-Do-not-use-grub2-mkconfig.patch \
35 " 36 "
36 37
37SRCREV = "efdb4d8f443768e59529c299290bee8b1f8f93c3" 38SRCREV = "efdb4d8f443768e59529c299290bee8b1f8f93c3"
diff --git a/recipes/ostree/ostree/0004-Mount-boot-partition.patch b/recipes/ostree/ostree/0004-Mount-boot-partition.patch
index 092e142..a81f731 100644
--- a/recipes/ostree/ostree/0004-Mount-boot-partition.patch
+++ b/recipes/ostree/ostree/0004-Mount-boot-partition.patch
@@ -1,82 +1,60 @@
1From 5e9ed74a20026e5c9043eaf8a224ce84cb9cd9f0 Mon Sep 17 00:00:00 2001 1From 33642082578946fdc73ade8b78c05ba8d8521652 Mon Sep 17 00:00:00 2001
2From: Gatis Paeglis <gatis.paeglis@theqtcompany.com> 2From: Gatis Paeglis <gatis.paeglis@theqtcompany.com>
3Date: Mon, 7 Dec 2015 18:14:26 +0100 3Date: Mon, 7 Mar 2016 15:17:34 +0100
4Subject: [PATCH] Mount boot partition 4Subject: [PATCH] ostree: Mount boot partition from user space
5 5
6On b2qt reference images the boot partition always is 6In the current approach we assumed that boot/
7the first partition on a device and rootfs is the second 7
8partition. We can get the root parition from a kernel 8- is on a separate boot partition
9command line and deduce the right boot partition from there. 9- boot partition is right before rootfs partition
10- rootfs parition is provided as a *device node*
11- has "ext2" filesystem (mount shell cmd tries to
12 auto detect FS type, mount system call does not.)
13
14The new approch does not assume any of the above, and
15moves this logic from early user space (initramfs) to
16user space. Initramfs by design should be used only to
17prepare the rootfs, other tasks should be done later.
10--- 18---
11 src/switchroot/ostree-prepare-root.c | 23 ++++++++++++++++++----- 19 src/switchroot/ostree-remount.c | 19 ++++++++++++++++++-
12 1 file changed, 18 insertions(+), 5 deletions(-) 20 1 file changed, 18 insertions(+), 1 deletion(-)
13 21
14diff --git a/src/switchroot/ostree-prepare-root.c b/src/switchroot/ostree-prepare-root.c 22diff --git a/src/switchroot/ostree-remount.c b/src/switchroot/ostree-remount.c
15index 3de137b..2637dc3 100644 23index b8d3a96..33f2645 100644
16--- a/src/switchroot/ostree-prepare-root.c 24--- a/src/switchroot/ostree-remount.c
17+++ b/src/switchroot/ostree-prepare-root.c 25+++ b/src/switchroot/ostree-remount.c
18@@ -45,7 +45,7 @@ 26@@ -77,7 +77,7 @@ maybe_mount_tmpfs_on_var (void)
19 #include "ostree-mount-util.h" 27 int
20 28 main(int argc, char *argv[])
21 static char *
22-parse_ostree_cmdline (void)
23+parse_kernel_cmdline (const char *arg)
24 { 29 {
25 FILE *f = fopen("/proc/cmdline", "r"); 30- const char *remounts[] = { "/sysroot", "/etc", "/home", "/root", "/tmp", "/var", NULL };
26 char *cmdline = NULL; 31+ const char *remounts[] = { "/sysroot", "/etc", "/home", "/root", "/tmp", "/var", "/boot", NULL };
27@@ -75,9 +75,9 @@ parse_ostree_cmdline (void)
28 const char *next_nonspc = next;
29 while (next_nonspc && *next_nonspc == ' ')
30 next_nonspc += 1;
31- if (strncmp (iter, "ostree=", strlen ("ostree=")) == 0)
32+ if (strncmp (iter, arg, strlen (arg)) == 0)
33 {
34- const char *start = iter + strlen ("ostree=");
35+ const char *start = iter + strlen (arg);
36 if (next)
37 ret = strndup (start, next - start);
38 else
39@@ -114,10 +114,12 @@ main(int argc, char *argv[])
40 const char *readonly_bind_mounts[] = { "/usr", NULL };
41 const char *root_mountpoint = NULL;
42 char *ostree_target = NULL;
43+ char *boot_partition = NULL;
44 char *deploy_path = NULL;
45 char srcpath[PATH_MAX];
46 char destpath[PATH_MAX];
47 char newroot[PATH_MAX];
48+ char boot_mountpoint[PATH_MAX];
49 struct stat stbuf; 32 struct stat stbuf;
50 int i; 33 int i;
51 34
52@@ -129,7 +131,7 @@ main(int argc, char *argv[]) 35@@ -117,5 +117,22 @@ main(int argc, char *argv[])
53 36
54 root_mountpoint = argv[1]; 37 maybe_mount_tmpfs_on_var ();
55 38
56- ostree_target = parse_ostree_cmdline (); 39+ /* ostree-prepare-root mounts boot/ if it is on the same partition as root filesystem.
57+ ostree_target = parse_kernel_cmdline ("ostree="); 40+ * If boot/ is not mounted, then it must be on a different partition. Try to mount
58 if (!ostree_target) 41+ * filesystem where LABEL=boot-ostree.
59 { 42+ */
60 fprintf (stderr, "No OSTree target; expected ostree=/ostree/boot.N/...\n"); 43+ if (!(lstat ("/boot/loader", &stbuf) == 0 && S_ISLNK (stbuf.st_mode)))
61@@ -246,6 +248,17 @@ main(int argc, char *argv[])
62 perrorv ("failed to MS_MOVE %s to %s", deploy_path, root_mountpoint);
63 exit (EXIT_FAILURE);
64 }
65-
66+
67+ /* first partition always is the boot partition */
68+ boot_partition = parse_kernel_cmdline ("root=");
69+ boot_partition[strlen (boot_partition) - 1] = '1';
70+ /* mount the real boot parition over the deployment's boot directory */
71+ snprintf (boot_mountpoint, sizeof(boot_mountpoint), "%s/boot/", root_mountpoint);
72+ if (mount (boot_partition, boot_mountpoint, "ext2", 0, NULL) < 0)
73+ { 44+ {
74+ perrorv ("failed to mount boot parition %s to %s", boot_partition, boot_mountpoint); 45+ /* mount the real boot parition over the deployment's boot directory */
75+ exit (EXIT_FAILURE); 46+ const char *mount_cmd="mount LABEL=boot-ostree /boot";
47+ FILE *fp = popen (mount_cmd, "w");
48+ if (fp == NULL)
49+ {
50+ perrorv ("popen failed for: %s", mount_cmd);
51+ exit (EXIT_FAILURE);
52+ }
53+ pclose (fp);
76+ } 54+ }
77+ 55+
78 exit (EXIT_SUCCESS); 56 exit (EXIT_SUCCESS);
79 } 57 }
80-- 58--
812.1.4 592.7.0
82 60
diff --git a/recipes/ostree/ostree/0005-Do-not-use-grub2-mkconfig.patch b/recipes/ostree/ostree/0005-Do-not-use-grub2-mkconfig.patch
new file mode 100644
index 0000000..1414ff7
--- /dev/null
+++ b/recipes/ostree/ostree/0005-Do-not-use-grub2-mkconfig.patch
@@ -0,0 +1,60 @@
1From b613d60319beffc861f5b1faa906d2ee0c685f52 Mon Sep 17 00:00:00 2001
2From: Gatis Paeglis <gatis.paeglis@theqtcompany.com>
3Date: Wed, 24 Feb 2016 18:12:27 +0100
4Subject: [PATCH] Do not use grub2-mkconfig.
5
6For details see: https://bugzilla.gnome.org/show_bug.cgi?id=762220
7---
8 src/libostree/ostree-bootloader-grub2.c | 12 +++++++++++-
9 1 file changed, 11 insertions(+), 1 deletion(-)
10
11diff --git a/src/libostree/ostree-bootloader-grub2.c b/src/libostree/ostree-bootloader-grub2.c
12index 1f89914..7cfb0dc 100644
13--- a/src/libostree/ostree-bootloader-grub2.c
14+++ b/src/libostree/ostree-bootloader-grub2.c
15@@ -282,6 +282,8 @@ grub2_child_setup (gpointer user_data)
16 }
17 }
18
19+#define OSTREE_NO_GRUB2_MKCONFIG
20+
21 static gboolean
22 _ostree_bootloader_grub2_write_config (OstreeBootloader *bootloader,
23 int bootversion,
24@@ -300,6 +302,7 @@ _ostree_bootloader_grub2_write_config (OstreeBootloader *bootloader,
25 g_autoptr(GFile) config_path_efi_dir = NULL;
26 g_autofree char *grub2_mkconfig_chroot = NULL;
27
28+#ifndef OSTREE_NO_GRUB2_MKCONFIG
29 if (ostree_sysroot_get_booted_deployment (self->sysroot) == NULL
30 && g_file_has_parent (self->sysroot->path, NULL))
31 {
32@@ -322,7 +325,7 @@ _ostree_bootloader_grub2_write_config (OstreeBootloader *bootloader,
33 tool_deployment_root = ostree_sysroot_get_deployment_directory (self->sysroot, tool_deployment);
34 grub2_mkconfig_chroot = g_file_get_path (tool_deployment_root);
35 }
36-
37+#endif
38 if (self->is_efi)
39 {
40 config_path_efi_dir = g_file_get_parent (self->config_path_efi);
41@@ -337,9 +340,16 @@ _ostree_bootloader_grub2_write_config (OstreeBootloader *bootloader,
42 bootversion);
43 }
44
45+#ifdef OSTREE_NO_GRUB2_MKCONFIG
46+ procctx = gs_subprocess_context_newv ("ostree-grub-generator", "-o",
47+ gs_file_get_path_cached (new_config_path),
48+ NULL);
49+#else
50 procctx = gs_subprocess_context_newv ("grub2-mkconfig", "-o",
51 gs_file_get_path_cached (new_config_path),
52 NULL);
53+#endif
54+
55 child_env = g_environ_setenv (child_env, "_OSTREE_GRUB2_BOOTVERSION", bootversion_str, TRUE);
56 /* We have to pass our state to the child */
57 if (self->is_efi)
58--
592.7.0
60