Compare commits

...

9 Commits

Author SHA1 Message Date
Martijn Braam 170c20a216 Added return_address patch 2018-09-01 20:41:13 +02:00
Martijn Braam 722cfaa740 Recreated kernel config from sun4i_defconfig 2018-09-01 20:34:12 +02:00
Martijn Braam 056b87f59a Aports: Device: Added linux-inet-inet1 2018-09-01 17:57:18 +02:00
Martijn Braam 2dcd1d1d5b aports: device: inet-inet1: Use linux-postmarketos-allwinner 2018-08-27 20:19:06 +02:00
Martijn Braam 522396b132 aports: main: Made mkinitfs put plain dtb files in /boot 2018-08-27 20:18:04 +02:00
Martijn Braam 83437fc074 aports: main: Added linux-postmarketos-allwinner 2018-08-27 20:17:21 +02:00
Martijn Braam f1beb6a46c aports: device: Added inet-inet1 2018-08-27 14:18:48 +02:00
Martijn Braam 0d64df595a aports: temp: Created u-boot package with inet1 support 2018-08-26 22:45:46 +02:00
Martijn Braam c6e9e7f321 aports: main: linux-postmarketos-stable: Added alwinner options 2018-08-26 22:44:41 +02:00
15 changed files with 3557 additions and 175 deletions

View File

@ -0,0 +1,29 @@
# Reference: <https://postmarketos.org/devicepkg>
pkgname="device-inet-inet1"
pkgdesc="Inet-Tek Inet 1"
pkgver=0.1
pkgrel=0
url="https://postmarketos.org"
license="MIT"
arch="noarch"
options="!check"
depends="postmarketos-base linux-postmarketos-allwinner mesa-dri-swrast u-boot-inet1 uboot-tools"
makedepends="devicepkg-dev uboot-tools"
source="
deviceinfo
uboot-script.cmd
"
build() {
mkimage -A arm -O linux -T script -C none -a 0 -e 0 -n postmarketos -d "$srcdir/uboot-script.cmd" "$srcdir/boot.scr"
devicepkg_build $startdir $pkgname
}
package() {
install -D -m644 "$srcdir"/boot.scr \
"$pkgdir"/boot/boot.scr
devicepkg_package $startdir $pkgname
}
sha512sums="a256477172ca9703a0c443e65a5747976f348e90d5bad170bfb4e24ca89ccf770812860ba6bd6ba64b6b1c597b5d5cbba8590a46e16356382cfa7074dd288c89 deviceinfo
f0f27d8e216a7d0bad2afec3c949dd4cc06b1e40b1e31fc45c11bbe202fbff4a6edd46833684d9fc2e177a72187809e8ea1750bb6dcfe1f5156fdb09fa439fac uboot-script.cmd"

View File

@ -0,0 +1,23 @@
# Reference: <https://postmarketos.org/deviceinfo>
# Please use double quotes only. You can source this file in shell scripts.
deviceinfo_format_version="0"
deviceinfo_name="Inet-Tek Inet 1"
deviceinfo_manufacturer="Inet-Tek"
deviceinfo_date=""
deviceinfo_dtb="sun4i-a10-inet1"
deviceinfo_modules_initfs=""
deviceinfo_arch="armhf"
# Device related
deviceinfo_keyboard="false"
deviceinfo_external_storage="true"
deviceinfo_screen_width="800"
deviceinfo_screen_height="600"
deviceinfo_dev_touchscreen=""
deviceinfo_dev_touchscreen_calibration=""
deviceinfo_dev_keyboard=""
# Bootloader related
deviceinfo_flash_method="none"
deviceinfo_generate_legacy_uboot_initfs="true"

View File

@ -0,0 +1,11 @@
setenv mmcnum 0
setenv mmcpart 1
setenv mmctype ext2
setenv bootargs init=/init.sh rw earlycon console=tty0 console=ttyS0,115200 console=ttyS1,115200 console=ttyS2,115200
echo Loading kernel
ext2load mmc 0 0x42000000 uImage-postmarketos-allwinner
echo Loading device tree
ext2load mmc 0 0x43000000 postmarketos-allwinner.dtb
echo Booting kernel
bootm 0x42000000 - 0x43000000

View File

