Skip to content

Commit

Permalink
Build the open ath9k firmwares into the kernel image
Browse files Browse the repository at this point in the history
Make the ath9k firmwares before the kernel so it can be built in
Commented out the code that copies the firmwares into the filesystem
This fixes #103. Since the firmware is built into the kernel image,
the firmware is available during boot time.
  • Loading branch information
SolidHal committed Jul 14, 2019
1 parent 61aa909 commit 7a671cb
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 13 deletions.
3 changes: 2 additions & 1 deletion resources/BuildResources/config
Original file line number Diff line number Diff line change
Expand Up @@ -1129,7 +1129,8 @@ CONFIG_PREVENT_FIRMWARE_BUILD=y
# Firmware loader
#
CONFIG_FW_LOADER=y
CONFIG_EXTRA_FIRMWARE=""
CONFIG_EXTRA_FIRMWARE="htc_9271.fw htc_7010.fw"
CONFIG_EXTRA_FIRMWARE_DIR="../open-ath9k-htc-firmware/target_firmware"
# CONFIG_FW_LOADER_USER_HELPER is not set
CONFIG_WANT_DEV_COREDUMP=y
CONFIG_ALLOW_DEV_COREDUMP=y
Expand Down
17 changes: 7 additions & 10 deletions scripts/buildKernel.sh
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,15 @@ TEST_PATCHES=false

ROOT_DIR=`pwd`
RESOURCES=$ROOT_DIR/resources/BuildResources


[ ! -d build ] && mkdir build
cd build
# 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
cd ..

# build Linux-libre, with ath9k_htc
[ ! -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 && FRESH=true
Expand Down Expand Up @@ -59,12 +64,4 @@ vbutil_kernel --pack vmlinux.kpart \
--config $RESOURCES/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
cd ..
cd $ROOT_DIR
5 changes: 3 additions & 2 deletions scripts/injectKernelIntoFS.sh
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,9 @@ mount -o noatime ${outdev}p2 $outmnt
dd if=$build_resources/blank_kernel of=${outdev}p1 conv=notrunc
dd if=build/linux-$KVER/vmlinux.kpart of=${outdev}p1 conv=notrunc
make -C build/linux-$KVER ARCH=arm INSTALL_MOD_PATH=$outmnt modules_install
install -D -m 644 build/open-ath9k-htc-firmware/target_firmware/htc_9271.fw $outmnt/lib/firmware/ath9k_htc/htc_9271-1.4.0.fw
install -D -m 644 build/open-ath9k-htc-firmware/target_firmware/htc_7010.fw $outmnt/lib/firmware/ath9k_htc/htc_7010-1.4.0.fw
#Dont put ath firmware in filesystem, it is now built into the kernel image
# install -D -m 644 build/open-ath9k-htc-firmware/target_firmware/htc_9271.fw $outmnt/lib/firmware/ath9k_htc/htc_9271-1.4.0.fw
# install -D -m 644 build/open-ath9k-htc-firmware/target_firmware/htc_7010.fw $outmnt/lib/firmware/ath9k_htc/htc_7010-1.4.0.fw

umount -l $outmnt > /dev/null 2>&1
rmdir $outmnt > /dev/null 2>&1
Expand Down

0 comments on commit 7a671cb

Please sign in to comment.