chore: kernel-src 归项目目录,更新路径与 gitignore
This commit is contained in:
@@ -1,19 +1,22 @@
|
||||
#!/usr/bin/env bash
|
||||
# Ubuntu HWE 6.17: apply SOF HDMI experiment patch, build generic kernel debs, optional install.
|
||||
# Run from your machine (requires sudo for apt/dpkg). Do NOT edit the plan file.
|
||||
# Ubuntu HWE 6.17: apply SOF iDisp HDMI experiment patch (0002), build generic debs, optional install.
|
||||
# Run on Ubuntu (Noble or host with linux-hwe-6.17 sources); requires sudo for apt/dpkg.
|
||||
set -euo pipefail
|
||||
|
||||
PATCH="${PATCH:-/home/jack/chromebox_10th_audio_driver/patches/ubuntu-hwe-6.17/0001-ASoC-intel-sof-fix-idisp-hdmi-dpcm-playback.patch}"
|
||||
SRC="${SRC:-$HOME/kernel-src/linux-hwe-6.17-6.17.0}"
|
||||
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
||||
REPO_ROOT="$(cd "$SCRIPT_DIR/.." && pwd)"
|
||||
PATCH="${PATCH:-$REPO_ROOT/patches/ubuntu-hwe-6.17/0002-ASoC-intel-sof-idisp-hdmi-dpcm-trigger-post.patch}"
|
||||
SRC="${SRC:-$REPO_ROOT/kernel-src/linux-hwe-6.17-6.17.0}"
|
||||
JOBS="${CONCURRENCY_LEVEL:-$(nproc)}"
|
||||
|
||||
usage() {
|
||||
echo "Usage: $0 [apply|deps|build|install|all]"
|
||||
echo " apply - patch -p1 in SRC (default: $SRC)"
|
||||
echo " apply - patch -p1 in SRC (PATCH=$PATCH)"
|
||||
echo " deps - sudo apt build-dep linux-hwe-6.17 + build tools"
|
||||
echo " build - fakeroot debian/rules clean && binary-generic"
|
||||
echo " install- sudo dpkg -i newest linux-image-* and linux-modules-* in parent of SRC"
|
||||
echo " all - apply deps build (install is manual: run install after reviewing debs)"
|
||||
echo "Env: PATCH=path SRC=path to linux-hwe-6.17-6.17.0 tree"
|
||||
}
|
||||
|
||||
if [[ ! -f "$SRC/debian/rules" ]]; then
|
||||
@@ -24,19 +27,19 @@ fi
|
||||
cmd_apply() {
|
||||
cd "$SRC"
|
||||
local f="sound/soc/intel/boards/sof_board_helpers.c"
|
||||
if grep -q 'link->dpcm_playback = 1' "$f" 2>/dev/null; then
|
||||
if grep -q 'link->trigger\[0\] = SND_SOC_DPCM_TRIGGER_POST' "$f" 2>/dev/null; then
|
||||
echo "Already patched: $f"
|
||||
else
|
||||
patch -p1 < "$PATCH"
|
||||
fi
|
||||
grep -n 'set_idisp_hdmi_link\|dpcm_playback\|playback_only' "$f" | head -20 || true
|
||||
grep -n 'set_idisp_hdmi_link\|playback_only\|trigger\[0\]' "$f" | head -25 || true
|
||||
}
|
||||
|
||||
cmd_deps() {
|
||||
sudo apt-get update
|
||||
sudo apt-get build-dep -y linux-hwe-6.17
|
||||
sudo apt-get install -y fakeroot build-essential libncurses-dev libssl-dev ccache \
|
||||
gawk debhelper libelf-dev
|
||||
gawk debhelper libelf-dev flex bison bc python3-dev
|
||||
}
|
||||
|
||||
cmd_build() {
|
||||
@@ -49,7 +52,6 @@ cmd_build() {
|
||||
cmd_install() {
|
||||
parent="$(dirname "$SRC")"
|
||||
cd "$parent"
|
||||
# Pick debs matching this source tree version (newest mtime)
|
||||
mapfile -t imgs < <(ls -t linux-image-*.deb 2>/dev/null || true)
|
||||
mapfile -t mods < <(ls -t linux-modules-*.deb 2>/dev/null || true)
|
||||
if [[ ${#imgs[@]} -eq 0 || ${#mods[@]} -eq 0 ]]; then
|
||||
|
||||
Reference in New Issue
Block a user