diff options
Diffstat (limited to 'meta-initramfs')
36 files changed, 381 insertions, 217 deletions
diff --git a/meta-initramfs/classes/klibc.bbclass b/meta-initramfs/classes/klibc.bbclass index b7b72b728b..bba10f1b61 100644 --- a/meta-initramfs/classes/klibc.bbclass +++ b/meta-initramfs/classes/klibc.bbclass @@ -8,9 +8,9 @@ CC_forcevariable_armv4_linux-gnueabi = "${TARGET_PREFIX}klcc ${TOOLCHAIN_OPTIONS CC_append_armv7ve = " ${@' -mfloat-abi=${TUNE_CCARGS_MFLOAT}' if (d.getVar('TUNE_CCARGS_MFLOAT') != '') else ''}" CC_append_armv7a = " ${@' -mfloat-abi=${TUNE_CCARGS_MFLOAT}' if (d.getVar('TUNE_CCARGS_MFLOAT') != '') else ''}" -CPP_forcevariable = "${CC} -E" - # klcc uses own optimizations by default. See klcc(1) man file. export CFLAGS="${TUNE_CCARGS}" export CPPFLAGS="${TUNE_CCARGS}" export LDFLAGS="${TUNE_CCARGS}" + +OVERRIDES =. "libc-klibc:" diff --git a/meta-initramfs/conf/layer.conf b/meta-initramfs/conf/layer.conf index bd92ddfbc2..6e0b00db0b 100644 --- a/meta-initramfs/conf/layer.conf +++ b/meta-initramfs/conf/layer.conf @@ -16,7 +16,7 @@ BBFILE_PATTERN_meta-initramfs := "^${LAYERDIR}/" BBFILE_PRIORITY_meta-initramfs = "8" LAYERDEPENDS_meta-initramfs = "core" -LAYERSERIES_COMPAT_meta-initramfs = "thud" +LAYERSERIES_COMPAT_meta-initramfs = "thud warrior" SIGGEN_EXCLUDE_SAFE_RECIPE_DEPS += " \ dracut->virtual/kernel \ diff --git a/meta-initramfs/recipes-bsp/kexecboot/files/0001-kexecboot-Use-new-reboot-API-with-klibc.patch b/meta-initramfs/recipes-bsp/kexecboot/files/0001-kexecboot-Use-new-reboot-API-with-klibc.patch new file mode 100644 index 0000000000..52d622a2f8 --- /dev/null +++ b/meta-initramfs/recipes-bsp/kexecboot/files/0001-kexecboot-Use-new-reboot-API-with-klibc.patch @@ -0,0 +1,42 @@ +From a6d1678379df6142a68cc9bb76dae540a31b8fdb Mon Sep 17 00:00:00 2001 +From: Khem Raj <raj.khem@gmail.com> +Date: Thu, 14 Mar 2019 23:47:50 -0700 +Subject: [PATCH] kexecboot: Use new reboot() API with klibc + +Klibc has changed this API in +https://git.kernel.org/pub/scm/libs/klibc/klibc.git/commit/?id=6b621b8705ce5901dcf49607c8a3523c9e521901 + +therefore adopt the code + +Upstream-Status: Pending + +Signed-off-by: Khem Raj <raj.khem@gmail.com> +--- + src/kexecboot.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/src/kexecboot.c b/src/kexecboot.c +index cf49b40..c785fce 100644 +--- a/src/kexecboot.c ++++ b/src/kexecboot.c +@@ -857,7 +857,7 @@ int process_ctx_menu(struct params_t *params, int action) { + #else + sync(); + /* if ( -1 == reboot(LINUX_REBOOT_CMD_RESTART) ) { */ +- if ( -1 == reboot(RB_AUTOBOOT) ) { ++ if ( -1 == reboot(RB_AUTOBOOT, NULL) ) { + log_msg(lg, "Can't initiate reboot: %s", ERRMSG); + } + #endif +@@ -874,7 +874,7 @@ int process_ctx_menu(struct params_t *params, int action) { + #else + sync(); + /* if ( -1 == reboot(LINUX_REBOOT_CMD_POWER_OFF) ) { */ +- if ( -1 == reboot(RB_POWER_OFF) ) { ++ if ( -1 == reboot(RB_POWER_OFF, NULL) ) { + log_msg(lg, "Can't initiate shutdown: %s", ERRMSG); + } + #endif +-- +2.21.0 + diff --git a/meta-initramfs/recipes-bsp/kexecboot/kexecboot_git.bb b/meta-initramfs/recipes-bsp/kexecboot/kexecboot_git.bb index 6d79e8f83f..4b20e1ed9a 100644 --- a/meta-initramfs/recipes-bsp/kexecboot/kexecboot_git.bb +++ b/meta-initramfs/recipes-bsp/kexecboot/kexecboot_git.bb @@ -6,7 +6,9 @@ LIC_FILES_CHKSUM = "file://COPYING;md5=94d55d512a9ba36caa9b7df079bae19f" PV = "0.6+git${SRCPV}" S = "${WORKDIR}/git" SRC_URI = "git://github.com/kexecboot/kexecboot.git" -SRCREV = "4c01d6960aa6a9d03675605062469ab777fa2b01" +SRC_URI_append_libc-klibc = " file://0001-kexecboot-Use-new-reboot-API-with-klibc.patch " + +SRCREV = "7409a1e0aaea61af87c4eca0149cec18a9f58ab6" inherit autotools EXTRA_OECONF = "--enable-textui --enable-delay=2 --enable-evdev-rate=1000,250" diff --git a/meta-initramfs/recipes-core/images/meta-initramfs-image.bb b/meta-initramfs/recipes-core/images/meta-initramfs-image.bb new file mode 100644 index 0000000000..9d70d6d02d --- /dev/null +++ b/meta-initramfs/recipes-core/images/meta-initramfs-image.bb @@ -0,0 +1,8 @@ +SUMMARY = "meta-initramfs build test image" + +IMAGE_INSTALL = "packagegroup-core-boot \ + packagegroup-meta-initramfs" + +LICENSE = "MIT" + +inherit core-image diff --git a/meta-initramfs/recipes-core/packagegroups/packagegroup-meta-initramfs.bb b/meta-initramfs/recipes-core/packagegroups/packagegroup-meta-initramfs.bb new file mode 100644 index 0000000000..bfede5a749 --- /dev/null +++ b/meta-initramfs/recipes-core/packagegroups/packagegroup-meta-initramfs.bb @@ -0,0 +1,36 @@ +SUMMARY = "Meta-initramfs packagegroups" + +inherit packagegroup + +PROVIDES = "${PACKAGES}" +PACKAGES = ' \ + packagegroup-meta-initramfs \ + packagegroup-meta-initramfs-devtools \ + packagegroup-meta-initramfs-kernel \ +' + +RDEPENDS_packagegroup-meta-initramfs = "\ + packagegroup-meta-initramfs-devtools \ + packagegroup-meta-initramfs-kernel \ +" + +RDEPENDS_packagegroup-meta-initramfs-devtools = "\ + libklibc dracut \ + klibc-utils-cat klibc-utils-losetup klibc-utils-readlink klibc-utils-chroot \ + klibc-utils-ls klibc-utils-reboot klibc-utils-cpio klibc-utils-minips \ + klibc-utils-resume klibc-utils-dd klibc-utils-mkdir klibc-utils-run-init \ + klibc-utils-dmesg klibc-utils-mkfifo klibc-utils-sh.shared klibc-utils-false \ + klibc-utils-mknod klibc-utils-sleep klibc-utils-fstype klibc-utils-mount \ + klibc-utils-sync klibc-utils-halt klibc-utils-mv klibc-utils-true klibc-utils-ipconfig \ + klibc-utils-nfsmount klibc-utils-umount klibc-utils-kill klibc-utils-nuke klibc-utils-uname \ + mtdinfo-klibc ubiattach-klibc ubiblock-klibc ubicrc32-klibc ubidetach-klibc \ + ubiformat-klibc ubimkvol-klibc ubinfo-klibc ubinize-klibc ubirename-klibc \ + ubirmvol-klibc ubirsvol-klibc ubiupdatevol-klibc \ + ${@bb.utils.contains_any("TRANSLATED_TARGET_ARCH", "i586 x86-64", "grubby", "", d)} \ + " + +RDEPENDS_packagegroup-meta-initramfs-kernel = "\ + kexec-klibc vmcore-dmesg-klibc \ + " + +EXCLUDE_FROM_WORLD = "1" diff --git a/meta-initramfs/recipes-devtools/dracut/dracut/0001-dracut.sh-improve-udevdir.patch b/meta-initramfs/recipes-devtools/dracut/dracut/0001-dracut.sh-improve-udevdir.patch new file mode 100644 index 0000000000..06e0a094f9 --- /dev/null +++ b/meta-initramfs/recipes-devtools/dracut/dracut/0001-dracut.sh-improve-udevdir.patch @@ -0,0 +1,39 @@ +From 974f728410052bc8fa18d93dc0c1a991bcdb96e6 Mon Sep 17 00:00:00 2001 +From: Hongxu Jia <hongxu.jia@windriver.com> +Date: Wed, 3 Apr 2019 15:24:47 +0800 +Subject: [PATCH] dracut.sh: improve udevdir + +In commit [9d1b81c dracut.sh: improve udevdir and systemdutildir +fallback logic], it checked a common binary `collect' to localte +udevdir. + +But upstream systemd drop binary `collect'. +[https://github.com/systemd/systemd/commit/a168792c2d95695fd30c0371d4b3890a9df1eafb] + +So check binary `ata_id' to instead. + +Upstream-Status: Submitted [https://github.com/dracutdevs/dracut/pull/558] + +Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com> +--- + dracut.sh | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/dracut.sh b/dracut.sh +index 3dc2adc..cc8b01a 100755 +--- a/dracut.sh ++++ b/dracut.sh +@@ -1311,8 +1311,8 @@ done + [[ -d $udevdir ]] \ + || udevdir="$(pkg-config udev --variable=udevdir 2>/dev/null)" + if ! [[ -d "$udevdir" ]]; then +- [[ -e /lib/udev/collect ]] && udevdir=/lib/udev +- [[ -e /usr/lib/udev/collect ]] && udevdir=/usr/lib/udev ++ [[ -e /lib/udev/ata_id ]] && udevdir=/lib/udev ++ [[ -e /usr/lib/udev/ata_id ]] && udevdir=/usr/lib/udev + fi + + [[ -d $systemdutildir ]] \ +-- +2.7.4 + diff --git a/meta-initramfs/recipes-devtools/dracut/dracut_git.bb b/meta-initramfs/recipes-devtools/dracut/dracut_git.bb index 059e40a3a9..344dfecbbb 100644 --- a/meta-initramfs/recipes-devtools/dracut/dracut_git.bb +++ b/meta-initramfs/recipes-devtools/dracut/dracut_git.bb @@ -6,12 +6,13 @@ LICENSE = "GPLv2" LIC_FILES_CHKSUM = "file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263" PE = "1" -PV = "048" +PV = "049" # v048 tag -SRCREV = "bc01f822de732d85d4bfc77bae44c6bd4abe43d7" +SRCREV = "225e4b94cbdb702cf512490dcd2ad9ca5f5b22c1" SRC_URI = "git://git.kernel.org/pub/scm/boot/dracut/dracut.git;protocol=http \ file://0001-util.h-include-sys-reg.h-when-libc-glibc.patch \ + file://0001-dracut.sh-improve-udevdir.patch \ " DEPENDS += "kmod" diff --git a/meta-initramfs/recipes-devtools/klibc/klibc-2.0.4/0001-Define-in_-structs-for-non-glibc-system-libs.patch b/meta-initramfs/recipes-devtools/klibc/files/0001-Define-in_-structs-for-non-glibc-system-libs.patch index e7a0cce837..e7a0cce837 100644 --- a/meta-initramfs/recipes-devtools/klibc/klibc-2.0.4/0001-Define-in_-structs-for-non-glibc-system-libs.patch +++ b/meta-initramfs/recipes-devtools/klibc/files/0001-Define-in_-structs-for-non-glibc-system-libs.patch diff --git a/meta-initramfs/recipes-devtools/klibc/files/0001-Define-ulocked_-fgets-fread-fwrite-aliases.patch b/meta-initramfs/recipes-devtools/klibc/files/0001-Define-ulocked_-fgets-fread-fwrite-aliases.patch new file mode 100644 index 0000000000..eee144dc4a --- /dev/null +++ b/meta-initramfs/recipes-devtools/klibc/files/0001-Define-ulocked_-fgets-fread-fwrite-aliases.patch @@ -0,0 +1,49 @@ +From 241f423a015279cb29b7ad1a34386ef1c32007fc Mon Sep 17 00:00:00 2001 +From: Khem Raj <raj.khem@gmail.com> +Date: Sun, 9 Dec 2018 16:47:16 -0800 +Subject: [PATCH] Define ulocked_{fgets|fread|fwrite} aliases + +latest clang converts the normal calls to the unlocked variant +equivalents + +Signed-off-by: Khem Raj <raj.khem@gmail.com> +Cc: Andrea Adami <andrea.adami@gmail.com> +--- + usr/klibc/fgets.c | 2 ++ + usr/klibc/fread2.c | 2 ++ + usr/klibc/fwrite2.c | 2 ++ + 3 files changed, 6 insertions(+) + +diff --git a/usr/klibc/fgets.c b/usr/klibc/fgets.c +index dbf742c6..2e9fcb65 100644 +--- a/usr/klibc/fgets.c ++++ b/usr/klibc/fgets.c +@@ -25,3 +25,5 @@ char *fgets(char *s, int n, FILE *f) + + return s; + } ++char *fgets_unlocked(char *s, int n, FILE *f) ++ __alias("fgets"); +diff --git a/usr/klibc/fread2.c b/usr/klibc/fread2.c +index 7dca56b1..5c234766 100644 +--- a/usr/klibc/fread2.c ++++ b/usr/klibc/fread2.c +@@ -11,3 +11,5 @@ size_t fread(void *ptr, size_t size, size_t nmemb, FILE * f) + { + return _fread(ptr, size * nmemb, f) / size; + } ++size_t fread_unlocked(void *ptr, size_t size, size_t nmemb, FILE *f) ++ __alias("fread"); +diff --git a/usr/klibc/fwrite2.c b/usr/klibc/fwrite2.c +index cebc017c..3e0bb57d 100644 +--- a/usr/klibc/fwrite2.c ++++ b/usr/klibc/fwrite2.c +@@ -11,3 +11,5 @@ size_t fwrite(const void *ptr, size_t size, size_t nmemb, FILE * f) + { + return _fwrite(ptr, size * nmemb, f) / size; + } ++size_t fwrite_unlocked(void *ptr, size_t size, size_t nmemb, FILE *f) ++ __alias("fwrite"); +-- +2.19.2 + diff --git a/meta-initramfs/recipes-devtools/klibc/klibc-2.0.4/0001-Kbuild.klibc-Add-path-to-compiler-headers-via-isyste.patch b/meta-initramfs/recipes-devtools/klibc/files/0001-Kbuild.klibc-Add-path-to-compiler-headers-via-isyste.patch index 181dcfb6de..181dcfb6de 100644 --- a/meta-initramfs/recipes-devtools/klibc/klibc-2.0.4/0001-Kbuild.klibc-Add-path-to-compiler-headers-via-isyste.patch +++ b/meta-initramfs/recipes-devtools/klibc/files/0001-Kbuild.klibc-Add-path-to-compiler-headers-via-isyste.patch diff --git a/meta-initramfs/recipes-devtools/klibc/klibc-2.0.4/0001-Kbuild.klibc-Use-print-libgcc-file-name-instead-of-p.patch b/meta-initramfs/recipes-devtools/klibc/files/0001-Kbuild.klibc-Use-print-libgcc-file-name-instead-of-p.patch index 1ba05a811e..1ba05a811e 100644 --- a/meta-initramfs/recipes-devtools/klibc/klibc-2.0.4/0001-Kbuild.klibc-Use-print-libgcc-file-name-instead-of-p.patch +++ b/meta-initramfs/recipes-devtools/klibc/files/0001-Kbuild.klibc-Use-print-libgcc-file-name-instead-of-p.patch diff --git a/meta-initramfs/recipes-devtools/klibc/klibc-2.0.4/0001-always-use-bfd-linker.patch b/meta-initramfs/recipes-devtools/klibc/files/0001-always-use-bfd-linker.patch index de04d691fe..de04d691fe 100644 --- a/meta-initramfs/recipes-devtools/klibc/klibc-2.0.4/0001-always-use-bfd-linker.patch +++ b/meta-initramfs/recipes-devtools/klibc/files/0001-always-use-bfd-linker.patch diff --git a/meta-initramfs/recipes-devtools/klibc/klibc-2.0.4/0001-arm-Do-not-set-a-fallback-march-and-mtune.patch b/meta-initramfs/recipes-devtools/klibc/files/0001-arm-Do-not-set-a-fallback-march-and-mtune.patch index fcf4f891a4..fcf4f891a4 100644 --- a/meta-initramfs/recipes-devtools/klibc/klibc-2.0.4/0001-arm-Do-not-set-a-fallback-march-and-mtune.patch +++ b/meta-initramfs/recipes-devtools/klibc/files/0001-arm-Do-not-set-a-fallback-march-and-mtune.patch diff --git a/meta-initramfs/recipes-devtools/klibc/klibc-2.0.4/0001-dash-Specify-format-string-in-fmtstr.patch b/meta-initramfs/recipes-devtools/klibc/files/0001-dash-Specify-format-string-in-fmtstr.patch index 46a23987f5..46a23987f5 100644 --- a/meta-initramfs/recipes-devtools/klibc/klibc-2.0.4/0001-dash-Specify-format-string-in-fmtstr.patch +++ b/meta-initramfs/recipes-devtools/klibc/files/0001-dash-Specify-format-string-in-fmtstr.patch diff --git a/meta-initramfs/recipes-devtools/klibc/klibc-2.0.4/0001-include-linux-sysinfo.h-directly.patch b/meta-initramfs/recipes-devtools/klibc/files/0001-include-linux-sysinfo.h-directly.patch index 04c97fc5ee..04c97fc5ee 100644 --- a/meta-initramfs/recipes-devtools/klibc/klibc-2.0.4/0001-include-linux-sysinfo.h-directly.patch +++ b/meta-initramfs/recipes-devtools/klibc/files/0001-include-linux-sysinfo.h-directly.patch diff --git a/meta-initramfs/recipes-devtools/klibc/klibc-2.0.4/0001-klibc-Kbuild-Accept-EXTRA_KLIBCAFLAGS.patch b/meta-initramfs/recipes-devtools/klibc/files/0001-klibc-Kbuild-Accept-EXTRA_KLIBCAFLAGS.patch index 94818e3669..94818e3669 100644 --- a/meta-initramfs/recipes-devtools/klibc/klibc-2.0.4/0001-klibc-Kbuild-Accept-EXTRA_KLIBCAFLAGS.patch +++ b/meta-initramfs/recipes-devtools/klibc/files/0001-klibc-Kbuild-Accept-EXTRA_KLIBCAFLAGS.patch diff --git a/meta-initramfs/recipes-devtools/klibc/klibc-2.0.4/0001-klibc-add-getrandom-syscall.patch b/meta-initramfs/recipes-devtools/klibc/files/0001-klibc-add-getrandom-syscall.patch index 0768f6d514..0768f6d514 100644 --- a/meta-initramfs/recipes-devtools/klibc/klibc-2.0.4/0001-klibc-add-getrandom-syscall.patch +++ b/meta-initramfs/recipes-devtools/klibc/files/0001-klibc-add-getrandom-syscall.patch diff --git a/meta-initramfs/recipes-devtools/klibc/klibc-2.0.4/0001-klibc_2.0.4-add-kexec_file_load-syscall.patch b/meta-initramfs/recipes-devtools/klibc/files/0001-klibc_2.0.4-add-kexec_file_load-syscall.patch index 3d8d987c43..3d8d987c43 100644 --- a/meta-initramfs/recipes-devtools/klibc/klibc-2.0.4/0001-klibc_2.0.4-add-kexec_file_load-syscall.patch +++ b/meta-initramfs/recipes-devtools/klibc/files/0001-klibc_2.0.4-add-kexec_file_load-syscall.patch diff --git a/meta-initramfs/recipes-devtools/klibc/klibc-2.0.4/0001-mkfifo-Implement-mkfifo.patch b/meta-initramfs/recipes-devtools/klibc/files/0001-mkfifo-Implement-mkfifo.patch index 3bc081d4e9..3bc081d4e9 100644 --- a/meta-initramfs/recipes-devtools/klibc/klibc-2.0.4/0001-mkfifo-Implement-mkfifo.patch +++ b/meta-initramfs/recipes-devtools/klibc/files/0001-mkfifo-Implement-mkfifo.patch diff --git a/meta-initramfs/recipes-devtools/klibc/klibc-2.0.4/armv4-fix-v4bx.patch b/meta-initramfs/recipes-devtools/klibc/files/armv4-fix-v4bx.patch index e842353061..4a334fa252 100644 --- a/meta-initramfs/recipes-devtools/klibc/klibc-2.0.4/armv4-fix-v4bx.patch +++ b/meta-initramfs/recipes-devtools/klibc/files/armv4-fix-v4bx.patch @@ -12,12 +12,10 @@ Signed-off-by: Andrea Adami <andrea.adami@gmail.com> usr/klibc/arch/arm/MCONFIG | 1 + 1 file changed, 1 insertion(+) -diff --git a/usr/klibc/arch/arm/MCONFIG b/usr/klibc/arch/arm/MCONFIG -index 53bc1dc..303c6ac 100644 --- a/usr/klibc/arch/arm/MCONFIG +++ b/usr/klibc/arch/arm/MCONFIG @@ -29,6 +29,7 @@ else - KLIBCSHAREDFLAGS = -Ttext 0x01800200 + KLIBCSHAREDFLAGS = -Ttext-segment 0x01800000 ifeq ($(CONFIG_AEABI),y) KLIBCREQFLAGS += -mabi=aapcs-linux -mno-thumb-interwork +KLIBCLDFLAGS += $(FIX_ARMV4_EABI_BX) diff --git a/meta-initramfs/recipes-devtools/klibc/klibc-2.0.4/klcc-consider-sysroot.patch b/meta-initramfs/recipes-devtools/klibc/files/klcc-consider-sysroot.patch index 5f47d3f20a..5f47d3f20a 100644 --- a/meta-initramfs/recipes-devtools/klibc/klibc-2.0.4/klcc-consider-sysroot.patch +++ b/meta-initramfs/recipes-devtools/klibc/files/klcc-consider-sysroot.patch diff --git a/meta-initramfs/recipes-devtools/klibc/klibc-2.0.4/klcc-cross-accept-clang-options.patch b/meta-initramfs/recipes-devtools/klibc/files/klcc-cross-accept-clang-options.patch index 07703aa536..07703aa536 100644 --- a/meta-initramfs/recipes-devtools/klibc/klibc-2.0.4/klcc-cross-accept-clang-options.patch +++ b/meta-initramfs/recipes-devtools/klibc/files/klcc-cross-accept-clang-options.patch diff --git a/meta-initramfs/recipes-devtools/klibc/klibc-2.0.4/klibc-config-eabi.patch b/meta-initramfs/recipes-devtools/klibc/files/klibc-config-eabi.patch index f28cd54233..a6998f86d6 100644 --- a/meta-initramfs/recipes-devtools/klibc/klibc-2.0.4/klibc-config-eabi.patch +++ b/meta-initramfs/recipes-devtools/klibc/files/klibc-config-eabi.patch @@ -12,13 +12,12 @@ Signed-off-by: Thomas Kunze <thommycheck@gmx.de> defconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -diff --git a/defconfig b/defconfig -index 04b98e9..0cb23d0 100644 --- a/defconfig +++ b/defconfig -@@ -6,4 +6,4 @@ CONFIG_KLIBC_ZLIB=y +@@ -6,5 +6,5 @@ CONFIG_KLIBC_ZLIB=y CONFIG_REGPARM=y # ARM options # CONFIG_KLIBC_THUMB is not set -# CONFIG_AEABI is not set +CONFIG_AEABI=y + # CONFIG_DEBUG_INFO is not set diff --git a/meta-initramfs/recipes-devtools/klibc/klibc-2.0.4/use-env-for-perl.patch b/meta-initramfs/recipes-devtools/klibc/files/use-env-for-perl.patch index eac128cc09..eac128cc09 100644 --- a/meta-initramfs/recipes-devtools/klibc/klibc-2.0.4/use-env-for-perl.patch +++ b/meta-initramfs/recipes-devtools/klibc/files/use-env-for-perl.patch diff --git a/meta-initramfs/recipes-devtools/klibc/klcc-cross_2.0.4.bb b/meta-initramfs/recipes-devtools/klibc/klcc-cross_2.0.6.bb index b285b2e8be..4011aa231e 100644 --- a/meta-initramfs/recipes-devtools/klibc/klcc-cross_2.0.4.bb +++ b/meta-initramfs/recipes-devtools/klibc/klcc-cross_2.0.6.bb @@ -7,8 +7,6 @@ DEPENDS = "klibc" PACKAGES = "" inherit nopackages -FILESPATH =. "${FILE_DIRNAME}/klibc-${PV}:" - SRC_URI += "file://use-env-for-perl.patch" # disable task already run in klibc recipe @@ -25,8 +23,8 @@ do_install() { # magic by removing all the crazy escaping. sed -i -e "2i \$TARGETSYSROOT = '${STAGING_DIR_TARGET}';" \ -e "2i \$NATIVESYSROOT = '${STAGING_DIR_NATIVE}';" \ - -e 's#${@d.getVar("STAGING_DIR_NATIVE", True).replace("/", "\\\\/").replace("-", "\\\\-").replace(".", "\\\\.")}#${NATIVESYSROOT}#g;' \ - -e 's#${@d.getVar("STAGING_DIR_TARGET", True).replace("/", "\\\\/").replace("-", "\\\\-").replace(".", "\\\\.")}#${TARGETSYSROOT}#g' \ + -e 's#${@d.getVar("STAGING_DIR_NATIVE").replace("/", "\\\\/").replace("-", "\\\\-").replace(".", "\\\\.")}#${NATIVESYSROOT}#g;' \ + -e 's#${@d.getVar("STAGING_DIR_TARGET").replace("/", "\\\\/").replace("-", "\\\\-").replace(".", "\\\\.")}#${TARGETSYSROOT}#g' \ ${D}${bindir_crossscripts}/${TARGET_PREFIX}klcc } diff --git a/meta-initramfs/recipes-devtools/klibc/klibc-2.0.4/klibc-linux-libc-dev.patch b/meta-initramfs/recipes-devtools/klibc/klibc-2.0.4/klibc-linux-libc-dev.patch deleted file mode 100644 index a5563b7407..0000000000 --- a/meta-initramfs/recipes-devtools/klibc/klibc-2.0.4/klibc-linux-libc-dev.patch +++ /dev/null @@ -1,29 +0,0 @@ -From 1be2bc41f915922102a3ba671b54c2df6f0052e6 Mon Sep 17 00:00:00 2001 -From: Ben Hutchings <ben@decadent.org.uk> -Date: Sun, 14 Mar 2010 18:41:56 +0000 -Subject: [PATCH] klibc_1.5.26: now build against linux-libc-headers - -commit 43adf69062254fb4f8d4d11fb5fe36a60ae25d5a - - Taken from debian "Fix klibc Debian specific build trouble" - Adapted for klibc_2.0.2 - ---- - scripts/Kbuild.install | 4 +++- - 1 file changed, 3 insertions(+), 1 deletion(-) - -diff --git a/scripts/Kbuild.install b/scripts/Kbuild.install -index 8af5697..d32a8a5 100644 ---- a/scripts/Kbuild.install -+++ b/scripts/Kbuild.install -@@ -95,7 +95,9 @@ header: - $(Q)mkdir -p $(INSTALLROOT)$(INSTALLDIR)/$(KCROSS)include - $(Q)mkdir -p $(INSTALLROOT)$(INSTALLDIR)/$(KCROSS)lib - $(Q)mkdir -p $(INSTALLROOT)$(INSTALLDIR)/$(KCROSS)bin -- $(Q)$(MAKE) -C $(KLIBCKERNELSRC) ARCH=$(KLIBCARCH) INSTALL_HDR_PATH=$(INSTALLROOT)$(INSTALLDIR)/$(KCROSS) headers_install -+ $(Q)for x in ../../../include/asm ../../../include/asm-generic ../../../include/linux ../../../include/mtd; do \ -+ ln -sf $${x} $(INSTALLROOT)$(INSTALLDIR)/$(KCROSS)include/ || exit; \ -+ done - $(Q)cp -rf usr/include/. $(INSTALLROOT)$(INSTALLDIR)/$(KCROSS)include/. - $(Q)chmod -R a+rX,go-w $(INSTALLROOT)$(INSTALLDIR)/$(KCROSS)include - $(Q)$(install-data) $(srctree)/klcc/klcc.1 $(INSTALLROOT)$(mandir)/man1/$(KCROSS)klcc.1 diff --git a/meta-initramfs/recipes-devtools/klibc/klibc-2.0.4/staging.patch b/meta-initramfs/recipes-devtools/klibc/klibc-2.0.4/staging.patch deleted file mode 100644 index 5c7a6625b5..0000000000 --- a/meta-initramfs/recipes-devtools/klibc/klibc-2.0.4/staging.patch +++ /dev/null @@ -1,151 +0,0 @@ -From 1892079b827cf8f8316305b6d6e0985db82441a2 Mon Sep 17 00:00:00 2001 -From: Thomas Kunze <thommycheck@gmx.de> -Date: Sat, 6 Aug 2011 05:30:14 +0000 -Subject: [PATCH] klibc: initial commit of version 1.5.24 - -Patch was imported from the OpenEmbedded git server -(git://git.openembedded.org/openembedded) -as of commit id eefb99a313bbcc8f34c8b32bf0c5aa2dd2580735 -Signed-off-by: Thomas Kunze <thommycheck@gmx.de> - -Minor edits following upstream changes -Signed-off-by: Andrea Adami <andrea.adami@gmail.com> - ---- - scripts/Kbuild.install | 4 ---- - usr/dash/Kbuild | 2 -- - usr/gzip/Kbuild | 2 -- - usr/kinit/Kbuild | 2 -- - usr/kinit/fstype/Kbuild | 2 -- - usr/kinit/ipconfig/Kbuild | 2 -- - usr/kinit/nfsmount/Kbuild | 2 -- - usr/kinit/resume/Kbuild | 2 -- - usr/kinit/run-init/Kbuild | 2 -- - usr/klibc/Kbuild | 2 -- - usr/utils/Kbuild | 2 -- - 11 files changed, 24 deletions(-) - -diff --git a/scripts/Kbuild.install b/scripts/Kbuild.install -index d32a8a5..fda699d 100644 ---- a/scripts/Kbuild.install -+++ b/scripts/Kbuild.install -@@ -88,19 +88,15 @@ else - header: - $(Q)echo " INSTALL headers + man pages to $(INSTALLROOT)$(INSTALLDIR)" - $(Q)mkdir -p $(INSTALLROOT)$(bindir) -- $(Q)mkdir -p $(INSTALLROOT)$(mandir)/man1 -- $(Q)mkdir -p $(INSTALLROOT)$(SHLIBDIR) - $(Q)mkdir -p $(INSTALLROOT)$(INSTALLDIR) - $(Q)-rm -rf $(INSTALLROOT)$(INSTALLDIR)/$(KCROSS)include - $(Q)mkdir -p $(INSTALLROOT)$(INSTALLDIR)/$(KCROSS)include - $(Q)mkdir -p $(INSTALLROOT)$(INSTALLDIR)/$(KCROSS)lib -- $(Q)mkdir -p $(INSTALLROOT)$(INSTALLDIR)/$(KCROSS)bin - $(Q)for x in ../../../include/asm ../../../include/asm-generic ../../../include/linux ../../../include/mtd; do \ - ln -sf $${x} $(INSTALLROOT)$(INSTALLDIR)/$(KCROSS)include/ || exit; \ - done - $(Q)cp -rf usr/include/. $(INSTALLROOT)$(INSTALLDIR)/$(KCROSS)include/. - $(Q)chmod -R a+rX,go-w $(INSTALLROOT)$(INSTALLDIR)/$(KCROSS)include -- $(Q)$(install-data) $(srctree)/klcc/klcc.1 $(INSTALLROOT)$(mandir)/man1/$(KCROSS)klcc.1 - $(Q)$(install-bin) $(objtree)/klcc/$(KCROSS)klcc $(INSTALLROOT)$(bindir) - - footer: header -diff --git a/usr/dash/Kbuild b/usr/dash/Kbuild -index 3a98c1f..1a6920a 100644 ---- a/usr/dash/Kbuild -+++ b/usr/dash/Kbuild -@@ -92,5 +92,3 @@ $(obj)/syntax.c: $(obj)/mksyntax - $(obj)/syntax.h: $(obj)/syntax.c - $(Q): - --# Targets to install --install-y := sh.shared -diff --git a/usr/gzip/Kbuild b/usr/gzip/Kbuild -index 9bbf0a4..c497d02 100644 ---- a/usr/gzip/Kbuild -+++ b/usr/gzip/Kbuild -@@ -21,5 +21,3 @@ $(obj)/gunzip $(obj)/zcat: $(obj)/gzip - # Cleaning - targets := gzip gzip.g gunzip zcat - --# Targets to install --install-y := gzip gunzip zcat -diff --git a/usr/kinit/Kbuild b/usr/kinit/Kbuild -index 5320127..f7fdccd 100644 ---- a/usr/kinit/Kbuild -+++ b/usr/kinit/Kbuild -@@ -33,5 +33,3 @@ targets += kinit kinit.g kinit.shared kinit.shared.g - subdir- := fstype ipconfig nfsmount resume run-init - - --# install binary --install-y := kinit kinit.shared -diff --git a/usr/kinit/fstype/Kbuild b/usr/kinit/fstype/Kbuild -index 9b20db1..367611d 100644 ---- a/usr/kinit/fstype/Kbuild -+++ b/usr/kinit/fstype/Kbuild -@@ -21,5 +21,3 @@ shared/fstype-y := $(objs) - # Cleaning - clean-dirs := static shared - --# install binary --install-y := $(shared-y) -diff --git a/usr/kinit/ipconfig/Kbuild b/usr/kinit/ipconfig/Kbuild -index 7f8d181..eb1d472 100644 ---- a/usr/kinit/ipconfig/Kbuild -+++ b/usr/kinit/ipconfig/Kbuild -@@ -27,5 +27,3 @@ shared/ipconfig-y := $(objs) - # Cleaning - clean-dirs := static shared - --# install binary --install-y := $(shared-y) -diff --git a/usr/kinit/nfsmount/Kbuild b/usr/kinit/nfsmount/Kbuild -index 461e6f3..ba31708 100644 ---- a/usr/kinit/nfsmount/Kbuild -+++ b/usr/kinit/nfsmount/Kbuild -@@ -23,5 +23,3 @@ dummypmap-y := dummypmap_test.o - - clean-dirs := static shared - --# Install binary --install-y := $(shared-y) -diff --git a/usr/kinit/resume/Kbuild b/usr/kinit/resume/Kbuild -index 034195d..c1342e1 100644 ---- a/usr/kinit/resume/Kbuild -+++ b/usr/kinit/resume/Kbuild -@@ -26,5 +26,3 @@ shared/resume-lib := ../lib.a - # Cleaning - clean-dirs := static shared - --# install binary --install-y := $(shared-y) -diff --git a/usr/kinit/run-init/Kbuild b/usr/kinit/run-init/Kbuild -index f7832b7..c153b0a 100644 ---- a/usr/kinit/run-init/Kbuild -+++ b/usr/kinit/run-init/Kbuild -@@ -30,5 +30,3 @@ shared/run-init-lib := ../lib.a - # Cleaning - clean-dirs := static shared - --# install binary --install-y := $(shared-y) -diff --git a/usr/klibc/Kbuild b/usr/klibc/Kbuild -index eba6add..98caf2e 100644 ---- a/usr/klibc/Kbuild -+++ b/usr/klibc/Kbuild -@@ -185,5 +185,3 @@ install-rule: - $(INSTALLROOT)$(INSTALLDIR)/$(KLIBCCROSS)lib)) - $(Q)$(install-lib) $(obj)/klibc-$(SOLIBHASH).so \ - $(INSTALLROOT)$(INSTALLDIR)/$(KLIBCCROSS)lib -- $(Q)$(install-lib) $(obj)/klibc-$(SOLIBHASH).so \ -- $(INSTALLROOT)$(SHLIBDIR) -diff --git a/usr/utils/Kbuild b/usr/utils/Kbuild -index 05aa794..67d9486 100644 ---- a/usr/utils/Kbuild -+++ b/usr/utils/Kbuild -@@ -72,5 +72,3 @@ $(obj)/shared/reboot $(obj)/shared/poweroff: $(obj)/shared/halt - # Clean deletes the static and shared dir - clean-dirs := static shared - --# install only install the shared binaries --install-y := $(shared-y) shared/reboot shared/poweroff diff --git a/meta-initramfs/recipes-devtools/klibc/klibc-static-utils_2.0.4.bb b/meta-initramfs/recipes-devtools/klibc/klibc-static-utils_2.0.6.bb index 35e17b2cc4..c835fd647a 100644 --- a/meta-initramfs/recipes-devtools/klibc/klibc-static-utils_2.0.4.bb +++ b/meta-initramfs/recipes-devtools/klibc/klibc-static-utils_2.0.6.bb @@ -10,7 +10,3 @@ KLIBC_UTILS_PKGNAME = "klibc-static-utils" require klibc-utils.inc require klibc.inc - -# avoid textrel if linking with -pie -SECURITY_CFLAGS = "" -SECURITY_LDFLAGS = "" diff --git a/meta-initramfs/recipes-devtools/klibc/klibc-utils.inc b/meta-initramfs/recipes-devtools/klibc/klibc-utils.inc index 2aac9e6ebf..00cb86d3e6 100644 --- a/meta-initramfs/recipes-devtools/klibc/klibc-utils.inc +++ b/meta-initramfs/recipes-devtools/klibc/klibc-utils.inc @@ -2,11 +2,11 @@ do_install() { install -d ${D}${base_bindir} install -d ${D}${base_sbindir} if [ "${KLIBC_UTILS_VARIANT}" = "shared" ]; then - install -m 755 usr/kinit/kinit.shared ${D}${base_bindir}/kinit.shared - install -m 755 usr/dash/sh.shared ${D}${base_bindir}/sh.shared + install -m 755 usr/kinit/shared/kinit ${D}${base_bindir}/kinit.shared + install -m 755 usr/dash/shared/sh ${D}${base_bindir}/sh.shared else - install -m 755 usr/dash/sh ${D}${base_bindir}/sh - install -m 755 usr/kinit/kinit ${D}${base_bindir}/kinit + install -m 755 usr/dash/static/sh ${D}${base_bindir}/sh + install -m 755 usr/kinit/static/kinit ${D}${base_bindir}/kinit install -m 755 usr/gzip/gzip ${D}${base_bindir} ln -s gzip ${D}${base_bindir}/gunzip ln -s gzip ${D}${base_bindir}/zcat diff --git a/meta-initramfs/recipes-devtools/klibc/klibc-utils_2.0.4.bb b/meta-initramfs/recipes-devtools/klibc/klibc-utils_2.0.6.bb index 06e71cb7b8..06e71cb7b8 100644 --- a/meta-initramfs/recipes-devtools/klibc/klibc-utils_2.0.4.bb +++ b/meta-initramfs/recipes-devtools/klibc/klibc-utils_2.0.6.bb diff --git a/meta-initramfs/recipes-devtools/klibc/klibc.inc b/meta-initramfs/recipes-devtools/klibc/klibc.inc index be01c2f58d..5805448671 100644 --- a/meta-initramfs/recipes-devtools/klibc/klibc.inc +++ b/meta-initramfs/recipes-devtools/klibc/klibc.inc @@ -5,12 +5,10 @@ SECTION = "libs" LICENSE = "BSD-3-Clause & GPL-2.0 & MIT & Zlib" LIC_FILES_CHKSUM = "file://usr/klibc/LICENSE;md5=d75181f10e998c21eb147f6d2e43ce8b" DEPENDS = "linux-libc-headers perl-native" -SRCREV = "4d19974d7020488f63651244e1f9f51727c3f66c" +SRCREV = "22b36d1ae34416bc48869619cbb0cccb2070f48f" SRC_URI = "git://git.kernel.org/pub/scm/libs/klibc/klibc.git \ ${ARMPATCHES} \ - file://klibc-linux-libc-dev.patch \ - file://staging.patch \ file://klcc-consider-sysroot.patch \ file://klcc-cross-accept-clang-options.patch \ file://0001-dash-Specify-format-string-in-fmtstr.patch \ @@ -24,6 +22,7 @@ SRC_URI = "git://git.kernel.org/pub/scm/libs/klibc/klibc.git \ file://0001-klibc_2.0.4-add-kexec_file_load-syscall.patch \ file://0001-klibc-add-getrandom-syscall.patch \ file://0001-klibc-Kbuild-Accept-EXTRA_KLIBCAFLAGS.patch \ + file://0001-Define-ulocked_-fgets-fread-fwrite-aliases.patch \ " ARMPATCHES ?= "" @@ -47,8 +46,6 @@ EXTRA_OEMAKE = "'KLIBCARCH=${KLIBC_ARCH}' \ 'KLIBCOPTFLAGS=${TUNE_CCARGS} -Os' \ V=1 \ " -EXTRA_OEMAKE += "'EXTRA_KLIBCAFLAGS=${SECURITY_CFLAGS} -Wa,--noexecstack' \ - 'EXTRA_KLIBCLDFLAGS=${SECURITY_LDFLAGS} -z noexecstack'" export FIX_ARMV4_EABI_BX = "${FIX_V4BX}" KLIBCTHUMB = "${@['CONFIG_KLIBC_THUMB=n', 'CONFIG_KLIBC_THUMB=y'][(d.getVar('ARM_INSTRUCTION_SET') == 'thumb')]}" @@ -69,13 +66,9 @@ KLIBC_ARCH = "${TARGET_ARCH}" KLIBC_ARCH_aarch64 = "arm64" KLIBC_ARCH_armeb = "arm" KLIBC_ARCH_mipsel = "mips" +KLIBC_ARCH_mips64el = "mips64" KLIBC_ARCH_x86 = "i386" KLIBC_ARCH_x86-64 = "x86_64" KLIBC_ARCH_powerpc = "ppc" KLIBC_ARCH_powerpc64 = "ppc64" THIS_LIBKLIBC = "libklibc (= ${PV}-${PR})" - -GCCPIE ?= "" -SECURITY_LDFLAGS = "${@'-z relro -z now -pie' if '${GCCPIE}' else ''}" -SECURITY_LDFLAGS_mips = "" -SECURITY_LDFLAGS_mips64 = "" diff --git a/meta-initramfs/recipes-devtools/klibc/klibc_2.0.4.bb b/meta-initramfs/recipes-devtools/klibc/klibc_2.0.6.bb index bc80f382fe..7df0b0a3d5 100644 --- a/meta-initramfs/recipes-devtools/klibc/klibc_2.0.4.bb +++ b/meta-initramfs/recipes-devtools/klibc/klibc_2.0.6.bb @@ -10,6 +10,8 @@ do_install() { install -d ${D}${libdir} install -m 755 usr/klibc/klibc-*.so ${D}${libdir} (cd ${D}${libdir}; ln -s klibc-*.so klibc.so) + rm -rf ${D}${exec_prefix}/man + rm -rf ${D}${libdir}/klibc/bin } PACKAGES = "libklibc libklibc-staticdev libklibc-dev" diff --git a/meta-initramfs/recipes-kernel/kexec/kexec-tools-klibc/140-mips_disable_devicetree_support.patch b/meta-initramfs/recipes-kernel/kexec/kexec-tools-klibc/140-mips_disable_devicetree_support.patch new file mode 100644 index 0000000000..b3ef3c82d1 --- /dev/null +++ b/meta-initramfs/recipes-kernel/kexec/kexec-tools-klibc/140-mips_disable_devicetree_support.patch @@ -0,0 +1,163 @@ +From 5ea7cd78cd252ffd3a9f3fbc8dc795d6e1596084 Mon Sep 17 00:00:00 2001 +From: Andrea Adami <andrea.adami@gmail.com> +Date: Mon, 17 Dec 2018 11:25:20 +0100 +Subject: [PATCH] kexec-tools: fix non-device tree devices on mips + +Add additional argument '--no-dtb' which disables device tree +search in currently loaded kernel. + +Taken from LEDE-DEV: +https://patchwork.ozlabs.org/patch/852961/ + +Rebased for kexec-tools 2.0.18 +Removed ppc change (unwanted ?) + +Signed-off-by: Konstantin Kuzov <master.nosferatu@gmail.com> +Signed-off-by: Andrea Adami <andrea.adami@gmail.com> +--- + kexec/arch/mips/include/arch/options.h | 4 +- + kexec/arch/mips/kexec-elf-mips.c | 58 ++++++++++++++------------ + kexec/arch/mips/kexec-mips.c | 4 ++ + kexec/arch/mips/kexec-mips.h | 1 + + 4 files changed, 39 insertions(+), 28 deletions(-) + +diff --git a/kexec/arch/mips/include/arch/options.h b/kexec/arch/mips/include/arch/options.h +index 416e224..18d2811 100644 +--- a/kexec/arch/mips/include/arch/options.h ++++ b/kexec/arch/mips/include/arch/options.h +@@ -5,6 +5,7 @@ + #define OPT_APPEND (OPT_ARCH_MAX+0) + #define OPT_DTB (OPT_ARCH_MAX+1) + #define OPT_RAMDISK (OPT_ARCH_MAX+2) ++#define OPT_NO_DTB (OPT_ARCH_MAX+3) + + /* Options relevant to the architecture (excluding loader-specific ones), + * in this case none: +@@ -14,7 +15,8 @@ + {"command-line", 1, 0, OPT_APPEND}, \ + {"append", 1, 0, OPT_APPEND}, \ + {"dtb", 1, 0, OPT_DTB }, \ +- {"initrd", 1, 0, OPT_RAMDISK }, ++ {"initrd", 1, 0, OPT_RAMDISK }, \ ++ {"no-dtb", 0, 0, OPT_NO_DTB }, + + + #define KEXEC_ARCH_OPT_STR KEXEC_OPT_STR "" +diff --git a/kexec/arch/mips/kexec-elf-mips.c b/kexec/arch/mips/kexec-elf-mips.c +index 849a7ba..5c0e535 100644 +--- a/kexec/arch/mips/kexec-elf-mips.c ++++ b/kexec/arch/mips/kexec-elf-mips.c +@@ -141,35 +141,37 @@ int elf_mips_load(int argc, char **argv, const char *buf, off_t len, + else + cmdline_addr = 0; + +- /* MIPS systems that have been converted to use device tree +- * passed through UHI will use commandline in the DTB and +- * the DTB passed as a separate buffer. Note that +- * CMDLINE_PREFIX is skipped here intentionally, as it is +- * used only in the legacy method */ +- +- if (arch_options.dtb_file) { +- dtb_buf = slurp_file(arch_options.dtb_file, &dtb_length); +- } else { +- create_flatten_tree(&dtb_buf, &dtb_length, cmdline_buf + strlen(CMDLINE_PREFIX)); +- } + +- if (arch_options.initrd_file) { +- initrd_buf = slurp_file(arch_options.initrd_file, &initrd_size); ++ if (!arch_options.no_dtb) { ++ /* MIPS systems that have been converted to use device tree ++ * passed through UHI will use commandline in the DTB and ++ * the DTB passed as a separate buffer. Note that ++ * CMDLINE_PREFIX is skipped here intentionally, as it is ++ * used only in the legacy method */ ++ ++ if (arch_options.dtb_file) { ++ dtb_buf = slurp_file(arch_options.dtb_file, &dtb_length); ++ } else { ++ create_flatten_tree(&dtb_buf, &dtb_length, cmdline_buf + strlen(CMDLINE_PREFIX)); ++ } + +- /* Create initrd entries in dtb - although at this time +- * they would not point to the correct location */ +- dtb_set_initrd(&dtb_buf, &dtb_length, initrd_buf, initrd_buf + initrd_size); ++ if (arch_options.initrd_file) { ++ initrd_buf = slurp_file(arch_options.initrd_file, &initrd_size); + +- initrd_base = add_buffer(info, initrd_buf, initrd_size, +- initrd_size, sizeof(void *), +- _ALIGN_UP(kernel_addr + kernel_size + dtb_length, +- pagesize), 0x0fffffff, 1); ++ /* Create initrd entries in dtb - although at this time ++ * they would not point to the correct location */ ++ dtb_set_initrd(&dtb_buf, &dtb_length, initrd_buf, initrd_buf + initrd_size); + +- /* Now that the buffer for initrd is prepared, update the dtb +- * with an appropriate location */ +- dtb_set_initrd(&dtb_buf, &dtb_length, initrd_base, initrd_base + initrd_size); +- } ++ initrd_base = add_buffer(info, initrd_buf, initrd_size, ++ initrd_size, sizeof(void *), ++ _ALIGN_UP(kernel_addr + kernel_size + dtb_length, ++ pagesize), 0x0fffffff, 1); + ++ /* Now that the buffer for initrd is prepared, update the dtb ++ * with an appropriate location */ ++ dtb_set_initrd(&dtb_buf, &dtb_length, initrd_base, initrd_base + initrd_size); ++ } ++ } + + /* This is a legacy method for commandline passing used + * currently by Octeon CPUs only */ +@@ -177,9 +179,11 @@ int elf_mips_load(int argc, char **argv, const char *buf, off_t len, + sizeof(cmdline_buf), sizeof(void *), + cmdline_addr, 0x0fffffff, 1); + +- add_buffer(info, dtb_buf, dtb_length, dtb_length, 0, +- _ALIGN_UP(kernel_addr + kernel_size, pagesize), +- 0x0fffffff, 1); ++ if (!arch_options.no_dtb) { ++ add_buffer(info, dtb_buf, dtb_length, dtb_length, 0, ++ _ALIGN_UP(kernel_addr + kernel_size, pagesize), ++ 0x0fffffff, 1); ++ } + + return 0; + } +diff --git a/kexec/arch/mips/kexec-mips.c b/kexec/arch/mips/kexec-mips.c +index 415c2ed..e557f8b 100644 +--- a/kexec/arch/mips/kexec-mips.c ++++ b/kexec/arch/mips/kexec-mips.c +@@ -89,6 +89,7 @@ void arch_usage(void) + " --append=STRING Set the kernel command line to STRING.\n" + " --dtb=FILE Use FILE as the device tree blob.\n" + " --initrd=FILE Use FILE as initial ramdisk.\n" ++ " --no-dtb Don't try to find device tree\n" + ); + } + +@@ -121,6 +122,9 @@ int arch_process_options(int argc, char **argv) + case OPT_RAMDISK: + arch_options.initrd_file = optarg; + break; ++ case OPT_NO_DTB: ++ arch_options.no_dtb = 1; ++ break; + default: + break; + } +diff --git a/kexec/arch/mips/kexec-mips.h b/kexec/arch/mips/kexec-mips.h +index 222c815..90b21c3 100644 +--- a/kexec/arch/mips/kexec-mips.h ++++ b/kexec/arch/mips/kexec-mips.h +@@ -22,6 +22,7 @@ struct arch_options_t { + char *dtb_file; + char *initrd_file; + int core_header_type; ++ int no_dtb; + }; + + extern struct memory_ranges usablemem_rgns; +-- +2.17.1 + diff --git a/meta-initramfs/recipes-kernel/kexec/kexec-tools-klibc/klibc-reboot.patch b/meta-initramfs/recipes-kernel/kexec/kexec-tools-klibc/klibc-reboot.patch new file mode 100644 index 0000000000..be1301df68 --- /dev/null +++ b/meta-initramfs/recipes-kernel/kexec/kexec-tools-klibc/klibc-reboot.patch @@ -0,0 +1,11 @@ +--- a/kexec/kexec.c ++++ b/kexec/kexec.c +@@ -901,7 +901,7 @@ static int my_exec(void) + if (xen_present()) + xen_kexec_exec(); + else +- reboot(LINUX_REBOOT_CMD_KEXEC); ++ reboot(LINUX_REBOOT_CMD_KEXEC, NULL); + /* I have failed if I make it here */ + fprintf(stderr, "kexec failed: %s\n", + strerror(errno)); diff --git a/meta-initramfs/recipes-kernel/kexec/kexec-tools-klibc_git.bb b/meta-initramfs/recipes-kernel/kexec/kexec-tools-klibc_git.bb index 25f5da48da..7ad55d8b8c 100644 --- a/meta-initramfs/recipes-kernel/kexec/kexec-tools-klibc_git.bb +++ b/meta-initramfs/recipes-kernel/kexec/kexec-tools-klibc_git.bb @@ -6,14 +6,14 @@ SECTION = "kernel/userland" LICENSE = "GPLv2" LIC_FILES_CHKSUM = "file://COPYING;md5=ea5bed2f60d357618ca161ad539f7c0a \ file://kexec/kexec.c;beginline=1;endline=20;md5=af10f6ae4a8715965e648aa687ad3e09" -PV = "2.0.17+git${SRCPV}" +PV = "2.0.18+git${SRCPV}" DEPENDS = "zlib xz" inherit klibc autotools SRC_URI = "git://git.kernel.org/pub/scm/utils/kernel/kexec/kexec-tools.git" -SRCREV = "b9de21ef51a7ceab7122a707c188602eae22c4ee" +SRCREV = "5750980cdbbc33ef75bfba6660295b932376ce15" BUILD_PATCHES = "file://0001-force-static-build.patch \ file://0002-Adjust-the-order-of-headers-to-fix-build-for-musl.patch" @@ -31,7 +31,8 @@ KLIBC_PATCHES += " \ file://0012-purgatory-string.c-avoid-inclusion-of-string.h.patch \ file://0013-sha256.h-avoid-inclusion-of-sys-types.h.patch \ file://0014-add-if_nameindex-from-musl.patch \ - file://0015-vmcore-dmesg-fix-warning.patch" + file://0015-vmcore-dmesg-fix-warning.patch \ + file://klibc-reboot.patch" WARNING_FIXES = "" FROM_OE_CORE = "file://arm_crashdump-fix-buffer-align.patch \ @@ -42,6 +43,9 @@ SRC_URI += "${BUILD_PATCHES} ${KLIBC_PATCHES} ${WARNING_FIXES} ${FROM_OE_CORE}" SRC_URI_append_arm = " file://arm_crashdump.patch" +SRC_URI_append_mips = " file://140-mips_disable_devicetree_support.patch" +SRC_URI_append_mipsel = " file://140-mips_disable_devicetree_support.patch" + SRC_URI_append_x86 = " file://x86_sys_io.patch file://x86_basename.patch \ file://x86_vfscanf.patch file://x86_kexec_test.patch" @@ -66,9 +70,12 @@ CFLAGS_x86-64_append = " ${COMMON_CFLAGS} -I${STAGING_DIR_HOST}${libdir}/klibc/i CFLAGS_arm_append = " ${COMMON_CFLAGS} -I${STAGING_DIR_HOST}${libdir}/klibc/include/bits32" CFLAGS_aarch64_append = "${COMMON_CFLAGS} -I${STAGING_DIR_HOST}${libdir}/klibc/include/bits64" CFLAGS_mips_append = " ${COMMON_CFLAGS} -I${STAGING_DIR_HOST}${libdir}/klibc/include/bits32" +CFLAGS_mipsel_append = " ${COMMON_CFLAGS} -I${STAGING_DIR_HOST}${libdir}/klibc/include/bits32" CFLAGS_mips64_append = " ${COMMON_CFLAGS} -I${STAGING_DIR_HOST}${libdir}/klibc/include/bits64" +CFLAGS_mips64el_append = " ${COMMON_CFLAGS} -I${STAGING_DIR_HOST}${libdir}/klibc/include/bits64" CFLAGS_powerpc_append = " ${COMMON_CFLAGS} -I${STAGING_DIR_HOST}${libdir}/klibc/include/bits32" + do_compile_prepend() { # Remove the prepackaged config.h from the source tree as it overrides # the same file generated by configure and placed in the build tree |