mirror of
https://github.com/ps5-linux/ps5-linux-image.git
synced 2026-07-15 21:42:27 +00:00
remove ubuntu2404
This commit is contained in:
26
README.md
26
README.md
@@ -1,6 +1,6 @@
|
|||||||
# PS5 Linux Image Builder
|
# PS5 Linux Image Builder
|
||||||
|
|
||||||
Builds bootable Linux USB images for PlayStation 5 using Docker containers. Supports Ubuntu 26.04, Ubuntu 24.04, Arch, CachyOS (Gamescope + Steam), and Alpine, individually or as a multi-distro image with kexec switching.
|
Builds bootable Linux USB images for PlayStation 5 using Docker containers. Supports Ubuntu 26.04, Arch, CachyOS (Gamescope + Steam), and Alpine, individually or as a multi-distro image with kexec switching.
|
||||||
|
|
||||||
## Prerequisites
|
## Prerequisites
|
||||||
|
|
||||||
@@ -22,17 +22,12 @@ newgrp docker
|
|||||||
|
|
||||||
OR
|
OR
|
||||||
|
|
||||||
# Build a single Ubuntu 24.04 image
|
|
||||||
./build_image.sh --distro ubuntu2404
|
|
||||||
|
|
||||||
OR
|
|
||||||
|
|
||||||
# Build CachyOS (Arch-based, Gamescope + Steam Big Picture)
|
# Build CachyOS (Arch-based, Gamescope + Steam Big Picture)
|
||||||
./build_image.sh --distro cachyos
|
./build_image.sh --distro cachyos
|
||||||
|
|
||||||
OR
|
OR
|
||||||
|
|
||||||
# Build a multi-distro image (ubuntu2604 + ubuntu2404 + arch + alpine + cachyos)
|
# Build a multi-distro image (ubuntu2604 + arch + alpine + cachyos)
|
||||||
./build_image.sh --distro all
|
./build_image.sh --distro all
|
||||||
```
|
```
|
||||||
|
|
||||||
@@ -48,7 +43,7 @@ sudo dd if=output/ps5-ubuntu2604.img of=/dev/sdX bs=4M status=progress
|
|||||||
|
|
||||||
| Flag | Description | Default |
|
| Flag | Description | Default |
|
||||||
|------|-------------|---------|
|
|------|-------------|---------|
|
||||||
| `--distro` | `ubuntu2604`, `ubuntu2404`, `arch`, `cachyos`, `alpine`, or `all` | `ubuntu2604` |
|
| `--distro` | `ubuntu2604`, `arch`, `cachyos`, `alpine`, or `all` | `ubuntu2604` |
|
||||||
| `--kernel` | Path to kernel source directory | auto-clone `v6.19.10` |
|
| `--kernel` | Path to kernel source directory | auto-clone `v6.19.10` |
|
||||||
| `--img-size` | Disk image size in MB | `12000` (`32000` for `all`) |
|
| `--img-size` | Disk image size in MB | `12000` (`32000` for `all`) |
|
||||||
| `--clean` | Remove all cached build artifacts and start fresh | off |
|
| `--clean` | Remove all cached build artifacts and start fresh | off |
|
||||||
@@ -69,7 +64,7 @@ Use `--clean` to wipe everything and rebuild from scratch. The build will also s
|
|||||||
PS5 Linux Image Builder
|
PS5 Linux Image Builder
|
||||||
=======================
|
=======================
|
||||||
Distro: all
|
Distro: all
|
||||||
(ubuntu2604 ubuntu2404 arch alpine cachyos)
|
(ubuntu2604 arch alpine cachyos)
|
||||||
Image size: 32000MB
|
Image size: 32000MB
|
||||||
Kernel src: /path/to/work/linux
|
Kernel src: /path/to/work/linux
|
||||||
|
|
||||||
@@ -91,7 +86,6 @@ All verbose output goes to `build.log`. The terminal shows a spinner with live p
|
|||||||
|
|
||||||
| Distro | Desktop | Kernel format | Init |
|
| Distro | Desktop | Kernel format | Init |
|
||||||
|--------|---------|---------------|------|
|
|--------|---------|---------------|------|
|
||||||
| Ubuntu 24.04 (Noble) | GNOME | `.deb` | systemd |
|
|
||||||
| Ubuntu 26.04 (Resolute) | GNOME | `.deb` | systemd |
|
| Ubuntu 26.04 (Resolute) | GNOME | `.deb` | systemd |
|
||||||
| Arch | Sway | `.pkg.tar.zst` | systemd |
|
| Arch | Sway | `.pkg.tar.zst` | systemd |
|
||||||
| CachyOS | Gamescope + Steam Big Picture (Arch + `[cachyos]` repo, no v3 migration in image build) | `.pkg.tar.zst` | systemd |
|
| CachyOS | Gamescope + Steam Big Picture (Arch + `[cachyos]` repo, no v3 migration in image build) | `.pkg.tar.zst` | systemd |
|
||||||
@@ -99,16 +93,15 @@ All verbose output goes to `build.log`. The terminal shows a spinner with live p
|
|||||||
|
|
||||||
## Multi-distro Image
|
## Multi-distro Image
|
||||||
|
|
||||||
`--distro all` builds a 32GB image with 6 partitions (one EFI boot partition plus five root filesystems):
|
`--distro all` builds a 32GB image with 5 partitions (one EFI boot partition plus four root filesystems):
|
||||||
|
|
||||||
| Partition | Type | Label | Content |
|
| Partition | Type | Label | Content |
|
||||||
|-----------|------|-------|---------|
|
|-----------|------|-------|---------|
|
||||||
| p1 | FAT32 | boot | Shared kernel, per-distro initrds, kexec scripts |
|
| p1 | FAT32 | boot | Shared kernel, per-distro initrds, kexec scripts |
|
||||||
| p2 | ext4 | ubuntu2604 | Ubuntu 26.04 rootfs |
|
| p2 | ext4 | ubuntu2604 | Ubuntu 26.04 rootfs |
|
||||||
| p3 | ext4 | ubuntu2404 | Ubuntu 24.04 rootfs |
|
| p3 | ext4 | arch | Arch rootfs |
|
||||||
| p4 | ext4 | arch | Arch rootfs |
|
| p4 | ext4 | alpine | Alpine rootfs |
|
||||||
| p5 | ext4 | alpine | Alpine rootfs |
|
| p5 | ext4 | cachyos | CachyOS rootfs |
|
||||||
| p6 | ext4 | cachyos | CachyOS rootfs |
|
|
||||||
|
|
||||||
The boot partition contains kexec scripts to switch between distros at runtime. Ubuntu 26.04 is the default boot target.
|
The boot partition contains kexec scripts to switch between distros at runtime. Ubuntu 26.04 is the default boot target.
|
||||||
|
|
||||||
@@ -124,7 +117,6 @@ docker/
|
|||||||
entrypoint.sh # Single-distro build logic
|
entrypoint.sh # Single-distro build logic
|
||||||
entrypoint-multi.sh # Multi-distro build logic
|
entrypoint-multi.sh # Multi-distro build logic
|
||||||
distros/
|
distros/
|
||||||
ubuntu2404/ # Ubuntu 24.04 (Noble)
|
|
||||||
ubuntu2604/ # Ubuntu 26.04 (Resolute)
|
ubuntu2604/ # Ubuntu 26.04 (Resolute)
|
||||||
arch/ # Arch Linux
|
arch/ # Arch Linux
|
||||||
cachyos/ # CachyOS repos + Gamescope/Steam
|
cachyos/ # CachyOS repos + Gamescope/Steam
|
||||||
@@ -133,7 +125,7 @@ distros/
|
|||||||
boot/
|
boot/
|
||||||
cmdline.txt # Kernel cmdline template (__DISTRO__ placeholder)
|
cmdline.txt # Kernel cmdline template (__DISTRO__ placeholder)
|
||||||
vram.txt # VRAM allocation
|
vram.txt # VRAM allocation
|
||||||
kexec-{ubuntu2604,ubuntu2404,arch,alpine,cachyos}.sh
|
kexec-{ubuntu2604,arch,alpine,cachyos}.sh
|
||||||
work/ # Build artifacts (auto-created)
|
work/ # Build artifacts (auto-created)
|
||||||
linux-bin/ # Compiled kernel packages
|
linux-bin/ # Compiled kernel packages
|
||||||
output/ # Final .img files
|
output/ # Final .img files
|
||||||
|
|||||||
@@ -1,6 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
# Switch to Ubuntu 24.04 via kexec
|
|
||||||
set -e
|
|
||||||
BOOT=/boot/efi
|
|
||||||
kexec -l "$BOOT/bzImage" --initrd="$BOOT/initrd-ubuntu2404.img" --command-line="$(cat $BOOT/cmdline-ubuntu2404.txt)"
|
|
||||||
kexec -e
|
|
||||||
@@ -9,13 +9,13 @@ KERNEL_SRC=""
|
|||||||
CLEAN=false
|
CLEAN=false
|
||||||
IMG_SIZE=12000
|
IMG_SIZE=12000
|
||||||
|
|
||||||
MULTI_DISTROS="ubuntu2604 ubuntu2404 arch alpine cachyos"
|
MULTI_DISTROS="ubuntu2604 arch alpine cachyos"
|
||||||
|
|
||||||
usage() {
|
usage() {
|
||||||
echo "Usage: $0 [--distro <distro>] [--kernel <path>] [--img-size <MB>] [--clean]"
|
echo "Usage: $0 [--distro <distro>] [--kernel <path>] [--img-size <MB>] [--clean]"
|
||||||
echo ""
|
echo ""
|
||||||
echo "Options:"
|
echo "Options:"
|
||||||
echo " --distro Distribution to build: ubuntu2604, ubuntu2404, arch, cachyos, alpine, all (default: ubuntu2604)"
|
echo " --distro Distribution to build: ubuntu2604, arch, cachyos, alpine, all (default: ubuntu2604)"
|
||||||
echo " --kernel Path to kernel source directory (default: auto-clone to work/linux/)"
|
echo " --kernel Path to kernel source directory (default: auto-clone to work/linux/)"
|
||||||
echo " --img-size Disk image size in MB (default: 12000, 32000 for --distro all)"
|
echo " --img-size Disk image size in MB (default: 12000, 32000 for --distro all)"
|
||||||
echo " --clean Remove all cached build artifacts and start from scratch"
|
echo " --clean Remove all cached build artifacts and start from scratch"
|
||||||
|
|||||||
@@ -1,13 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
# Grows the root partition and filesystem to fill the disk.
|
|
||||||
# Runs once on first boot, then disables itself.
|
|
||||||
set -e
|
|
||||||
|
|
||||||
ROOT_DEV=$(findmnt -no SOURCE /)
|
|
||||||
DISK=$(lsblk -ndo PKNAME "$ROOT_DEV")
|
|
||||||
PART_NUM=$(cat /sys/class/block/$(basename "$ROOT_DEV")/partition)
|
|
||||||
|
|
||||||
growpart "/dev/$DISK" "$PART_NUM" || true
|
|
||||||
resize2fs "$ROOT_DEV" || true
|
|
||||||
|
|
||||||
systemctl disable grow-rootfs.service
|
|
||||||
@@ -1,13 +0,0 @@
|
|||||||
[Unit]
|
|
||||||
Description=Grow root filesystem to fill disk
|
|
||||||
DefaultDependencies=no
|
|
||||||
Before=local-fs.target
|
|
||||||
After=local-fs-pre.target
|
|
||||||
|
|
||||||
[Service]
|
|
||||||
Type=oneshot
|
|
||||||
ExecStart=/usr/local/sbin/grow-rootfs
|
|
||||||
RemainAfterExit=yes
|
|
||||||
|
|
||||||
[Install]
|
|
||||||
WantedBy=local-fs.target
|
|
||||||
@@ -1,162 +0,0 @@
|
|||||||
image:
|
|
||||||
name: ps5-ubuntu2404
|
|
||||||
distribution: ubuntu
|
|
||||||
release: noble
|
|
||||||
description: Ubuntu Noble desktop
|
|
||||||
architecture: x86_64
|
|
||||||
|
|
||||||
source:
|
|
||||||
downloader: debootstrap
|
|
||||||
url: http://archive.ubuntu.com/ubuntu
|
|
||||||
variant: minbase
|
|
||||||
keyserver: keyserver.ubuntu.com
|
|
||||||
keys:
|
|
||||||
- 0x790BC7277767219C42C86F933B4FE6ACC0B21F32
|
|
||||||
- 0xf6ecb3762474eda9d21b7022871920d1991bc93c
|
|
||||||
|
|
||||||
packages:
|
|
||||||
manager: apt
|
|
||||||
update: true
|
|
||||||
cleanup: true
|
|
||||||
|
|
||||||
repositories:
|
|
||||||
- name: sources.list
|
|
||||||
url: |-
|
|
||||||
deb http://archive.ubuntu.com/ubuntu {{ image.release }} main restricted universe multiverse
|
|
||||||
deb http://archive.ubuntu.com/ubuntu {{ image.release }}-updates main restricted universe multiverse
|
|
||||||
deb http://security.ubuntu.com/ubuntu {{ image.release }}-security main restricted universe multiverse
|
|
||||||
architectures:
|
|
||||||
- amd64
|
|
||||||
|
|
||||||
sets:
|
|
||||||
- packages:
|
|
||||||
- ubuntu-desktop
|
|
||||||
- gnome-software
|
|
||||||
- firefox
|
|
||||||
- openssh-server
|
|
||||||
- build-essential
|
|
||||||
- network-manager
|
|
||||||
- linux-firmware
|
|
||||||
- initramfs-tools
|
|
||||||
- kmod
|
|
||||||
- dialog
|
|
||||||
- sudo
|
|
||||||
- nano
|
|
||||||
- cloud-guest-utils
|
|
||||||
- kexec-tools
|
|
||||||
- fonts-ubuntu
|
|
||||||
- fonts-liberation
|
|
||||||
- fonts-dejavu
|
|
||||||
- fontconfig
|
|
||||||
- systemd-zram-generator
|
|
||||||
- git
|
|
||||||
- flex
|
|
||||||
- gawk
|
|
||||||
- bison
|
|
||||||
- dwarves
|
|
||||||
- libelf-dev
|
|
||||||
- libssl-dev
|
|
||||||
- libncurses-dev
|
|
||||||
action: install
|
|
||||||
|
|
||||||
files:
|
|
||||||
- path: /etc/hostname
|
|
||||||
generator: hostname
|
|
||||||
|
|
||||||
- path: /etc/hosts
|
|
||||||
generator: hosts
|
|
||||||
|
|
||||||
- path: /etc/machine-id
|
|
||||||
generator: dump
|
|
||||||
|
|
||||||
- path: /etc/NetworkManager/conf.d/dns.conf
|
|
||||||
generator: copy
|
|
||||||
source: /tmp/build-staging/nm-dns.conf
|
|
||||||
|
|
||||||
- path: /etc/kernel/postinst.d/zz-update-boot
|
|
||||||
generator: copy
|
|
||||||
source: /tmp/build-staging/zz-update-boot
|
|
||||||
mode: "0755"
|
|
||||||
|
|
||||||
- path: /etc/fstab
|
|
||||||
generator: copy
|
|
||||||
source: /tmp/build-staging/fstab
|
|
||||||
|
|
||||||
- path: /usr/local/sbin/grow-rootfs
|
|
||||||
generator: copy
|
|
||||||
source: /tmp/build-staging/grow-rootfs
|
|
||||||
mode: "0755"
|
|
||||||
|
|
||||||
- path: /etc/systemd/system/grow-rootfs.service
|
|
||||||
generator: copy
|
|
||||||
source: /tmp/build-staging/grow-rootfs.service
|
|
||||||
|
|
||||||
- path: /opt/debs/
|
|
||||||
generator: copy
|
|
||||||
source: /tmp/build-staging/debs
|
|
||||||
|
|
||||||
actions:
|
|
||||||
- trigger: post-unpack
|
|
||||||
action: |-
|
|
||||||
#!/bin/bash
|
|
||||||
set -eux
|
|
||||||
# Clear stale apt lists to avoid InRelease split errors after debootstrap
|
|
||||||
rm -f /var/lib/apt/lists/*InRelease /var/lib/apt/lists/*Release /var/lib/apt/lists/*Packages* || true
|
|
||||||
# Retry up to 10 times on transient 429/network errors
|
|
||||||
echo 'Acquire::Retries "10";' > /etc/apt/apt.conf.d/80retry
|
|
||||||
# Install gnupg + dirmngr so we can fetch the Mozilla PPA key
|
|
||||||
apt-get update
|
|
||||||
apt-get install -y gnupg dirmngr curl
|
|
||||||
|
|
||||||
# Import Mozilla PPA signing key and add repository
|
|
||||||
mkdir -p /root/.gnupg /etc/apt/keyrings
|
|
||||||
chmod 700 /root/.gnupg
|
|
||||||
curl -fsSL "https://keyserver.ubuntu.com/pks/lookup?op=get&search=0x0AB215679C571D1C8325275B9BDB3D89CE49EC21" | \
|
|
||||||
gpg --no-default-keyring --keyring gnupg-ring:/etc/apt/keyrings/mozillateam.gpg --import
|
|
||||||
chmod 644 /etc/apt/keyrings/mozillateam.gpg
|
|
||||||
|
|
||||||
echo "deb [signed-by=/etc/apt/keyrings/mozillateam.gpg] http://ppa.launchpad.net/mozillateam/ppa/ubuntu noble main" \
|
|
||||||
> /etc/apt/sources.list.d/mozilla-ppa.list
|
|
||||||
|
|
||||||
# Pin PPA firefox over snap transitional package
|
|
||||||
cat > /etc/apt/preferences.d/mozilla-ppa << 'PINEOF'
|
|
||||||
Package: firefox*
|
|
||||||
Pin: release o=LP-PPA-mozillateam
|
|
||||||
Pin-Priority: 1001
|
|
||||||
PINEOF
|
|
||||||
|
|
||||||
- trigger: post-update
|
|
||||||
action: |-
|
|
||||||
#!/bin/bash
|
|
||||||
set -eux
|
|
||||||
passwd -l root
|
|
||||||
|
|
||||||
- trigger: post-packages
|
|
||||||
action: |-
|
|
||||||
#!/bin/bash
|
|
||||||
set -eux
|
|
||||||
fc-cache -f -v
|
|
||||||
|
|
||||||
# SSH — password auth only, root login via sudo
|
|
||||||
sed -i 's/^#*PermitRootLogin.*/PermitRootLogin no/' /etc/ssh/sshd_config
|
|
||||||
sed -i 's/^#*PasswordAuthentication.*/PasswordAuthentication yes/' /etc/ssh/sshd_config
|
|
||||||
systemctl enable ssh
|
|
||||||
|
|
||||||
# zram swap: half of RAM, zstd compressed
|
|
||||||
printf '[zram0]\nzram-size = ram / 2\ncompression-algorithm = zstd\n' > /etc/systemd/zram-generator.conf
|
|
||||||
|
|
||||||
- trigger: post-files
|
|
||||||
action: |-
|
|
||||||
#!/bin/bash
|
|
||||||
set -eux
|
|
||||||
systemctl enable grow-rootfs.service
|
|
||||||
systemctl enable systemd-resolved
|
|
||||||
mkdir -p /boot/efi
|
|
||||||
dpkg -i /opt/debs/*.deb
|
|
||||||
rm -rf /opt/debs
|
|
||||||
KVER=$(ls -1t /lib/modules | head -1)
|
|
||||||
update-initramfs -c -k "$KVER"
|
|
||||||
/etc/kernel/postinst.d/zz-update-boot "$KVER"
|
|
||||||
|
|
||||||
mappings:
|
|
||||||
architecture_map: debian
|
|
||||||
@@ -1,2 +0,0 @@
|
|||||||
[main]
|
|
||||||
dns=systemd-resolved
|
|
||||||
@@ -5,7 +5,7 @@ set -ex
|
|||||||
|
|
||||||
IMG_SIZE="${IMG_SIZE:-32000}"
|
IMG_SIZE="${IMG_SIZE:-32000}"
|
||||||
SKIP_CHROOT="${SKIP_CHROOT:-false}"
|
SKIP_CHROOT="${SKIP_CHROOT:-false}"
|
||||||
DISTROS="${DISTROS:-ubuntu2404 ubuntu2604 arch alpine cachyos}"
|
DISTROS="${DISTROS:-ubuntu2604 arch alpine cachyos}"
|
||||||
STAGING="/tmp/build-staging"
|
STAGING="/tmp/build-staging"
|
||||||
EFI_LABEL="boot"
|
EFI_LABEL="boot"
|
||||||
IMG="/output/ps5-multi.img"
|
IMG="/output/ps5-multi.img"
|
||||||
|
|||||||
Reference in New Issue
Block a user