#!/usr/bin/env zsh # # Copyright (C) 2015-2016 Dyne.org Foundation # # ARM SDK is designed, written and maintained by parazyd # # This source code is free software; you can redistribute it and/or # modify it under the terms of the GNU Public License as published by # the Free Software Foundation; either version 3 of the License, or # (at your option) any later version. # # This source code is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. Please refer # to the GNU Public License for more details. # # You should have received a copy of the GNU Public License along with # this source code; if not, write to: Free Software Foundation, Inc., # 675 Mass Ave, Cambridge, MA 02139, USA. # # ARM SDK build script for Raspberry Pi 2 and 3 devices (armhf) # -- settings -- device_name="raspi2" arch="armhf" size=1337 extra_packages=(wpasupplicant ntpdate) # Ones below should not need changing workdir="$R/arm/${armdev}-build" strapdir="${workdir}/${os}-${arch}" #enable_qemu_wrapper=1 # Uncomment this to enable qemu-wrapper (consult the readme) parted_boot=(fat32 0 64) parted_root=(ext4 64 -1) inittab="T0:23:respawn:/sbin/agetty -L ttyAMA0 115200 vt100" custmodules=() # source common commands source $common image_name="${os}-${release}-${version}-${arch}-${device_name}" # -- end settings -- ${device_name}-build-kernel() { fn ${device_name}-build-kernel notice "Grabbing kernel sources" sudo mkdir ${strapdir}/usr/src/kernel && sudo chown $USER ${strapdir}/usr/src/kernel cd ${strapdir}/usr/src git clone --depth 1 \ https://github.com/raspberrypi/linux \ -b rpi-4.1.y \ ${strapdir}/usr/src/kernel cd ${strapdir}/usr/src/kernel copy-kernel-config make -j `grep -c processor /proc/cpuinfo` make-kernel-modules notice "Grabbing rpi-firmware..." git clone --depth 1 \ https://github.com/raspberrypi/firmware.git \ rpi-firmware sudo cp -rfv rpi-firmware/boot/* ${workdir}/bootp/ sudo perl scripts/mkknlimg --dtok arch/arm/boot/zImage ${workdir}/bootp/kernel7.img sudo cp -v arch/arm/boot/dts/bcm*.dtb ${workdir}/bootp/ sudo cp -v arch/arm/boot/dts/overlays/*overlay*.dtb ${workdir}/bootp/overlays/ sudo rm -rfv ${strapdir}/lib/firmware get-kernel-firmware sudo chown $USER ${strapdir}/lib cp -ra $R/tmp/firmware ${strapdir}/lib/firmware cd $strapdir/usr/src/kernel make INSTALL_MOD_PATH=${strapdir} firmware_install make mrproper cp -v ../${device_name}.config .config make modules_prepare notice "Creating cmdline.txt..." cat <