Skip to content

Commit

Permalink
Fix armbian-firmware-full package build.
Browse files Browse the repository at this point in the history
Include symlinks from linux-firmware.
  • Loading branch information
h-s-c authored and igorpecovnik committed Aug 12, 2024
1 parent 1e7b704 commit 08ef1a9
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
15 changes: 9 additions & 6 deletions lib/functions/compilation/packages/firmware-deb.sh
Original file line number Diff line number Diff line change
Expand Up @@ -30,18 +30,21 @@ function compile_firmware() {
if [[ -n $FULL ]]; then
# Fetch kernel firmware from git. This is large, but we don't have two copies of it anymore. So more manageable.
declare fetched_revision
do_checkout="no" fetch_from_repo "$MAINLINE_FIRMWARE_SOURCE" "linux-firmware-git" "branch:main"
fetch_from_repo "$MAINLINE_FIRMWARE_SOURCE" "linux-firmware-git" "branch:main"
declare -r mainline_firmware_git_sha1="${fetched_revision}"

# use git archive to export the ${mainline_firmware_git_sha1} revision into "${fw_temp_dir}/${fw_dir}/lib/firmware/"
run_host_command_logged git -C "${SRC}/cache/sources/linux-firmware-git" archive --format=tar "${mainline_firmware_git_sha1}" "|" tar -C "${fw_temp_dir}/${fw_dir}/lib/firmware/" -xf -
# Usage of make install ensures proper symlink creation
cd "${SRC}/cache/sources/linux-firmware-git" || exit_with_error "can't change directory"
run_host_command_logged make DESTDIR="${fw_temp_dir}/${fw_dir}" FIRMWAREDIR=/lib/firmware install

# Full version conflicts with more stuff, of course.
extra_conflicts_comma=",amd64-microcode,intel-microcode"

# @TODO: rpardini: disabled, this is not the place to do this; move to extension/bsp/whatever
# cp : create hardlinks for ath11k WCN685x hw2.1 firmware since they are using the same firmware with hw2.0
# run_host_command_logged cp -af --reflink=auto "${fw_temp_dir}/${fw_dir}/lib/firmware/ath11k/WCN6855/hw2.0/" "${fw_temp_dir}/${fw_dir}/lib/firmware/ath11k/WCN6855/hw2.1/"
# This symlink messes with the armbian-firmware overwrite step
# @TODO: remove no longer needed symlink from armbian-firmware
if [[ -d "${fw_temp_dir}/${fw_dir}/lib/firmware/ath11k/WCN6855/hw2.1/" ]]; then
run_host_command_logged rm -r "${fw_temp_dir}/${fw_dir}/lib/firmware/ath11k/WCN6855/hw2.1/"
fi
fi

# Armbian firmware; this overwrites anything in the mainline firmware repo (if that was included, in the full version only)
Expand Down
1 change: 1 addition & 0 deletions lib/functions/host/prepare-host.sh
Original file line number Diff line number Diff line change
Expand Up @@ -282,6 +282,7 @@ function adaptative_prepare_host_dependencies() {
parted gdisk fdisk # partition tools @TODO why so many?
aria2 curl wget axel # downloaders et al
parallel # do things in parallel (used for fast md5 hashing in initrd cache)
rdfind # armbian-firmware-full/linux-firmware symlink creation step
)

# @TODO: distcc -- handle in extension?
Expand Down

0 comments on commit 08ef1a9

Please sign in to comment.