@ -0,0 +1,276 @@
From a66aaac889f09425ff0f3ddb27aca46ae02d6eea Mon Sep 17 00:00:00 2001
From: Joe Perches <joe@perches.com>
Date: Thu, 25 Jun 2015 15:01:02 -0700
Subject: [PATCH] compiler-gcc: integrate the various compiler-gcc[345].h files
As gcc major version numbers are going to advance rather rapidly in the
future, there's no real value in separate files for each compiler
version.
Deduplicate some of the macros #defined in each file too.
Neaten comments using normal kernel commenting style.
Upstream-Status: Backport
Signed-off-by: Joe Perches <joe@perches.com>
Cc: Andi Kleen <andi@firstfloor.org>
Cc: Michal Marek <mmarek@suse.cz>
Cc: Segher Boessenkool <segher@kernel.crashing.org>
Cc: Sasha Levin <levinsasha928@gmail.com>
Cc: Anton Blanchard <anton@samba.org>
Cc: Alan Modra <amodra@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Jonathan Liu <net147@gmail.com>
---
include/linux/compiler-gcc.h | 120 ++++++++++++++++++++++++++++++++++++++++--
include/linux/compiler-gcc3.h | 23 --------
include/linux/compiler-gcc4.h | 74 --------------------------
3 files changed, 116 insertions(+), 101 deletions(-)
delete mode 100644 include/linux/compiler-gcc3.h
delete mode 100644 include/linux/compiler-gcc4.h
diff --git a/include/linux/compiler-gcc.h b/include/linux/compiler-gcc.h
index 7970e31..727add9 100644
--- a/include/linux/compiler-gcc.h
+++ b/include/linux/compiler-gcc.h
@@ -97,10 +97,122 @@
#define __maybe_unused __attribute__((unused))
#define __always_unused __attribute__((unused))
-#define __gcc_header(x) #x
-#define _gcc_header(x) __gcc_header(linux/compiler-gcc##x.h)
-#define gcc_header(x) _gcc_header(x)
-#include gcc_header(__GNUC__)
+/* gcc version specific checks */
+
+#if GCC_VERSION < 30200
+# error Sorry, your compiler is too old - please upgrade it.
+#endif
+
+#if GCC_VERSION < 30300
+# define __used __attribute__((__unused__))
+#else
+# define __used __attribute__((__used__))
+#endif
+
+#ifdef CONFIG_GCOV_KERNEL
+# if GCC_VERSION < 30400
+# error "GCOV profiling support for gcc versions below 3.4 not included"
+# endif /* __GNUC_MINOR__ */
+#endif /* CONFIG_GCOV_KERNEL */
+
+#if GCC_VERSION >= 30400
+#define __must_check __attribute__((warn_unused_result))
+#endif
+
+#if GCC_VERSION >= 40000
+
+/* GCC 4.1.[01] miscompiles __weak */
+#ifdef __KERNEL__
+# if GCC_VERSION >= 40100 && GCC_VERSION <= 40101
+# error Your version of gcc miscompiles the __weak directive
+# endif
+#endif
+
+#define __used __attribute__((__used__))
+#define __compiler_offsetof(a, b) \
+ __builtin_offsetof(a, b)
+
+#if GCC_VERSION >= 40100 && GCC_VERSION < 40600
+# define __compiletime_object_size(obj) __builtin_object_size(obj, 0)
+#endif
+
+#if GCC_VERSION >= 40300
+/* Mark functions as cold. gcc will assume any path leading to a call
+ * to them will be unlikely. This means a lot of manual unlikely()s
+ * are unnecessary now for any paths leading to the usual suspects
+ * like BUG(), printk(), panic() etc. [but let's keep them for now for
+ * older compilers]
+ *
+ * Early snapshots of gcc 4.3 don't support this and we can't detect this
+ * in the preprocessor, but we can live with this because they're unreleased.
+ * Maketime probing would be overkill here.
+ *
+ * gcc also has a __attribute__((__hot__)) to move hot functions into
+ * a special section, but I don't see any sense in this right now in
+ * the kernel context
+ */
+#define __cold __attribute__((__cold__))
+
+#define __UNIQUE_ID(prefix) __PASTE(__PASTE(__UNIQUE_ID_, prefix), __COUNTER__)
+
+#ifndef __CHECKER__
+# define __compiletime_warning(message) __attribute__((warning(message)))
+# define __compiletime_error(message) __attribute__((error(message)))
+#endif /* __CHECKER__ */
+#endif /* GCC_VERSION >= 40300 */
+
+#if GCC_VERSION >= 40500
+/*
+ * Mark a position in code as unreachable. This can be used to
+ * suppress control flow warnings after asm blocks that transfer
+ * control elsewhere.
+ *
+ * Early snapshots of gcc 4.5 don't support this and we can't detect
+ * this in the preprocessor, but we can live with this because they're
+ * unreleased. Really, we need to have autoconf for the kernel.
+ */
+#define unreachable() __builtin_unreachable()
+
+/* Mark a function definition as prohibited from being cloned. */
+#define __noclone __attribute__((__noclone__))
+
+#endif /* GCC_VERSION >= 40500 */
+
+#if GCC_VERSION >= 40600
+/*
+ * Tell the optimizer that something else uses this function or variable.
+ */
+#define __visible __attribute__((externally_visible))
+#endif
+
+/*
+ * GCC 'asm goto' miscompiles certain code sequences:
+ *
+ * http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58670
+ *
+ * Work it around via a compiler barrier quirk suggested by Jakub Jelinek.
+ *
+ * (asm goto is automatically volatile - the naming reflects this.)
+ */
+#define asm_volatile_goto(x...) do { asm goto(x); asm (""); } while (0)
+
+#ifdef CONFIG_ARCH_USE_BUILTIN_BSWAP
+#if GCC_VERSION >= 40400
+#define __HAVE_BUILTIN_BSWAP32__
+#define __HAVE_BUILTIN_BSWAP64__
+#endif
+#if GCC_VERSION >= 40800 || (defined(__powerpc__) && GCC_VERSION >= 40600)
+#define __HAVE_BUILTIN_BSWAP16__
+#endif
+#endif /* CONFIG_ARCH_USE_BUILTIN_BSWAP */
+
+#if GCC_VERSION >= 50000
+#define KASAN_ABI_VERSION 4
+#elif GCC_VERSION >= 40902
+#define KASAN_ABI_VERSION 3
+#endif
+
+#endif /* gcc version >= 40000 specific checks */
#if !defined(__noclone)
#define __noclone /* not needed */
diff --git a/include/linux/compiler-gcc3.h b/include/linux/compiler-gcc3.h
deleted file mode 100644
index 37d4124..0000000
--- a/include/linux/compiler-gcc3.h
+++ /dev/null
@@ -1,23 +0,0 @@
-#ifndef __LINUX_COMPILER_H
-#error "Please don't include <linux/compiler-gcc3.h> directly, include <linux/compiler.h> instead."
-#endif
-
-#if __GNUC_MINOR__ < 2
-# error Sorry, your compiler is too old - please upgrade it.
-#endif
-
-#if __GNUC_MINOR__ >= 3
-# define __used __attribute__((__used__))
-#else
-# define __used __attribute__((__unused__))
-#endif
-
-#if __GNUC_MINOR__ >= 4
-#define __must_check __attribute__((warn_unused_result))
-#endif
-
-#ifdef CONFIG_GCOV_KERNEL
-# if __GNUC_MINOR__ < 4
-# error "GCOV profiling support for gcc versions below 3.4 not included"
-# endif /* __GNUC_MINOR__ */
-#endif /* CONFIG_GCOV_KERNEL */
diff --git a/include/linux/compiler-gcc4.h b/include/linux/compiler-gcc4.h
deleted file mode 100644
index 91b1aa8..0000000
--- a/include/linux/compiler-gcc4.h
+++ /dev/null
@@ -1,74 +0,0 @@
-#ifndef __LINUX_COMPILER_H
-#error "Please don't include <linux/compiler-gcc4.h> directly, include <linux/compiler.h> instead."
-#endif
-
-/* GCC 4.1.[01] miscompiles __weak */
-#ifdef __KERNEL__
-# if __GNUC_MINOR__ == 1 && __GNUC_PATCHLEVEL__ <= 1
-# error Your version of gcc miscompiles the __weak directive
-# endif
-#endif
-
-#define __used __attribute__((__used__))
-#define __must_check __attribute__((warn_unused_result))
-#define __compiler_offsetof(a,b) __builtin_offsetof(a,b)
-
-#if __GNUC_MINOR__ >= 3
-/* Mark functions as cold. gcc will assume any path leading to a call
- to them will be unlikely. This means a lot of manual unlikely()s
- are unnecessary now for any paths leading to the usual suspects
- like BUG(), printk(), panic() etc. [but let's keep them for now for
- older compilers]
-
- Early snapshots of gcc 4.3 don't support this and we can't detect this
- in the preprocessor, but we can live with this because they're unreleased.
- Maketime probing would be overkill here.
-
- gcc also has a __attribute__((__hot__)) to move hot functions into
- a special section, but I don't see any sense in this right now in
- the kernel context */
-#define __cold __attribute__((__cold__))
-
-#define __linktime_error(message) __attribute__((__error__(message)))
-
-/*
- * GCC 'asm goto' miscompiles certain code sequences:
- *
- * http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58670
- *
- * Work it around via a compiler barrier quirk suggested by Jakub Jelinek.
- * Fixed in GCC 4.8.2 and later versions.
- *
- * (asm goto is automatically volatile - the naming reflects this.)
- */
-#if GCC_VERSION <= 40801
-# define asm_volatile_goto(x...) do { asm goto(x); asm (""); } while (0)
-#else
-# define asm_volatile_goto(x...) do { asm goto(x); } while (0)
-#endif
-
-#if __GNUC_MINOR__ >= 5
-/*
- * Mark a position in code as unreachable. This can be used to
- * suppress control flow warnings after asm blocks that transfer
- * control elsewhere.
- *
- * Early snapshots of gcc 4.5 don't support this and we can't detect
- * this in the preprocessor, but we can live with this because they're
- * unreleased. Really, we need to have autoconf for the kernel.
- */
-#define unreachable() __builtin_unreachable()
-
-/* Mark a function definition as prohibited from being cloned. */
-#define __noclone __attribute__((__noclone__))
-
-#endif
-#endif
-
-#if __GNUC_MINOR__ > 0
-#define __compiletime_object_size(obj) __builtin_object_size(obj, 0)
-#endif
-#if __GNUC_MINOR__ >= 4 && !defined(__CHECKER__)
-#define __compiletime_warning(message) __attribute__((warning(message)))
-#define __compiletime_error(message) __attribute__((error(message)))
-#endif
--
2.10.0

