commit 1a267a5d29e53bd918d4c8df5477fe1cce4fb02a
parent d23ae63e6af7c813acfc23dbf3cac5abd3f4075e
Author: parazyd <parazyd@dyne.org>
Date: Sat, 28 Oct 2017 12:42:10 +0200
revise raspberry pi scripts
Diffstat:
3 files changed, 60 insertions(+), 58 deletions(-)
diff --git a/boards/raspberry-pi1.sh b/boards/raspberry-pi1.sh
@@ -30,15 +30,15 @@ size=1891
inittab=("T0:23:respawn:/sbin/agetty -L ttyAMA0 115200 vt100")
parted_type="dos"
-parted_boot="fat32 0 64"
-parted_root="ext4 64 -1"
+parted_boot="fat32 2048s 264191s"
+parted_root="ext4 264192s 100%"
bootfs="vfat"
extra_packages+=()
custmodules=(snd_bcm2835)
gitkernel="https://github.com/raspberrypi/linux.git"
-gitbranch="rpi-4.10.y"
+gitbranch="rpi-4.13.y"
rpifirmware="https://github.com/raspberrypi/firmware.git"
@@ -59,6 +59,12 @@ postbuild() {
copy-root-overlay
+ notice "downloading broadcom firmware for bt/wifi"
+ sudo mkdir -p $strapdir/lib/firmware/brcm
+ # https://git.kernel.org/pub/scm/linux/kernel/git/firmware/linux-firmware.git/tree/brcm
+ sudo wget -q -O "$strapdir/lib/firmware/brcm/brcmfmac43430-sdio.bin" \
+ https://git.kernel.org/pub/scm/linux/kernel/git/firmware/linux-firmware.git/plain/brcm/brcmfmac43430-sdio.bin
+
postbuild-clean
}
@@ -74,15 +80,20 @@ build_kernel_armel() {
get-kernel-sources || zerr
pushd $R/tmp/kernels/$device_name/${device_name}-linux
+ # pi1 defconfig
make \
$MAKEOPTS \
ARCH=arm \
CROSS_COMPILE=$compiler \
bcmrpi_defconfig || zerr
+
+ # compile kernel and modules
make \
$MAKEOPTS \
ARCH=arm \
CROSS_COMPILE=$compiler || zerr
+
+ # install kernel modules
sudo -E PATH="$PATH" \
make \
$MAKEOPTS \
@@ -90,42 +101,34 @@ build_kernel_armel() {
CROSS_COMPILE=$compiler \
INSTALL_MOD_PATH=$strapdir \
modules_install || zerr
- popd
-
- clone-git "$rpifirmware" "$R/tmp/kernels/$device_name/${device_name}-firmware"
- sudo cp -rf $R/tmp/kernels/$device_name/${device_name}-firmware/boot/* $strapdir/boot/
- pushd $R/tmp/kernels/$device_name/${device_name}-linux
- sudo perl scripts/mkknlimg --dtok arch/arm/boot/zImage $strapdir/boot/kernel.img
- sudo cp arch/arm/boot/dts/bcm*.dtb $strapdir/boot/
- sudo cp arch/arm/boot/dts/overlays/*.dtbo $strapdir/boot/overlays/
- sudo cp arch/arm/boot/dts/overlays/README $strapdir/boot/overlays/
- popd
-
- pushd $R/tmp/kernels/$device_name/${device_name}-linux
+ # install kernel headers
sudo -E PATH="$PATH" \
make \
$MAKEOPTS \
ARCH=arm \
CROSS_COMPILE=$compiler \
- INSTALL_MOD_PATH=$strapdir \
- firmware_install || zerr
- make \
- $MAKEOPTS \
- ARCH=arm \
- CROSS_COMPILE=$compiler \
- mrproper
- make \
- $MAKEOPTS \
- ARCH=arm \
- CROSS_COMPILE=$compiler \
- bcmrpi_defconfig
+ INSTALL_HDR_PATH=$strapdir/usr \
+ headers_install || zerr
+
+ # install kernel firmware
sudo -E PATH="$PATH" \
make \
$MAKEOPTS \
ARCH=arm \
CROSS_COMPILE=$compiler \
- modules_prepare || zerr
+ INSTALL_MOD_PATH=$strapdir \
+ firmware_install || zerr
+ popd
+
+ clone-git "$rpifirmware" "$R/tmp/kernels/$device_name/${device_name}-firmware"
+ sudo cp -rf $R/tmp/kernels/$device_name/${device_name}-firmware/boot/* $strapdir/boot/
+
+ pushd $R/tmp/kernels/$device_name/${device_name}-linux
+ sudo perl scripts/mkknlimg --dtok arch/arm/boot/zImage $strapdir/boot/kernel.img
+ sudo cp arch/arm/boot/dts/bcm*.dtb $strapdir/boot/
+ sudo cp arch/arm/boot/dts/overlays/*.dtbo $strapdir/boot/overlays/
+ sudo cp arch/arm/boot/dts/overlays/README $strapdir/boot/overlays/
popd
postbuild || zerr
diff --git a/boards/raspberry-pi2.sh b/boards/raspberry-pi2.sh
@@ -38,7 +38,7 @@ extra_packages+=()
custmodules=(snd_bcm2835)
gitkernel="https://github.com/raspberrypi/linux.git"
-gitbranch="rpi-4.10.y"
+gitbranch="rpi-4.13.y"
rpifirmware="https://github.com/raspberrypi/firmware.git"
@@ -59,9 +59,11 @@ postbuild() {
copy-root-overlay
- notice "installing raspberry pi 3 firmware for bt/wifi"
+ notice "downloading broadcom firmware for bt/wifi"
sudo mkdir -p $strapdir/lib/firmware/brcm
- sudo cp $R/extra/raspberry-fw/brcmfmac43430-sdio.{bin,txt} $strapdir/lib/firmware/brcm/
+ # https://git.kernel.org/pub/scm/linux/kernel/git/firmware/linux-firmware.git/tree/brcm
+ sudo wget -q -O "$strapdir/lib/firmware/brcm/brcmfmac43430-sdio.bin" \
+ https://git.kernel.org/pub/scm/linux/kernel/git/firmware/linux-firmware.git/plain/brcm/brcmfmac43430-sdio.bin
postbuild-clean
}
@@ -78,15 +80,20 @@ build_kernel_armhf() {
get-kernel-sources || zerr
pushd $R/tmp/kernels/$device_name/${device_name}-linux
+ # pi2 defconfig
make \
$MAKEOPTS \
ARCH=arm \
CROSS_COMPILE=$compiler \
bcm2709_defconfig || zerr
+
+ # compile kernel and modules
make \
$MAKEOPTS \
ARCH=arm \
CROSS_COMPILE=$compiler || zerr
+
+ # install kernel modules
sudo -E PATH="$PATH" \
make \
$MAKEOPTS \
@@ -94,42 +101,34 @@ build_kernel_armhf() {
CROSS_COMPILE=$compiler \
INSTALL_MOD_PATH=$strapdir \
modules_install || zerr
- popd
-
- clone-git "$rpifirmware" "$R/tmp/kernels/$device_name/${device_name}-firmware"
- sudo cp -rf $R/tmp/kernels/$device_name/${device_name}-firmware/boot/* $strapdir/boot/
- pushd $R/tmp/kernels/$device_name/${device_name}-linux
- sudo perl scripts/mkknlimg --dtok arch/arm/boot/zImage $strapdir/boot/kernel7.img
- sudo cp arch/arm/boot/dts/bcm*.dtb $strapdir/boot/
- sudo cp arch/arm/boot/dts/overlays/*.dtbo $strapdir/boot/overlays/
- sudo cp arch/arm/boot/dts/overlays/README $strapdir/boot/overlays/
- popd
-
- pushd $R/tmp/kernels/$device_name/${device_name}-linux
+ # install kernel headers
sudo -E PATH="$PATH" \
make \
$MAKEOPTS \
ARCH=arm \
CROSS_COMPILE=$compiler \
- INSTALL_MOD_PATH=$strapdir \
- firmware_install || zerr
- make \
- $MAKEOPTS \
- ARCH=arm \
- CROSS_COMPILE=$compiler \
- mrproper
- make \
- $MAKEOPTS \
- ARCH=arm \
- CROSS_COMPILE=$compiler \
- bcm2709_defconfig
+ ISNTALL_HDR_PATH=$strapdir/usr \
+ headers_install || zerr
+
+ # install kernel firmware
sudo -E PATH="$PATH" \
make \
$MAKEOPTS \
ARCH=arm \
CROSS_COMPILE=$compiler \
- modules_prepare || zerr
+ INSTALL_MOD_PATH=$strapdir \
+ firmware_install || zerr
+ popd
+
+ clone-git "$rpifirmware" "$R/tmp/kernels/$device_name/${device_name}-firmware"
+ sudo cp -rf $R/tmp/kernels/$device_name/${device_name}-firmware/boot/* $strapdir/boot/
+
+ pushd $R/tmp/kernels/$device_name/${device_name}-linux
+ sudo perl scripts/mkknlimg --dtok arch/arm/boot/zImage $strapdir/boot/kernel7.img
+ sudo cp arch/arm/boot/dts/bcm*.dtb $strapdir/boot/
+ sudo cp arch/arm/boot/dts/overlays/*.dtbo $strapdir/boot/overlays/
+ sudo cp arch/arm/boot/dts/overlays/README $strapdir/boot/overlays/
popd
postbuild || zerr
diff --git a/boards/raspberry-pi3.sh b/boards/raspberry-pi3.sh
@@ -30,8 +30,8 @@ size=1891
inittab=("T0:23:respawn:/sbin/agetty -L ttyAMA0 115200 vt100")
parted_type="dos"
-parted_boot="fat32 0 64"
-parted_root="ext4 64 -1"
+parted_boot="fat32 2048s 264191s"
+parted_root="ext4 264192s 100%"
bootfs="vfat"
extra_packages+=()