Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix build script issues #2

Merged
merged 3 commits into from
Aug 3, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 12 additions & 5 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,9 @@ set -e
kernel_config_dir=$PWD/config
source_dir=$PWD/source
build_dir=$PWD/build
patches_dir=$PWD/patches

kernel_version="6.4.6"
kernel_version="6.4.8"
tarball_url="https://cdn.kernel.org/pub/linux/kernel/v${kernel_version:0:1}.x/linux-${kernel_version}.tar.xz"
tarball_name="$(echo $tarball_url | cut -f 8 -d '/')"

Expand All @@ -24,8 +25,14 @@ function build_kernel {
mkdir -p ${firmware_dir}/amdgpu
cp -r /lib/firmware/amdgpu/stoney* ${firmware_dir}/amdgpu
# doesn't matter if decompression fails
xz -d ${firmware_dir}/amdgpu/stoney* &> /dev/null || true
zstd -d ${firmware_dir}/amdgpu/stoney* &> /dev/null || true
xz_count=`ls -1 ${firmware_dir}/amdgpu/stoney*.xz 2>/dev/null | wc -l`
zst_count=`ls -1 ${firmware_dir}/amdgpu/stoney*.zst 2>/dev/null | wc -l`
if [ $xz_count != 0 ]; then
xz -d ${firmware_dir}/amdgpu/stoney*.xz &> /dev/null || true
fi
if [ $zst_count != 0 ]; then
zstd -d ${firmware_dir}/amdgpu/stoney*.zst &> /dev/null || true
fi
;;
avs)
arch=x86_64
Expand All @@ -46,10 +53,10 @@ function build_kernel {

echo "Building $variant kernel"

curl -LO tarball_url -o ${source_dir}/${variant}/${tarball_name}
curl -L $tarball_url -o ${source_dir}/${variant}/${tarball_name}
tar xf ${source_dir}/${variant}/${tarball_name} -C ${source_dir}/${variant}/
cd $kernel_source_dir
patch -p1 < ../patches/${variant}/*
patch -p1 < ${patches_dir}/${variant}/* &> /dev/null || true

case $arch in
arm64) cross="aarch64-linux-gnu-";;
Expand Down
2 changes: 1 addition & 1 deletion config/stoney.config
Original file line number Diff line number Diff line change
Expand Up @@ -2265,7 +2265,7 @@ CONFIG_FW_LOADER_DEBUG=y
CONFIG_FW_LOADER_PAGED_BUF=y
CONFIG_FW_LOADER_SYSFS=y
CONFIG_EXTRA_FIRMWARE="amdgpu/stoney_ce.bin amdgpu/stoney_me.bin amdgpu/stoney_mec.bin amdgpu/stoney_pfp.bin amdgpu/stoney_rlc.bin amdgpu/stoney_sdma.bin amdgpu/stoney_uvd.bin amdgpu/stoney_vce.bin"
CONFIG_EXTRA_FIRMWARE_DIR="../build/stoney/stoney_firmware"
CONFIG_EXTRA_FIRMWARE_DIR="../../../build/stoney/stoney_firmware"
# CONFIG_FW_LOADER_USER_HELPER is not set
CONFIG_FW_LOADER_COMPRESS=y
CONFIG_FW_LOADER_COMPRESS_XZ=y
Expand Down