View File

@ -0,0 +1,49 @@
From aeea3592a13bf12861943e44fc48f1f270941f8d Mon Sep 17 00:00:00 2001
From: Behan Webster <behanw@converseincode.com>
Date: Wed, 24 Sep 2014 01:06:46 +0100
Subject: [PATCH] ARM: 8158/1: LLVMLinux: use static inline in ARM ftrace.h
With compilers which follow the C99 standard (like modern versions of gcc and
clang), "extern inline" does the wrong thing (emits code for an externally
linkable version of the inline function). In this case using static inline
and removing the NULL version of return_address in return_address.c does
the right thing.
Signed-off-by: Behan Webster <behanw@converseincode.com>
Reviewed-by: Mark Charlebois <charlebm@gmail.com>
Acked-by: Steven Rostedt <rostedt@goodmis.org>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
---
arch/arm/include/asm/ftrace.h | 2 +-
arch/arm/kernel/return_address.c | 5 -----
2 files changed, 1 insertion(+), 6 deletions(-)
diff --git a/arch/arm/include/asm/ftrace.h b/arch/arm/include/asm/ftrace.h
index 39eb16b0066f2..bfe2a2f5a644e 100644
--- a/arch/arm/include/asm/ftrace.h
+++ b/arch/arm/include/asm/ftrace.h
@@ -45,7 +45,7 @@ void *return_address(unsigned int);
#else
-extern inline void *return_address(unsigned int level)
+static inline void *return_address(unsigned int level)
{
return NULL;
}
diff --git a/arch/arm/kernel/return_address.c b/arch/arm/kernel/return_address.c
index fafedd86885dd..f6aa84d5b93c9 100644
--- a/arch/arm/kernel/return_address.c
+++ b/arch/arm/kernel/return_address.c
@@ -63,11 +63,6 @@ void *return_address(unsigned int level)
#warning "TODO: return_address should use unwind tables"
#endif
-void *return_address(unsigned int level)
-{
- return NULL;
-}
-
#endif /* if defined(CONFIG_FRAME_POINTER) && !defined(CONFIG_ARM_UNWIND) / else */
EXPORT_SYMBOL_GPL(return_address);

View File

@ -0,0 +1,55 @@
# Kernel config based on: arch/arm/configs/lineageos_mako_defconfig
pkgname="linux-inet-inet1"
pkgver=3.4.104
pkgrel=0
pkgdesc="Linux 3.4 kernel from sunxi"
arch="armhf"
_carch="arm"
_flavor="inet-inet1"
url="https://github.com/linux-sunxi/linux-sunxi"
license="GPL2"
options="!strip !check !tracedeps"
makedepends="perl sed installkernel bash gmp-dev bc linux-headers elfutils-dev"
HOSTCC="${CC:-gcc}"
HOSTCC="${HOSTCC#${CROSS_COMPILE}}"
# Source
_commit="d47d367036be38c5180632ec8a3ad169a4593a88"
_config="config-${_flavor}.armhf"
source="
$pkgname-$_commit.tar.gz::https://github.com/linux-sunxi/linux-sunxi/archive/${_commit}.tar.gz
$_config
0001-compiler-gcc-integrate-the-various-compiler-gcc-345-.patch
00_fix_return_address.patch
"
builddir="$srcdir/linux-sunxi-${_commit}"
prepare() {
default_prepare
# gcc6 support
#cp -v "$srcdir/compiler-gcc6.h" "$builddir/include/linux/"
cp "$srcdir"/$_config "$builddir"/.config
make ARCH="$_carch" HOSTCC="$HOSTCC" silentoldconfig
}
build() {
unset LDFLAGS
make ARCH="$_carch" CC="${CC:-gcc}" \
KBUILD_BUILD_VERSION="$((pkgrel + 1 ))-Alpine"
}
package() {
install -Dm644 "$builddir/arch/arm/boot/zImage" \
"$pkgdir/boot/vmlinuz-$_flavor"
install -D "$builddir/include/config/kernel.release" \
"$pkgdir/usr/share/kernel/$_flavor/kernel.release"
}
sha512sums="0b2f0fdf67bfc714df5b3b12a3cb65e022b983c0c5dca1c6e8bbc6badf7485f8d005d5698ec8719eccb79ea8ce41294349473dd86293263e3eeabfbdf48351a3 linux-inet-inet1-d47d367036be38c5180632ec8a3ad169a4593a88.tar.gz
0fc3f52bbcaa657b5f1065e712f3854b5be412b631e7c4ce1262f1473101dad6f892b2b0aaae367305c4430b56f7e576a5d135eef3da489cb4dd92f4943eb1d0 config-inet-inet1.armhf
2955149c50e63ca1c496127aeba99ad3bf22f543cb11526c92677bcf8f77f851a20da34ac5bb3ce046710a4cd70f0101ed4abba775619ff8ea52de5f13b6118c 0001-compiler-gcc-integrate-the-various-compiler-gcc-345-.patch
ea1d3b5a234fa565e3c1a792de48f4fc4e6023d281d303c8e319c7ef28edc5739ab0e4dea0139a41f0a5c7d03e27921ccaa214fd0ac5c72245a094ce60128864 00_fix_return_address.patch"

