mirror of
https://github.com/rosalinux/image-builder.git
synced 2025-02-23 10:22:50 +00:00
add rpi5 (also good for rpi4)
This commit is contained in:
parent
90a77dcf26
commit
1e8b3ad3b6
11 changed files with 157 additions and 6 deletions
38
device/raspberry/rpi5/mkosi.conf
Normal file
38
device/raspberry/rpi5/mkosi.conf
Normal file
|
@ -0,0 +1,38 @@
|
||||||
|
[Distribution]
|
||||||
|
Distribution=rosa
|
||||||
|
Release=rosa13
|
||||||
|
Architecture=arm64
|
||||||
|
|
||||||
|
[Output]
|
||||||
|
Format=disk
|
||||||
|
CompressOutput=
|
||||||
|
# RPI firmware does not support
|
||||||
|
# 4k sectors
|
||||||
|
SectorSize=512
|
||||||
|
|
||||||
|
[Content]
|
||||||
|
Packages=
|
||||||
|
kernel-6.12-generic
|
||||||
|
raspberrypi-bootloader
|
||||||
|
coreutils
|
||||||
|
dnf5
|
||||||
|
neovim
|
||||||
|
dracut
|
||||||
|
iproute2
|
||||||
|
locales-en
|
||||||
|
openssh-server
|
||||||
|
rosa-repos
|
||||||
|
systemd
|
||||||
|
|
||||||
|
Bootable=no
|
||||||
|
Autologin=yes
|
||||||
|
RootPassword=root
|
||||||
|
RootShell=/usr/bin/bash
|
||||||
|
Locale=en_US.UTF-8
|
||||||
|
Timezone=Europe/Moscow
|
||||||
|
Hostname=raspberrypi
|
||||||
|
WithDocs=no
|
||||||
|
CleanPackageMetadata=false
|
||||||
|
|
||||||
|
[Build]
|
||||||
|
WithNetwork=yes
|
1
device/raspberry/rpi5/mkosi.extra/boot/cmdline.txt
Normal file
1
device/raspberry/rpi5/mkosi.extra/boot/cmdline.txt
Normal file
|
@ -0,0 +1 @@
|
||||||
|
console=serial0,115200 console=tty1 loglevel=1 root=LABEL=rootfs rootfstype=ext4 fsck.repair=yes
|
49
device/raspberry/rpi5/mkosi.extra/boot/config.txt
Normal file
49
device/raspberry/rpi5/mkosi.extra/boot/config.txt
Normal file
|
@ -0,0 +1,49 @@
|
||||||
|
# For more options and information see
|
||||||
|
# http://rptl.io/configtxt
|
||||||
|
# Some settings may impact device functionality. See link above for details
|
||||||
|
|
||||||
|
# Uncomment some or all of these to enable the optional hardware interfaces
|
||||||
|
#dtparam=i2c_arm=on
|
||||||
|
#dtparam=i2s=on
|
||||||
|
#dtparam=spi=on
|
||||||
|
|
||||||
|
# Enable audio (loads snd_bcm2835)
|
||||||
|
dtparam=audio=on
|
||||||
|
|
||||||
|
# Additional overlays and parameters are documented
|
||||||
|
# /boot/firmware/overlays/README
|
||||||
|
|
||||||
|
# Automatically load overlays for detected cameras
|
||||||
|
camera_auto_detect=1
|
||||||
|
|
||||||
|
# Automatically load overlays for detected DSI displays
|
||||||
|
display_auto_detect=1
|
||||||
|
|
||||||
|
# Automatically load initramfs files, if found
|
||||||
|
auto_initramfs=1
|
||||||
|
|
||||||
|
# Enable DRM VC4 V3D driver
|
||||||
|
dtoverlay=vc4-kms-v3d
|
||||||
|
max_framebuffers=2
|
||||||
|
|
||||||
|
# Don't have the firmware create an initial video= setting in cmdline.txt.
|
||||||
|
# Use the kernel's default instead.
|
||||||
|
disable_fw_kms_setup=1
|
||||||
|
|
||||||
|
# Disable compensation for displays with overscan
|
||||||
|
disable_overscan=1
|
||||||
|
|
||||||
|
# Run as fast as firmware / board allows
|
||||||
|
arm_boost=1
|
||||||
|
|
||||||
|
[cm4]
|
||||||
|
# Enable host mode on the 2711 built-in XHCI USB controller.
|
||||||
|
# This line should be removed if the legacy DWC2 controller is required
|
||||||
|
# (e.g. for USB device mode) or if USB support is not required.
|
||||||
|
otg_mode=1
|
||||||
|
|
||||||
|
[cm5]
|
||||||
|
dtoverlay=dwc2,dr_mode=host
|
||||||
|
|
||||||
|
[all]
|
||||||
|
arm_64bit=1
|
|
@ -0,0 +1,4 @@
|
||||||
|
# grow up rootfs on first boot
|
||||||
|
[Partition]
|
||||||
|
Type=root
|
||||||
|
GrowFileSystem=yes
|
|
@ -0,0 +1,10 @@
|
||||||
|
[Match]
|
||||||
|
Type=ether
|
||||||
|
|
||||||
|
[Network]
|
||||||
|
DHCP=yes
|
||||||
|
LinkLocalAddressing=yes
|
||||||
|
MulticastDNS=yes
|
||||||
|
|
||||||
|
[DHCPv4]
|
||||||
|
ClientIdentifier=mac
|
|
@ -0,0 +1,5 @@
|
||||||
|
[Unit]
|
||||||
|
ConditionFirstBoot=true
|
||||||
|
|
||||||
|
[Install]
|
||||||
|
WantedBy=multi-user.target
|
|
@ -0,0 +1,7 @@
|
||||||
|
enable sshd.service
|
||||||
|
enable systemd-networkd.service
|
||||||
|
enable systemd-growfs-root.service
|
||||||
|
|
||||||
|
# We install dnf in some images but it's only going to be used rarely,
|
||||||
|
# so let's not have dnf create its cache.
|
||||||
|
disable dnf-makecache.*
|
22
device/raspberry/rpi5/mkosi.postinst.d/10-boot.sh
Executable file
22
device/raspberry/rpi5/mkosi.postinst.d/10-boot.sh
Executable file
|
@ -0,0 +1,22 @@
|
||||||
|
#!/bin/bash
|
||||||
|
# Find vmlinuz and initrd files in the /boot directory
|
||||||
|
vmlinuz_file=$(find ${BUILDROOT}/boot -name 'vmlinuz-*' -type f | head -n 1)
|
||||||
|
initrd_file=$(find ${BUILDROOT}/boot -name 'initrd-*.img' -type f | head -n 1)
|
||||||
|
|
||||||
|
# Check if both files were found
|
||||||
|
if [[ -z "$vmlinuz_file" || -z "$initrd_file" ]]; then
|
||||||
|
printf "Error: vmlinuz or initrd files not found in /boot.\n"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Extract the base names of the files (without the directory path)
|
||||||
|
kernel_name=$(basename "$vmlinuz_file")
|
||||||
|
initrd_name=$(basename "$initrd_file")
|
||||||
|
|
||||||
|
# Append the required lines to /boot/config.txt
|
||||||
|
{
|
||||||
|
printf "kernel=%s\n" "$kernel_name"
|
||||||
|
printf "initramfs %s followkernel\n" "$initrd_name"
|
||||||
|
} >> ${BUILDROOT}/boot/config.txt
|
||||||
|
|
||||||
|
printf "The kernel and initrd entries have been added to /boot/config.txt.\n"
|
7
device/raspberry/rpi5/mkosi.repart/00-boot.conf
Normal file
7
device/raspberry/rpi5/mkosi.repart/00-boot.conf
Normal file
|
@ -0,0 +1,7 @@
|
||||||
|
[Partition]
|
||||||
|
Type=esp
|
||||||
|
Label=bootfs
|
||||||
|
Format=vfat
|
||||||
|
CopyFiles=/boot/:/
|
||||||
|
SizeMinBytes=256M
|
||||||
|
SizeMaxBytes=256M
|
7
device/raspberry/rpi5/mkosi.repart/10-root.conf
Normal file
7
device/raspberry/rpi5/mkosi.repart/10-root.conf
Normal file
|
@ -0,0 +1,7 @@
|
||||||
|
[Partition]
|
||||||
|
Type=root
|
||||||
|
Label=rootfs
|
||||||
|
Format=ext4
|
||||||
|
CopyFiles=/
|
||||||
|
ExcludeFiles=/boot/firmware
|
||||||
|
Minimize=guess
|
|
@ -8,9 +8,16 @@ Distribution=rosa
|
||||||
Release=rosa13
|
Release=rosa13
|
||||||
Architecture=arm64
|
Architecture=arm64
|
||||||
|
|
||||||
|
[Build]
|
||||||
|
WithNetwork=yes
|
||||||
|
BuildSources=./:mkosi
|
||||||
|
./mkosi.images/u-boot/configuration:configuration
|
||||||
|
|
||||||
[Output]
|
[Output]
|
||||||
Format=disk
|
Format=disk
|
||||||
CompressOutput=
|
CompressOutput=
|
||||||
|
# nand u-boot does not support
|
||||||
|
# 4k sectors
|
||||||
SectorSize=512
|
SectorSize=512
|
||||||
|
|
||||||
[Content]
|
[Content]
|
||||||
|
@ -36,9 +43,3 @@ Timezone=Europe/Moscow
|
||||||
Hostname=elara
|
Hostname=elara
|
||||||
WithDocs=no
|
WithDocs=no
|
||||||
CleanPackageMetadata=false
|
CleanPackageMetadata=false
|
||||||
|
|
||||||
[Build]
|
|
||||||
WithNetwork=yes
|
|
||||||
|
|
||||||
BuildSources=./:mkosi
|
|
||||||
./mkosi.images/u-boot/configuration:configuration
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue