summaryrefslogtreecommitdiffstats
path: root/recipes-bsp
diff options
context:
space:
mode:
authorAnton Gerasimov <anton@advancedtelematic.com>2016-09-26 15:44:53 +0200
committerAnton Gerasimov <anton@advancedtelematic.com>2016-09-26 15:44:53 +0200
commit844ddcf4496edfdb9b682f712ab1ae1cd16f1f97 (patch)
tree5cb9794fb8630c32797b9687cd847d7b954b55cd /recipes-bsp
parent0983092cf61779b70cb41741bd4913b0f0f0fbac (diff)
downloadmeta-updater-844ddcf4496edfdb9b682f712ab1ae1cd16f1f97.tar.gz
Added initramfs image and fixed several error to make AGL rootfs
bootable as an OSTree deployment Bug-AGL: SPEC-253 Change-Id: If636a282d51a64c73c46ce70a361518c1f70cdd6 Signed-off-by: Anton Gerasimov <anton@advancedtelematic.com>
Diffstat (limited to 'recipes-bsp')
-rw-r--r--recipes-bsp/u-boot/u-boot-ota/0001-Set-up-environment-for-OSTree-integration.patch27
-rw-r--r--recipes-bsp/u-boot/u-boot-ota/0002-Replace-wraps-with-built-in-code-to-remove-dependenc.patch165
-rw-r--r--recipes-bsp/u-boot/u-boot-ota_2015.07.bb24
-rw-r--r--recipes-bsp/u-boot/u-boot-ota_2016.07.bb23
4 files changed, 121 insertions, 118 deletions
diff --git a/recipes-bsp/u-boot/u-boot-ota/0001-Set-up-environment-for-OSTree-integration.patch b/recipes-bsp/u-boot/u-boot-ota/0001-Set-up-environment-for-OSTree-integration.patch
index c33d40c..186a2a2 100644
--- a/recipes-bsp/u-boot/u-boot-ota/0001-Set-up-environment-for-OSTree-integration.patch
+++ b/recipes-bsp/u-boot/u-boot-ota/0001-Set-up-environment-for-OSTree-integration.patch
@@ -1,36 +1,41 @@
1From 2b4d519bef51d9bfb646588aa5198f71022a867b Mon Sep 17 00:00:00 2001 1From ebb26338d0c2f436a86fd4d7cb8d723a90d6a369 Mon Sep 17 00:00:00 2001
2From: Anton Gerasimov <anton@advancedtelematic.com> 2From: Anton Gerasimov <anton@advancedtelematic.com>
3Date: Mon, 15 Aug 2016 15:54:20 +0200 3Date: Thu, 15 Sep 2016 17:52:41 +0200
4Subject: [PATCH] Set up environment for OSTree integration 4Subject: [PATCH 1/2] Set up environment for OSTree integration
5 5
6--- 6---
7 include/configs/qemu-x86.h | 15 +++++++++++++++ 7 include/configs/qemu-x86.h | 20 ++++++++++++++++++++
8 1 file changed, 15 insertions(+) 8 1 file changed, 20 insertions(+)
9 9
10diff --git a/include/configs/qemu-x86.h b/include/configs/qemu-x86.h 10diff --git a/include/configs/qemu-x86.h b/include/configs/qemu-x86.h
11index 476d37d..f49e2a5 100644 11index 78c296f..79df455 100644
12--- a/include/configs/qemu-x86.h 12--- a/include/configs/qemu-x86.h
13+++ b/include/configs/qemu-x86.h 13+++ b/include/configs/qemu-x86.h
14@@ -56,4 +56,19 @@ 14@@ -74,4 +74,24 @@
15 #undef CONFIG_ENV_IS_IN_SPI_FLASH 15 #undef CONFIG_ENV_IS_IN_SPI_FLASH
16 #define CONFIG_ENV_IS_NOWHERE 16 #define CONFIG_ENV_IS_NOWHERE
17 17
18+#undef CONFIG_BOOTARGS 18+#undef CONFIG_BOOTARGS
19+#define CONFIG_BOOTARGS "root=/dev/hda2 console=ttyS0" 19+#define CONFIG_BOOTARGS "root=/dev/hda2 console=ttyS0"
20+ 20+
21+#undef CONFIG_BOOTDELAY
22+#define CONFIG_BOOTDELAY 3
23+
21+#undef CONFIG_BOOTCOMMAND 24+#undef CONFIG_BOOTCOMMAND
22+#define CONFIG_BOOTCOMMAND "run loadenv;" \ 25+#define CONFIG_BOOTCOMMAND "run loadenv;" \
23+ "ext2load ide 0:1 $loadaddr $kernel_image;" \ 26+ "setenv bootargs $bootargs\" console=ttyS0 root=/dev/hda\";" \
24+ "ext2load ide 0:1 $ramdiskaddr $ramdisk_image;" \ 27+ "ext2load ide 0 $loadaddr \"/boot\"$kernel_image;" \
28+ "ext2load ide 0 $ramdiskaddr \"/boot\"$ramdisk_image;" \
25+ "zboot $loadaddr - $ramdiskaddr $filesize" 29+ "zboot $loadaddr - $ramdiskaddr $filesize"
26+ 30+
27+#undef CONFIG_EXTRA_ENV_SETTINGS 31+#undef CONFIG_EXTRA_ENV_SETTINGS
28+#define CONFIG_EXTRA_ENV_SETTINGS "kernel_image=/bzImage\0" \ 32+#define CONFIG_EXTRA_ENV_SETTINGS "kernel_image=/bzImage\0" \
29+ "ramdisk_image=/initrd\0" \ 33+ "ramdisk_image=/initrd\0" \
30+ "ramdiskaddr=0x4000000\0" \ 34+ "ramdiskaddr=0x4000000\0" \
31+ "loadenv=if ext2ls ide 0:1 /loader.0/uEnv.txt; then ext2load ide 0:1 $loadaddr uEnv.txt; env import -t $loadaddr $filesize; fi;" 35+ "bootdelay=3\0" \
36+ "loadenv=if ext2load ide 0 $loadaddr /boot/loader/uEnv.txt; then env import -t $loadaddr $filesize; fi;"
32+ 37+
33 #endif /* __CONFIG_H */ 38 #endif /* __CONFIG_H */
34-- 39--
352.8.3 402.9.3
36 41
diff --git a/recipes-bsp/u-boot/u-boot-ota/0002-Replace-wraps-with-built-in-code-to-remove-dependenc.patch b/recipes-bsp/u-boot/u-boot-ota/0002-Replace-wraps-with-built-in-code-to-remove-dependenc.patch
index 83e223f..7540b74 100644
--- a/recipes-bsp/u-boot/u-boot-ota/0002-Replace-wraps-with-built-in-code-to-remove-dependenc.patch
+++ b/recipes-bsp/u-boot/u-boot-ota/0002-Replace-wraps-with-built-in-code-to-remove-dependenc.patch
@@ -1,44 +1,38 @@
1From d5bea58bf85522a289194d59dfab00207ffdfb4f Mon Sep 17 00:00:00 2001 1From ab0d7e270d89f6eb99582197d2d58bf60c9c3d26 Mon Sep 17 00:00:00 2001
2From: Anton Gerasimov <anton@advancedtelematic.com> 2From: Anton Gerasimov <anton@advancedtelematic.com>
3Date: Fri, 26 Aug 2016 13:51:30 +0200 3Date: Thu, 15 Sep 2016 16:49:32 +0200
4Subject: [PATCH 2/2] Replace wraps with built-in code to remove dependency on 4Subject: [PATCH 2/2] Replace wraps with built-in code to remove dependency on
5 multilib 5 multilib
6 6
7--- 7---
8 arch/x86/config.mk | 3 -- 8 arch/x86/config.mk | 2 --
9 arch/x86/lib/gcc.c | 97 +++++++++++++++++++++++++++++++++++++++++++++++------- 9 arch/x86/lib/gcc.c | 104 ++++++++++++++++++++++++++++++++++++++++++++---------
10 2 files changed, 86 insertions(+), 14 deletions(-) 10 2 files changed, 87 insertions(+), 19 deletions(-)
11 11
12diff --git a/arch/x86/config.mk b/arch/x86/config.mk 12diff --git a/arch/x86/config.mk b/arch/x86/config.mk
13index d7addd8..892e0fc 100644 13index 999143e..139576e 100644
14--- a/arch/x86/config.mk 14--- a/arch/x86/config.mk
15+++ b/arch/x86/config.mk 15+++ b/arch/x86/config.mk
16@@ -21,9 +21,6 @@ PLATFORM_RELFLAGS += -ffunction-sections -fvisibility=hidden 16@@ -22,5 +22,3 @@ PLATFORM_RELFLAGS += -ffunction-sections -fvisibility=hidden
17 17 PLATFORM_LDFLAGS += --emit-relocs -Bsymbolic -Bsymbolic-functions -m elf_i386
18 PLATFORM_LDFLAGS += -Bsymbolic -Bsymbolic-functions -m elf_i386
19 18
19 LDFLAGS_FINAL += --gc-sections -pie
20-LDFLAGS_FINAL += --wrap=__divdi3 --wrap=__udivdi3 20-LDFLAGS_FINAL += --wrap=__divdi3 --wrap=__udivdi3
21-LDFLAGS_FINAL += --wrap=__moddi3 --wrap=__umoddi3 21-LDFLAGS_FINAL += --wrap=__moddi3 --wrap=__umoddi3
22-
23 # This is used in the top-level Makefile which does not include
24 # PLATFORM_LDFLAGS
25 LDFLAGS_EFI_PAYLOAD := -Bsymbolic -Bsymbolic-functions -shared --no-undefined
26diff --git a/arch/x86/lib/gcc.c b/arch/x86/lib/gcc.c 22diff --git a/arch/x86/lib/gcc.c b/arch/x86/lib/gcc.c
27index 3c70d79..6b47785 100644 23index 497ad75..c321b11 100644
28--- a/arch/x86/lib/gcc.c 24--- a/arch/x86/lib/gcc.c
29+++ b/arch/x86/lib/gcc.c 25+++ b/arch/x86/lib/gcc.c
30@@ -8,22 +8,97 @@ 26@@ -19,22 +19,92 @@
31 27
32 #ifdef __GNUC__ 28 #ifdef __GNUC__
33 29
34+#include <stdint.h> 30-/*
35+#include <stddef.h> 31- * GCC's libgcc handling is quite broken. While the libgcc functions
36 /* 32- * are always regparm(0) the code that calls them uses whatever the
37 * GCC's libgcc handling is quite broken. While the libgcc functions 33- * compiler call specifies. Therefore we need a wrapper around those
38 * are always regparm(0) the code that calls them uses whatever the 34- * functions. See gcc bug PR41055 for more information.
39 * compiler call specifies. Therefore we need a wrapper around those 35- */
40 * functions. See gcc bug PR41055 for more information.
41 */
42-#define WRAP_LIBGCC_CALL(type, name) \ 36-#define WRAP_LIBGCC_CALL(type, name) \
43- type __normal_##name(type a, type b) __attribute__((regparm(0))); \ 37- type __normal_##name(type a, type b) __attribute__((regparm(0))); \
44- type __wrap_##name(type a, type b); \ 38- type __wrap_##name(type a, type b); \
@@ -50,92 +44,95 @@ index 3c70d79..6b47785 100644
50-WRAP_LIBGCC_CALL(unsigned long long, __udivdi3) 44-WRAP_LIBGCC_CALL(unsigned long long, __udivdi3)
51-WRAP_LIBGCC_CALL(long long, __moddi3) 45-WRAP_LIBGCC_CALL(long long, __moddi3)
52-WRAP_LIBGCC_CALL(unsigned long long, __umoddi3) 46-WRAP_LIBGCC_CALL(unsigned long long, __umoddi3)
47+#include <stdint.h>
48+#include <stddef.h>
49+
53+uint64_t __udivmoddi4 ( uint64_t num, 50+uint64_t __udivmoddi4 ( uint64_t num,
54+ uint64_t den, 51+ uint64_t den,
55+ uint64_t *rem_p ) 52+ uint64_t *rem_p )
56+{ 53+{
57+ uint64_t quot = 0, qbit = 1; 54+ uint64_t quot = 0, qbit = 1;
58+ 55+
59+ if ( den == 0 ) { 56+ if ( den == 0 ) {
60+ return 1/((unsigned)den); /* Intentional divide by zero, without 57+ return 1/((unsigned)den); /* Intentional divide by zero, without
61+ triggering a compiler warning which 58+ triggering a compiler warning which
62+ would abort the build */ 59+ would abort the build */
63+ } 60+ }
64+
65+ /* Left-justify denominator and count shift */
66+ while ( (int64_t)den >= 0 ) {
67+ den <<= 1;
68+ qbit <<= 1;
69+ }
70+
71+ while ( qbit ) {
72+ if ( den <= num ) {
73+ num -= den;
74+ quot += qbit;
75+ }
76+ den >>= 1;
77+ qbit >>= 1;
78+ }
79+
80+ if ( rem_p )
81+ *rem_p = num;
82+
83+ return quot;
84+}
85+ 61+
62+ /* Left-justify denominator and count shift */
63+ while ( (int64_t)den >= 0 ) {
64+ den <<= 1;
65+ qbit <<= 1;
66+ }
67+
68+ while ( qbit ) {
69+ if ( den <= num ) {
70+ num -= den;
71+ quot += qbit;
72+ }
73+ den >>= 1;
74+ qbit >>= 1;
75+ }
76+
77+ if ( rem_p )
78+ *rem_p = num;
79+
80+ return quot;
81+}
86+uint64_t __udivdi3( uint64_t num, uint64_t den ) 82+uint64_t __udivdi3( uint64_t num, uint64_t den )
87+{ 83+{
88+ return __udivmoddi4(num, den, NULL); 84+ return __udivmoddi4(num, den, NULL);
89+} 85+}
90+ 86+
91+uint64_t __umoddi3 ( uint64_t num, uint64_t den ) 87+uint64_t __umoddi3 ( uint64_t num, uint64_t den )
92+{ 88+{
93+ uint64_t v; 89+ uint64_t v;
94+ 90+
95+ (void) __udivmoddi4(num, den, &v); 91+ (void) __udivmoddi4(num, den, &v);
96+ return v; 92+ return v;
97+} 93+}
98+ 94+
99+int64_t __divmoddi4 ( int64_t num, 95+int64_t __divmoddi4 ( int64_t num,
100+ int64_t den, 96+ int64_t den,
101+ int64_t* rem_p ) 97+ int64_t* rem_p )
102+{ 98+{
103+ int minus = 0; 99+ int minus = 0;
104+ int64_t v; 100+ int64_t v;
105+ 101+
106+ if ( num < 0 ) { 102+ if ( num < 0 ) {
107+ num = -num; 103+ num = -num;
108+ minus = 1; 104+ minus = 1;
109+ } 105+ }
110+ if ( den < 0 ) { 106+ if ( den < 0 ) {
111+ den = -den; 107+ den = -den;
112+ minus ^= 1; 108+ minus ^= 1;
113+ } 109+ }
114+ 110+
115+ v = __udivmoddi4(num, den, (uint64_t *)rem_p); 111+ v = __udivmoddi4(num, den, (uint64_t *)rem_p);
116+ if ( minus ) { 112+ if ( minus ) {
117+ v = -v; 113+ v = -v;
118+ if ( rem_p ) 114+ if ( rem_p )
119+ *rem_p = -(*rem_p); 115+ *rem_p = -(*rem_p);
120+ } 116+ }
121+ 117+
122+ return v; 118+ return v;
123+} 119+}
124+ 120+
121+
125+int64_t __moddi3 (int64_t num, int64_t den) 122+int64_t __moddi3 (int64_t num, int64_t den)
126+{ 123+{
127+ int64_t v; 124+ int64_t v;
128+ 125+
129+ (void) __divmoddi4(num, den, &v); 126+ (void) __divmoddi4(num, den, &v);
130+ return v; 127+ return v;
131+} 128+}
132+ 129+
133+int64_t __divdi3(int64_t num, int64_t den) 130+int64_t __divdi3(int64_t num, int64_t den)
134+{ 131+{
135+ return __divmoddi4(num, den, NULL); 132+ return __divmoddi4(num, den, NULL);
136+} 133+}
137 134
138 #endif 135 #endif
139-- 136--
1402.9.2 1372.9.3
141 138
diff --git a/recipes-bsp/u-boot/u-boot-ota_2015.07.bb b/recipes-bsp/u-boot/u-boot-ota_2015.07.bb
new file mode 100644
index 0000000..ab5d403
--- /dev/null
+++ b/recipes-bsp/u-boot/u-boot-ota_2015.07.bb
@@ -0,0 +1,24 @@
1include recipes-bsp/u-boot/u-boot.inc
2DEPENDS += "dtc-native"
3
4LICENSE = "GPLv2+"
5LIC_FILES_CHKSUM = "file://Licenses/README;md5=0507cd7da8e7ad6d6701926ec9b84c95"
6
7# This revision corresponds to the tag "v2015.07"
8# We use the revision in order to avoid having to fetch it from the
9# repo during parse
10SRCREV = "baba2f57e8f4ed3fa67fe213d22da0de5e00f204"
11
12SRC_URI += "file://0001-Set-up-environment-for-OSTree-integration.patch \
13 file://0002-Replace-wraps-with-built-in-code-to-remove-dependenc.patch \
14 "
15
16PV = "v2015.07+git${SRCPV}"
17
18EXTRA_OEMAKE_append = " KCFLAGS=-fgnu89-inline "
19EXTRA_OEMAKE_append_qemux86 = " BUILD_ROM=y"
20EXTRA_OEMAKE_append_qemux86-64 = " BUILD_ROM=y"
21
22UBOOT_SUFFIX = "bin"
23UBOOT_SUFFIX_qemux86 = "rom"
24UBOOT_SUFFIX_qemux86-64 = "rom"
diff --git a/recipes-bsp/u-boot/u-boot-ota_2016.07.bb b/recipes-bsp/u-boot/u-boot-ota_2016.07.bb
deleted file mode 100644
index 7d440ef..0000000
--- a/recipes-bsp/u-boot/u-boot-ota_2016.07.bb
+++ /dev/null
@@ -1,23 +0,0 @@
1include recipes-bsp/u-boot/u-boot.inc
2DEPENDS += "dtc-native"
3
4LICENSE = "GPLv2+"
5LIC_FILES_CHKSUM = "file://Licenses/README;md5=a2c678cfd4a4d97135585cad908541c6"
6
7# This revision corresponds to the tag "v2016.07"
8# We use the revision in order to avoid having to fetch it from the
9# repo during parse
10SRCREV = "25922d42f8e9e7ae503ae55a972ba1404e5b6a8c"
11
12SRC_URI += "file://0001-Set-up-environment-for-OSTree-integration.patch \
13 file://0002-Replace-wraps-with-built-in-code-to-remove-dependenc.patch"
14
15PV = "v2016.07+git${SRCPV}"
16
17EXTRA_OEMAKE_append = " KCFLAGS=-fgnu89-inline"
18EXTRA_OEMAKE_append_qemux86 = " KCFLAGS=-fgnu89-inline BUILD_ROM=y"
19EXTRA_OEMAKE_append_qemux86-64 = " KCFLAGS=-fgnu89-inline BUILD_ROM=y"
20
21UBOOT_SUFFIX = "bin"
22UBOOT_SUFFIX_qemux86 = "rom"
23UBOOT_SUFFIX_qemux86-64 = "rom"