4
0

added support for raspberry pi 4

This commit is contained in:
Benjamin Böhmke 2020-01-23 19:27:52 +01:00
parent d4ed3cb12e
commit 00211b4a68
2 changed files with 14 additions and 5 deletions

View File

@ -83,16 +83,25 @@ echo "select kernel"
setenv boot_kernel "/boot/uImage" setenv boot_kernel "/boot/uImage"
# only if new pi a new kernel is required # only if new pi a new kernel is required
# https://www.raspberrypi.org/documentation/hardware/raspberrypi/revision-codes/README.md
setexpr board_new_pi ${board_revision} \& 0x800000 setexpr board_new_pi ${board_revision} \& 0x800000
if test ${board_new_pi} > 0; then if test ${board_new_pi} > 0; then
echo "new board" echo "new board"
# get cpu id from revision # get cpu id from revision
setexpr board_cpu ${board_revision} \& 0xF000 setexpr board_cpu ${board_revision} \& 0xF000
# at the moment CPU except the oldest need the new kernel # BCM2836 (pi2)
if test ${board_cpu} > 0x0000; then if test ${board_cpu} == 0x1000; then
setenv boot_kernel "/boot/uImage2" setenv boot_kernel "/boot/uImage2"
fi fi
# BCM2837 (pi3)
if test ${board_cpu} == 0x2000; then
setenv boot_kernel "/boot/uImage2"
fi
# BCM2711 (pi4)
if test ${board_cpu} > 0x3000; then
setenv boot_kernel "/boot/uImage4"
fi
else else
echo "old board" echo "old board"
fi fi

View File

@ -28,7 +28,7 @@ set -e
# static config # static config
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
RES_PATH=/resources/ RES_PATH=/resources/
BASE_PACKAGES="alpine-base tzdata parted ifupdown e2fsprogs-extra util-linux coreutils linux-rpi linux-rpi2" BASE_PACKAGES="alpine-base tzdata parted ifupdown e2fsprogs-extra util-linux coreutils linux-rpi linux-rpi2 linux-rpi4"
WORK_PATH="/work" WORK_PATH="/work"
ROOTFS_PATH="${WORK_PATH}/root_fs" ROOTFS_PATH="${WORK_PATH}/root_fs"
@ -77,7 +77,7 @@ cp /usr/share/apk/keys/*.rsa.pub ${ROOTFS_PATH}/etc/apk/keys/
cp /etc/apk/repositories ${ROOTFS_PATH}/etc/apk/repositories cp /etc/apk/repositories ${ROOTFS_PATH}/etc/apk/repositories
# initial package installation # initial package installation
apk --root ${ROOTFS_PATH} --update-cache --initdb --arch armhf add $BASE_PACKAGES apk --root ${ROOTFS_PATH} --update-cache --initdb --arch armv7 add $BASE_PACKAGES
# add google DNS to enable network access inside chroot # add google DNS to enable network access inside chroot
echo "nameserver 8.8.8.8" > ${ROOTFS_PATH}/etc/resolv.conf echo "nameserver 8.8.8.8" > ${ROOTFS_PATH}/etc/resolv.conf
@ -251,7 +251,7 @@ echo ">> Prepare kernel for uboot"
# build uImage # build uImage
mkimage -A arm -O linux -T kernel -C none -a 0x00008000 -e 0x00008000 -n "Linux kernel" -d ${ROOTFS_PATH}/boot/vmlinuz-rpi ${ROOTFS_PATH}/boot/uImage mkimage -A arm -O linux -T kernel -C none -a 0x00008000 -e 0x00008000 -n "Linux kernel" -d ${ROOTFS_PATH}/boot/vmlinuz-rpi ${ROOTFS_PATH}/boot/uImage
mkimage -A arm -O linux -T kernel -C none -a 0x00008000 -e 0x00008000 -n "Linux kernel" -d ${ROOTFS_PATH}/boot/vmlinuz-rpi2 ${ROOTFS_PATH}/boot/uImage2 mkimage -A arm -O linux -T kernel -C none -a 0x00008000 -e 0x00008000 -n "Linux kernel" -d ${ROOTFS_PATH}/boot/vmlinuz-rpi2 ${ROOTFS_PATH}/boot/uImage2
mkimage -A arm -O linux -T kernel -C none -a 0x00008000 -e 0x00008000 -n "Linux kernel" -d ${ROOTFS_PATH}/boot/vmlinuz-rpi4 ${ROOTFS_PATH}/boot/uImage4
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
# create boot FS # create boot FS