View File

@ -0,0 +1,69 @@
// SOURCE:
// https://github.com/NextThingCo/CHIP-u-boot/issues/10#issuecomment-287515505
#ifndef __LINUX_COMPILER_H
#error "Please don't include <linux/compiler-gcc6.h> directly, include <linux/compiler.h> instead."
#endif
#define __used __attribute__((__used__))
#define __must_check __attribute__((warn_unused_result))
#define __compiler_offsetof(a, b) __builtin_offsetof(a, b)
/* Mark functions as cold. gcc will assume any path leading to a call
to them will be unlikely. This means a lot of manual unlikely()s
are unnecessary now for any paths leading to the usual suspects
like BUG(), printk(), panic() etc. [but let's keep them for now for
older compilers]
Early snapshots of gcc 4.3 don't support this and we can't detect this
in the preprocessor, but we can live with this because they're unreleased.
Maketime probing would be overkill here.
gcc also has a __attribute__((__hot__)) to move hot functions into
a special section, but I don't see any sense in this right now in
the kernel context */
#define __cold __attribute__((__cold__))
#define __UNIQUE_ID(prefix) __PASTE(__PASTE(__UNIQUE_ID_, prefix), __COUNTER__)
#ifndef __CHECKER__
# define __compiletime_warning(message) __attribute__((warning(message)))
# define __compiletime_error(message) __attribute__((error(message)))
#endif /* __CHECKER__ */
/*
* Mark a position in code as unreachable. This can be used to
* suppress control flow warnings after asm blocks that transfer
* control elsewhere.
*
* Early snapshots of gcc 4.5 don't support this and we can't detect
* this in the preprocessor, but we can live with this because they're
* unreleased. Really, we need to have autoconf for the kernel.
*/
#define unreachable() __builtin_unreachable()
/* Mark a function definition as prohibited from being cloned. */
#define __noclone __attribute__((__noclone__))
/*
* Tell the optimizer that something else uses this function or variable.
*/
#define __visible __attribute__((externally_visible))
/*
* GCC 'asm goto' miscompiles certain code sequences:
*
* http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58670
*
* Work it around via a compiler barrier quirk suggested by Jakub Jelinek.
*
* (asm goto is automatically volatile - the naming reflects this.)
*/
#define asm_volatile_goto(x...) do { asm goto(x); asm (""); } while (0)
#ifdef CONFIG_ARCH_USE_BUILTIN_BSWAP
#define __HAVE_BUILTIN_BSWAP32__
#define __HAVE_BUILTIN_BSWAP64__
#define __HAVE_BUILTIN_BSWAP16__
#endif /* CONFIG_ARCH_USE_BUILTIN_BSWAP */

