fix: missing BTF and USB_CDNS modules
This commit is contained in:
1 parent
e7d330a56f
commit
4a36d85ef3
2 files changed
+55
-27
No files matched your search
@@ -14,25 +14,43 @@ KERNEL_PATCHES=$BUILD/linux-sky1
|
||||
LOGS=$BUILD/logs
|
||||
|
||||
CMDLINE_COMMON="console=tty0 console=ttyAMA0,115200n8 cma=512M clk_ignore_unused=1 cpufreq.default_governor=schedutil"
|
||||
CMDLINE_LOWPOWER="pcie_aspm=powersave pcie_aspm_policy=default $CMDLINE_COMMON"
|
||||
CMDLINE_POWERSAVE="pcie_aspm=powersave pcie_aspm_policy=default $CMDLINE_COMMON"
|
||||
CMDLINE="pcie_aspm=off $CMDLINE_COMMON"
|
||||
|
||||
log() { printf '[%s] %s\n' "$(date '+%H:%M:%S')" "$*"; }
|
||||
die() { printf '[%s] ERROR: %s\n' "$(date '+%H:%M:%S')" "$*"; exit 1; }
|
||||
run() { "$@" 2>&1 > "/tmp/$1.error.log" || die "failed: $(echo /tmp/$1.error.log | tail -n 1)"; }
|
||||
get() { [ -f "/tmp/$1" ] || { run wget -q -O "/tmp/$1" "$2/$1"; cat "/tmp/$1"; return; }; log "using cached file /tmp/$1" >&2; cat "/tmp/$1"; }
|
||||
run() { "$@" 2>&1 > "/tmp/$1.error.log" || die "failed: $(cat /tmp/$1.error.log | tail -n 1)"; }
|
||||
get() { local dl=/tmp/$1; [ -f "$dl" ] || { run wget -q -O $dl "$2/$1"; cat $dl; return; }; log "using cached file $dl" >&2; cat $dl; }
|
||||
sub() { local sh=/tmp/$LOCAL_VERSION.build.sub.sh; echo "$(declare -p); $(declare -f)" > $sh; echo "source $sh 2>/dev/null && $1"; }
|
||||
|
||||
uninstall() {
|
||||
purge() {
|
||||
log "removing modules"
|
||||
pkexec rm -rf "/lib/modules/$LOCAL_VERSION" "$HEADERS" || die "failed"
|
||||
log "removing boot images and configs"
|
||||
pkexec find /boot -name "*-$LOCAL_VERSION*" -delete || die "failed"
|
||||
log "done"
|
||||
rm -rf "/lib/modules/$LOCAL_VERSION" "$HEADERS" || die "failed"
|
||||
log "removing boot images and config files"
|
||||
find /boot -name "*-$LOCAL_VERSION*" -delete || die "failed"
|
||||
}
|
||||
|
||||
[ -z "$UNINSTALL" ] || { uninstall; exit 0; }
|
||||
setup() {
|
||||
log "uninstalling (if exists) legacy kernel ${LOCAL_VERSION} from previous build(s)"
|
||||
purge
|
||||
log "copying header files"
|
||||
cp -r "$KERNEL_TREE" "$HEADERS" || die "failed"
|
||||
log "installing kernel modules"
|
||||
make -C "$HEADERS" ARCH=arm64 -j"$JOBS" modules_install install clean </dev/null >"$LOGS/install.log" 2>&1 || die "failed (see logs/install.log)"
|
||||
|
||||
log "updating bootloader configuration"
|
||||
run grubby --update-kernel=/boot/vmlinuz-$LOCAL_VERSION --args="$CMDLINE"
|
||||
|
||||
local id="$(grubby --info=$(grubby --default-index) | grep 'id=' | awk -F'\"' '{print $2}')"
|
||||
local conf=/boot/loader/entries/$id.powersave.conf
|
||||
cp /boot/loader/entries/$id.conf $conf
|
||||
sed -i "s/$CMDLINE/$CMDLINE_POWERSAVE/" $conf
|
||||
sed -i "/^title/s/$/ Powersave Mode/" $conf
|
||||
}
|
||||
|
||||
[ -z "$UNINSTALL" ] || { pkexec bash -c "$(sub purge)"; exit 0; }
|
||||
[ -z "$CLEAN" ] || rm -rf $KERNEL_TREE $KERNEL_PATCHES $LOGS; mkdir -p "$LOGS"
|
||||
log "building linux kernel ${KERNEL_VERSION} for Fedora ${DISTRO_VERSION} with sky1-${TAG:=latest} patches"
|
||||
log "building linux kernel ${KERNEL_VERSION} (arm64) for Fedora ${DISTRO_VERSION} with sky1-${TAG:=latest} patches"
|
||||
|
||||
append() {
|
||||
local series=$KERNEL_PATCHES/patches/series
|
||||
@@ -42,8 +60,8 @@ append() {
|
||||
}
|
||||
|
||||
rebase() {
|
||||
git remote add $1 https://github.com/$1/linux-sky1.git >/dev/null 2>&1
|
||||
git fetch $1 >/dev/null 2>&1
|
||||
run git remote add $1 https://github.com/$1/linux-sky1.git
|
||||
run git fetch $1
|
||||
git rebase $1/$2 >/dev/null 2>&1 || append || die "could not rebase branch $1:$2"
|
||||
}
|
||||
|
||||
@@ -51,6 +69,8 @@ if [ ! -d "$KERNEL_PATCHES" ]; then
|
||||
log "cloning linux-sky1 repository"
|
||||
run git clone --depth=1 https://github.com/Sky1-Linux/linux-sky1.git
|
||||
cd $KERNEL_PATCHES
|
||||
git config user.email "build@ms-r1.local"
|
||||
git config user.name "Build"
|
||||
rebase srcshelton main # patches: fix Kconfig deps and module reachability
|
||||
rebase peppergrayxyz v6.19.10 # Update patch for 6.19.10
|
||||
rebase grkml config/cilium-ipsec-prereqs # config: enable Cilium IPsec prerequisites across all tracks
|
||||
@@ -84,9 +104,10 @@ if [ ! -f "$KERNEL_TREE/.config-fedora" ]; then
|
||||
> $KERNEL_TREE/.config-fedora
|
||||
fi
|
||||
|
||||
if [ ! -f "$KERNEL_TREE/.config.ms-r1" ] || [ -n "$RECONFIGURE" ]; then
|
||||
if [ ! -f "$KERNEL_TREE/.config.ms-r1" ] || [ -n "$REBUILD" ]; then
|
||||
log "configuring kernel"
|
||||
cd $KERNEL_TREE
|
||||
make mrproper >/dev/null
|
||||
cp $KERNEL_PATCHES/config/config.sky1-${TAG} .config-sky1
|
||||
./scripts/kconfig/merge_config.sh -m -O . .config-sky1 .config-fedora >/dev/null
|
||||
./scripts/kconfig/merge_config.sh -m -O . .config "$BUILD/config/ms-r1.fragment" >/dev/null
|
||||
@@ -94,12 +115,14 @@ if [ ! -f "$KERNEL_TREE/.config.ms-r1" ] || [ -n "$RECONFIGURE" ]; then
|
||||
cp .config .config.ms-r1
|
||||
fi
|
||||
|
||||
log "compiling kernel"; make -C "$KERNEL_TREE" ARCH=arm64 CROSS_COMPILE=$CROSS -j"$JOBS" </dev/null >"$LOGS/build.log" 2>&1 || die "failed (see logs/build.log)"
|
||||
log "done"
|
||||
[ -n "$INSTALL" ] || { log "note: run this script with INSTALL=1 to trigger kernel install (requires root privileges)"; exit 0; }
|
||||
[ -z "$(find /boot -maxdepth 1 -name "*-${LOCAL_VERSION}*" 2>/dev/null)" ] || { log "uninstalling legacy kernel ${LOCAL_VERSION} from previous build(s)"; uninstall; }
|
||||
log "compiling kernel"
|
||||
make -C "$KERNEL_TREE" ARCH=arm64 CROSS_COMPILE=$CROSS -j"$JOBS" </dev/null >"$LOGS/build.log" 2>&1 || die "failed (see logs/build.log)"
|
||||
|
||||
log "copying header files"; pkexec cp -r "$KERNEL_TREE" "$HEADERS" || die "failed"
|
||||
log "installing kernel"; pkexec make -C "$DEVEL" ARCH=arm64 modules_install install clean </dev/null >"$LOGS/install.log" 2>&1 || die "failed (see logs/install.log)"
|
||||
log "updating grub2 arguments"; run pkexec grubby --update-kernel=/boot/vmlinuz-$LOCAL_VERSION --args="$(if [ -n "$LOWPOWER" ]; then echo $CMDLINE_LOWPOWER; else echo $CMDLINE; fi)"
|
||||
if [ -z "$INSTALL" ]; then
|
||||
log "done"
|
||||
log "note: run this script with INSTALL=1 to trigger kernel install (requires root privileges)"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
pkexec bash -c "$(sub setup)"
|
||||
log "done"
|
||||
Reference in new issue
Block a user