2018-06-21 18:33:30 +02:00
|
|
|
#!/bin/sh -xe
|
|
|
|
|
|
|
|
#Build kenerl, wifi firmware
|
|
|
|
|
|
|
|
|
2018-06-21 21:35:02 +02:00
|
|
|
KVER=4.17.2
|
2018-06-21 18:33:30 +02:00
|
|
|
|
|
|
|
# build Linux-libre, with ath9k_htc, dwc2 from Chrome OS and without many useless drivers
|
|
|
|
[ ! -f linux-libre-$KVER-gnu.tar.lz ] && wget https://www.linux-libre.fsfla.org/pub/linux-libre/releases/$KVER-gnu/linux-libre-$KVER-gnu.tar.lz
|
|
|
|
[ ! -d linux-$KVER ] && tar --lzip -xvf linux-libre-$KVER-gnu.tar.lz
|
|
|
|
cd linux-$KVER
|
|
|
|
make clean
|
|
|
|
make mrproper
|
2018-06-21 21:35:02 +02:00
|
|
|
# rm -rf drivers/usb/dwc2
|
|
|
|
# ln -s ../../../chromeos-3.14/drivers/usb/dwc2 drivers/usb/
|
|
|
|
# patch -p 1 < ../chromeos-dwc2-glue.patch
|
2018-06-21 18:33:30 +02:00
|
|
|
# reset the minor version number, so out-of-tree drivers continue to work after
|
|
|
|
# a kernel upgrade
|
|
|
|
sed s/'SUBLEVEL = .*'/'SUBLEVEL = 0'/ -i Makefile
|
|
|
|
cp ../config .config
|
|
|
|
make -j `grep ^processor /proc/cpuinfo | wc -l` CROSS_COMPILE=arm-none-eabi- ARCH=arm zImage modules dtbs
|
|
|
|
[ ! -h kernel.its ] && ln -s ../kernel.its .
|
|
|
|
mkimage -D "-I dts -O dtb -p 2048" -f kernel.its vmlinux.uimg
|
|
|
|
dd if=/dev/zero of=bootloader.bin bs=512 count=1
|
|
|
|
vbutil_kernel --pack vmlinux.kpart \
|
|
|
|
--version 1 \
|
|
|
|
--vmlinuz vmlinux.uimg \
|
|
|
|
--arch arm \
|
|
|
|
--keyblock /usr/share/vboot/devkeys/kernel.keyblock \
|
|
|
|
--signprivate /usr/share/vboot/devkeys/kernel_data_key.vbprivk \
|
|
|
|
--config ../cmdline \
|
|
|
|
--bootloader bootloader.bin
|
|
|
|
cd ..
|
|
|
|
|
|
|
|
# build AR9271 firmware
|
|
|
|
[ ! -d open-ath9k-htc-firmware ] && git clone --depth 1 https://github.com/qca/open-ath9k-htc-firmware.git
|
|
|
|
cd open-ath9k-htc-firmware
|
|
|
|
make toolchain
|
|
|
|
make -C target_firmware
|
2018-06-21 21:35:02 +02:00
|
|
|
cd ..
|