File diff suppressed because it is too large Load Diff

View File

@ -9,7 +9,7 @@ case $pkgver in
*.*.*) _kernver=${pkgver%.*};;
*.*) _kernver=$pkgver;;
esac
pkgrel=0
pkgrel=1
arch="x86_64 armhf aarch64"
pkgdesc="Linux for pmOS supported chipsets (stable)"
@ -184,7 +184,7 @@ dev() {
}
sha512sums="950eb85ac743b291afe9f21cd174d823e25f11883ee62cecfbfff8fe8c5672aae707654b1b8f29a133b1f2e3529e63b9f7fba4c45d6dacccc8000b3a9a9ae038 linux-4.18.tar.xz
a428ce2a9c65bae3e7f88a43b0112e2524298ba068cf85732b25f18c5f92d101089ab3589582050c0dc9fca3571ea7fb89f9398d0c9dede03f1754b3f5fe455c config-postmarketos-stable.armhf
991687e70ee222e3d340e769061c542a24f24ad9619e1b200fbbdff0fcf493a1674087ec082cf3a45e45a4ed20b14682943c8cfc459b052e2094506d3e0b3423 config-postmarketos-stable.armhf
b24240f2c8e011ffa1ff141cf8d623dcbe4cbde389322e59e264edf1b01985b3527576a06c1f0d8e5ef67519f95cc9a9ff9f2636178d00e4272cd472e268f1ec config-postmarketos-stable.aarch64
77ae0b80272d871475043cc17ae54e20d5456da8c729ea832906c2881389c53e4d800aaeab38090f3f878f15045b2c70dc4912b62742753c40f80ad69ed51599 config-postmarketos-stable.x86_64
f8a4a1056bd29c29361f5529f711318fdb7546ff7469a3592601ae2d69d84b7d62ff4f75cf9d5aad4c1523ae71a7c1a88d9ee33bfce719e91686ca219ad13ed8 patch-4.18.4.xz"

View File

@ -1,5 +1,5 @@
pkgname=postmarketos-mkinitfs
pkgver=0.6.8
pkgver=0.7.0
pkgrel=0
pkgdesc="Tool to generate initramfs images for postmarketOS"
url="https://postmarketos.org"
@ -25,4 +25,4 @@ package() {
}
sha512sums="d5abfe9a1298069e6722555c6e16223b09b36af65d879feb64d540aa6cbc009a3aa7f00528bcf656370ec37cc64f925c72ebb77813961cd6ebf22107b57ea029 init.sh.in
4515bc6891110e9c8b1ed8d31a89818c7c222a364bdbdf90097d5d6bbdb97eb889d4dbaec78dc928aa5ff698a8e89a76338e7c63017bf8dfb93f44a293848ca0 init_functions.sh
f3dc19f6976a95f11ef15155a240574edb46fdaa6885733532abc942c22b43422f9be50b3ae93dc42f9b1a683a62f3246efdb85cd38dbb3abbfdff46bba96617 mkinitfs.sh"
8f695f90f1b40fd563f39b75fd99b36c29559563c3be20f37443eb70bd12f1529b12fdc92a0bcc38144217ba83d07bee2ea863d73b57a659c51e864bb2996567 mkinitfs.sh"

View File

@ -350,9 +350,11 @@ append_device_tree()
[ -n "${deviceinfo_dtb}" ] || return
dtb="/usr/share/dtb/${deviceinfo_dtb}.dtb"
kernel="${outfile/initramfs-/vmlinuz-}"
flavor="${outfile/initramfs-/}"
echo "==> kernel: appending device-tree ${deviceinfo_dtb}"
if [ -e "$dtb" ]; then
cat "$kernel" "$dtb" > "${kernel}-dtb"
cp "$dtb" "${flavor}.dtb"
else
echo "NOTE: device tree does not exist, not appending it to the kernel."
echo "This is expected for downstream kernels."

