mirror of
https://github.com/ps5-linux/ps5-linux-image.git
synced 2026-07-15 21:42:27 +00:00
kernel only option; persistent ccache; single kernel deb; CI support; robust resize2fs; cross compile fixes; custom kernel headers; arch postinstall; amd64 deb
This commit is contained in:
2
.github/workflows/dispatch.yml
vendored
2
.github/workflows/dispatch.yml
vendored
@@ -13,6 +13,6 @@ jobs:
|
|||||||
uses: peter-evans/repository-dispatch@v3
|
uses: peter-evans/repository-dispatch@v3
|
||||||
with:
|
with:
|
||||||
token: ${{ secrets.DISPATCH_TOKEN }}
|
token: ${{ secrets.DISPATCH_TOKEN }}
|
||||||
repository: resulknad/ps5-vps-setup
|
repository: ps5-linux/ps5-linux-updates
|
||||||
event-type: image-builder-updated
|
event-type: image-builder-updated
|
||||||
client-payload: '{"sha": "${{ github.sha }}"}'
|
client-payload: '{"sha": "${{ github.sha }}"}'
|
||||||
|
|||||||
@@ -42,7 +42,7 @@ done
|
|||||||
LINUX_REPO="https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git"
|
LINUX_REPO="https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git"
|
||||||
LINUX_DEFAULT_DIR="$SCRIPT_DIR/work/linux"
|
LINUX_DEFAULT_DIR="$SCRIPT_DIR/work/linux"
|
||||||
|
|
||||||
PATCHES_REPO="https://github.com/resulknad/ps5-linux-patches.git"
|
PATCHES_REPO="https://github.com/ps5-linux/ps5-linux-patches.git"
|
||||||
PATCHES_DIR="$SCRIPT_DIR/work/ps5-linux-patches"
|
PATCHES_DIR="$SCRIPT_DIR/work/ps5-linux-patches"
|
||||||
|
|
||||||
if [ -z "$KERNEL_SRC" ]; then
|
if [ -z "$KERNEL_SRC" ]; then
|
||||||
@@ -233,7 +233,6 @@ else
|
|||||||
if [ ! -d "$KERNEL_SRC/.git" ]; then
|
if [ ! -d "$KERNEL_SRC/.git" ]; then
|
||||||
REPO_URL="$PATCHES_REPO"
|
REPO_URL="$PATCHES_REPO"
|
||||||
[ -n "$PATCHES_TOKEN" ] && REPO_URL="${PATCHES_REPO/https:\/\//https:\/\/${PATCHES_TOKEN}@}"
|
[ -n "$PATCHES_TOKEN" ] && REPO_URL="${PATCHES_REPO/https:\/\//https:\/\/${PATCHES_TOKEN}@}"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
mkdir -p "$PATCHES_DIR"
|
mkdir -p "$PATCHES_DIR"
|
||||||
|
|||||||
@@ -8,6 +8,7 @@ DISK=$(lsblk -ndo PKNAME "$ROOT_DEV")
|
|||||||
PART_NUM=$(cat /sys/class/block/$(basename "$ROOT_DEV")/partition)
|
PART_NUM=$(cat /sys/class/block/$(basename "$ROOT_DEV")/partition)
|
||||||
|
|
||||||
growpart "/dev/$DISK" "$PART_NUM" || true
|
growpart "/dev/$DISK" "$PART_NUM" || true
|
||||||
|
partprobe "/dev/$DISK"
|
||||||
resize2fs "$ROOT_DEV" || true
|
resize2fs "$ROOT_DEV" || true
|
||||||
|
|
||||||
rc-update del grow-rootfs default
|
rc-update del grow-rootfs default
|
||||||
|
|||||||
@@ -8,6 +8,7 @@ DISK="/dev/$(lsblk -ndo PKNAME "$ROOT_DEV")"
|
|||||||
PART_NUM=$(cat /sys/class/block/$(basename "$ROOT_DEV")/partition)
|
PART_NUM=$(cat /sys/class/block/$(basename "$ROOT_DEV")/partition)
|
||||||
|
|
||||||
parted -s "$DISK" resizepart "$PART_NUM" 100%
|
parted -s "$DISK" resizepart "$PART_NUM" 100%
|
||||||
|
partprobe "$DISK"
|
||||||
resize2fs "$ROOT_DEV"
|
resize2fs "$ROOT_DEV"
|
||||||
|
|
||||||
systemctl disable grow-rootfs.service
|
systemctl disable grow-rootfs.service
|
||||||
|
|||||||
@@ -175,7 +175,7 @@ actions:
|
|||||||
|
|
||||||
# Install custom kernel packages
|
# Install custom kernel packages
|
||||||
if ls /opt/pkgs/*.pkg.tar.zst 1>/dev/null 2>&1; then
|
if ls /opt/pkgs/*.pkg.tar.zst 1>/dev/null 2>&1; then
|
||||||
pacman -U --noconfirm /opt/pkgs/*.pkg.tar.zst
|
pacman -U --noconfirm --ask 4 /opt/pkgs/*.pkg.tar.zst
|
||||||
rm -rf /opt/pkgs
|
rm -rf /opt/pkgs
|
||||||
KVER=$(ls -1t /lib/modules | head -1)
|
KVER=$(ls -1t /lib/modules | head -1)
|
||||||
# mkinitcpio may warn about missing optional modules; don't fail on those
|
# mkinitcpio may warn about missing optional modules; don't fail on those
|
||||||
|
|||||||
@@ -7,8 +7,8 @@ ROOT_DEV=$(findmnt -no SOURCE /)
|
|||||||
DISK="/dev/$(lsblk -ndo PKNAME "$ROOT_DEV")"
|
DISK="/dev/$(lsblk -ndo PKNAME "$ROOT_DEV")"
|
||||||
PART_NUM=$(cat /sys/class/block/$(basename "$ROOT_DEV")/partition)
|
PART_NUM=$(cat /sys/class/block/$(basename "$ROOT_DEV")/partition)
|
||||||
|
|
||||||
growpart "$DISK" "$PART_NUM"
|
growpart "$DISK" "$PART_NUM" || true
|
||||||
|
partprobe "$DISK"
|
||||||
resize2fs "$ROOT_DEV"
|
resize2fs "$ROOT_DEV" || true
|
||||||
|
|
||||||
systemctl disable grow-rootfs.service
|
systemctl disable grow-rootfs.service
|
||||||
|
|||||||
@@ -1,13 +1,19 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
# Grows the root partition and filesystem to fill the disk.
|
# Grows the root partition and filesystem to fill the disk.
|
||||||
# Runs once on first boot, then disables itself.
|
# Runs once on first boot, then disables itself.
|
||||||
set -e
|
# If resize fails, the service stays enabled and retries next boot.
|
||||||
|
|
||||||
ROOT_DEV=$(findmnt -no SOURCE /)
|
ROOT_DEV=$(findmnt -no SOURCE /) || { echo "Cannot find root device"; exit 1; }
|
||||||
DISK=$(lsblk -ndo PKNAME "$ROOT_DEV")
|
DISK=$(lsblk -ndo PKNAME "$ROOT_DEV")
|
||||||
PART_NUM=$(cat /sys/class/block/$(basename "$ROOT_DEV")/partition)
|
PART_NUM=$(cat /sys/class/block/$(basename "$ROOT_DEV")/partition 2>/dev/null)
|
||||||
|
|
||||||
|
if [ -z "$DISK" ] || [ -z "$PART_NUM" ]; then
|
||||||
|
echo "Cannot determine disk layout (DISK=$DISK PART_NUM=$PART_NUM)"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
growpart "/dev/$DISK" "$PART_NUM" || true
|
growpart "/dev/$DISK" "$PART_NUM" || true
|
||||||
resize2fs "$ROOT_DEV" || true
|
partprobe "/dev/$DISK"
|
||||||
|
resize2fs "$ROOT_DEV"
|
||||||
|
|
||||||
systemctl disable grow-rootfs.service
|
systemctl disable grow-rootfs.service
|
||||||
|
|||||||
@@ -1,13 +1,10 @@
|
|||||||
[Unit]
|
[Unit]
|
||||||
Description=Grow root filesystem to fill disk
|
Description=Grow root filesystem to fill disk
|
||||||
DefaultDependencies=no
|
After=local-fs.target
|
||||||
Before=local-fs.target
|
|
||||||
After=local-fs-pre.target
|
|
||||||
|
|
||||||
[Service]
|
[Service]
|
||||||
Type=oneshot
|
Type=oneshot
|
||||||
ExecStart=/usr/local/sbin/grow-rootfs
|
ExecStart=/usr/local/sbin/grow-rootfs
|
||||||
RemainAfterExit=yes
|
|
||||||
|
|
||||||
[Install]
|
[Install]
|
||||||
WantedBy=local-fs.target
|
WantedBy=multi-user.target
|
||||||
|
|||||||
@@ -14,6 +14,7 @@ WORKDIR /out/staging
|
|||||||
# Output packages go to /out
|
# Output packages go to /out
|
||||||
|
|
||||||
COPY docker/kernel-builder-arch/build.sh /build.sh
|
COPY docker/kernel-builder-arch/build.sh /build.sh
|
||||||
|
COPY docker/kernel-builder-arch/install.sh /install.sh
|
||||||
RUN chmod +x /build.sh
|
RUN chmod +x /build.sh
|
||||||
|
|
||||||
CMD ["/build.sh"]
|
CMD ["/build.sh"]
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ fi
|
|||||||
|
|
||||||
# Determine version from staged modules directory
|
# Determine version from staged modules directory
|
||||||
KVER=$(ls /out/staging/lib/modules/)
|
KVER=$(ls /out/staging/lib/modules/)
|
||||||
PKGNAME="linux-custom"
|
PKGNAME="linux-ps5"
|
||||||
VERSION=${KVER%%-*}
|
VERSION=${KVER%%-*}
|
||||||
|
|
||||||
echo "==> Packaging kernel $KVER as pacman package"
|
echo "==> Packaging kernel $KVER as pacman package"
|
||||||
@@ -24,10 +24,22 @@ cp /out/staging/boot/bzImage "$STAGING/boot/vmlinuz-$KVER"
|
|||||||
cp /out/staging/System.map "$STAGING/boot/System.map-$KVER"
|
cp /out/staging/System.map "$STAGING/boot/System.map-$KVER"
|
||||||
cp /out/staging/.config "$STAGING/boot/config-$KVER"
|
cp /out/staging/.config "$STAGING/boot/config-$KVER"
|
||||||
|
|
||||||
# Copy pre-installed modules (Arch uses /lib -> /usr/lib)
|
# Copy pre-installed modules (Arch uses /usr/lib/modules)
|
||||||
mkdir -p "$STAGING/usr/lib/modules"
|
mkdir -p "$STAGING/usr/lib/modules"
|
||||||
cp -a "/out/staging/lib/modules/$KVER" "$STAGING/usr/lib/modules/"
|
cp -a "/out/staging/lib/modules/$KVER" "$STAGING/usr/lib/modules/"
|
||||||
|
|
||||||
|
# Kernel headers (for out-of-tree module builds)
|
||||||
|
if [ -d /out/staging/headers ]; then
|
||||||
|
# UAPI headers (/usr/include/linux/, /usr/include/asm/, etc.)
|
||||||
|
cp -a /out/staging/headers/usr "$STAGING/usr"
|
||||||
|
# Build headers (/usr/lib/modules/$KVER/build/)
|
||||||
|
mkdir -p "$STAGING/usr/lib/modules/$KVER"
|
||||||
|
cp -a /out/staging/headers/lib/modules/$KVER/build "$STAGING/usr/lib/modules/$KVER/build"
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Create .INSTALL from template, baking in KVER
|
||||||
|
sed "s/__KVER__/$KVER/g" /install.sh > "$STAGING/.INSTALL"
|
||||||
|
|
||||||
# Create .PKGINFO
|
# Create .PKGINFO
|
||||||
BUILDDATE=$(date -u +%s)
|
BUILDDATE=$(date -u +%s)
|
||||||
INSTALLED_SIZE=$(du -sb "$STAGING" | awk '{print $1}')
|
INSTALLED_SIZE=$(du -sb "$STAGING" | awk '{print $1}')
|
||||||
@@ -35,24 +47,33 @@ cat > "$STAGING/.PKGINFO" << EOF
|
|||||||
pkgname = $PKGNAME
|
pkgname = $PKGNAME
|
||||||
pkgbase = $PKGNAME
|
pkgbase = $PKGNAME
|
||||||
pkgver = ${VERSION}-1
|
pkgver = ${VERSION}-1
|
||||||
pkgdesc = Custom Linux kernel $KVER for PS5
|
pkgdesc = PS5 Linux kernel $KVER (image + modules + headers)
|
||||||
url = https://kernel.org
|
url = https://kernel.org
|
||||||
builddate = $BUILDDATE
|
builddate = $BUILDDATE
|
||||||
packager = bootstrap_docker
|
packager = ps5-linux
|
||||||
size = $INSTALLED_SIZE
|
size = $INSTALLED_SIZE
|
||||||
arch = x86_64
|
arch = x86_64
|
||||||
license = GPL-2.0-only
|
license = GPL-2.0-only
|
||||||
provides = linux=$VERSION
|
provides = linux=$VERSION
|
||||||
provides = linux-custom=$VERSION
|
provides = linux-headers=$VERSION
|
||||||
|
provides = linux-api-headers=$VERSION
|
||||||
|
conflict = linux
|
||||||
|
conflict = linux-headers
|
||||||
|
conflict = linux-api-headers
|
||||||
|
conflict = linux-custom
|
||||||
|
replaces = linux
|
||||||
|
replaces = linux-headers
|
||||||
|
replaces = linux-api-headers
|
||||||
|
replaces = linux-custom
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
# Create .MTREE (required by newer pacman)
|
# Create .MTREE (required by newer pacman)
|
||||||
cd "$STAGING"
|
cd "$STAGING"
|
||||||
LANG=C bsdtar -czf .MTREE --format=mtree \
|
LANG=C bsdtar -czf .MTREE --format=mtree \
|
||||||
--options='!all,use-set,type,uid,gid,mode,time,size,md5,sha256,link' \
|
--options='!all,use-set,type,uid,gid,mode,time,size,md5,sha256,link' \
|
||||||
.PKGINFO *
|
.PKGINFO .INSTALL *
|
||||||
|
|
||||||
# Build the package
|
# Build the package
|
||||||
LANG=C bsdtar -cf - .PKGINFO .MTREE * | zstd -c -T0 > "/out/${PKGNAME}-${VERSION}-1-x86_64.pkg.tar.zst"
|
LANG=C bsdtar -cf - .PKGINFO .INSTALL .MTREE * | zstd -c -T0 > "/out/${PKGNAME}-${VERSION}-1-x86_64.pkg.tar.zst"
|
||||||
|
|
||||||
echo "==> Done: /out/${PKGNAME}-${VERSION}-1-x86_64.pkg.tar.zst"
|
echo "==> Done: /out/${PKGNAME}-${VERSION}-1-x86_64.pkg.tar.zst"
|
||||||
|
|||||||
35
docker/kernel-builder-arch/install.sh
Normal file
35
docker/kernel-builder-arch/install.sh
Normal file
@@ -0,0 +1,35 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
# Pacman .INSTALL script for linux-ps5.
|
||||||
|
# KVER is replaced at package build time.
|
||||||
|
|
||||||
|
post_install() {
|
||||||
|
KVER="__KVER__"
|
||||||
|
echo ">> linux-ps5 post_install: kernel $KVER"
|
||||||
|
|
||||||
|
# Rebuild initramfs
|
||||||
|
if command -v mkinitcpio >/dev/null 2>&1; then
|
||||||
|
echo ">> Rebuilding initramfs with mkinitcpio for $KVER"
|
||||||
|
mkinitcpio -k "$KVER" -g "/boot/initrd.img-$KVER"
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Copy kernel + initrd to EFI partition
|
||||||
|
if [ -d /boot/efi ]; then
|
||||||
|
OLD_BZ=$(ls -l /boot/efi/bzImage 2>/dev/null | awk '{print $5}') || true
|
||||||
|
OLD_INITRD=$(ls -l /boot/efi/initrd.img 2>/dev/null | awk '{print $5}') || true
|
||||||
|
echo ">> Copying /boot/vmlinuz-$KVER -> /boot/efi/bzImage"
|
||||||
|
cp "/boot/vmlinuz-$KVER" /boot/efi/bzImage
|
||||||
|
NEW_BZ=$(ls -l /boot/efi/bzImage | awk '{print $5}')
|
||||||
|
echo ">> bzImage: ${OLD_BZ:-<new>} -> $NEW_BZ bytes"
|
||||||
|
echo ">> Copying /boot/initrd.img-$KVER -> /boot/efi/initrd.img"
|
||||||
|
cp "/boot/initrd.img-$KVER" /boot/efi/initrd.img
|
||||||
|
NEW_INITRD=$(ls -l /boot/efi/initrd.img | awk '{print $5}')
|
||||||
|
echo ">> initrd.img: ${OLD_INITRD:-<new>} -> $NEW_INITRD bytes"
|
||||||
|
echo ">> Kernel $KVER deployed to /boot/efi"
|
||||||
|
else
|
||||||
|
echo ">> /boot/efi not found, skipping EFI deploy"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
post_upgrade() {
|
||||||
|
post_install
|
||||||
|
}
|
||||||
@@ -25,4 +25,13 @@ KVER=$(make -s kernelrelease)
|
|||||||
rm -f "/out/staging/lib/modules/$KVER/build" \
|
rm -f "/out/staging/lib/modules/$KVER/build" \
|
||||||
"/out/staging/lib/modules/$KVER/source"
|
"/out/staging/lib/modules/$KVER/source"
|
||||||
|
|
||||||
|
# Stage kernel headers for out-of-tree module builds
|
||||||
|
echo "=== Staging kernel headers ==="
|
||||||
|
HDR="/out/staging/headers"
|
||||||
|
make headers_install INSTALL_HDR_PATH="$HDR/usr"
|
||||||
|
|
||||||
|
# Use the kernel's own install-extmod-build script (same as deb-pkg uses)
|
||||||
|
export srctree=/src SRCARCH=x86
|
||||||
|
CC="${CROSS_COMPILE}gcc" HOSTCC=gcc MAKE=make /src/scripts/package/install-extmod-build "$HDR/lib/modules/$KVER/build"
|
||||||
|
|
||||||
echo "=== Build artifacts staged in /out/staging ==="
|
echo "=== Build artifacts staged in /out/staging ==="
|
||||||
|
|||||||
@@ -1,29 +1,80 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
# Builds a combined linux-ps5 .deb from the kernel source at /src.
|
# Builds a combined linux-ps5 .deb from staged artifacts in /out/staging.
|
||||||
# Runs inside the kernel-builder container; output goes to /out.
|
# Runs inside the kernel-builder container; output goes to /out.
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
make -j$(nproc) DPKG_FLAGS=-d bindeb-pkg
|
STAGING="/out/staging"
|
||||||
|
KVER=$(ls -1 "$STAGING/lib/modules" | head -1)
|
||||||
|
VER="${KVER%%-*}"
|
||||||
|
ARCH=amd64
|
||||||
|
|
||||||
VER=$(dpkg-deb -f "$(ls /linux-image-[0-9]*.deb | grep -v dbg | head -1)" Version)
|
PKG=$(mktemp -d)
|
||||||
ARCH=$(dpkg-deb -f "$(ls /linux-image-[0-9]*.deb | grep -v dbg | head -1)" Architecture)
|
mkdir -p "$PKG/DEBIAN"
|
||||||
KVER=$(ls /src/debian/linux-image-[0-9]*/lib/modules/ 2>/dev/null | head -1)
|
mkdir -p "$PKG/boot"
|
||||||
|
mkdir -p "$PKG/lib/modules"
|
||||||
|
|
||||||
TMPDIR=$(mktemp -d)
|
cp "$STAGING/boot/bzImage" "$PKG/boot/vmlinuz-$KVER"
|
||||||
mkdir -p "$TMPDIR/DEBIAN"
|
cp "$STAGING/System.map" "$PKG/boot/System.map-$KVER"
|
||||||
for deb in $(ls /linux-image-[0-9]*.deb /linux-headers-*.deb /linux-libc-dev_*.deb 2>/dev/null | grep -v -- '-dbg_'); do
|
cp "$STAGING/.config" "$PKG/boot/config-$KVER"
|
||||||
dpkg-deb -x "$deb" "$TMPDIR"
|
cp -a "$STAGING/lib/modules/$KVER" "$PKG/lib/modules/"
|
||||||
done
|
|
||||||
|
|
||||||
cat > "$TMPDIR/DEBIAN/control" << CTRL
|
# Kernel headers (for out-of-tree module builds)
|
||||||
|
if [ -d "$STAGING/headers" ]; then
|
||||||
|
cp -a "$STAGING/headers/usr" "$PKG/usr"
|
||||||
|
# Point /lib/modules/$KVER/build at the installed headers
|
||||||
|
HDR_DEST="/usr/lib/modules/$KVER/build"
|
||||||
|
mkdir -p "$PKG/usr/lib/modules/$KVER"
|
||||||
|
cp -a "$STAGING/headers/lib/modules/$KVER/build" "$PKG/usr/lib/modules/$KVER/build"
|
||||||
|
ln -sf "$HDR_DEST" "$PKG/lib/modules/$KVER/build"
|
||||||
|
fi
|
||||||
|
|
||||||
|
cat > "$PKG/DEBIAN/control" << CTRL
|
||||||
Package: linux-ps5
|
Package: linux-ps5
|
||||||
Version: $VER
|
Version: $VER
|
||||||
Architecture: $ARCH
|
Architecture: $ARCH
|
||||||
Maintainer: PS5 Linux
|
Maintainer: PS5 Linux
|
||||||
Provides: linux-image, linux-image-$KVER, linux-headers-$KVER, linux-libc-dev
|
Provides: linux-image-$KVER, linux-headers-$KVER, linux-libc-dev
|
||||||
Conflicts: linux-image-$KVER, linux-headers-$KVER, linux-libc-dev
|
Conflicts: linux-image-$KVER, linux-headers-$KVER, linux-libc-dev
|
||||||
Replaces: linux-image-$KVER, linux-headers-$KVER, linux-libc-dev
|
Replaces: linux-image-$KVER, linux-headers-$KVER, linux-libc-dev
|
||||||
Description: PS5 Linux kernel $KVER (image + headers + libc-dev)
|
Description: PS5 Linux kernel $KVER (image + modules + headers + libc-dev)
|
||||||
CTRL
|
CTRL
|
||||||
|
|
||||||
dpkg-deb --build --root-owner-group "$TMPDIR" "/out/linux-ps5_${VER}_${ARCH}.deb"
|
cat > "$PKG/DEBIAN/postinst" << 'POSTINST'
|
||||||
|
#!/bin/bash
|
||||||
|
set -e
|
||||||
|
KVER="$(ls -1t /lib/modules | head -1)"
|
||||||
|
echo ">> linux-ps5 postinst: kernel $KVER"
|
||||||
|
|
||||||
|
# Rebuild initramfs
|
||||||
|
if command -v update-initramfs >/dev/null 2>&1; then
|
||||||
|
echo ">> Rebuilding initramfs with update-initramfs for $KVER"
|
||||||
|
update-initramfs -c -k "$KVER"
|
||||||
|
elif command -v mkinitcpio >/dev/null 2>&1; then
|
||||||
|
echo ">> Rebuilding initramfs with mkinitcpio for $KVER"
|
||||||
|
mkinitcpio -k "$KVER" -g "/boot/initrd.img-$KVER"
|
||||||
|
elif command -v mkinitfs >/dev/null 2>&1; then
|
||||||
|
echo ">> Rebuilding initramfs with mkinitfs for $KVER"
|
||||||
|
mkinitfs -o "/boot/initrd.img-$KVER" "$KVER"
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Copy kernel + initrd to EFI partition
|
||||||
|
if [ -d /boot/efi ]; then
|
||||||
|
OLD_BZ=$(ls -l /boot/efi/bzImage 2>/dev/null | awk '{print $5}') || true
|
||||||
|
OLD_INITRD=$(ls -l /boot/efi/initrd.img 2>/dev/null | awk '{print $5}') || true
|
||||||
|
echo ">> Copying /boot/vmlinuz-$KVER -> /boot/efi/bzImage"
|
||||||
|
cp "/boot/vmlinuz-$KVER" /boot/efi/bzImage
|
||||||
|
NEW_BZ=$(ls -l /boot/efi/bzImage | awk '{print $5}')
|
||||||
|
echo ">> bzImage: ${OLD_BZ:-<new>} -> $NEW_BZ bytes"
|
||||||
|
echo ">> Copying /boot/initrd.img-$KVER -> /boot/efi/initrd.img"
|
||||||
|
cp "/boot/initrd.img-$KVER" /boot/efi/initrd.img
|
||||||
|
NEW_INITRD=$(ls -l /boot/efi/initrd.img | awk '{print $5}')
|
||||||
|
echo ">> initrd.img: ${OLD_INITRD:-<new>} -> $NEW_INITRD bytes"
|
||||||
|
echo ">> Kernel $KVER deployed to /boot/efi"
|
||||||
|
else
|
||||||
|
echo ">> /boot/efi not found, skipping EFI deploy"
|
||||||
|
fi
|
||||||
|
POSTINST
|
||||||
|
chmod 755 "$PKG/DEBIAN/postinst"
|
||||||
|
|
||||||
|
dpkg-deb --build --root-owner-group "$PKG" "/out/linux-ps5_${VER}_${ARCH}.deb"
|
||||||
|
rm -rf "$PKG"
|
||||||
|
|||||||
Reference in New Issue
Block a user