Commit a99e2526 authored by Kaarle Ritvanen's avatar Kaarle Ritvanen

update-kernel: support for arm architecture

parent 63a3fbcf
...@@ -152,6 +152,9 @@ if [ -z "$FLAVOR" ]; then ...@@ -152,6 +152,9 @@ if [ -z "$FLAVOR" ]; then
[ "$FLAVOR" ] || FLAVOR=vanilla [ "$FLAVOR" ] || FLAVOR=vanilla
fi fi
[ "$ARCH" ] || ARCH=$(apk --print-arch)
ARM=$(echo "$ARCH" | grep ^arm || :)
TMPDIR=$(mktemp -d /tmp/$SCRIPT.XXXXXX) TMPDIR=$(mktemp -d /tmp/$SCRIPT.XXXXXX)
ROOT=$TMPDIR/root ROOT=$TMPDIR/root
BOOT=$ROOT/boot BOOT=$ROOT/boot
...@@ -176,7 +179,7 @@ _apk() { ...@@ -176,7 +179,7 @@ _apk() {
wrapper="fakeroot $opt -s $fake_env --" wrapper="fakeroot $opt -s $fake_env --"
fi fi
$wrapper apk $cmd $QUIET_OPT -p $ROOT ${ARCH:+--arch "$ARCH"} \ $wrapper apk $cmd $QUIET_OPT -p $ROOT --arch "$ARCH" \
--keys-dir /etc/apk/keys \ --keys-dir /etc/apk/keys \
--repositories-file /etc/apk/repositories $* --repositories-file /etc/apk/repositories $*
} }
...@@ -193,7 +196,7 @@ _apk add --initdb --update-cache ...@@ -193,7 +196,7 @@ _apk add --initdb --update-cache
if [ "$BUILDDIR" ]; then if [ "$BUILDDIR" ]; then
mkdir -p $BOOT mkdir -p $BOOT
make -C "$BUILDDIR" firmware_install install modules_install \ make -C "$BUILDDIR" ${ARM:+z}install firmware_install modules_install \
INSTALL_MOD_PATH=$ROOT INSTALL_PATH=$BOOT INSTALL_MOD_PATH=$ROOT INSTALL_PATH=$BOOT
else else
if [ -z "$PACKAGES" ]; then if [ -z "$PACKAGES" ]; then
...@@ -214,8 +217,9 @@ depmod -b $ROOT "$KVER" ...@@ -214,8 +217,9 @@ depmod -b $ROOT "$KVER"
STAGING=$TMPDIR/boot STAGING=$TMPDIR/boot
MODLOOP=$TMPDIR/modloop MODLOOP=$TMPDIR/modloop
MODIMG=modloop-$FLAVOR MODIMG=modloop-$FLAVOR
DTB_STAGING=$TMPDIR/dtbs
mkdir $MODLOOP $STAGING mkdir $DTB_STAGING $MODLOOP $STAGING
cp -a $ROOT/lib/modules $MODLOOP cp -a $ROOT/lib/modules $MODLOOP
cp -a $ROOT/lib/firmware $MODLOOP/modules cp -a $ROOT/lib/firmware $MODLOOP/modules
_exec mksquashfs $MODLOOP "$STAGING/$MODIMG" -comp xz _exec mksquashfs $MODLOOP "$STAGING/$MODIMG" -comp xz
...@@ -227,6 +231,12 @@ for file in System.map config vmlinuz; do ...@@ -227,6 +231,12 @@ for file in System.map config vmlinuz; do
cp "$BOOT/$file$KVER_FLAVOR" $STAGING cp "$BOOT/$file$KVER_FLAVOR" $STAGING
done done
if [ "$ARM" ]; then
DTBDIR=$ROOT/usr/lib/linux-$KVER
[ "$BUILDDIR" ] && DTBDIR=$BUILDDIR/source/arch/arm/boot/dts
cp "$DTBDIR"/*.dtb $DTB_STAGING
fi
if [ "$MNTDIR" ]; then if [ "$MNTDIR" ]; then
ignore_sigs ignore_sigs
...@@ -236,6 +246,12 @@ fi ...@@ -236,6 +246,12 @@ fi
mv $STAGING/* "$DESTDIR" mv $STAGING/* "$DESTDIR"
if [ "$ARM" ]; then
DTBDIR=$DESTDIR/dtbs
mkdir -p "$DTBDIR"
mv $DTB_STAGING/* "$DTBDIR"
fi
if [ "$MNTDIR" ]; then if [ "$MNTDIR" ]; then
set +e set +e
sync sync
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment