summaryrefslogtreecommitdiffstats
path: root/meta-initramfs
diff options
context:
space:
mode:
authorAndrea Adami <andrea.adami@gmail.com>2017-06-21 09:27:44 +0200
committerMartin Jansa <Martin.Jansa@gmail.com>2017-06-22 16:03:01 +0200
commit99c2b3bcee1f7f644a540c642daaf2d22c60a028 (patch)
tree2f76f7a7bea6c985e97e704f02533de28e2ec94d /meta-initramfs
parentec5b888b74928c98a46b7c17d384ca4317b26bfe (diff)
downloadmeta-openembedded-99c2b3bcee1f7f644a540c642daaf2d22c60a028.tar.gz
kexecboot: update recipe to master on github (4c4f127)
With pending OE patches and a new fix for gcc 7. Set PV = "0.6+git${SRCPV}" while waiting for a new 0.7 tarball upstream. Signed-off-by: Andrea Adami <andrea.adami@gmail.com> Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
Diffstat (limited to 'meta-initramfs')
-rw-r--r--meta-initramfs/recipes-bsp/kexecboot/files/0001-kexecboot-fix-build-when-S-B.patch61
-rw-r--r--meta-initramfs/recipes-bsp/kexecboot/files/0002-kexecboot-fix-configure-warnings.patch33
-rw-r--r--meta-initramfs/recipes-bsp/kexecboot/files/0003-kexecboot-do-not-hardcode-MOUNTPOINT.patch97
-rw-r--r--meta-initramfs/recipes-bsp/kexecboot/files/0004-kexecboot.c-workaround-for-absolute-kernel-and-initr.patch135
-rw-r--r--meta-initramfs/recipes-bsp/kexecboot/files/0005-rgb.h-fix-build-with-gcc5.patch35
-rw-r--r--meta-initramfs/recipes-bsp/kexecboot/kexecboot_git.bb (renamed from meta-initramfs/recipes-bsp/kexecboot/kexecboot_0.6.bb)19
6 files changed, 4 insertions, 376 deletions
diff --git a/meta-initramfs/recipes-bsp/kexecboot/files/0001-kexecboot-fix-build-when-S-B.patch b/meta-initramfs/recipes-bsp/kexecboot/files/0001-kexecboot-fix-build-when-S-B.patch
deleted file mode 100644
index 6d3270f89..000000000
--- a/meta-initramfs/recipes-bsp/kexecboot/files/0001-kexecboot-fix-build-when-S-B.patch
+++ /dev/null
@@ -1,61 +0,0 @@
1From 8519d61a7097498b0ee93fb8dc8262286825f3e5 Mon Sep 17 00:00:00 2001
2From: Andrea Adami <andrea.adami@gmail.com>
3Date: Thu, 1 May 2014 23:58:51 +0200
4Subject: [PATCH 1/4] kexecboot: fix build when S != B
5
6* fatal error: ../config.h: No such file or directory
7
8Signed-off-by: Andrea Adami <andrea.adami@gmail.com>
9---
10 machine/zaurus.c | 2 +-
11 res/theme-gui.h | 2 +-
12 res/theme-tui.h | 4 ++--
13 3 files changed, 4 insertions(+), 4 deletions(-)
14
15diff --git a/machine/zaurus.c b/machine/zaurus.c
16index ea21047..83be13b 100644
17--- a/machine/zaurus.c
18+++ b/machine/zaurus.c
19@@ -25,7 +25,7 @@
20 *
21 */
22
23-#include "../config.h"
24+#include "config.h"
25
26 #ifdef USE_ZAURUS
27
28diff --git a/res/theme-gui.h b/res/theme-gui.h
29index f8fef7f..79bed39 100644
30--- a/res/theme-gui.h
31+++ b/res/theme-gui.h
32@@ -15,7 +15,7 @@
33 *
34 */
35
36-#include "../config.h"
37+#include "config.h"
38
39 #ifdef USE_ICONS
40 /** Icons **/
41diff --git a/res/theme-tui.h b/res/theme-tui.h
42index 94e7693..909be56 100644
43--- a/res/theme-tui.h
44+++ b/res/theme-tui.h
45@@ -15,11 +15,11 @@
46 *
47 */
48
49-#include "../config.h"
50+#include "config.h"
51
52 #ifdef USE_TEXTUI
53 /** TEXT UI colors **/
54-#include "../termseq.h"
55+#include "termseq.h"
56
57 /* Background color pair */
58 #define TUI_CLR_BG TERM_CSI TERM_BG_BLACK ";" TERM_FG_WHITE TERM_SGR
59--
601.9.1
61
diff --git a/meta-initramfs/recipes-bsp/kexecboot/files/0002-kexecboot-fix-configure-warnings.patch b/meta-initramfs/recipes-bsp/kexecboot/files/0002-kexecboot-fix-configure-warnings.patch
deleted file mode 100644
index ecf422b72..000000000
--- a/meta-initramfs/recipes-bsp/kexecboot/files/0002-kexecboot-fix-configure-warnings.patch
+++ /dev/null
@@ -1,33 +0,0 @@
1From b8938acc3f1ab35273fa9a2fa7728050ef72ff65 Mon Sep 17 00:00:00 2001
2From: Andrea Adami <andrea.adami@gmail.com>
3Date: Fri, 2 May 2014 00:19:24 +0200
4Subject: [PATCH 2/4] kexecboot: fix configure warnings
5
6Makefile.am:5: warning: source file 'fstype/fstype.c' is in a subdirectory,
7Makefile.am:5: but option 'subdir-objects' is disabled
8automake: warning: possible forward-incompatibility.
9...
10Makefile.am:5: warning: source file 'machine/zaurus.c' is in a subdirectory,
11...
12
13Signed-off-by: Andrea Adami <andrea.adami@gmail.com>
14---
15 configure.ac | 2 +-
16 1 file changed, 1 insertion(+), 1 deletion(-)
17
18diff --git a/configure.ac b/configure.ac
19index 0ca4b81..66ec54e 100644
20--- a/configure.ac
21+++ b/configure.ac
22@@ -1,7 +1,7 @@
23 AC_PREREQ(2.53)
24 AC_INIT([kexecboot], [0.6], [kexecboot-devel@linuxtogo.org])
25 AC_CANONICAL_HOST
26-AM_INIT_AUTOMAKE([-Wall foreign])
27+AM_INIT_AUTOMAKE([-Wall foreign] [subdir-objects])
28 AC_CONFIG_SRCDIR(kexecboot.c)
29 AC_CONFIG_HEADERS(config.h)
30 AM_MAINTAINER_MODE
31--
321.9.1
33
diff --git a/meta-initramfs/recipes-bsp/kexecboot/files/0003-kexecboot-do-not-hardcode-MOUNTPOINT.patch b/meta-initramfs/recipes-bsp/kexecboot/files/0003-kexecboot-do-not-hardcode-MOUNTPOINT.patch
deleted file mode 100644
index 4caa0d5f0..000000000
--- a/meta-initramfs/recipes-bsp/kexecboot/files/0003-kexecboot-do-not-hardcode-MOUNTPOINT.patch
+++ /dev/null
@@ -1,97 +0,0 @@
1From 800dae0d34f8629a34c638a612166b76dda03e27 Mon Sep 17 00:00:00 2001
2From: Andrea Adami <andrea.adami@gmail.com>
3Date: Sat, 2 Aug 2014 01:13:08 +0200
4Subject: [PATCH 3/4] kexecboot: do not hardcode MOUNTPOINT
5
6Avoid to hardcode it: could be requested as a new configure option.
7
8Signed-off-by: Andrea Adami <andrea.adami@gmail.com>
9---
10 cfgparser.c | 6 +++---
11 kexecboot.c | 18 ++++++++++--------
12 2 files changed, 13 insertions(+), 11 deletions(-)
13
14diff --git a/cfgparser.c b/cfgparser.c
15index 8f6688c..dec27b1 100644
16--- a/cfgparser.c
17+++ b/cfgparser.c
18@@ -141,7 +141,7 @@ static int set_kernel(struct cfgdata_t *cfgdata, char *value)
19 return -1;
20 }
21
22- strcpy(sc->kernelpath, "/mnt");
23+ strcpy(sc->kernelpath, MOUNTPOINT);
24 strcat(sc->kernelpath, value);
25 return 0;
26 }
27@@ -155,7 +155,7 @@ static int set_icon(struct cfgdata_t *cfgdata, char *value)
28
29 dispose(sc->iconpath);
30 /* Add our mountpoint, since the enduser won't know it */
31- sc->iconpath = malloc(sizeof(MOUNTPOINT)+strlen(value));
32+ sc->iconpath = malloc(strlen(MOUNTPOINT)+strlen(value)+1);
33 if (NULL == sc->iconpath) {
34 DPRINTF("Can't allocate memory to store iconpath '%s'", value);
35 return -1;
36@@ -194,7 +194,7 @@ static int set_initrd(struct cfgdata_t *cfgdata, char *value)
37 return -1;
38 }
39
40- strcpy(sc->initrd, "/mnt");
41+ strcpy(sc->initrd, MOUNTPOINT);
42 strcat(sc->initrd, value);
43 return 0;
44 }
45diff --git a/kexecboot.c b/kexecboot.c
46index d6657a0..7268d6b 100644
47--- a/kexecboot.c
48+++ b/kexecboot.c
49@@ -57,20 +57,22 @@
50 #endif
51
52 #ifdef USE_MACHINE_KERNEL
53-/* Machine-dependent kernel patch */
54+/* Machine-dependent kernel path */
55 char *machine_kernel = NULL;
56 #endif
57
58+#define PREPEND_MOUNTPATH(string) MOUNTPOINT""string
59+
60 /* NULL-terminated array of kernel search paths
61 * First item should be filled with machine-dependent path */
62 char *default_kernels[] = {
63 #ifdef USE_ZIMAGE
64- "/mnt/boot/zImage",
65- "/mnt/zImage",
66+ PREPEND_MOUNTPATH("/boot/zImage"),
67+ PREPEND_MOUNTPATH("/zImage"),
68 #endif
69 #ifdef USE_UIMAGE
70- "/mnt/boot/uImage",
71- "/mnt/uImage",
72+ PREPEND_MOUNTPATH("/boot/uImage"),
73+ PREPEND_MOUNTPATH("/uImage"),
74 #endif
75 NULL
76 };
77@@ -149,14 +151,14 @@ char *get_machine_kernelpath() {
78 ++tmp;
79 }
80
81- /* Prepend "/mnt/boot/zImage-" to hw */
82- tmp = malloc(strlen(hw) + 17 + 1); /* strlen("/mnt/boot/zImage-") */
83+ /* Prepend MOUNTPOINT"/boot/zImage-" to hw */
84+ tmp = malloc(strlen(PREPEND_MOUNTPATH("/boot/zImage-")) + strlen(hw) + 1);
85 if (NULL == tmp) {
86 DPRINTF("Can't allocate memory for machine-specific kernel path");
87 return NULL;
88 }
89
90- strcpy(tmp, "/mnt/boot/zImage-");
91+ strcpy(tmp, PREPEND_MOUNTPATH("/boot/zImage-"));
92 strcat(tmp, hw);
93
94 return tmp;
95--
961.9.1
97
diff --git a/meta-initramfs/recipes-bsp/kexecboot/files/0004-kexecboot.c-workaround-for-absolute-kernel-and-initr.patch b/meta-initramfs/recipes-bsp/kexecboot/files/0004-kexecboot.c-workaround-for-absolute-kernel-and-initr.patch
deleted file mode 100644
index 6d81d8357..000000000
--- a/meta-initramfs/recipes-bsp/kexecboot/files/0004-kexecboot.c-workaround-for-absolute-kernel-and-initr.patch
+++ /dev/null
@@ -1,135 +0,0 @@
1From de9a6284df8add6ec03e1d9981d0b6d0595bbc69 Mon Sep 17 00:00:00 2001
2From: Andrea Adami <andrea.adami@gmail.com>
3Date: Mon, 10 Nov 2014 23:37:23 +0100
4Subject: [PATCH 4/4] kexecboot.c: workaround for absolute kernel and initrd
5 symlinks
6
7Add MOUNTPOINT prefix if the kernel/initrd symlinks start with '/'.
8Do nothing if the path is a relative symbolic link or not a symlink.
9
10Fix following situation:
11
12root@mizar:/var/tmp# ls -al boot/
13total 2076
14drwxr-xr-x 2 root root 4096 lug 5 01:38 .
15drwxrwxrwt 4 root root 4096 lug 5 12:26 ..
16-rw-r--r-- 1 root root 831 lug 5 01:24 boot.cfg
17-rw-r--r-- 1 root root 1322 lug 5 01:24 icon.xpm
18lrwxrwxrwx 1 root root 34 lug 5 12:26 zImage ->
19/boot/zImage-3.14.5-yocto-standard
20-rw-r--r-- 1 root root 2106832 lug 5 01:20 zImage-3.14.5-yocto-standard
21
22Cannot open `/mnt/boot/zImage': No such file or directory
23Nothing has been loaded!
24
25Signed-off-by: Andrea Adami <andrea.adami@gmail.com>
26---
27 kexecboot.c | 53 ++++++++++++++++++++++++++++++++++++++++++++---------
28 1 file changed, 44 insertions(+), 9 deletions(-)
29
30diff --git a/kexecboot.c b/kexecboot.c
31index 7268d6b..8a7a7d2 100644
32--- a/kexecboot.c
33+++ b/kexecboot.c
34@@ -208,11 +208,16 @@ void start_kernel(struct params_t *params, int choice)
35 const char *load_argv[] = { NULL, "-l", NULL, NULL, NULL, NULL };
36 const char *exec_argv[] = { NULL, "-e", NULL, NULL};
37
38- char *cmdline_arg = NULL, *initrd_arg = NULL;
39+ char *cmdline_arg = NULL, *initrd_arg = NULL, *kernel_arg = NULL;
40 int n, idx, u;
41 struct stat sinfo;
42 struct boot_item_t *item;
43
44+ /* buffer for readlink (could be truncated) */
45+ char buf[512];
46+ int len;
47+
48+
49 item = params->bootcfg->list[choice];
50
51 exec_argv[0] = kexec_path;
52@@ -306,10 +311,17 @@ void start_kernel(struct params_t *params, int choice)
53 }
54 }
55
56+ /* Mount boot device */
57+ if ( -1 == mount(mount_dev, mount_point, mount_fstype,
58+ MS_RDONLY, NULL) ) {
59+ perror("Can't mount boot device");
60+ exit(-1);
61+ }
62+
63 /* fill '--initrd' option */
64 if (item->initrd) {
65 /* allocate space */
66- n = sizeof(str_initrd_start) + strlen(item->initrd);
67+ n = sizeof(str_initrd_start) + strlen(item->initrd) + 1 + sizeof(mount_point) + sizeof(buf);
68
69 initrd_arg = (char *)malloc(n);
70 if (NULL == initrd_arg) {
71@@ -317,24 +329,46 @@ void start_kernel(struct params_t *params, int choice)
72 } else {
73 strcpy(initrd_arg, str_initrd_start); /* --initrd= */
74 strcat(initrd_arg, item->initrd);
75+
76+ if ((len = readlink(item->initrd, buf, sizeof(buf)-1)) != -1) {
77+ buf[len] = '\0';
78+ /* Fix absolute symlinks: prepend MOUNTPOINT */
79+ if (buf[0] == '/') {
80+ strcpy(initrd_arg, str_initrd_start); /* --initrd= */
81+ strcat(initrd_arg, mount_point);
82+ strcat(initrd_arg, buf);
83+ }
84+ }
85 load_argv[idx] = initrd_arg;
86 ++idx;
87 }
88 }
89
90 /* Append kernelpath as last arg of kexec */
91- load_argv[idx] = item->kernelpath;
92+ /* allocate space */
93+ n = strlen(item->kernelpath) + 1 + sizeof(mount_point) + sizeof(buf);
94+
95+ kernel_arg = (char *)malloc(n);
96+ if (NULL == kernel_arg) {
97+ perror("Can't allocate memory for kernel_arg");
98+ } else {
99+ strcpy(kernel_arg, item->kernelpath);
100+
101+ if ((len = readlink(item->kernelpath, buf, sizeof(buf)-1)) != -1) {
102+ buf[len] = '\0';
103+ /* Fix absolute symlinks: prepend MOUNTPOINT */
104+ if (buf[0] == '/') {
105+ strcpy(kernel_arg, mount_point);
106+ strcat(kernel_arg, buf);
107+ }
108+ }
109+ load_argv[idx] = kernel_arg;
110+ }
111
112 DPRINTF("load_argv: %s, %s, %s, %s, %s", load_argv[0],
113 load_argv[1], load_argv[2],
114 load_argv[3], load_argv[4]);
115
116- /* Mount boot device */
117- if ( -1 == mount(mount_dev, mount_point, mount_fstype,
118- MS_RDONLY, NULL) ) {
119- perror("Can't mount boot device");
120- exit(-1);
121- }
122
123 /* Load kernel */
124 n = fexecw(kexec_path, (char *const *)load_argv, envp);
125@@ -347,6 +381,7 @@ void start_kernel(struct params_t *params, int choice)
126
127 dispose(cmdline_arg);
128 dispose(initrd_arg);
129+ dispose(kernel_arg);
130
131 /* Check /proc/sys/net presence */
132 if ( -1 == stat("/proc/sys/net", &sinfo) ) {
133--
1341.9.1
135
diff --git a/meta-initramfs/recipes-bsp/kexecboot/files/0005-rgb.h-fix-build-with-gcc5.patch b/meta-initramfs/recipes-bsp/kexecboot/files/0005-rgb.h-fix-build-with-gcc5.patch
deleted file mode 100644
index b54199b08..000000000
--- a/meta-initramfs/recipes-bsp/kexecboot/files/0005-rgb.h-fix-build-with-gcc5.patch
+++ /dev/null
@@ -1,35 +0,0 @@
1From b2c4fc69868a4831ec798ad98f5e7fce200cf0e3 Mon Sep 17 00:00:00 2001
2From: Andrea Adami <andrea.adami@gmail.com>
3Date: Thu, 24 Sep 2015 00:02:48 +0200
4Subject: [PATCH] rgb.h: fix build with gcc 5 (C99 inline semantic)
5
6Building with gcc 5.2 we trigger the following error:
7
8rgb.h:55:1: warning: inline function 'rgba2comp' declared but never defined
9| rgba2comp(kx_rgba rgba, kx_ccomp *red, kx_ccomp *green,
10| ^
11
12https://gcc.gnu.org/gcc-5/porting_to.html
13
14Signed-off-by: Andrea Adami <andrea.adami@gmail.com>
15---
16 rgb.h | 2 +-
17 1 file changed, 1 insertion(+), 1 deletion(-)
18
19diff --git a/rgb.h b/rgb.h
20index 0ba987a..4f64622 100644
21--- a/rgb.h
22+++ b/rgb.h
23@@ -51,8 +51,7 @@ typedef struct {
24 } kx_named_color;
25
26 /* Convert RGBA uint32 to red/green/blue/alpha components */
27-inline void
28-rgba2comp(kx_rgba rgba, kx_ccomp *red, kx_ccomp *green,
29+void rgba2comp(kx_rgba rgba, kx_ccomp *red, kx_ccomp *green,
30 kx_ccomp *blue, kx_ccomp *alpha);
31
32 /* Convert hex rgb color to rgba color */
33--
341.9.1
35
diff --git a/meta-initramfs/recipes-bsp/kexecboot/kexecboot_0.6.bb b/meta-initramfs/recipes-bsp/kexecboot/kexecboot_git.bb
index 45095f311..9f5dad7c6 100644
--- a/meta-initramfs/recipes-bsp/kexecboot/kexecboot_0.6.bb
+++ b/meta-initramfs/recipes-bsp/kexecboot/kexecboot_git.bb
@@ -36,21 +36,10 @@ DESCRIPTION = "kexecboot is a graphical linux-as-bootloader implementation based
36HOMEPAGE = "http://kexecboot.org" 36HOMEPAGE = "http://kexecboot.org"
37LICENSE = "GPLv2" 37LICENSE = "GPLv2"
38LIC_FILES_CHKSUM = "file://COPYING;md5=94d55d512a9ba36caa9b7df079bae19f" 38LIC_FILES_CHKSUM = "file://COPYING;md5=94d55d512a9ba36caa9b7df079bae19f"
39 39PV = "0.6+git${SRCPV}"
40S = "${WORKDIR}/kexecboot-${PV}" 40S = "${WORKDIR}/git"
41SRC_URI = "https://github.com/kexecboot/kexecboot/archive/v${PV}.tar.gz" 41SRC_URI = "git://github.com/kexecboot/kexecboot.git"
42SRC_URI[md5sum] = "46b7c1a6f20531be56445ebb8669a2b8" 42SRCREV = "4c4f127e79ac5b8d6b6e2fbb938ccbf12b04c531"
43SRC_URI[sha256sum] = "6b360b8aa59bc5d68a96705349a0dd416f8ed704e931fa0ac7849298258f0f15"
44
45SRC_URI += "\
46 file://0001-kexecboot-fix-build-when-S-B.patch \
47 file://0002-kexecboot-fix-configure-warnings.patch \
48 file://0003-kexecboot-do-not-hardcode-MOUNTPOINT.patch \
49 file://0004-kexecboot.c-workaround-for-absolute-kernel-and-initr.patch \
50 \
51 file://0005-rgb.h-fix-build-with-gcc5.patch \
52 "
53
54inherit autotools 43inherit autotools
55 44
56EXTRA_OECONF = "--enable-textui --enable-delay=2 --enable-evdev-rate=1000,250" 45EXTRA_OECONF = "--enable-textui --enable-delay=2 --enable-evdev-rate=1000,250"