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
[ "$FLAVOR" ] || FLAVOR=vanilla
fi
[ "$ARCH" ] || ARCH=$(apk --print-arch)
ARM=$(echo "$ARCH" | grep ^arm || :)
TMPDIR=$(mktemp -d /tmp/$SCRIPT.XXXXXX)
ROOT=$TMPDIR/root
BOOT=$ROOT/boot
......@@ -176,7 +179,7 @@ _apk() {
wrapper="fakeroot $opt -s $fake_env --"
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 \
--repositories-file /etc/apk/repositories $*
}
......@@ -193,7 +196,7 @@ _apk add --initdb --update-cache
if [ "$BUILDDIR" ]; then
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
else
if [ -z "$PACKAGES" ]; then
......@@ -214,8 +217,9 @@ depmod -b $ROOT "$KVER"
STAGING=$TMPDIR/boot
MODLOOP=$TMPDIR/modloop
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/firmware $MODLOOP/modules
_exec mksquashfs $MODLOOP "$STAGING/$MODIMG" -comp xz
......@@ -227,6 +231,12 @@ 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 "$DTBDIR"/*.dtb $DTB_STAGING
fi
if [ "$MNTDIR" ]; then
ignore_sigs
......@@ -236,6 +246,12 @@ fi
mv $STAGING/* "$DESTDIR"
if [ "$ARM" ]; then
DTBDIR=$DESTDIR/dtbs
mkdir -p "$DTBDIR"
mv $DTB_STAGING/* "$DTBDIR"
fi
if [ "$MNTDIR" ]; then
set +e
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