From 9c7b6054fe0cce633b22b7c6b10943089aa9f6d8 Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Fri, 17 Jun 2022 17:00:19 +0200 Subject: [kernel-vanilla] Add sof firmware for newer hda sound --- core/modules/kernel-vanilla/module.build | 19 ++++++++++++++----- core/modules/kernel-vanilla/module.conf | 4 +++- 2 files changed, 17 insertions(+), 6 deletions(-) (limited to 'core/modules/kernel-vanilla') diff --git a/core/modules/kernel-vanilla/module.build b/core/modules/kernel-vanilla/module.build index 803e0f36..f91108f8 100644 --- a/core/modules/kernel-vanilla/module.build +++ b/core/modules/kernel-vanilla/module.build @@ -27,10 +27,15 @@ fetch_source() { # Fetch all the firmware if ! [ -s "./fw/Makefile" ]; then rm -rf -- "./fw" - git clone --depth 1 "git://git.kernel.org/pub/scm/linux/kernel/git/firmware/linux-firmware.git" "./fw" \ + git clone --depth 1 "https://git.kernel.org/pub/scm/linux/kernel/git/firmware/linux-firmware.git" "./fw" \ || perror "Could not clone linux-firmware repo." rm -rf -- ./fw/LICENSE.* ./fw/*.txt fi + if ! [ -s "./sof/install.sh" ]; then + rm -rf -- "./sof" + git clone --depth 1 "https://github.com/thesofproject/sof-bin.git" "./sof" \ + || perror "Could not clone SOF" + fi # Kernel - cached or freshly fetched if nfs_cache_avail; then @@ -56,7 +61,7 @@ fetch_kernel_source() { pinfo "Trying to update existing clone" cde ksrc git pull || perror "Could not pull already checked out repo" - cd .. + cde .. else rm -rf "./ksrc" git clone --depth 1 "${REQUIRED_GIT}" -b "v${REQUIRED_KERNEL}" ksrc || perror "Could not clone kernel git." @@ -81,7 +86,6 @@ fetch_kernel_source() { git apply < "$patch" || perror "Could not apply $patch" echo "$patch" >> "patches-done" done - cd - } build() { @@ -128,8 +132,13 @@ build() { # copy most recent firmware cde "${MODULE_WORK_DIR}" - mkdir -p "${MODULE_BUILD_DIR}/lib/firmware" + mkdir -p "${MODULE_BUILD_DIR}/lib/firmware/intel" cp -r ./fw/* "${MODULE_BUILD_DIR}/lib/firmware/" || perror "Could not copy linux-firmware to '${MODULE_BUILD_DIR}/lib/firmware/'" + cde sof + FW_DEST="${MODULE_BUILD_DIR}/lib/firmware/intel" \ + TOOLS_DEST="${MODULE_BUILD_DIR}/usr/bin" \ + ./install.sh v2.1.x/v2.1.1 || perror "Installing sof firmware failed" + cde .. # copy kernel to build cp ksrc/arch/x86/boot/bzImage "${MODULE_BUILD_DIR}/kernel" || perror "Could not copy bzImage" @@ -212,7 +221,7 @@ patch_aufs() { local KERNEL_MAJOR=${REQUIRED_KERNEL%%.*} local AUFS="aufs${KERNEL_MAJOR}" pinfo "Cloning ${AUFS} standalone git" - cd "${MODULE_WORK_DIR}" + cde "${MODULE_WORK_DIR}" [ -d "${AUFS}-standalone/.git" ] && rm -rf "${AUFS}-standalone" # if already there, kill it. # git: --depth 1 won't work here due to later "checkout origin/branch" if [ "$KERNEL_MAJOR" = "3" ]; then diff --git a/core/modules/kernel-vanilla/module.conf b/core/modules/kernel-vanilla/module.conf index 6adb2f4c..964ff4d9 100644 --- a/core/modules/kernel-vanilla/module.conf +++ b/core/modules/kernel-vanilla/module.conf @@ -1,6 +1,8 @@ #!/bin/bash REQUIRED_BINARIES="" REQUIRED_LIBRARIES="" -REQUIRED_DIRECTORIES="" +REQUIRED_DIRECTORIES=" + /lib/firmware/intel/sof-* +" REQUIRED_KERNEL="${CONFIG_KERNEL_VERSION:-"5.10.75"}" REQUIRED_GIT="git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git" -- cgit v1.2.3-55-g7522