From 397332e937352835ab8db0cac87d1ff61693f90a Mon Sep 17 00:00:00 2001 From: parazyd Date: Fri, 30 Sep 2016 10:50:36 +0200 Subject: [PATCH] add prebuild and postbuild at kernel --- boards/example.sh | 18 ++++++++++++++++++ boards/raspberry-pi.sh | 35 ++++++++++++++++++++++++++++++++++- lib/libdevuansdk | 2 +- 3 files changed, 53 insertions(+), 2 deletions(-) diff --git a/boards/example.sh b/boards/example.sh index f7005a5..5547617 100644 --- a/boards/example.sh +++ b/boards/example.sh @@ -46,6 +46,20 @@ custmodules=() # add the snd module here perhaps gitkernel="https://github.com/raspberrypi/linux.git" gitbranch="rpi-4.4.y" +## things you need to do before building the kernel +prebuild() { + fn prebuild + notice "executing $device_name prebuild" + return 0 +} + +## things you need to do after building the kernel +postbuild() { + fn postbuild + notice "executing $device_name postbuild" + return 0 +} + ## kernel build function build_kernel_armhf() { fn build_kernel_armhf @@ -53,6 +67,8 @@ build_kernel_armhf() { req+=(workdir strapdir) ckreq || return 1 + prebuild + notice "building $arch kernel" act "grabbing kernel sources" @@ -73,4 +89,6 @@ are sudo rm -rf $strapdir/lib/firmware get-kernel-firmware sudo cp -ra $R/tmp/linux-firmware $strapdir/lib/firmware + + postbuild } diff --git a/boards/raspberry-pi.sh b/boards/raspberry-pi.sh index 197ab82..638141d 100644 --- a/boards/raspberry-pi.sh +++ b/boards/raspberry-pi.sh @@ -20,7 +20,7 @@ ## kernel build script for Raspberry Pi 2/3 boards ## settings & config -vars+=(device_name arch size parted_boot parted_root inittab) +vars+=(device_name arch size parted_type parted_boot parted_root inittab) vars+=(gitkernel gitbranch rpifirmware) arrs+=(custmodules extra_packages) @@ -29,6 +29,7 @@ arch="armhf" size=1337 inittab="T0:23:respawn:/sbin/agetty -L ttyAMA0 115200 vt100" +parted_type="dos" parted_boot="fat32 0 64" parted_root="ext4 64 -1" @@ -39,12 +40,42 @@ gitkernel="https://github.com/raspberrypi/linux.git" gitbranch="rpi-4.4.y" rpifirmware="https://github.com/raspberrypi/firmware.git" +prebuild() { + fn prebuild + req=(device_name strapdir) + ckreq || return 1 + + notice "executing $device_name prebuild" + + ## fstab + cat < +## proc +proc /proc proc nodev,noexec,nosuid 0 0 + +## rootfs +/dev/mmcblk0p2 / ext4 errors=remount-ro 0 1 + +## bootfs +/dev/mmcblk0p1 /boot vfat noauto 0 0 +EOF +} + +postbuild() { + fn postbuild + + notice "executing $device_name postbuild" + return 0 +} + build_kernel_armhf() { fn build_kernel_armhf req=(R arch device_name gitkernel gitbranch MAKEOPTS rpifirmware) req+=(workdir strapdir) ckreq || return 1 + prebuild || zerr + notice "building $arch kernel" act "grabbing kernel sources" @@ -97,4 +128,6 @@ EOF sudo mkdir -p $strapdir/lib/firmware/brcm sudo cp -v $R/extra/rpi3/brcmfmac43430-sdio.txt $strapdir/lib/firmware/brcm/ sudo cp -v $R/extra/rpi3/brcmfmac43430-sdio.bin $strapdir/lib/firmware/brcm/ + + postbuild || zerr } diff --git a/lib/libdevuansdk b/lib/libdevuansdk index 8ea24e6..f2bdce8 160000 --- a/lib/libdevuansdk +++ b/lib/libdevuansdk @@ -1 +1 @@ -Subproject commit 8ea24e6e47dc633970257539c5b2ac78ea64fa20 +Subproject commit f2bdce8156146ee51b9bd387ec3199bcc938f5a5