diff options
author | Natanael Copa <ncopa@alpinelinux.org> | 2016-07-25 08:23:53 +0000 |
---|---|---|
committer | Natanael Copa <ncopa@alpinelinux.org> | 2016-07-25 08:24:55 +0000 |
commit | fe78dda2445239074ee1e7e47e0b8bd2a7bd1604 (patch) | |
tree | 9894b305aff120f5aa0b2a605b23bf1c0e60df20 /main/alpine-conf/0003-update-kernel-improve-dtb-handling.patch | |
parent | bff48ae6f03917a6f3c54062fe8276197b823bda (diff) | |
download | aports-fe78dda2445239074ee1e7e47e0b8bd2a7bd1604.tar.bz2 aports-fe78dda2445239074ee1e7e47e0b8bd2a7bd1604.tar.xz |
main/alpine-conf: update-kernel fixes
Diffstat (limited to 'main/alpine-conf/0003-update-kernel-improve-dtb-handling.patch')
-rw-r--r-- | main/alpine-conf/0003-update-kernel-improve-dtb-handling.patch | 93 |
1 files changed, 93 insertions, 0 deletions
diff --git a/main/alpine-conf/0003-update-kernel-improve-dtb-handling.patch b/main/alpine-conf/0003-update-kernel-improve-dtb-handling.patch new file mode 100644 index 0000000000..ca07c3c86c --- /dev/null +++ b/main/alpine-conf/0003-update-kernel-improve-dtb-handling.patch @@ -0,0 +1,93 @@ +From 824237dd105fd91bf3bdbe860c8a1908f30937d7 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Timo=20Ter=C3=A4s?= <timo.teras@iki.fi> +Date: Thu, 14 Jul 2016 06:12:30 +0000 +Subject: [PATCH 3/3] update-kernel: improve dtb handling + +- install dtbs to right place from kernel source trees +- install rpi dtbs to root of boot media (fixes #5884) +- support aarch64 +--- + update-kernel.in | 38 +++++++++++++++++++++++--------------- + 1 file changed, 23 insertions(+), 15 deletions(-) + +diff --git a/update-kernel.in b/update-kernel.in +index 5b8f6f3..57f51de 100644 +--- a/update-kernel.in ++++ b/update-kernel.in +@@ -153,7 +153,6 @@ if [ -z "$FLAVOR" ]; then + fi + + [ "$ARCH" ] || ARCH=$(apk --print-arch) +-ARM=$(echo "$ARCH" | grep ^arm || :) + + TMPDIR=$(mktemp -d /tmp/$SCRIPT.XXXXXX) + ROOT=$TMPDIR/root +@@ -195,9 +194,17 @@ extra_pkgs() { + _apk add --initdb --update-cache + + if [ "$BUILDDIR" ]; then ++ local _install ++ case "$ARCH" in ++ arm*|aarch64*) _install="zinstall dtbs_install" ;; ++ *) _install="install" ;; ++ esac ++ + mkdir -p $BOOT +- make -C "$BUILDDIR" ${ARM:+z}install firmware_install modules_install \ +- INSTALL_MOD_PATH=$ROOT INSTALL_PATH=$BOOT ++ make -C "$BUILDDIR" $_install firmware_install modules_install \ ++ INSTALL_MOD_PATH=$ROOT \ ++ INSTALL_PATH=$BOOT \ ++ INSTALL_DTBS_PATH='$ROOT/usr/lib/linux-$(KERNELRELEASE)' \ + else + if [ -z "$PACKAGES" ]; then + PACKAGES="$(extra_pkgs "dahdi-linux-$FLAVOR" dahdi-linux) +@@ -211,6 +218,7 @@ _apk add --no-scripts alpine-base $PACKAGES + KVER_FLAVOR= + [ "$FLAVOR" = vanilla ] || KVER_FLAVOR=-$FLAVOR + KVER=$(basename $(ls -d $ROOT/lib/modules/*"$KVER_FLAVOR")) ++DTBDIR=$ROOT/usr/lib/linux-$KVER + depmod -b $ROOT "$KVER" + + +@@ -236,14 +244,6 @@ for file in System.map config vmlinuz; do + cp "$BOOT/$file$KVER_FLAVOR" $STAGING + done + +-if [ "$ARM" ]; then +- DTBDIR=$ROOT/usr/lib/linux-$KVER +- [ "$BUILDDIR" ] && DTBDIR=$BUILDDIR/source/arch/arm/boot/dts +- cp -a "$DTBDIR"/* $DTB_STAGING +- find "$DTB_STAGING" -type f \! \( -name "*.dtb" -o -name "*.dtbo" \) -delete +-fi +- +- + if [ "$MNTDIR" ]; then + ignore_sigs + umount /.modloop +@@ -252,10 +252,18 @@ fi + + mv $STAGING/* "$DESTDIR" + +-if [ "$ARM" ]; then +- DTBDIR=$DESTDIR/dtbs +- mkdir -p "$DTBDIR" +- mv $DTB_STAGING/* "$DTBDIR" ++if [ -d "$DTBDIR" ]; then ++ local _opwd=$PWD ++ local _dtb ++ case "$FLAVOR" in ++ rpi*) _dtb="$DESTDIR" ;; ++ *) _dtb="$DESTDIR/dtbs" ;; ++ esac ++ mkdir -p "$_dtb" ++ _dtb=$(realpath "$_dtb") ++ cd "$DTBDIR" ++ find -type f \( -name "*.dtb" -o -name "*.dtbo" \) | cpio -pudm "$_dtb" 2> /dev/null ++ cd "$_opwd" + fi + + if [ "$MNTDIR" ]; then +-- +2.9.1 + |