111
aports/temp/u-boot/APKBUILD Normal file
View File

@ -0,0 +1,111 @@
# Contributor: He Yangxuan <yangxuan8282@gmail.com>
# Contributor: William Pitcock <nenolod@dereferenced.org>
# Contributor: Timo Teras <timo.teras@iki.fi>
# Maintainer: Leonardo Arena <rnalrd@alpinelinux.org>
pkgname=u-boot
pkgver=2018.05
pkgrel=3
pkgdesc="u-boot bootloader common files"
url="http://www.denx.de/wiki/U-Boot/"
arch="armhf aarch64"
license="GPL-2.0"
depends=""
depends_dev=""
makedepends="$depends_dev bc dtc python2-dev swig"
install=""
source="ftp://ftp.denx.de/pub/u-boot/u-boot-${pkgver//_/-}.tar.bz2
README.txt
update-u-boot
"
builddir="$srcdir"/u-boot-${pkgver//_/-}
case "$CARCH" in
armhf) board_configs="
beagleboard:am335x_boneblack
cubieboard:Cubieboard,Cubieboard2
cuboxi:mx6cuboxi
raspberrypi:rpi_0_w,rpi,rpi_2,rpi_3_32b
wandboard:wandboard
inet1:inet1
";;
aarch64) board_configs="
thunderx:thunderx_88xx
raspberrypi:rpi_3
";;
esac
_allboards=""
for board_config in $board_configs; do
_allboards="$_allboards $pkgname-${board_config%%:*}"
done
subpackages="$pkgname-all:_all $_allboards"
build() {
cd "$builddir"
touch include/config.h
LC_ALL=C date +'#define U_BOOT_DATE "%b %d %C%y"' > include/timestamp_autogenerated.h
LC_ALL=C date +'#define U_BOOT_TIME "%T"' >> include/timestamp_autogenerated.h
local board_config board
for board_config in $board_configs; do
local configs="${board_config#*:}"
for board in ${configs//,/ }; do
msg "Building u-boot for $board"
export BUILD_DIR="$builddir"/build/$board
mkdir -p "$BUILD_DIR"
make O="$BUILD_DIR" ${board}_config || return 1
make O="$BUILD_DIR" all || return 1
done
done
}
package() {
cd "$builddir"/build
mkdir -p "$pkgdir"/usr/share/$pkgname "$pkgdir"/usr/sbin
install "$srcdir"/README.txt "$pkgdir"/usr/share/$pkgname/README.txt || return 1
install "$srcdir"/update-u-boot "$pkgdir"/usr/sbin || return 1
}
_all() {
pkgdesc="u-boot for all boards (meta package)"
depends="$_allboards"
mkdir -p "$subpkgdir"/
}
_split_boards() {
cd "$builddir"/build
pkgdesc="u-boot for $1"
depends="u-boot"
shift
local board
for board; do
msg "Including board $board"
mkdir -p "$subpkgdir"/usr/share/$pkgname/$board
export BUILD_DIR="$builddir"/build/$board
local ok=no
for image in u-boot-sunxi-with-spl.bin -- MLO SPL u-boot.img -- u-boot.bin; do
if [ "$image" = "--" ]; then
[ "$ok" = yes ] && break
continue
fi
if [ -e "$BUILD_DIR"/$image ]; then
cp "$BUILD_DIR"/$image "$subpkgdir"/usr/share/$pkgname/$board \
|| return 1
ok=yes
fi
done
[ "$ok" = yes ] || return 1
done
}
for board_config in $board_configs; do
_board="${board_config%%:*}"
_configs="${board_config#*:}"
eval "${_board}() { _split_boards $_board ${_configs//,/ }; }"
done
sha512sums="218f71282c9d027b0faf210ce2d4d713779e0c61ea4a23f03d5dec0ca8836a3c26b46c5e258d583834f5b5a2f4663f98729ca4b0101a60f85457eb892f8370d2 u-boot-2018.05.tar.bz2
f8c9bb6e84d6f0620c976ac7ad5dd7ec7ff9dfdd4b1d03d2bf6653e7beccf80bdf2debfc92fb1f696dba92fb40287d3c45897e0078951451d0835cb61a5f16d1 README.txt
b3b4fb70c4eea2034bae45c513bca7b738be7507b46d3f2d62b31c794cd238d492acf960c95078cb1c945520debd5d2762103df7cef0fc36acfe9ff9a94549fc update-u-boot"

View File

@ -0,0 +1,32 @@
WandBoard
---------
- ROM loads boot loader from raw MMC sectors at fixed address
- NOTE: 1st partition needs to start after boot loader
- Install u-boot with:
dd if=wandboard/SPL of=/dev/mmcblk0 bs=1k seek=1
dd if=wandboard/u-boot.img of=/dev/mmcblk0 bs=1k seek=69
sync
(Note - the SD card node may vary, so adjust this as needed).
- Insert the SD card into the slot located in the bottom of the board
(same side as the mx6 processor)
BeagleBoard
-----------
- ROM looks for 1st partition with FAT, and loads MLO from it
- NOTE: MLO needs to be the first file created on this partition
- Install u-boot with:
cp am335x_boneblack/{MLO,u-boot.img} /media/mmcblk0p1/
Sunxi (Cubie* etc)
------------------
- ROM loads boot loader from SD-CARD sectors at fixed address
- Install u-boot with:
sudo dd if=<board>/u-boot-sunxi-with-spl.bin of=/dev/sda bs=1024 seek=8

View File

@ -0,0 +1,122 @@
#!/bin/sh
verbose=
board=
device=
dryrun=
imagedir=
get_defaults() {
if [ -z "$board" -a -e /sys/firmware/devicetree/base/compatible ]; then
case "$(cat /sys/firmware/devicetree/base/compatible 2>/dev/null)" in
wand,*) board=wand ;;
esac
fi
if [ -z "$device" ]; then
case "$board" in
wand|cubie|cubie2) device=/dev/mmcblk0p0 ;;
mx6cuboxi) device=/dev/mmcblk0 ;;
esac
fi
if [ -z "$imagedir" ]; then
imagedir="$(realpath $(dirname $0))"
[ -f "$imagedir/README.txt" ] || imagedir="/usr/share/u-boot"
fi
}
die() {
echo "ERROR: $@"
exit 1
}
usage() {
get_defaults
cat <<EOF
usage: $0 [-b|--board <board-type>] [-d|--device <device>]
options:
-b,--board <board> Specify the board type: wand, cubie, cubie2, cuboxi
(current default: ${board:-none})
-d,--device <device> Specify the device where to install u-boot
(current default: ${device:-none})
-i,--imagedir <imagedir> Specify u-boot image directory
(current default: ${imagedir:-none})
-n,--dry-run Print commands but don't execute them
EOF
}
while [ $# -gt 0 ]; do
opt="$1"
shift
case "$opt" in
-b|--board)
case "$1" in
wand|wandboard) board="wand" ;;
cubie|cubieboard) board="cubie" ;;
cuboxi|mx6cuboxi) board="mx6cuboxi" ;;
*) usage; exit 1;;
esac
shift
;;
-d|--device)
device="$1"
shift
;;
-i|--imagedir)
imagedir="$1"
shift
;;
-n|--dry-run)
dryrun="echo"
;;
--)
break
;;
-*)
usage
exit 1
;;
esac
done
get_defaults
if [ -z "$board" -o -z "$device" -o -z "$imagedir" -o ! -e "$imagedir" ]; then
usage
exit 1
fi
if [ -z "$dryrun" ]; then
echo "Updating $board u-boot in $device in 3 seconds..."
sleep 3
fi
(
set -e
case "$board" in
wand)
[ -e "$imagedir/wandboard" ] || die "wandboard images not installed, apk add u-boot-wandboard"
$dryrun dd if=$imagedir/wandboard/SPL of=$device bs=1k seek=1 status=none
$dryrun dd if=$imagedir/wandboard/u-boot.img of=$device bs=1k seek=69 status=none
;;
cubie|cubie2)
[ -e "$imagedir/Cubieboard${board#cubie}" ] || die "Cubieboard images not installed, apk add u-boot-cubieboard"
$dryrun dd if=$imagedir/Cubieboard${board#cubie}/u-boot-sunxi-with-spl.bin of=$device bs=1024 seek=8 status=none
;;
mx6cuboxi)
[ -e "$imagedir/mx6cuboxi" ] || die "iMX6 Cubox-i images not installed, apk add u-boot-cuboxi"
$dryrun dd if=$imagedir/mx6cuboxi/SPL of=$device bs=1k seek=1 status=none
$dryrun dd if=$imagedir/mx6cuboxi/u-boot.img of=$device bs=1k seek=69 status=none
;;
esac
$dryrun sync
) || die "U-Boot installation in $device failed"
[ -z "$dryrun" ] && echo "Completed successfully."