-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #19 from go-debos/wip/d4s/rpi64
Arm64 unified recipe for Raspberry Pi 3 and 4
- Loading branch information
Showing
10 changed files
with
173 additions
and
123 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,167 @@ | ||
{{- $firmware_version := or .firmware_version "1.20201022" -}} | ||
{{- $mirror := or .mirror "http://deb.debian.org/debian" -}} | ||
{{- $suite := or .suite "bullseye" -}} | ||
{{- $kernel := or .kernel "linux-image-arm64" -}} | ||
{{- $cmdline := or .cmdline " rootwait ro fsck.mode=auto fsck.repair=yes console=ttyS1,115200" -}} | ||
{{- $image := or .image "debian-rpi64.img" -}} | ||
|
||
architecture: arm64 | ||
|
||
actions: | ||
{{ if ne $firmware_version "debian" }} | ||
# Download all needed proprietary stuff first | ||
- action: download | ||
description: Download latest version of the firmware from GitHub | ||
url: http://github.com/raspberrypi/firmware/archive/{{ $firmware_version }}.tar.gz | ||
unpack: true # Unpack downloaded file | ||
name: firmware # name for usage directory with unpacked content in other actions | ||
{{ end }} | ||
|
||
- action: debootstrap | ||
suite: {{ $suite }} | ||
components: | ||
- main | ||
- non-free | ||
mirror: {{ $mirror }} | ||
variant: minbase | ||
|
||
- action: apt | ||
description: Install extra packages | ||
packages: | ||
- adduser | ||
- bluetooth | ||
- ca-certificates | ||
- dbus-user-session | ||
- iproute2 | ||
- i2c-tools | ||
- libnss-resolve | ||
- openssh-server | ||
- sudo | ||
- systemd-sysv | ||
- u-boot-menu | ||
- u-boot-rpi | ||
- vim-tiny | ||
|
||
- action: overlay | ||
description: Install U-Boot menu configuration | ||
source: overlays/u-boot-menu | ||
|
||
- action: apt | ||
description: Install kernel and firmware packages for RPi | ||
packages: | ||
- {{ $kernel}} | ||
- firmware-brcm80211 | ||
- rpi.gpio-common | ||
|
||
- action: overlay | ||
description: Copy config.txt | ||
source: overlays/fw-config | ||
destination: /boot/firmware | ||
|
||
- action: run | ||
description: Install U-Boot | ||
chroot: false | ||
command: sh -c "cp -av ${ROOTDIR}/usr/lib/u-boot/rpi_arm64/u-boot.bin ${ROOTDIR}/boot/firmware/" | ||
|
||
- action: run | ||
description: Copy DTBs for the kernel | ||
chroot: false | ||
command: sh -c "mkdir -p ${ROOTDIR}/boot/dtbs; cp -rav ${ROOTDIR}/usr/lib/linux-image-*-arm64/broadcom ${ROOTDIR}/boot/dtbs/" | ||
|
||
{{ if ne $firmware_version "debian" }} | ||
- action: overlay | ||
description: Install RPi boot firmware ({{ $firmware_version }}) | ||
origin: firmware | ||
source: firmware-{{ $firmware_version }}/boot | ||
destination: /boot/firmware | ||
|
||
{{ else }} | ||
- action: apt | ||
description: Install RPi firmware package | ||
packages: | ||
- raspi-firmware | ||
|
||
- action: run | ||
description: Install RPi boot firmware (Debian) | ||
chroot: false | ||
command: sh -c "cp -av ${ROOTDIR}/usr/lib/raspi-firmware/* ${ROOTDIR}/boot/firmware/" | ||
|
||
- action: run | ||
description: Copy DTBs from the kernel | ||
chroot: false | ||
command: sh -c "cp -av ${ROOTDIR}/usr/lib/linux-image-*-arm64/broadcom/* ${ROOTDIR}/boot/firmware/" | ||
|
||
- action: run | ||
description: Use upstream DTBs naming | ||
chroot: false | ||
command: sh -c "echo upstream_kernel=1 >> ${ROOTDIR}/boot/firmware/config.txt" | ||
|
||
# Do not need to keep firmware package after firmware partition setup. | ||
# raspi-firmware contains kernel postinstall script incompatible with U-Boot | ||
- action: run | ||
description: Remove RPi firmware package | ||
chroot: true | ||
command: dpkg -P raspi-firmware | ||
{{ end }} | ||
|
||
- action: run | ||
description: Cleanup firmware partition | ||
chroot: false | ||
command: sh -c "rm -rf ${ROOTDIR}/boot/firmware/kernel* ${ROOTDIR}/boot/firmware/vmlinuz* ${ROOTDIR}/boot/firmware/initrd.img*" | ||
|
||
- action: run | ||
description: Set up user | ||
chroot: true | ||
script: scripts/setup-user.sh | ||
|
||
- action: run | ||
description: Add hostname | ||
chroot: true | ||
command: echo rpi64 > /etc/hostname | ||
|
||
- action: overlay | ||
description: Autoload modules | ||
source: overlays/modules | ||
|
||
- action: overlay | ||
source: overlays/networkd | ||
|
||
- action: run | ||
chroot: true | ||
script: scripts/setup-networking.sh | ||
|
||
- action: image-partition | ||
imagename: {{ $image }} | ||
imagesize: 4GB | ||
partitiontype: msdos | ||
mountpoints: | ||
- mountpoint: / | ||
partition: root | ||
- mountpoint: /boot/firmware | ||
partition: firmware | ||
options: [ x-systemd.automount ] | ||
partitions: | ||
- name: firmware | ||
fs: fat32 | ||
start: 0% | ||
end: 64MB | ||
- name: root | ||
fs: ext4 | ||
start: 64MB | ||
end: 100% | ||
flags: [ boot ] | ||
|
||
- action: filesystem-deploy | ||
description: Deploying filesystem onto image | ||
setup-kernel-cmdline: true | ||
append-kernel-cmdline: {{ $cmdline }} | ||
|
||
- action: run | ||
description: Create block map file | ||
postprocess: true | ||
command: bmaptool create {{ $image }} > {{ $image }}.bmap | ||
|
||
- action: run | ||
description: Compressing final image | ||
postprocess: true | ||
command: gzip -f {{ $image }} |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
i2c-dev |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.