diff --git a/kernel/makefile b/kernel/makefile index db06bd210..3598f5c65 100644 --- a/kernel/makefile +++ b/kernel/makefile @@ -50,6 +50,9 @@ KERNEL_BLOBBY_TAR_SIGNATURE_TARGET := $(PRAWNOS_BUILD_SOURCES)/$(KERNEL_BLOBBY_T KERNEL_BLOBBY_SOURCE_NAME := linux-$(KVER)-blobby-$(TARGET) KERNEL_BLOBBY_PUBKEY := $(KERNEL_SHARED_RESOURCES)/blobby-linux-signing-key.gpg + +KERNEL_FIRMWARES := $(PRAWNOS_KERNEL_BUILD)/prawnos-firmwares + ATH9K_EXTRACTED := $(PRAWNOS_ATH9K_BUILD)/.ath9k_extracted ATH9K_TAR := $(KERNEL_SHARED_RESOURCES)/open-ath9k-htc-firmware.tar.gz ATH9K := open-ath9k-htc-firmware @@ -58,9 +61,14 @@ ATH9K_7010_FW := $(PRAWNOS_ATH9K_BUILD)/target_firmware/htc_7010.fw ATH9K_BUILT := $(ATH9K_9271_FW) ATH9K_BUILD_LOG := $(PRAWNOS_BUILD_LOGS)/ath9k-log.txt -KERNEL_ATH9K_FIRMWARES := $(PRAWNOS_KERNEL_BUILD)/open-ath9k-firmware +KERNEL_ATH9K_INSTALLED := $(KERNEL_FIRMWARES)/htc_9271.fw -KERNEL_ATH9K_INSTALLED := $(KERNEL_ATH9K_FIRMWARES)/htc_9271.fw +MARVELL_8997_DEB := $(PRAWNOS_BUILD_SHARED)/firmware-libertas_20210315-3_all.deb +MARVELL_8997 := $(PRAWNOS_BUILD_SHARED)/firmware-libertas +MARVELL_8997_EXTRACTED := $(MARVELL_8997)/.marvell_8997_extracted +MARVELL_8997_COMBO_FW := $(MARVELL_8997)/lib/firmware/mrvl/pcieusb8997_combo_v4.bin + +KERNEL_MARVELL_INSTALLED := $(KERNEL_FIRMWARES)/pcieusb8997_combo_v4.bin ### PHONY RULES .PHONY: kernel @@ -69,6 +77,9 @@ kernel: $(PRAWNOS_KERNEL_BUILT) .PHONY: ath9k ath9k: $(ATH9K_BUILT) +.PHONY: marvell +marvell: $(MARVELL_8997_EXTRACTED) + .PHONY: patch_kernel patch_kernel: $(KERNEL_PATCHED) @@ -157,8 +168,8 @@ KERNEL_TAR_SIGNATURE_TARGET_BASENAME := $(KERNEL_BLOBBY_TAR_SIGNATURE_TARGET_BAS KERNEL_PUBKEY := $(KERNEL_BLOBBY_PUBKEY) endif -$(KERNEL_ATH9K_FIRMWARES): - mkdir -p $(KERNEL_ATH9K_FIRMWARES) +$(KERNEL_FIRMWARES): + mkdir -p $(KERNEL_FIRMWARES) $(KERNEL_TAR_SIGNATURE): | $(PRAWNOS_BUILD_SOURCES) ifeq ($(KERNEL_TYPE),$(PRAWNOS_HYBRID_KERNEL)) @@ -191,7 +202,7 @@ $(KERNEL_EXTRACTED): $(KERNEL_TAR) $(KERNEL_TAR_SIGNATURE) rm -rf $(PRAWNOS_BUILD)/$(KERNEL_HYBRID_SOURCE_NAME) gpg --verify $(KERNEL_LIBRE_TAR_SIGNATURE) $(KERNEL_LIBRE_TAR_SIGNATURE_TARGET) && \ tar --lzip -xf $(KERNEL_LIBRE_TAR) -C $(PRAWNOS_BUILD) && \ - mv $(PRAWNOS_BUILD)/linux-$(KVER) $(PRAWNOS_BUILD)/$(KERNEL_LIBRE_SOURCE_NAME) && \ + mv $(PRAWNOS_BUILD)/linux-$(KVER) $(PRAWNOS_BUILD)/$(KERNEL_LIBRE_SOURCE_NAME) if [ ! -f $(KERNEL_BLOBBY_TAR_SIGNATURE_TARGET) ]; then xz --decompress --keep $(KERNEL_BLOBBY_TAR) ; fi ; \ gpg --verify $(KERNEL_BLOBBY_TAR_SIGNATURE) $(KERNEL_BLOBBY_TAR_SIGNATURE_TARGET) && \ tar -xf $(KERNEL_BLOBBY_TAR_SIGNATURE_TARGET) -C $(PRAWNOS_BUILD) && \ @@ -245,11 +256,24 @@ $(ATH9K_BUILT): $(ATH9K_EXTRACTED) rm -rf $(ATH9K_BUILD_LOG) $(PRAWNOS_KERNEL_SCRIPTS_BUILD_ATH9K) $(PRAWNOS_ATH9K_BUILD) 2>&1 | tee $(ATH9K_BUILD_LOG) -$(KERNEL_ATH9K_INSTALLED): $(KERNEL_PATCHED) $(ATH9K_BUILT) | $(KERNEL_ATH9K_FIRMWARES) - cp $(ATH9K_9271_FW) $(KERNEL_ATH9K_FIRMWARES)/ - cp $(ATH9K_7010_FW) $(KERNEL_ATH9K_FIRMWARES)/ +$(KERNEL_ATH9K_INSTALLED): $(KERNEL_PATCHED) $(ATH9K_BUILT) | $(KERNEL_FIRMWARES) + cp $(ATH9K_9271_FW) $(KERNEL_FIRMWARES)/ +# skip the older 7010 FW to save kernel space +# cp $(ATH9K_7010_FW) $(KERNEL_FIRMWARES)/ + +$(MARVELL_8997_DEB): + wget $(WGET_OPTS) http://ftp.us.debian.org/debian/pool/non-free/f/firmware-nonfree/firmware-libertas_20210315-3_all.deb -O $(MARVELL_8997_DEB) + +$(MARVELL_8997_EXTRACTED): $(MARVELL_8997_DEB) + rm -rf $(MARVELL_8997) + dpkg-deb -R $(MARVELL_8997_DEB) $(MARVELL_8997) + touch $(MARVELL_8997_EXTRACTED) + +$(KERNEL_MARVELL_INSTALLED): $(KERNEL_PATCHED) $(MARVELL_8997_EXTRACTED) | $(KERNEL_FIRMWARES) + mkdir -p $(KERNEL_FIRMWARES)/mrvl + cp $(MARVELL_8997_COMBO_FW) $(KERNEL_FIRMWARES)/mrvl -$(PRAWNOS_KERNEL_BUILT): $(KERNEL_ATH9K_INSTALLED) $(PRAWNOS_INITRAMFS_IMAGE) $(KERNEL_CONFIG_GENERATED) +$(PRAWNOS_KERNEL_BUILT): $(KERNEL_ATH9K_INSTALLED) $(KERNEL_MARVELL_INSTALLED) $(PRAWNOS_INITRAMFS_IMAGE) $(KERNEL_CONFIG_GENERATED) # rebuilding the kernel means we also need to rebuild the kernel package $(MAKE) -C $(PRAWNOS_KERNEL_PACKAGE_IMAGE) clean rm -rf $(KERNEL_BUILD_LOG) diff --git a/kernel/resources/arm64/hybrid-config.fragment b/kernel/resources/arm64/hybrid-config.fragment index 71dda8da8..01857c103 100644 --- a/kernel/resources/arm64/hybrid-config.fragment +++ b/kernel/resources/arm64/hybrid-config.fragment @@ -6,4 +6,5 @@ CONFIG_MWIFIEX_SDIO=y CONFIG_MWIFIEX_PCIE=y # CONFIG_MWIFIEX_USB is not set # CONFIG_MWL8K is not set -# CONFIG_PWRSEQ_SD8787 is not set \ No newline at end of file +# CONFIG_PWRSEQ_SD8787 is not set +CONFIG_EXTRA_FIRMWARE="htc_9271.fw mrvl/pcieusb8997_combo_v4.bin" \ No newline at end of file diff --git a/kernel/resources/arm64/libre-config b/kernel/resources/arm64/libre-config index 453a20670..a300606f5 100644 --- a/kernel/resources/arm64/libre-config +++ b/kernel/resources/arm64/libre-config @@ -1573,8 +1573,8 @@ CONFIG_PREVENT_FIRMWARE_BUILD=y # Firmware loader # CONFIG_FW_LOADER=y -CONFIG_EXTRA_FIRMWARE="htc_9271.fw htc_7010.fw" -CONFIG_EXTRA_FIRMWARE_DIR="./open-ath9k-firmware" +CONFIG_EXTRA_FIRMWARE="htc_9271.fw" +CONFIG_EXTRA_FIRMWARE_DIR="./prawnos-firmwares" # CONFIG_FW_LOADER_USER_HELPER is not set # CONFIG_FW_LOADER_COMPRESS is not set CONFIG_FW_CACHE=y