diff options
Diffstat (limited to 'poky/meta/recipes-bsp')
13 files changed, 389 insertions, 245 deletions
diff --git a/poky/meta/recipes-bsp/acpid/acpid_2.0.30.bb b/poky/meta/recipes-bsp/acpid/acpid_2.0.31.bb index aa19d28ed..407492132 100644 --- a/poky/meta/recipes-bsp/acpid/acpid_2.0.30.bb +++ b/poky/meta/recipes-bsp/acpid/acpid_2.0.31.bb @@ -3,5 +3,5 @@ require acpid.inc LIC_FILES_CHKSUM = "file://COPYING;md5=8ca43cbc842c2336e835926c2166c28b \ file://acpid.h;endline=24;md5=324a9cf225ae69ddaad1bf9d942115b5" -SRC_URI[md5sum] = "1528040b5d34f8c24ebabd97befbf913" -SRC_URI[sha256sum] = "28b77b62d3f64ebd1c2a3d16bccc6d4333b4e24a86aeacebec255fad223cf4cb" +SRC_URI[md5sum] = "599dd38681b5917eeeafb58176793952" +SRC_URI[sha256sum] = "fc9dc669ed85d9a1739aa76915e0667c6697c5431160f8dfb253046c6a072cc3" diff --git a/poky/meta/recipes-bsp/gnu-efi/gnu-efi_3.0.8.bb b/poky/meta/recipes-bsp/gnu-efi/gnu-efi_3.0.9.bb index dba473344..0667191fb 100644 --- a/poky/meta/recipes-bsp/gnu-efi/gnu-efi_3.0.8.bb +++ b/poky/meta/recipes-bsp/gnu-efi/gnu-efi_3.0.9.bb @@ -18,8 +18,8 @@ SRC_URI = "${SOURCEFORGE_MIRROR}/${BPN}/${BP}.tar.bz2 \ file://gcc46-compatibility.patch \ " -SRC_URI[md5sum] = "ae32011cfe6b1c40c0f244b9a49ba181" -SRC_URI[sha256sum] = "76006d8ea8d67bcf72f35d09d43e9ef6a69400d6d5d4bf64baf1ab7434e2b722" +SRC_URI[md5sum] = "32af17b917545a693e549af2439c4a99" +SRC_URI[sha256sum] = "6715ea7eae1c7e4fc5041034bd3f107ec2911962ed284a081e491646b12277f0" COMPATIBLE_HOST = "(x86_64.*|i.86.*|aarch64.*|arm.*)-linux" COMPATIBLE_HOST_armv4 = 'null' diff --git a/poky/meta/recipes-bsp/grub/files/disable-address-of-packed-member.patch b/poky/meta/recipes-bsp/grub/files/disable-address-of-packed-member.patch new file mode 100644 index 000000000..415f52ebe --- /dev/null +++ b/poky/meta/recipes-bsp/grub/files/disable-address-of-packed-member.patch @@ -0,0 +1,262 @@ +Disable address-of-packed-member warnings with gcc9 + +gcc9 has turned this warning into error when -Werror is used, lets paper +it over by turning it into a warning for now + +Fixes + error: taking address of packed member of 'struct head' may result in an unaligned pointer value [-Werror=address-of-packed-member] + +Upstream-Status: Pending +Signed-off-by: Khem Raj <raj.khem@gmail.com> +--- a/grub-core/commands/lsacpi.c ++++ b/grub-core/commands/lsacpi.c +@@ -26,6 +26,9 @@ + #include <grub/dl.h> + + #pragma GCC diagnostic ignored "-Wcast-align" ++#if __GNUC__ >= 9 ++#pragma GCC diagnostic ignored "-Waddress-of-packed-member" ++#endif + + GRUB_MOD_LICENSE ("GPLv3+"); + +--- a/grub-core/commands/lspci.c ++++ b/grub-core/commands/lspci.c +@@ -26,6 +26,9 @@ + + GRUB_MOD_LICENSE ("GPLv3+"); + ++#if __GNUC__ >= 9 ++#pragma GCC diagnostic ignored "-Waddress-of-packed-member" ++#endif + struct grub_pci_classname + { + int class; +@@ -171,7 +174,7 @@ grub_lspci_iter (grub_pci_device_t dev, + + if (space == 0) + continue; +- ++ + switch (space & GRUB_PCI_ADDR_SPACE_MASK) + { + case GRUB_PCI_ADDR_SPACE_IO: +@@ -195,13 +198,13 @@ grub_lspci_iter (grub_pci_device_t dev, + (space & GRUB_PCI_ADDR_MEM_MASK), + space & GRUB_PCI_ADDR_MEM_PREFETCH + ? "prefetchable" : "non-prefetchable"); +- ++ + } + else + grub_printf ("\t32-bit memory space %d at 0x%016llx [%s]\n", + (unsigned) ((reg - GRUB_PCI_REG_ADDRESSES) + / sizeof (grub_uint32_t)) - 1, +- (unsigned long long) ++ (unsigned long long) + (space & GRUB_PCI_ADDR_MEM_MASK), + space & GRUB_PCI_ADDR_MEM_PREFETCH + ? "prefetchable" : "non-prefetchable"); +--- a/grub-core/fs/cpio_common.c ++++ b/grub-core/fs/cpio_common.c +@@ -26,7 +26,9 @@ + #include <grub/archelp.h> + + GRUB_MOD_LICENSE ("GPLv3+"); +- ++#if __GNUC__ >= 9 ++#pragma GCC diagnostic ignored "-Waddress-of-packed-member" ++#endif + struct grub_archelp_data + { + grub_disk_t disk; +@@ -108,7 +110,7 @@ grub_cpio_get_link_target (struct grub_a + if (!ret) + return NULL; + +- err = grub_disk_read (data->disk, 0, data->dofs, data->size, ++ err = grub_disk_read (data->disk, 0, data->dofs, data->size, + ret); + if (err) + { +--- a/grub-core/fs/hfs.c ++++ b/grub-core/fs/hfs.c +@@ -32,6 +32,9 @@ + #include <grub/fshelp.h> + + GRUB_MOD_LICENSE ("GPLv3+"); ++#if __GNUC__ >= 9 ++#pragma GCC diagnostic ignored "-Waddress-of-packed-member" ++#endif + + #define GRUB_HFS_SBLOCK 2 + #define GRUB_HFS_EMBED_HFSPLUS_SIG 0x482B +@@ -882,7 +885,7 @@ grub_hfs_iterate_dir_it_dir (struct grub + { + struct grub_hfs_catalog_key *ckey = rec->key; + struct grub_hfs_iterate_dir_node_found_ctx *ctx = hook_arg; +- ++ + /* Stop when the entries do not match anymore. */ + if (ckey->parent_dir != ctx->dir_be) + return 1; +@@ -1076,7 +1079,7 @@ macroman_to_utf8 (char *to, const grub_u + { + *optr++ = ':'; + continue; +- } ++ } + if (!(*iptr & 0x80)) + { + *optr++ = *iptr; +@@ -1093,7 +1096,7 @@ utf8_to_macroman (grub_uint8_t *to, cons + grub_uint8_t *end = to + 31; + grub_uint8_t *optr = to; + const char *iptr = from; +- ++ + while (*iptr && optr < end) + { + int i, clen; +@@ -1103,7 +1106,7 @@ utf8_to_macroman (grub_uint8_t *to, cons + *optr++ = '/'; + iptr++; + continue; +- } ++ } + if (!(*iptr & 0x80)) + { + *optr++ = *iptr++; +@@ -1164,7 +1167,7 @@ lookup_file (grub_fshelp_node_t dir, + *foundnode = grub_malloc (sizeof (struct grub_fshelp_node)); + if (!*foundnode) + return grub_errno; +- ++ + (*foundnode)->inode = grub_be_to_cpu32 (fdrec.dir.dirid); + (*foundnode)->fdrec = fdrec; + (*foundnode)->data = dir->data; +@@ -1265,7 +1268,7 @@ grub_hfs_dir (grub_device_t device, cons + .hook_data = hook_data + }; + grub_fshelp_node_t found = NULL; +- ++ + grub_dl_ref (my_mod); + + data = grub_hfs_mount (device->disk); +@@ -1294,7 +1297,7 @@ grub_hfs_open (struct grub_file *file, c + { + struct grub_hfs_data *data; + grub_fshelp_node_t found = NULL; +- ++ + grub_dl_ref (my_mod); + + data = grub_hfs_mount (file->device->disk); +--- a/grub-core/fs/hfsplus.c ++++ b/grub-core/fs/hfsplus.c +@@ -19,7 +19,7 @@ + + /* HFS+ is documented at http://developer.apple.com/technotes/tn/tn1150.html */ + +-#define grub_fshelp_node grub_hfsplus_file ++#define grub_fshelp_node grub_hfsplus_file + #include <grub/err.h> + #include <grub/file.h> + #include <grub/mm.h> +@@ -34,6 +34,9 @@ + + GRUB_MOD_LICENSE ("GPLv3+"); + ++#if __GNUC__ >= 9 ++#pragma GCC diagnostic ignored "-Waddress-of-packed-member" ++#endif + /* The type of node. */ + enum grub_hfsplus_btnode_type + { +@@ -145,7 +148,7 @@ grub_hfsplus_read_block (grub_fshelp_nod + { + struct grub_hfsplus_btnode *nnode = 0; + grub_disk_addr_t blksleft = fileblock; +- struct grub_hfsplus_extent *extents = node->compressed ++ struct grub_hfsplus_extent *extents = node->compressed + ? &node->resource_extents[0] : &node->extents[0]; + + while (1) +@@ -461,7 +464,7 @@ grub_hfsplus_cmp_extkey (struct grub_hfs + + if (extkey_a->type < extkey_b->type) + return -1; +- ++ + akey = grub_be_to_cpu32 (extkey_a->start); + if (akey > extkey_b->start) + return 1; +@@ -548,7 +551,7 @@ grub_hfsplus_btree_search (struct grub_h + struct grub_hfsplus_key_internal *key, + int (*compare_keys) (struct grub_hfsplus_key *keya, + struct grub_hfsplus_key_internal *keyb), +- struct grub_hfsplus_btnode **matchnode, ++ struct grub_hfsplus_btnode **matchnode, + grub_off_t *keyoffset) + { + grub_uint64_t currnode; +--- a/grub-core/fs/jfs.c ++++ b/grub-core/fs/jfs.c +@@ -28,6 +28,9 @@ + #include <grub/i18n.h> + + GRUB_MOD_LICENSE ("GPLv3+"); ++#if __GNUC__ >= 9 ++#pragma GCC diagnostic ignored "-Waddress-of-packed-member" ++#endif + + #define GRUB_JFS_MAX_SYMLNK_CNT 8 + #define GRUB_JFS_FILETYPE_MASK 0170000 +--- a/grub-core/kern/efi/efi.c ++++ b/grub-core/kern/efi/efi.c +@@ -29,6 +29,9 @@ + #include <grub/mm.h> + #include <grub/loader.h> + ++#if __GNUC__ >= 9 ++#pragma GCC diagnostic ignored "-Waddress-of-packed-member" ++#endif + /* The handle of GRUB itself. Filled in by the startup code. */ + grub_efi_handle_t grub_efi_image_handle; + +@@ -201,7 +204,7 @@ grub_efi_set_variable(const char *var, c + + r = grub_efi_system_table->runtime_services; + +- status = efi_call_5 (r->set_variable, var16, guid, ++ status = efi_call_5 (r->set_variable, var16, guid, + (GRUB_EFI_VARIABLE_NON_VOLATILE + | GRUB_EFI_VARIABLE_BOOTSERVICE_ACCESS + | GRUB_EFI_VARIABLE_RUNTIME_ACCESS), +--- a/grub-core/loader/efi/chainloader.c ++++ b/grub-core/loader/efi/chainloader.c +@@ -41,6 +41,9 @@ + #endif + + GRUB_MOD_LICENSE ("GPLv3+"); ++#if __GNUC__ >= 9 ++#pragma GCC diagnostic ignored "-Waddress-of-packed-member" ++#endif + + static grub_dl_t my_mod; + +--- a/grub-core/commands/usbtest.c ++++ b/grub-core/commands/usbtest.c +@@ -63,6 +63,10 @@ static const char *usb_devspeed[] = + "High" + }; + ++#if __GNUC__ >= 9 ++#pragma GCC diagnostic ignored "-Waddress-of-packed-member" ++#endif ++ + static grub_usb_err_t + grub_usb_get_string (grub_usb_device_t dev, grub_uint8_t index, int langid, + char **string) diff --git a/poky/meta/recipes-bsp/grub/files/fix.build.with.squashfs.patch b/poky/meta/recipes-bsp/grub/files/fix.build.with.squashfs.patch new file mode 100644 index 000000000..2c2d2ea0b --- /dev/null +++ b/poky/meta/recipes-bsp/grub/files/fix.build.with.squashfs.patch @@ -0,0 +1,24 @@ +When squashfs support is enabled, the build fails with: + +../grub-2.02/grub-core/fs/squash4.c: In function 'direct_read': +../grub-2.02/grub-core/fs/squash4.c:868:10: error: 'err' may be used uninitialized in this function [-Werror=maybe-uninitialized] + if (err) + ^ +cc1: all warnings being treated as errors +Makefile:7272: recipe for target 'grub-core/fs/libgrubmods_a-squash4.o' failed + +Upstream-Status: Pending (should be fixed in gnulib which is then rarely updated in grub) + +Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com> + +--- grub-2.02/grub-core/fs/squash4.c 2019-03-10 20:00:14.070468728 +0000 ++++ grub-2.02.fixed/grub-core/fs/squash4.c 2019-03-10 19:58:31.382477818 +0000 +@@ -746,7 +746,7 @@ + struct grub_squash_cache_inode *ino, + grub_off_t off, char *buf, grub_size_t len) + { +- grub_err_t err; ++ grub_err_t err = 0; + grub_off_t cumulated_uncompressed_size = 0; + grub_uint64_t a = 0; + grub_size_t i; diff --git a/poky/meta/recipes-bsp/grub/grub2.inc b/poky/meta/recipes-bsp/grub/grub2.inc index 8e0f86217..c6994723f 100644 --- a/poky/meta/recipes-bsp/grub/grub2.inc +++ b/poky/meta/recipes-bsp/grub/grub2.inc @@ -21,6 +21,8 @@ SRC_URI = "https://ftp.gnu.org/gnu/grub/grub-${PV}.tar.gz \ file://gcc8.patch \ file://0001-x86-64-Treat-R_X86_64_PLT32-as-R_X86_64_PC32.patch \ file://0001-grub-setup-Debug-message-cleanup.patch \ + file://disable-address-of-packed-member.patch \ + file://fix.build.with.squashfs.patch \ " SRC_URI[md5sum] = "1116d1f60c840e6dbd67abbc99acb45d" SRC_URI[sha256sum] = "660ee136fbcee08858516ed4de2ad87068bfe1b6b8b37896ce3529ff054a726d" diff --git a/poky/meta/recipes-bsp/u-boot/files/CVE-2018-1000205-1.patch b/poky/meta/recipes-bsp/u-boot/files/CVE-2018-1000205-1.patch deleted file mode 100644 index fed3c3dcb..000000000 --- a/poky/meta/recipes-bsp/u-boot/files/CVE-2018-1000205-1.patch +++ /dev/null @@ -1,59 +0,0 @@ -From 7346c1e192d63cd35f99c7e845e53c5d4d0bdc24 Mon Sep 17 00:00:00 2001 -From: Teddy Reed <teddy.reed@gmail.com> -Date: Sat, 9 Jun 2018 11:45:20 -0400 -Subject: [PATCH] vboot: Do not use hashed-strings offset - -The hashed-strings signature property includes two uint32_t values. -The first is unneeded as there should never be a start offset into the -strings region. The second, the size, is needed because the added -signature node appends to this region. - -See tools/image-host.c, where a static 0 value is used for the offset. - -Signed-off-by: Teddy Reed <teddy.reed@gmail.com> -Reviewed-by: Simon Glass <sjg@chromium.org> - -Upstream-Status: Backport[http://git.denx.de/?p=u-boot.git;a=commit; - h=7346c1e192d63cd35f99c7e845e53c5d4d0bdc24] - -CVE: CVE-2018-1000205 - -Signed-off-by: Changqing Li <changqing.li@windriver.com> ---- - common/image-sig.c | 7 +++++-- - tools/image-host.c | 1 + - 2 files changed, 6 insertions(+), 2 deletions(-) - -diff --git a/common/image-sig.c b/common/image-sig.c -index 8d2fd10..5a269d3 100644 ---- a/common/image-sig.c -+++ b/common/image-sig.c -@@ -377,8 +377,11 @@ int fit_config_check_sig(const void *fit, int noffset, int required_keynode, - /* Add the strings */ - strings = fdt_getprop(fit, noffset, "hashed-strings", NULL); - if (strings) { -- fdt_regions[count].offset = fdt_off_dt_strings(fit) + -- fdt32_to_cpu(strings[0]); -+ /* -+ * The strings region offset must be a static 0x0. -+ * This is set in tool/image-host.c -+ */ -+ fdt_regions[count].offset = fdt_off_dt_strings(fit); - fdt_regions[count].size = fdt32_to_cpu(strings[1]); - count++; - } -diff --git a/tools/image-host.c b/tools/image-host.c -index 8e43671..be2d59b 100644 ---- a/tools/image-host.c -+++ b/tools/image-host.c -@@ -135,6 +135,7 @@ static int fit_image_write_sig(void *fit, int noffset, uint8_t *value, - - ret = fdt_setprop(fit, noffset, "hashed-nodes", - region_prop, region_proplen); -+ /* This is a legacy offset, it is unused, and must remain 0. */ - strdata[0] = 0; - strdata[1] = cpu_to_fdt32(string_size); - if (!ret) { --- -2.7.4 - diff --git a/poky/meta/recipes-bsp/u-boot/files/CVE-2018-1000205-2.patch b/poky/meta/recipes-bsp/u-boot/files/CVE-2018-1000205-2.patch deleted file mode 100644 index bb79af1c7..000000000 --- a/poky/meta/recipes-bsp/u-boot/files/CVE-2018-1000205-2.patch +++ /dev/null @@ -1,143 +0,0 @@ -From 72239fc85f3eda078547956608c063ab965e90e9 Mon Sep 17 00:00:00 2001 -From: Teddy Reed <teddy.reed@gmail.com> -Date: Sat, 9 Jun 2018 11:38:05 -0400 -Subject: [PATCH] vboot: Add FIT_SIGNATURE_MAX_SIZE protection - -This adds a new config value FIT_SIGNATURE_MAX_SIZE, which controls the -max size of a FIT header's totalsize field. The field is checked before -signature checks are applied to protect from reading past the intended -FIT regions. - -This field is not part of the vboot signature so it should be sanity -checked. If the field is corrupted then the structure or string region -reads may have unintended behavior, such as reading from device memory. -A default value of 256MB is set and intended to support most max storage -sizes. - -Suggested-by: Simon Glass <sjg@chromium.org> -Signed-off-by: Teddy Reed <teddy.reed@gmail.com> -Reviewed-by: Simon Glass <sjg@chromium.org> - -Upstream-Status: Backport[http://git.denx.de/?p=u-boot.git;a=commit; - h=72239fc85f3eda078547956608c063ab965e90e9] - -CVE: CVE-2018-1000205 - -Signed-off-by: Changqing Li <changqing.li@windriver.com> ---- - Kconfig | 10 ++++++++++ - common/image-sig.c | 5 +++++ - test/py/tests/test_vboot.py | 33 +++++++++++++++++++++++++++++++++ - tools/Makefile | 1 + - 4 files changed, 49 insertions(+) - -diff --git a/Kconfig b/Kconfig -index 5a82c95..c8b86cd 100644 ---- a/Kconfig -+++ b/Kconfig -@@ -267,6 +267,16 @@ config FIT_SIGNATURE - format support in this case, enable it using - CONFIG_IMAGE_FORMAT_LEGACY. - -+config FIT_SIGNATURE_MAX_SIZE -+ hex "Max size of signed FIT structures" -+ depends on FIT_SIGNATURE -+ default 0x10000000 -+ help -+ This option sets a max size in bytes for verified FIT uImages. -+ A sane value of 256MB protects corrupted DTB structures from overlapping -+ device memory. Assure this size does not extend past expected storage -+ space. -+ - config FIT_VERBOSE - bool "Show verbose messages when FIT images fail" - help -diff --git a/common/image-sig.c b/common/image-sig.c -index f65d883..8d2fd10 100644 ---- a/common/image-sig.c -+++ b/common/image-sig.c -@@ -156,6 +156,11 @@ static int fit_image_setup_verify(struct image_sign_info *info, - { - char *algo_name; - -+ if (fdt_totalsize(fit) > CONFIG_FIT_SIGNATURE_MAX_SIZE) { -+ *err_msgp = "Total size too large"; -+ return 1; -+ } -+ - if (fit_image_hash_get_algo(fit, noffset, &algo_name)) { - *err_msgp = "Can't get hash algo property"; - return -1; -diff --git a/test/py/tests/test_vboot.py b/test/py/tests/test_vboot.py -index ee939f2..3d25ec3 100644 ---- a/test/py/tests/test_vboot.py -+++ b/test/py/tests/test_vboot.py -@@ -26,6 +26,7 @@ Tests run with both SHA1 and SHA256 hashing. - - import pytest - import sys -+import struct - import u_boot_utils as util - - @pytest.mark.boardspec('sandbox') -@@ -105,6 +106,26 @@ def test_vboot(u_boot_console): - util.run_and_log(cons, [mkimage, '-F', '-k', tmpdir, '-K', dtb, - '-r', fit]) - -+ def replace_fit_totalsize(size): -+ """Replace FIT header's totalsize with something greater. -+ -+ The totalsize must be less than or equal to FIT_SIGNATURE_MAX_SIZE. -+ If the size is greater, the signature verification should return false. -+ -+ Args: -+ size: The new totalsize of the header -+ -+ Returns: -+ prev_size: The previous totalsize read from the header -+ """ -+ total_size = 0 -+ with open(fit, 'r+b') as handle: -+ handle.seek(4) -+ total_size = handle.read(4) -+ handle.seek(4) -+ handle.write(struct.pack(">I", size)) -+ return struct.unpack(">I", total_size)[0] -+ - def test_with_algo(sha_algo): - """Test verified boot with the given hash algorithm. - -@@ -146,6 +167,18 @@ def test_vboot(u_boot_console): - util.run_and_log(cons, [fit_check_sign, '-f', fit, '-k', tmpdir, - '-k', dtb]) - -+ # Replace header bytes -+ bcfg = u_boot_console.config.buildconfig -+ max_size = int(bcfg.get('config_fit_signature_max_size', 0x10000000), 0) -+ existing_size = replace_fit_totalsize(max_size + 1) -+ run_bootm(sha_algo, 'Signed config with bad hash', 'Bad Data Hash', False) -+ cons.log.action('%s: Check overflowed FIT header totalsize' % sha_algo) -+ -+ # Replace with existing header bytes -+ replace_fit_totalsize(existing_size) -+ run_bootm(sha_algo, 'signed config', 'dev+', True) -+ cons.log.action('%s: Check default FIT header totalsize' % sha_algo) -+ - # Increment the first byte of the signature, which should cause failure - sig = util.run_and_log(cons, 'fdtget -t bx %s %s value' % - (fit, sig_node)) -diff --git a/tools/Makefile b/tools/Makefile -index 5dd33ed..0c3341e 100644 ---- a/tools/Makefile -+++ b/tools/Makefile -@@ -133,6 +133,7 @@ ifdef CONFIG_FIT_SIGNATURE - # This affects include/image.h, but including the board config file - # is tricky, so manually define this options here. - HOST_EXTRACFLAGS += -DCONFIG_FIT_SIGNATURE -+HOST_EXTRACFLAGS += -DCONFIG_FIT_SIGNATURE_MAX_SIZE=$(CONFIG_FIT_SIGNATURE_MAX_SIZE) - endif - - ifdef CONFIG_SYS_U_BOOT_OFFS --- -2.7.4 - diff --git a/poky/meta/recipes-bsp/u-boot/u-boot-common_2018.07.inc b/poky/meta/recipes-bsp/u-boot/u-boot-common.inc index 22b44dccc..dcfb9cc63 100644 --- a/poky/meta/recipes-bsp/u-boot/u-boot-common_2018.07.inc +++ b/poky/meta/recipes-bsp/u-boot/u-boot-common.inc @@ -8,11 +8,8 @@ PE = "1" # We use the revision in order to avoid having to fetch it from the # repo during parse -SRCREV = "8c5d4fd0ec222701598a27b26ab7265d4cee45a3" +SRCREV = "d3689267f92c5956e09cc7d1baa4700141662bff" -SRC_URI = "git://git.denx.de/u-boot.git \ - file://CVE-2018-1000205-1.patch \ - file://CVE-2018-1000205-2.patch \ -" +SRC_URI = "git://git.denx.de/u-boot.git" S = "${WORKDIR}/git" diff --git a/poky/meta/recipes-bsp/u-boot/u-boot-fw-utils_2018.07.bb b/poky/meta/recipes-bsp/u-boot/u-boot-fw-utils_2019.01.bb index 52c13e75d..b5ce56847 100644 --- a/poky/meta/recipes-bsp/u-boot/u-boot-fw-utils_2018.07.bb +++ b/poky/meta/recipes-bsp/u-boot/u-boot-fw-utils_2019.01.bb @@ -1,4 +1,4 @@ -require u-boot-common_${PV}.inc +require u-boot-common.inc SUMMARY = "U-Boot bootloader fw_printenv/setenv utilities" DEPENDS += "mtd-utils" diff --git a/poky/meta/recipes-bsp/u-boot/u-boot-mkimage_2018.07.bb b/poky/meta/recipes-bsp/u-boot/u-boot-mkimage_2018.07.bb deleted file mode 100644 index 08bff1d16..000000000 --- a/poky/meta/recipes-bsp/u-boot/u-boot-mkimage_2018.07.bb +++ /dev/null @@ -1,29 +0,0 @@ -require u-boot-common_${PV}.inc - -SUMMARY = "U-Boot bootloader image creation tool" -DEPENDS += "openssl" - -EXTRA_OEMAKE_class-target = 'CROSS_COMPILE="${TARGET_PREFIX}" CC="${CC} ${CFLAGS} ${LDFLAGS}" HOSTCC="${BUILD_CC} ${BUILD_CFLAGS} ${BUILD_LDFLAGS}" STRIP=true V=1' -EXTRA_OEMAKE_class-native = 'CC="${BUILD_CC} ${BUILD_CFLAGS} ${BUILD_LDFLAGS}" HOSTCC="${BUILD_CC} ${BUILD_CFLAGS} ${BUILD_LDFLAGS}" STRIP=true V=1' -EXTRA_OEMAKE_class-nativesdk = 'CROSS_COMPILE="${HOST_PREFIX}" CC="${CC} ${CFLAGS} ${LDFLAGS}" HOSTCC="${BUILD_CC} ${BUILD_CFLAGS} ${BUILD_LDFLAGS}" STRIP=true V=1' - -do_compile () { - oe_runmake sandbox_defconfig - - # Disable CONFIG_CMD_LICENSE, license.h is not used by tools and - # generating it requires bin2header tool, which for target build - # is built with target tools and thus cannot be executed on host. - sed -i "s/CONFIG_CMD_LICENSE=.*/# CONFIG_CMD_LICENSE is not set/" .config - - oe_runmake cross_tools NO_SDL=1 -} - -do_install () { - install -d ${D}${bindir} - install -m 0755 tools/mkimage ${D}${bindir}/uboot-mkimage - ln -sf uboot-mkimage ${D}${bindir}/mkimage -} - -RDEPENDS_${PN} += "dtc" - -BBCLASSEXTEND = "native nativesdk" diff --git a/poky/meta/recipes-bsp/u-boot/u-boot-tools_2019.01.bb b/poky/meta/recipes-bsp/u-boot/u-boot-tools_2019.01.bb new file mode 100644 index 000000000..bede984ef --- /dev/null +++ b/poky/meta/recipes-bsp/u-boot/u-boot-tools_2019.01.bb @@ -0,0 +1,67 @@ +require u-boot-common.inc + +SUMMARY = "U-Boot bootloader tools" +DEPENDS += "openssl" + +PROVIDES = "${MLPREFIX}u-boot-mkimage ${MLPREFIX}u-boot-mkenvimage" +PROVIDES_class-native = "u-boot-mkimage-native u-boot-mkenvimage-native" + +PACKAGES += "${PN}-mkimage ${PN}-mkenvimage" + +# Required for backward compatibility with "u-boot-mkimage-xxx.bb" +RPROVIDES_${PN}-mkimage = "u-boot-mkimage" +RREPLACES_${PN}-mkimage = "u-boot-mkimage" +RCONFLICTS_${PN}-mkimage = "u-boot-mkimage" + +EXTRA_OEMAKE_class-target = 'CROSS_COMPILE="${TARGET_PREFIX}" CC="${CC} ${CFLAGS} ${LDFLAGS}" HOSTCC="${BUILD_CC} ${BUILD_CFLAGS} ${BUILD_LDFLAGS}" STRIP=true V=1' +EXTRA_OEMAKE_class-native = 'CC="${BUILD_CC} ${BUILD_CFLAGS} ${BUILD_LDFLAGS}" HOSTCC="${BUILD_CC} ${BUILD_CFLAGS} ${BUILD_LDFLAGS}" STRIP=true V=1' +EXTRA_OEMAKE_class-nativesdk = 'CROSS_COMPILE="${HOST_PREFIX}" CC="${CC} ${CFLAGS} ${LDFLAGS}" HOSTCC="${BUILD_CC} ${BUILD_CFLAGS} ${BUILD_LDFLAGS}" STRIP=true V=1' + +SED_CONFIG_EFI = '-e "s/CONFIG_EFI_LOADER=.*/# CONFIG_EFI_LOADER is not set/"' +SED_CONFIG_EFI_x86 = '' +SED_CONFIG_EFI_x86-64 = '' +SED_CONFIG_EFI_arm = '' +SED_CONFIG_EFI_armeb = '' +SED_CONFIG_EFI_aarch64 = '' + +do_compile () { + oe_runmake sandbox_defconfig + + # Disable CONFIG_CMD_LICENSE, license.h is not used by tools and + # generating it requires bin2header tool, which for target build + # is built with target tools and thus cannot be executed on host. + sed -i -e "s/CONFIG_CMD_LICENSE=.*/# CONFIG_CMD_LICENSE is not set/" ${SED_CONFIG_EFI} .config + + oe_runmake cross_tools NO_SDL=1 +} + +do_install () { + install -d ${D}${bindir} + + # mkimage + install -m 0755 tools/mkimage ${D}${bindir}/uboot-mkimage + ln -sf uboot-mkimage ${D}${bindir}/mkimage + + # mkenvimage + install -m 0755 tools/mkenvimage ${D}${bindir}/uboot-mkenvimage + ln -sf uboot-mkenvimage ${D}${bindir}/mkenvimage + + # dumpimage + install -m 0755 tools/dumpimage ${D}${bindir}/uboot-dumpimage + ln -sf uboot-dumpimage ${D}${bindir}/dumpimage + + # fit_check_sign + install -m 0755 tools/fit_check_sign ${D}${bindir}/uboot-fit_check_sign + ln -sf uboot-fit_check_sign ${D}${bindir}/fit_check_sign +} + +ALLOW_EMPTY_${PN} = "1" +FILES_${PN} = "" +FILES_${PN}-mkimage = "${bindir}/uboot-mkimage ${bindir}/mkimage ${bindir}/uboot-dumpimage ${bindir}/dumpimage ${bindir}/uboot-fit_check_sign ${bindir}/fit_check_sign" +FILES_${PN}-mkenvimage = "${bindir}/uboot-mkenvimage ${bindir}/mkenvimage" + +RDEPENDS_${PN}-mkimage += "dtc" +RDEPENDS_${PN} += "${PN}-mkimage ${PN}-mkenvimage" +RDEPENDS_${PN}_class-native = "" + +BBCLASSEXTEND = "native nativesdk" diff --git a/poky/meta/recipes-bsp/u-boot/u-boot.inc b/poky/meta/recipes-bsp/u-boot/u-boot.inc index 48fbc5721..96c1f9401 100644 --- a/poky/meta/recipes-bsp/u-boot/u-boot.inc +++ b/poky/meta/recipes-bsp/u-boot/u-boot.inc @@ -5,7 +5,9 @@ B = "${WORKDIR}/build" PACKAGE_ARCH = "${MACHINE_ARCH}" -inherit uboot-config uboot-extlinux-config uboot-sign deploy +DEPENDS += "kern-tools-native" + +inherit uboot-config uboot-extlinux-config uboot-sign deploy cml1 DEPENDS += "swig-native python-native" @@ -66,6 +68,28 @@ UBOOT_EXTLINUX_INSTALL_DIR ?= "/boot/extlinux" UBOOT_EXTLINUX_CONF_NAME ?= "extlinux.conf" UBOOT_EXTLINUX_SYMLINK ?= "${UBOOT_EXTLINUX_CONF_NAME}-${MACHINE}-${PR}" +# returns all the elements from the src uri that are .cfg files +def find_cfgs(d): + sources=src_patches(d, True) + sources_list=[] + for s in sources: + if s.endswith('.cfg'): + sources_list.append(s) + + return sources_list + +do_configure () { + if [ -z "${UBOOT_CONFIG}" ]; then + if [ -n "${UBOOT_MACHINE}" ]; then + oe_runmake -C ${S} O=${B} ${UBOOT_MACHINE} + else + oe_runmake -C ${S} O=${B} oldconfig + fi + merge_config.sh -m .config ${@" ".join(find_cfgs(d))} + cml1_do_configure + fi +} + do_compile () { if [ "${@bb.utils.filter('DISTRO_FEATURES', 'ld-is-gold', d)}" ]; then sed -i 's/$(CROSS_COMPILE)ld$/$(CROSS_COMPILE)ld.bfd/g' ${S}/config.mk @@ -105,7 +129,6 @@ do_compile () { done unset i else - oe_runmake -C ${S} O=${B} ${UBOOT_MACHINE} oe_runmake -C ${S} O=${B} ${UBOOT_MAKE_TARGET} fi @@ -201,7 +224,7 @@ do_install () { } -FILES_${PN} = "/boot ${sysconfdir}" +FILES_${PN} = "/boot ${sysconfdir} ${datadir}" do_deploy () { if [ -n "${UBOOT_CONFIG}" ] diff --git a/poky/meta/recipes-bsp/u-boot/u-boot_2018.07.bb b/poky/meta/recipes-bsp/u-boot/u-boot_2019.01.bb index 37c21dcaa..02d67c0db 100644 --- a/poky/meta/recipes-bsp/u-boot/u-boot_2018.07.bb +++ b/poky/meta/recipes-bsp/u-boot/u-boot_2019.01.bb @@ -1,4 +1,4 @@ -require u-boot-common_${PV}.inc +require u-boot-common.inc require u-boot.inc DEPENDS += "bc-native dtc-native" |