diff options
19 files changed, 320 insertions, 197 deletions
diff --git a/conf/distro/include/nitrogen6x.conf b/conf/distro/include/nitrogen6x.conf index 1000676..ce64083 100644 --- a/conf/distro/include/nitrogen6x.conf +++ b/conf/distro/include/nitrogen6x.conf | |||
@@ -34,15 +34,8 @@ BOOTFS_CONTENT = "\ | |||
34 | 6x_bootscript-${MACHINE}:6x_bootscript \ | 34 | 6x_bootscript-${MACHINE}:6x_bootscript \ |
35 | 6x_upgrade-${MACHINE}:6x_upgrade \ | 35 | 6x_upgrade-${MACHINE}:6x_upgrade \ |
36 | u-boot-${MACHINE}.imx:u-boot.imx \ | 36 | u-boot-${MACHINE}.imx:u-boot.imx \ |
37 | ${KERNEL_IMAGETYPE}:update/${KERNEL_IMAGETYPE} \ | ||
38 | ${KERNEL_IMAGETYPE}-imx6q-${MACHINE}.dtb:update/imx6q-${MACHINE}.dtb \ | ||
39 | ${KERNEL_IMAGETYPE}-imx6dl-${MACHINE}.dtb:update/imx6dl-${MACHINE}.dtb \ | ||
40 | ${KERNEL_IMAGETYPE}-imx6q-sabrelite.dtb:update/imx6q-sabrelite.dtb \ | ||
41 | ${KERNEL_IMAGETYPE}-imx6dl-nit6xlite.dtb:update/imx6dl-nit6xlite.dtb \ | ||
42 | ${KERNEL_IMAGETYPE}-imx6q-nitrogen6_max.dtb:update/imx6q-nitrogen6_max.dtb \ | ||
43 | update/platform:update/platform \ | ||
44 | " | 37 | " |
45 | BOOTFS_DEPENDS = "u-boot:do_deploy virtual/kernel:do_deploy u-boot-script-boundary:do_deploy b2qt-update-framework:do_deploy" | 38 | BOOTFS_DEPENDS = "u-boot:do_deploy virtual/kernel:do_deploy u-boot-script-boundary:do_deploy" |
46 | 39 | ||
47 | EXTRA_IMAGEDEPENDS += "u-boot-script-boundary" | 40 | EXTRA_IMAGEDEPENDS += "u-boot-script-boundary" |
48 | 41 | ||
@@ -71,6 +64,4 @@ MACHINE_EXTRA_INSTALL_SDK += " \ | |||
71 | opencv-dev \ | 64 | opencv-dev \ |
72 | " | 65 | " |
73 | 66 | ||
74 | B2QT_PLATFORM = "iMX6-eLinux" | ||
75 | |||
76 | ADB_PRODUCTID = "0x0d02" | 67 | ADB_PRODUCTID = "0x0d02" |
diff --git a/meta-fsl-extras/recipes/u-boot/u-boot-script-boundary/0002-nitrogen6x-update.patch b/meta-fsl-extras/recipes/u-boot/u-boot-script-boundary/0002-nitrogen6x-update.patch deleted file mode 100644 index dd699d8..0000000 --- a/meta-fsl-extras/recipes/u-boot/u-boot-script-boundary/0002-nitrogen6x-update.patch +++ /dev/null | |||
@@ -1,84 +0,0 @@ | |||
1 | From 3d7276b2b27317c5067d2095ea5c3952d11f4390 Mon Sep 17 00:00:00 2001 | ||
2 | From: Rainer Keller <rainer.keller@digia.com> | ||
3 | Date: Fri, 5 Sep 2014 14:39:50 +0200 | ||
4 | Subject: [PATCH] Add support for update recovery linux | ||
5 | |||
6 | --- | ||
7 | board/boundary/nitrogen6x/6x_bootscript-yocto.txt | 61 +++++++++++++++++++++++ | ||
8 | 1 file changed, 61 insertions(+) | ||
9 | |||
10 | diff --git a/board/boundary/nitrogen6x/6x_bootscript-yocto.txt b/board/boundary/nitrogen6x/6x_bootscript-yocto.txt | ||
11 | index 5bc6170..4116ed4 100644 | ||
12 | --- a/board/boundary/nitrogen6x/6x_bootscript-yocto.txt | ||
13 | +++ b/board/boundary/nitrogen6x/6x_bootscript-yocto.txt | ||
14 | @@ -1,3 +1,67 @@ | ||
15 | +# Boot2Qt update part begin | ||
16 | +echo "Boot to Qt" | ||
17 | +mw.b 0x13000000 0x76 1 # v | ||
18 | +mw.b 0x13000001 0x75 1 # u | ||
19 | +mw.b 0x13000002 0x74 1 # t | ||
20 | +mw.b 0x13000003 0x69 1 # i | ||
21 | + | ||
22 | +fdtaddr=0x12000000 | ||
23 | + | ||
24 | +if test "x$boot2qt_update_state" = "x" ; then | ||
25 | + setenv boot2qt_update_state valid | ||
26 | + saveenv | ||
27 | +fi | ||
28 | + | ||
29 | +# This is a workaround because environment partition is read-only. | ||
30 | +if fatload mmc 1:1 0x12000000 update/state ; then | ||
31 | + if cmp.b 0x12000000 0x13000000 1 ; then | ||
32 | + echo "State: Valid" | ||
33 | + setenv boot2qt_fat_state valid | ||
34 | + setenv boot2qt_update_state valid | ||
35 | + saveenv | ||
36 | + fi | ||
37 | + if cmp.b 0x12000000 0x13000001 1 ; then | ||
38 | + echo "State: Update" | ||
39 | + setenv boot2qt_fat_state update | ||
40 | + fi | ||
41 | + if cmp.b 0x12000000 0x13000002 1 ; then | ||
42 | + echo "State: Testing" | ||
43 | + setenv boot2qt_fat_state testing | ||
44 | + fi | ||
45 | +fi | ||
46 | + | ||
47 | +if test "x$boot2qt_fat_state" = "xupdate" || test "x$boot2qt_update_state" = "xinvalid" ; then | ||
48 | + setenv boot2qt_update_state testing | ||
49 | + saveenv | ||
50 | + echo "Recovery linux starting..." | ||
51 | + setenv bootargs "console=ttymxc1,115200 vmalloc=400M consoleblank=0 vt.global_cursor_default=0 root=/dev/ram0" | ||
52 | + | ||
53 | + # Guess dtb name | ||
54 | + dtbname="imx6"; | ||
55 | + if itest.s x6S != "x$cpu" ; then | ||
56 | + dtbname=${dtbname}q-; | ||
57 | + else | ||
58 | + dtbname=${dtbname}s-; | ||
59 | + fi | ||
60 | + | ||
61 | + if itest.s x == "x$board" ; then | ||
62 | + board=sabrelite | ||
63 | + fi | ||
64 | + dtbname=${dtbname}${board}.dtb; | ||
65 | + | ||
66 | + fatload mmc 1:1 ${loadaddr} update/uImage | ||
67 | + fatload mmc 1:1 ${fdtaddr} update/${dtbname} | ||
68 | + fatload mmc 1:1 0x13000000 update/uRamdisk | ||
69 | + bootm ${loadaddr} 0x13000000 ${fdtaddr} | ||
70 | +fi | ||
71 | + | ||
72 | +if test "x$boot2qt_fat_state" = "xtesting" || test "x$boot2qt_update_state" = "xtesting"; then | ||
73 | + setenv boot2qt_update_state invalid | ||
74 | + saveenv | ||
75 | +fi | ||
76 | + | ||
77 | +# Boot2Qt update part end | ||
78 | + | ||
79 | # Yocto-specifics | ||
80 | setenv bootpart 2 | ||
81 | setenv bootdir / | ||
82 | -- | ||
83 | 1.8.5.5 | ||
84 | |||
diff --git a/meta-fsl-extras/recipes/u-boot/u-boot-script-boundary_git.bbappend b/meta-fsl-extras/recipes/u-boot/u-boot-script-boundary_git.bbappend index abbc222..a6cee2b 100644 --- a/meta-fsl-extras/recipes/u-boot/u-boot-script-boundary_git.bbappend +++ b/meta-fsl-extras/recipes/u-boot/u-boot-script-boundary_git.bbappend | |||
@@ -23,5 +23,4 @@ | |||
23 | FILESEXTRAPATHS_append := "${THISDIR}/${PN}:" | 23 | FILESEXTRAPATHS_append := "${THISDIR}/${PN}:" |
24 | SRC_URI += " \ | 24 | SRC_URI += " \ |
25 | file://0001-nitrogen6x-update-bootargs.patch \ | 25 | file://0001-nitrogen6x-update-bootargs.patch \ |
26 | file://0002-nitrogen6x-update.patch \ | ||
27 | " | 26 | " |
diff --git a/recipes/e2fsprogs/e2fsprogs_%.bbappend b/recipes/e2fsprogs/e2fsprogs_%.bbappend deleted file mode 100644 index 608377e..0000000 --- a/recipes/e2fsprogs/e2fsprogs_%.bbappend +++ /dev/null | |||
@@ -1 +0,0 @@ | |||
1 | BBCLASSEXTEND = "native nativesdk" | ||
diff --git a/recipes/glib-networking/glib-networking_%.bbappend b/recipes/glib-networking/glib-networking_%.bbappend deleted file mode 100644 index 608377e..0000000 --- a/recipes/glib-networking/glib-networking_%.bbappend +++ /dev/null | |||
@@ -1 +0,0 @@ | |||
1 | BBCLASSEXTEND = "native nativesdk" | ||
diff --git a/recipes/gpgme/gpgme_%.bbappend b/recipes/gpgme/gpgme_%.bbappend deleted file mode 100644 index 608377e..0000000 --- a/recipes/gpgme/gpgme_%.bbappend +++ /dev/null | |||
@@ -1 +0,0 @@ | |||
1 | BBCLASSEXTEND = "native nativesdk" | ||
diff --git a/recipes/libassuan/libassuan_%.bbappend b/recipes/libassuan/libassuan_%.bbappend deleted file mode 100644 index 608377e..0000000 --- a/recipes/libassuan/libassuan_%.bbappend +++ /dev/null | |||
@@ -1 +0,0 @@ | |||
1 | BBCLASSEXTEND = "native nativesdk" | ||
diff --git a/recipes/libgpg-error/libgpg-error_%.bbappend b/recipes/libgpg-error/libgpg-error_%.bbappend deleted file mode 100644 index 2a59083..0000000 --- a/recipes/libgpg-error/libgpg-error_%.bbappend +++ /dev/null | |||
@@ -1 +0,0 @@ | |||
1 | BBCLASSEXTEND += "nativesdk" | ||
diff --git a/recipes/libgsystem/libgsystem.bb b/recipes/libgsystem/libgsystem.bb index f006a39..d2d1a0b 100644 --- a/recipes/libgsystem/libgsystem.bb +++ b/recipes/libgsystem/libgsystem.bb | |||
@@ -39,5 +39,3 @@ do_configure_prepend() { | |||
39 | # We get a syntax error since we do not bundle gnome recipes that define this macro. | 39 | # We get a syntax error since we do not bundle gnome recipes that define this macro. |
40 | sed -i '/GTK_DOC_CHECK/d' ${S}/configure.ac | 40 | sed -i '/GTK_DOC_CHECK/d' ${S}/configure.ac |
41 | } | 41 | } |
42 | |||
43 | BBCLASSEXTEND = "native nativesdk" | ||
diff --git a/recipes/b2qt-update-framework/b2qt-update-framework.bb b/recipes/libsoup-2.4/libsoup-2.4_2.46.0.bbappend index ceae95a..bc3d1ff 100644 --- a/recipes/b2qt-update-framework/b2qt-update-framework.bb +++ b/recipes/libsoup-2.4/libsoup-2.4_2.46.0.bbappend | |||
@@ -1,6 +1,6 @@ | |||
1 | ############################################################################# | 1 | ############################################################################# |
2 | ## | 2 | ## |
3 | ## Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies). | 3 | ## Copyright (C) 2015 Digia Plc and/or its subsidiary(-ies). |
4 | ## | 4 | ## |
5 | ## This file is part of the Qt Enterprise Embedded Scripts of the Qt | 5 | ## This file is part of the Qt Enterprise Embedded Scripts of the Qt |
6 | ## framework. | 6 | ## framework. |
@@ -20,26 +20,9 @@ | |||
20 | ## | 20 | ## |
21 | ############################################################################# | 21 | ############################################################################# |
22 | 22 | ||
23 | DESCRIPTION = "Boot to Qt update framework" | 23 | # Remove this recipe when openembedded-core/meta/recipes-support/libsoup/ |
24 | HOMEPAGE = "http://www.qt.io" | 24 | # will be updated to 2.50.0 version or above. |
25 | SECTION = "devel" | 25 | PV = "2.50.0" |
26 | LICENSE = "CLOSED" | ||
27 | 26 | ||
28 | PV = "1.0.0" | 27 | SRC_URI[md5sum] = "9a84d66e1b7ccd3bd340574b11eccc15" |
29 | PR = "r0" | 28 | SRC_URI[sha256sum] = "1e01365ac4af3817187ea847f9d3588c27eee01fc519a5a7cb212bb78b0f667b" |
30 | SRCREV = "${PV}" | ||
31 | |||
32 | inherit deploy | ||
33 | |||
34 | do_deploy() { | ||
35 | install -d ${DEPLOYDIR}/update/ | ||
36 | echo ${B2QT_PLATFORM} > ${DEPLOYDIR}/update/platform | ||
37 | } | ||
38 | |||
39 | addtask deploy after do_install before do_build | ||
40 | |||
41 | do_compile[noexec] = "1" | ||
42 | do_install[noexec] = "1" | ||
43 | do_populate_sysroot[noexec] = "1" | ||
44 | |||
45 | PACKAGE_ARCH = "${MACHINE_ARCH}" | ||
diff --git a/recipes/libsoup/libsoup-%.bbappend b/recipes/libsoup/libsoup-%.bbappend deleted file mode 100644 index 4a95767..0000000 --- a/recipes/libsoup/libsoup-%.bbappend +++ /dev/null | |||
@@ -1,2 +0,0 @@ | |||
1 | DEPENDS += "glib-networking" | ||
2 | BBCLASSEXTEND = "native nativesdk" | ||
diff --git a/recipes/ostree/ostree.bb b/recipes/ostree/ostree.bb index acd8305..49060b6 100644 --- a/recipes/ostree/ostree.bb +++ b/recipes/ostree/ostree.bb | |||
@@ -28,13 +28,18 @@ LIC_FILES_CHKSUM = "file://COPYING;md5=5f30f0716dfdd0d91eb439ebec522ec2" | |||
28 | inherit autotools pkgconfig systemd | 28 | inherit autotools pkgconfig systemd |
29 | 29 | ||
30 | SRC_URI = " \ | 30 | SRC_URI = " \ |
31 | git://github.com/GNOME/ostree.git;tag=v2015.9 \ | 31 | git://github.com/GNOME/ostree.git \ |
32 | file://0001-Don-t-require-boot-uEnv.txt-for-u-boot-support.patch \ | 32 | file://0001-Allow-updating-files-on-the-boot-partition.patch \ |
33 | file://0002-u-boot-Merge-ostree-s-and-systems-uEnv.txt.patch \ | ||
34 | file://0003-Allow-updating-files-in-root-of-boot.patch \ | ||
33 | " | 35 | " |
34 | 36 | ||
37 | SRCREV = "efdb4d8f443768e59529c299290bee8b1f8f93c3" | ||
38 | |||
35 | S = "${WORKDIR}/git" | 39 | S = "${WORKDIR}/git" |
36 | 40 | ||
37 | DEPENDS = "glib-2.0 e2fsprogs gpgme attr libsoup-2.4 libgsystem libassuan xz" | 41 | DEPENDS = "glib-2.0 e2fsprogs gpgme attr libsoup-2.4 libgsystem libassuan xz" |
42 | RRECOMMENDS_${PN} += "gnupg" | ||
38 | 43 | ||
39 | PACKAGECONFIG ??= "${@base_contains('DISTRO_FEATURES', 'systemd', 'systemd', '', d)}" | 44 | PACKAGECONFIG ??= "${@base_contains('DISTRO_FEATURES', 'systemd', 'systemd', '', d)}" |
40 | PACKAGECONFIG[systemd] = "--with-systemdsystemunitdir=${systemd_unitdir}/system/,,," | 45 | PACKAGECONFIG[systemd] = "--with-systemdsystemunitdir=${systemd_unitdir}/system/,,," |
@@ -42,7 +47,13 @@ PACKAGECONFIG[systemd] = "--with-systemdsystemunitdir=${systemd_unitdir}/system/ | |||
42 | SYSTEMD_SERVICE_${PN} = "ostree-prepare-root.service ostree-remount.service" | 47 | SYSTEMD_SERVICE_${PN} = "ostree-prepare-root.service ostree-remount.service" |
43 | FILES_${PN} += "${systemd_unitdir}/system/" | 48 | FILES_${PN} += "${systemd_unitdir}/system/" |
44 | 49 | ||
45 | EXTRA_OECONF = "--with-dracut --without-selinux --without-libarchive --with-grub2=no --enable-gtk-doc-html=no" | 50 | EXTRA_OECONF = "--with-dracut \ |
51 | --without-selinux \ | ||
52 | --without-libarchive \ | ||
53 | --with-grub2=no \ | ||
54 | --enable-gtk-doc-html=no \ | ||
55 | --with-soup \ | ||
56 | --enable-libsoup-client-certs" | ||
46 | 57 | ||
47 | do_configure_prepend() { | 58 | do_configure_prepend() { |
48 | cd ${S} | 59 | cd ${S} |
@@ -57,5 +68,3 @@ do_install_append() { | |||
57 | # this of course is a broken configure.ac logic. | 68 | # this of course is a broken configure.ac logic. |
58 | rm -rf ${D}${libdir}/dracut/ | 69 | rm -rf ${D}${libdir}/dracut/ |
59 | } | 70 | } |
60 | |||
61 | BBCLASSEXTEND = "native nativesdk" | ||
diff --git a/recipes/ostree/ostree/0001-Allow-updating-files-on-the-boot-partition.patch b/recipes/ostree/ostree/0001-Allow-updating-files-on-the-boot-partition.patch new file mode 100644 index 0000000..0905cc1 --- /dev/null +++ b/recipes/ostree/ostree/0001-Allow-updating-files-on-the-boot-partition.patch | |||
@@ -0,0 +1,92 @@ | |||
1 | From bbb7a8ce89e3e13672c63fd4f1f19988fdf40014 Mon Sep 17 00:00:00 2001 | ||
2 | From: Gatis Paeglis <gatis.paeglis@theqtcompany.com> | ||
3 | Date: Thu, 5 Nov 2015 17:37:54 +0100 | ||
4 | Subject: [PATCH 1/2] Allow updating files on the boot partition | ||
5 | |||
6 | Until now OSTree copied only vmlinuz and initramfs | ||
7 | binaries to the boot partition. This patch adds support | ||
8 | for copying other files from the /boot directory of the | ||
9 | tree. | ||
10 | |||
11 | How this works: | ||
12 | |||
13 | Ignore subdirectories, only files in root of the boot | ||
14 | directory are copied. There is overhead of copying files | ||
15 | to boot partition, therefore the amount of files in the | ||
16 | boot/ should be kept to the minimum and subdirectories | ||
17 | shouldn't really be necessary. | ||
18 | |||
19 | Files on the boot partition are updated only with major | ||
20 | releases, when kernel/initramfs bootcsum changes. Files | ||
21 | that require frequent updates should not be stored here. | ||
22 | --- | ||
23 | src/libostree/ostree-sysroot-deploy.c | 53 +++++++++++++++++++++++++++++++++++ | ||
24 | 1 file changed, 53 insertions(+) | ||
25 | |||
26 | diff --git a/src/libostree/ostree-sysroot-deploy.c b/src/libostree/ostree-sysroot-deploy.c | ||
27 | index f7afe3d..4d6534d 100644 | ||
28 | --- a/src/libostree/ostree-sysroot-deploy.c | ||
29 | +++ b/src/libostree/ostree-sysroot-deploy.c | ||
30 | @@ -1340,6 +1340,59 @@ install_deployment_kernel (OstreeSysroot *sysroot, | ||
31 | } | ||
32 | } | ||
33 | |||
34 | + { | ||
35 | + /* Copy other files that are stored in the boot directory. Lets keep this simple: | ||
36 | + * | ||
37 | + * - Ignore subdirectories, only files in root of the boot directory are copied. There is | ||
38 | + * overhead of copying files to boot partition, therefore the amount of files in the boot/ | ||
39 | + * should be kept to the minimum and subdirectories shouldn't really be necessary. | ||
40 | + * - Files on the boot partition are updated only with major releases, when kernel/initramfs | ||
41 | + * bootcsum changes. Files that require frequent updates should not be stored here. | ||
42 | + */ | ||
43 | + g_autoptr(GFileEnumerator) dir_enum = NULL; | ||
44 | + g_autoptr(GFile) deployments_bootdir = g_file_get_child (deployment_dir, "boot"); | ||
45 | + dir_enum = g_file_enumerate_children (deployments_bootdir, OSTREE_GIO_FAST_QUERYINFO, | ||
46 | + G_FILE_QUERY_INFO_NOFOLLOW_SYMLINKS, | ||
47 | + NULL, error); | ||
48 | + while (TRUE) | ||
49 | + { | ||
50 | + GFileInfo *file_info = NULL; | ||
51 | + g_autoptr(GFile) source_file = NULL; | ||
52 | + g_autoptr(GFile) dest_file = NULL; | ||
53 | + g_autoptr(GFile) symlink_target = NULL; | ||
54 | + GFileType type; | ||
55 | + const char *name; | ||
56 | + | ||
57 | + if (!gs_file_enumerator_iterate (dir_enum, &file_info, NULL, cancellable, error)) | ||
58 | + goto out; | ||
59 | + if (file_info == NULL) | ||
60 | + break; | ||
61 | + | ||
62 | + type = g_file_info_get_file_type (file_info); | ||
63 | + name = g_file_info_get_name (file_info); | ||
64 | + if (type == G_FILE_TYPE_DIRECTORY) | ||
65 | + continue; | ||
66 | + if (type == G_FILE_TYPE_SYMBOLIC_LINK) | ||
67 | + { | ||
68 | + symlink_target = g_file_get_child (bootcsumdir, g_file_info_get_symlink_target(file_info)); | ||
69 | + if (!g_file_query_exists (symlink_target, NULL)) | ||
70 | + continue; | ||
71 | + } | ||
72 | + if (g_str_has_prefix (name, "vmlinuz-") || g_str_has_prefix (name, "initramfs-")) | ||
73 | + continue; | ||
74 | + | ||
75 | + dest_file = g_file_get_child (bootcsumdir, name); | ||
76 | + if (!g_file_query_exists (dest_file, NULL)) | ||
77 | + { | ||
78 | + source_file = g_file_enumerator_get_child (dir_enum, file_info); | ||
79 | + if (!gs_file_linkcopy_sync_data (source_file, dest_file, | ||
80 | + G_FILE_COPY_OVERWRITE | G_FILE_COPY_NOFOLLOW_SYMLINKS | G_FILE_COPY_ALL_METADATA, | ||
81 | + cancellable, error)) | ||
82 | + goto out; | ||
83 | + } | ||
84 | + } | ||
85 | + } | ||
86 | + | ||
87 | if (fstatat (deployment_dfd, "usr/lib/os-release", &stbuf, 0) != 0) | ||
88 | { | ||
89 | if (errno != ENOENT) | ||
90 | -- | ||
91 | 2.1.4 | ||
92 | |||
diff --git a/recipes/ostree/ostree/0001-Don-t-require-boot-uEnv.txt-for-u-boot-support.patch b/recipes/ostree/ostree/0001-Don-t-require-boot-uEnv.txt-for-u-boot-support.patch deleted file mode 100644 index 8e1be94..0000000 --- a/recipes/ostree/ostree/0001-Don-t-require-boot-uEnv.txt-for-u-boot-support.patch +++ /dev/null | |||
@@ -1,62 +0,0 @@ | |||
1 | From ca0a0261be6397d5acb7a4fa2a492c5b554fb1fe Mon Sep 17 00:00:00 2001 | ||
2 | From: Gatis Paeglis <gatis.paeglis@theqtcompany.com> | ||
3 | Date: Tue, 6 Oct 2015 23:43:25 +0200 | ||
4 | Subject: [PATCH] Don't require /boot/uEnv.txt for u-boot support | ||
5 | |||
6 | The current code checks if /boot/uEnv.txt is a symlink to | ||
7 | decice if sysroot requires u-boot support. Why this is bad: | ||
8 | |||
9 | There are 2 ways to provide a custom env to u-boot from user space: | ||
10 | |||
11 | 1) A compiled binary that is sourced from u-boot. | ||
12 | 2) A text file (usually /uEnv.txt) that is imported into env from u-boot. | ||
13 | |||
14 | The current OSTree u-boot integration code was designed with the 1st | ||
15 | case in mind. | ||
16 | |||
17 | Many bootscripts provided by an embedded device vendors expect | ||
18 | to find uEnv.txt in the top level directory, it is often hardcoded | ||
19 | when building u-boot and is difficult to change later on. Or in other | ||
20 | cases it is stored in read-only memory so changing it would require | ||
21 | re-flushing boot loader with a new env. So the issue here is that | ||
22 | OSTree's and vendor uEnv.txt want to exist on the same path and OSTree | ||
23 | would throw away any changes added to /uEnv.txt by user on the next | ||
24 | upgrade/deploy. | ||
25 | |||
26 | This patch "hides" away the OSTree's env file loader/uEnv.txt from users | ||
27 | who are used to edditing uEnv.txt at the top level directory. Now to add | ||
28 | OSTree support on such boards you can simply add a custom logic in uEnv.txt | ||
29 | that loads ostree env from /loader/uEnv.txt | ||
30 | |||
31 | This change is backward compatible with the previous ostree releases and | ||
32 | solves the issue described in: | ||
33 | |||
34 | https://bugzilla.gnome.org/show_bug.cgi?id=755787 | ||
35 | --- | ||
36 | src/libostree/ostree-bootloader-uboot.c | 4 ++-- | ||
37 | 1 file changed, 2 insertions(+), 2 deletions(-) | ||
38 | |||
39 | diff --git a/src/libostree/ostree-bootloader-uboot.c b/src/libostree/ostree-bootloader-uboot.c | ||
40 | index 4c0218f..f67e9bd 100644 | ||
41 | --- a/src/libostree/ostree-bootloader-uboot.c | ||
42 | +++ b/src/libostree/ostree-bootloader-uboot.c | ||
43 | @@ -52,7 +52,7 @@ _ostree_bootloader_uboot_query (OstreeBootloader *bootloader, | ||
44 | { | ||
45 | OstreeBootloaderUboot *self = OSTREE_BOOTLOADER_UBOOT (bootloader); | ||
46 | |||
47 | - *out_is_active = g_file_query_file_type (self->config_path, G_FILE_QUERY_INFO_NOFOLLOW_SYMLINKS, NULL) == G_FILE_TYPE_SYMBOLIC_LINK; | ||
48 | + *out_is_active = g_file_query_file_type (self->config_path, G_FILE_QUERY_INFO_NOFOLLOW_SYMLINKS, NULL) == G_FILE_TYPE_REGULAR; | ||
49 | return TRUE; | ||
50 | } | ||
51 | |||
52 | @@ -177,6 +177,6 @@ _ostree_bootloader_uboot_new (OstreeSysroot *sysroot) | ||
53 | { | ||
54 | OstreeBootloaderUboot *self = g_object_new (OSTREE_TYPE_BOOTLOADER_UBOOT, NULL); | ||
55 | self->sysroot = g_object_ref (sysroot); | ||
56 | - self->config_path = g_file_resolve_relative_path (self->sysroot->path, "boot/uEnv.txt"); | ||
57 | + self->config_path = g_file_resolve_relative_path (self->sysroot->path, "boot/loader/uEnv.txt"); | ||
58 | return self; | ||
59 | } | ||
60 | -- | ||
61 | 2.1.4 | ||
62 | |||
diff --git a/recipes/ostree/ostree/0002-u-boot-Merge-ostree-s-and-systems-uEnv.txt.patch b/recipes/ostree/ostree/0002-u-boot-Merge-ostree-s-and-systems-uEnv.txt.patch new file mode 100644 index 0000000..08855de --- /dev/null +++ b/recipes/ostree/ostree/0002-u-boot-Merge-ostree-s-and-systems-uEnv.txt.patch | |||
@@ -0,0 +1,99 @@ | |||
1 | From 5ee49772b001b9757d6cb21fcc587d5ddc66cdb7 Mon Sep 17 00:00:00 2001 | ||
2 | From: Gatis Paeglis <gatis.paeglis@theqtcompany.com> | ||
3 | Date: Thu, 5 Nov 2015 17:39:16 +0100 | ||
4 | Subject: [PATCH 2/2] u-boot: Merge ostree's and systems uEnv.txt | ||
5 | |||
6 | This allows for simpler u-boot scripts and is | ||
7 | a proper fix for: | ||
8 | |||
9 | https://bugzilla.gnome.org/show_bug.cgi?id=755787 | ||
10 | --- | ||
11 | src/libostree/ostree-bootloader-uboot.c | 42 ++++++++++++++++++++++++++++++--- | ||
12 | 1 file changed, 39 insertions(+), 3 deletions(-) | ||
13 | |||
14 | diff --git a/src/libostree/ostree-bootloader-uboot.c b/src/libostree/ostree-bootloader-uboot.c | ||
15 | index f67e9bd..be1a40d 100644 | ||
16 | --- a/src/libostree/ostree-bootloader-uboot.c | ||
17 | +++ b/src/libostree/ostree-bootloader-uboot.c | ||
18 | @@ -29,6 +29,10 @@ | ||
19 | #include "otutil.h" | ||
20 | |||
21 | #include <string.h> | ||
22 | +#include <stdlib.h> | ||
23 | +#include <stdio.h> | ||
24 | +#include <unistd.h> | ||
25 | +#include <fcntl.h> | ||
26 | |||
27 | struct _OstreeBootloaderUboot | ||
28 | { | ||
29 | @@ -69,13 +73,17 @@ create_config_from_boot_loader_entries (OstreeBootloaderUboot *self, | ||
30 | GCancellable *cancellable, | ||
31 | GError **error) | ||
32 | { | ||
33 | + gboolean ret = FALSE; | ||
34 | g_autoptr(GPtrArray) boot_loader_configs = NULL; | ||
35 | OstreeBootconfigParser *config; | ||
36 | const char *val; | ||
37 | + g_autofree char *boot_path = NULL; | ||
38 | + g_autoptr(GFile) uenv_file = NULL; | ||
39 | + char uenv_path[2048]; | ||
40 | |||
41 | if (!_ostree_sysroot_read_boot_loader_configs (self->sysroot, bootversion, &boot_loader_configs, | ||
42 | cancellable, error)) | ||
43 | - return FALSE; | ||
44 | + goto out; | ||
45 | |||
46 | /* U-Boot doesn't support a menu so just pick the first one since the list is ordered */ | ||
47 | config = boot_loader_configs->pdata[0]; | ||
48 | @@ -85,10 +93,13 @@ create_config_from_boot_loader_entries (OstreeBootloaderUboot *self, | ||
49 | { | ||
50 | g_set_error (error, G_IO_ERROR, G_IO_ERROR_FAILED, | ||
51 | "No \"linux\" key in bootloader config"); | ||
52 | - return FALSE; | ||
53 | + goto out; | ||
54 | } | ||
55 | g_ptr_array_add (new_lines, g_strdup_printf ("kernel_image=%s", val)); | ||
56 | |||
57 | + boot_path = strndup (val, strlen (val) - strlen ("/vmlinuz")); | ||
58 | + g_ptr_array_add (new_lines, g_strdup_printf ("bootdir=%s", boot_path)); | ||
59 | + | ||
60 | val = ostree_bootconfig_parser_get (config, "initrd"); | ||
61 | if (val) | ||
62 | g_ptr_array_add (new_lines, g_strdup_printf ("ramdisk_image=%s", val)); | ||
63 | @@ -97,7 +108,32 @@ create_config_from_boot_loader_entries (OstreeBootloaderUboot *self, | ||
64 | if (val) | ||
65 | g_ptr_array_add (new_lines, g_strdup_printf ("bootargs=%s", val)); | ||
66 | |||
67 | - return TRUE; | ||
68 | + /* Merge with user's uEnv.txt if it exists */ | ||
69 | + snprintf (uenv_path, sizeof(uenv_path), "boot/%s/uEnv.txt", boot_path); | ||
70 | + uenv_file = g_file_get_child (self->sysroot->path, uenv_path); | ||
71 | + if (g_file_query_exists (uenv_file, cancellable)) | ||
72 | + { | ||
73 | + g_autoptr(GInputStream) instream = NULL; | ||
74 | + g_autoptr(GDataInputStream) datastream = NULL; | ||
75 | + gsize len; | ||
76 | + | ||
77 | + instream = (GInputStream*)g_file_read (uenv_file, cancellable, error); | ||
78 | + if (!instream) | ||
79 | + goto out; | ||
80 | + | ||
81 | + datastream = g_data_input_stream_new (instream); | ||
82 | + while (TRUE) | ||
83 | + { | ||
84 | + val = g_data_input_stream_read_line (datastream, &len, cancellable, error); | ||
85 | + if (!val) | ||
86 | + break; | ||
87 | + g_ptr_array_add (new_lines, (char *)val); | ||
88 | + } | ||
89 | + } | ||
90 | + | ||
91 | + ret = TRUE; | ||
92 | +out: | ||
93 | + return ret; | ||
94 | } | ||
95 | |||
96 | static gboolean | ||
97 | -- | ||
98 | 2.1.4 | ||
99 | |||
diff --git a/recipes/ostree/ostree/0003-Allow-updating-files-in-root-of-boot.patch b/recipes/ostree/ostree/0003-Allow-updating-files-in-root-of-boot.patch new file mode 100644 index 0000000..d93da22 --- /dev/null +++ b/recipes/ostree/ostree/0003-Allow-updating-files-in-root-of-boot.patch | |||
@@ -0,0 +1,104 @@ | |||
1 | From f5a1391e64d4b17ed05fb47f23d5d35affb9f1fd Mon Sep 17 00:00:00 2001 | ||
2 | From: Gatis Paeglis <gatis.paeglis@theqtcompany.com> | ||
3 | Date: Thu, 5 Nov 2015 14:58:56 +0100 | ||
4 | Subject: [PATCH] Allow updating files in root of /boot | ||
5 | |||
6 | It is common for u-boot based systems to search | ||
7 | top level directory of the boot partiton for | ||
8 | additional files that are required for booting. | ||
9 | It can be difficult to change this search logic | ||
10 | if it is hardcoded somewhere low in the stack or | ||
11 | in u-boot env that is in read-only memory. To | ||
12 | allow updating these files you need to add a | ||
13 | symlink in your ostree sysroot: | ||
14 | |||
15 | cd sysroot/boot | ||
16 | ln -s loader/my-special-file my-special-file | ||
17 | |||
18 | The bellow code will make sure that loader/my-special-file | ||
19 | points to the correct target file version. | ||
20 | |||
21 | This does not break the atomic property of update. | ||
22 | --- | ||
23 | src/libostree/ostree-bootloader-uboot.c | 65 +++++++++++++++++++++++++++++++++ | ||
24 | 1 file changed, 65 insertions(+) | ||
25 | |||
26 | diff --git a/src/libostree/ostree-bootloader-uboot.c b/src/libostree/ostree-bootloader-uboot.c | ||
27 | index be1a40d..779c302 100644 | ||
28 | --- a/src/libostree/ostree-bootloader-uboot.c | ||
29 | +++ b/src/libostree/ostree-bootloader-uboot.c | ||
30 | @@ -131,6 +131,71 @@ create_config_from_boot_loader_entries (OstreeBootloaderUboot *self, | ||
31 | } | ||
32 | } | ||
33 | |||
34 | + { | ||
35 | + /* It is common for u-boot based systems to search top level directory of the boot | ||
36 | + * partiton for additional files that are required for booting. It can be difficult | ||
37 | + * to change this search logic if it is hardcoded somewhere low in the stack or in | ||
38 | + * u-boot env that is in read-only memory. To allow updating these files you need to | ||
39 | + * add a symlink in your ostree sysroot: | ||
40 | + * | ||
41 | + * cd sysroot/boot | ||
42 | + * ln -s loader/my-special-file my-special-file | ||
43 | + * | ||
44 | + * The bellow code will make sure that loader/my-special-file points to the correct | ||
45 | + * target file version. | ||
46 | + * | ||
47 | + */ | ||
48 | + g_autoptr(GFile) child = NULL; | ||
49 | + int loader_fd; | ||
50 | + g_autoptr(GFileEnumerator) dir_enum = NULL; | ||
51 | + g_autoptr(GFile) real_boot = NULL; | ||
52 | + g_autofree char *loader_path = NULL; | ||
53 | + char buf[2048]; | ||
54 | + | ||
55 | + child = ot_gfile_resolve_path_printf (self->sysroot->path, "boot/loader.%d/", bootversion); | ||
56 | + loader_path = g_file_get_path(child); | ||
57 | + loader_fd = open (loader_path, O_RDONLY); | ||
58 | + if (loader_fd == -1) { | ||
59 | + perror("open"); | ||
60 | + goto out; | ||
61 | + } | ||
62 | + | ||
63 | + child = g_file_get_child (self->sysroot->path, "boot"); | ||
64 | + dir_enum = g_file_enumerate_children (child, OSTREE_GIO_FAST_QUERYINFO, | ||
65 | + G_FILE_QUERY_INFO_NOFOLLOW_SYMLINKS, | ||
66 | + NULL, error); | ||
67 | + | ||
68 | + while (TRUE) { | ||
69 | + const char *symlink_target, *name; | ||
70 | + GFileInfo *file_info = NULL; | ||
71 | + | ||
72 | + if (!gs_file_enumerator_iterate (dir_enum, &file_info, NULL, cancellable, error)) { | ||
73 | + close(loader_fd); | ||
74 | + goto out; | ||
75 | + } | ||
76 | + | ||
77 | + if (file_info == NULL) | ||
78 | + break; | ||
79 | + | ||
80 | + if (g_file_info_get_is_symlink(file_info)) { | ||
81 | + symlink_target = g_file_info_get_symlink_target(file_info); | ||
82 | + if (g_str_has_prefix(symlink_target, "loader/")) { | ||
83 | + name = g_file_info_get_name(file_info); | ||
84 | + if (g_strcmp0 (name, "uEnv.txt") == 0) | ||
85 | + continue; | ||
86 | + | ||
87 | + snprintf(buf, sizeof(buf), "%s/%s", loader_path, name); | ||
88 | + remove(buf); | ||
89 | + snprintf(buf, sizeof(buf), "..%s/%s", boot_path, name); | ||
90 | + if (symlinkat(buf, loader_fd, name) == -1) | ||
91 | + perror("symlinkat"); | ||
92 | + } | ||
93 | + } | ||
94 | + } | ||
95 | + | ||
96 | + close(loader_fd); | ||
97 | + } | ||
98 | + | ||
99 | ret = TRUE; | ||
100 | out: | ||
101 | return ret; | ||
102 | -- | ||
103 | 2.1.4 | ||
104 | |||
diff --git a/recipes/packagegroup/nativesdk-packagegroup-b2qt-embedded-toolchain-host.bb b/recipes/packagegroup/nativesdk-packagegroup-b2qt-embedded-toolchain-host.bb index 7591b6b..f64c0ac 100644 --- a/recipes/packagegroup/nativesdk-packagegroup-b2qt-embedded-toolchain-host.bb +++ b/recipes/packagegroup/nativesdk-packagegroup-b2qt-embedded-toolchain-host.bb | |||
@@ -30,7 +30,6 @@ RDEPENDS_${PN} = "\ | |||
30 | nativesdk-python-modules \ | 30 | nativesdk-python-modules \ |
31 | nativesdk-python-misc \ | 31 | nativesdk-python-misc \ |
32 | nativesdk-gperf \ | 32 | nativesdk-gperf \ |
33 | nativesdk-ostree \ | ||
34 | ${@base_contains("DISTRO_FEATURES", "wayland", "nativesdk-wayland", "", d)} \ | 33 | ${@base_contains("DISTRO_FEATURES", "wayland", "nativesdk-wayland", "", d)} \ |
35 | ${MACHINE_EXTRA_INSTALL_SDK_HOST} \ | 34 | ${MACHINE_EXTRA_INSTALL_SDK_HOST} \ |
36 | " | 35 | " |
diff --git a/scripts/manifest.xml b/scripts/manifest.xml index 6e356ab..927a2f3 100644 --- a/scripts/manifest.xml +++ b/scripts/manifest.xml | |||
@@ -11,13 +11,14 @@ | |||
11 | <remote fetch="git://github.com/architech-boards" name="architech"/> | 11 | <remote fetch="git://github.com/architech-boards" name="architech"/> |
12 | <remote fetch="git://github.com/meta-qt5" name="meta-qt5"/> | 12 | <remote fetch="git://github.com/meta-qt5" name="meta-qt5"/> |
13 | <remote fetch="git://git.yoctoproject.org" name="intel"/> | 13 | <remote fetch="git://git.yoctoproject.org" name="intel"/> |
14 | <remote fetch="git://github.com/openembedded" name="oe-mirror"/> | ||
14 | 15 | ||
15 | <project name="poky" | 16 | <project name="poky" |
16 | remote="yocto" | 17 | remote="yocto" |
17 | revision="57eb677f0efe9a4060c764e8e9dfe2440d4e5eb2" | 18 | revision="57eb677f0efe9a4060c764e8e9dfe2440d4e5eb2" |
18 | path="sources/poky"/> | 19 | path="sources/poky"/> |
19 | <project name="meta-openembedded" | 20 | <project name="meta-openembedded" |
20 | remote="oe" | 21 | remote="oe-mirror" |
21 | revision="214e1801d0efc38d3b6142bdc0d8e58ca593e34c" | 22 | revision="214e1801d0efc38d3b6142bdc0d8e58ca593e34c" |
22 | path="sources/meta-openembedded"/> | 23 | path="sources/meta-openembedded"/> |
23 | <project name="meta-qt5" | 24 | <project name="meta-qt5" |
diff --git a/scripts/manifest_fido.xml b/scripts/manifest_fido.xml index 9bd0510..2a1c78e 100644 --- a/scripts/manifest_fido.xml +++ b/scripts/manifest_fido.xml | |||
@@ -11,13 +11,14 @@ | |||
11 | <remote fetch="git://github.com/architech-boards" name="architech"/> | 11 | <remote fetch="git://github.com/architech-boards" name="architech"/> |
12 | <remote fetch="git://github.com/meta-qt5" name="meta-qt5"/> | 12 | <remote fetch="git://github.com/meta-qt5" name="meta-qt5"/> |
13 | <remote fetch="git://git.yoctoproject.org" name="intel"/> | 13 | <remote fetch="git://git.yoctoproject.org" name="intel"/> |
14 | <remote fetch="git://github.com/openembedded" name="oe-mirror"/> | ||
14 | 15 | ||
15 | <project name="poky" | 16 | <project name="poky" |
16 | remote="yocto" | 17 | remote="yocto" |
17 | revision="fido" | 18 | revision="fido" |
18 | path="sources/poky"/> | 19 | path="sources/poky"/> |
19 | <project name="meta-openembedded" | 20 | <project name="meta-openembedded" |
20 | remote="oe" | 21 | remote="oe-mirror" |
21 | revision="fido" | 22 | revision="fido" |
22 | path="sources/meta-openembedded"/> | 23 | path="sources/meta-openembedded"/> |
23 | <project name="meta-qt5" | 24 | <project name="meta-qt5" |