-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add support for bootstrapping Debian
- Loading branch information
Showing
22 changed files
with
243 additions
and
18 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,6 +13,8 @@ apt-get -y install \ | |
fdisk \ | ||
file \ | ||
git \ | ||
gpg \ | ||
mmdebstrap \ | ||
python3 \ | ||
wget \ | ||
xz-utils \ | ||
|
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,8 @@ | ||
root = true | ||
|
||
recipes = [ | ||
"debian-bootstrap", | ||
] | ||
|
||
[parameters."debian-bootstrap"] | ||
suite = "bookworm" |
5 changes: 5 additions & 0 deletions
5
bakery/repositories/core/recipes/debian-bootstrap/recipe.toml
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,5 @@ | ||
description = "bootstrap Debian from scratch" | ||
priority = 10_000_000 | ||
|
||
[parameters] | ||
suite = { default = "stable" } |
8 changes: 8 additions & 0 deletions
8
bakery/repositories/core/recipes/debian-bootstrap/steps/00-run.sh
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,8 @@ | ||
#!/bin/bash | ||
|
||
set -euo pipefail | ||
|
||
mmdebstrap \ | ||
--architectures="${RUGPI_ARCH}" \ | ||
"${RECIPE_PARAM_SUITE}" \ | ||
"${RUGPI_ROOT_DIR}" |
1 change: 1 addition & 0 deletions
1
bakery/repositories/core/recipes/debian-raspberrypi/files/cmdline.txt
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 @@ | ||
console=serial0,115200 console=tty1 rootfstype=ext4 fsck.repair=yes rootwait |
6 changes: 6 additions & 0 deletions
6
bakery/repositories/core/recipes/debian-raspberrypi/files/config.txt
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,6 @@ | ||
# Enable DRM VC4 V3D driver. | ||
dtoverlay=vc4-kms-v3d | ||
max_framebuffers=2 | ||
|
||
# We want to run the processor in its 64-bit mode. | ||
arm_64bit=1 |
30 changes: 30 additions & 0 deletions
30
bakery/repositories/core/recipes/debian-raspberrypi/files/raspberrypi.gpg.key
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,30 @@ | ||
-----BEGIN PGP PUBLIC KEY BLOCK----- | ||
Version: GnuPG v1.4.12 (GNU/Linux) | ||
|
||
mQENBE/d7o8BCACrwqQacGJfn3tnMzGui6mv2lLxYbsOuy/+U4rqMmGEuo3h9m92 | ||
30E2EtypsoWczkBretzLUCFv+VUOxaA6sV9+puTqYGhhQZFuKUWcG7orf7QbZRuu | ||
TxsEUepW5lg7MExmAu1JJzqM0kMQX8fVyWVDkjchZ/is4q3BPOUCJbUJOsE+kK/6 | ||
8kW6nWdhwSAjfDh06bA5wvoXNjYoDdnSZyVdcYCPEJXEg5jfF/+nmiFKMZBraHwn | ||
eQsepr7rBXxNcEvDlSOPal11fg90KXpy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yZQrqO6pU9SRnHRxCFvGv6y+mXXXMRcmjZG7GiD6tQWeN/3wb | ||
EbAn5cg6CJ/Lk/BI4iRRfBX07LbYULCohlGkwBOkRo10T+Ld4vCCnBftCh5x2OtZ | ||
TOWRULxP36y2PLGVNF+q9pho98qx+RIxvpofQM/842ZycjPJvzgVQsW4LT91KYAE | ||
4TVf6JjwUM6HZDoiNcX6d7zOhNfQihXTsniZZ6rky287htsWVDNkqOi5T3oTxWUo | ||
m++/7s3K3L0zWopdhMVcgg6Nt9gcjzqN1c0gy55L/g== | ||
=mNSj | ||
-----END PGP PUBLIC KEY BLOCK----- |
3 changes: 3 additions & 0 deletions
3
bakery/repositories/core/recipes/debian-raspberrypi/files/raspberrypi.list
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,3 @@ | ||
deb http://archive.raspberrypi.com/debian/ RELEASE main | ||
# Uncomment line below then 'apt-get update' to enable 'apt-get source' | ||
#deb-src http://archive.raspberrypi.com/debian/ RELEASE main |
2 changes: 2 additions & 0 deletions
2
bakery/repositories/core/recipes/debian-raspberrypi/recipe.toml
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,2 @@ | ||
description = "setup Debian for Raspberry Pi" | ||
priority = 9_000_000 |
9 changes: 9 additions & 0 deletions
9
bakery/repositories/core/recipes/debian-raspberrypi/steps/00-run.sh
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,9 @@ | ||
#!/bin/bash | ||
|
||
set -euo pipefail | ||
|
||
gpg --dearmor \ | ||
< "${RECIPE_DIR}/files/raspberrypi.gpg.key" \ | ||
> "${RUGPI_ROOT_DIR}/etc/apt/trusted.gpg.d/raspberrypi-archive-stable.gpg" | ||
|
||
chmod 644 "${RUGPI_ROOT_DIR}/etc/apt/trusted.gpg.d/raspberrypi-archive-stable.gpg" |
27 changes: 27 additions & 0 deletions
27
bakery/repositories/core/recipes/debian-raspberrypi/steps/01-install.sh
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,27 @@ | ||
#!/bin/bash | ||
|
||
set -euo pipefail | ||
|
||
install -m 644 "${RECIPE_DIR}/files/raspberrypi.list" "/etc/apt/sources.list.d/" | ||
sed -i "s/RELEASE/bookworm/g" "/etc/apt/sources.list.d/raspberrypi.list" | ||
|
||
apt-get update -y | ||
apt-get install -y raspberrypi-archive-keyring | ||
|
||
apt-get install -y \ | ||
initramfs-tools \ | ||
raspi-firmware \ | ||
linux-image-rpi-v8 \ | ||
linux-headers-rpi-v8 \ | ||
linux-image-rpi-2712 \ | ||
linux-headers-rpi-2712 | ||
|
||
install -m 644 "${RECIPE_DIR}/files/cmdline.txt" "/boot/firmware/" | ||
install -m 644 "${RECIPE_DIR}/files/config.txt" "/boot/firmware/" | ||
|
||
# XXX: Currently Rugpi expects the files for the boot partition to be directly in | ||
# `/boot` as this was the case before Debian Bookworm. Changing this is a breaking | ||
# change of Rugpi. We may do this with the next major release. If that happens, the | ||
# following two lines can/must be removed. | ||
mv /boot/firmware/* /boot | ||
rm -rf /boot/firmware |
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 @@ | ||
openssh-server |
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
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 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 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,23 @@ | ||
parent = "core/debian-bookworm" | ||
|
||
recipes = [ | ||
"core/debian-raspberrypi", | ||
"core/rugpi-ctrl", | ||
"core/set-hostname", | ||
"core/persist-root-home", | ||
"core/ssh", | ||
"core/apt-cleanup", | ||
"rugpi-extra/avahi", | ||
"setup-network", | ||
] | ||
|
||
[parameters."core/set-hostname"] | ||
hostname = "rugpi-bootstrapped" | ||
|
||
[parameters."core/apt-cleanup"] | ||
autoremove = true | ||
|
||
[parameters."core/ssh"] | ||
root_authorized_keys = """ | ||
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQC2tN+ZL8lGnx8rW+vm9ukX1uhKE7GREHitIVxIN3fVh406ksaZzY4FB7JqMqor4SBpR/Eigm6mSSE6KdwSYYC99hakLVvFUG6b6xvB7gOgre8M0JuL9XwBfaUfNln6Hl2Xirlml61JwOWa8Lh+T8mquw9OUK20tkXNPrigVKH+RMQA2V0AQrHnzo9GXMT5HEdAfaVVhL8S1inlKixiPbnvt+nWUSoKGLo+I08w5ZKI88C+saP6VqFiinp57uF0F3oqwcupZe0j6vxGuN5hFg8YGcICFnjXUAVjds8pfcf7aImvYZdp192jC9JAfzx3LzJZLn+kY9hIQkqip/tfTtp56eBb+j9i07PhrDsGiZVNOWf+YG3Cw5Ix6ltOL0dvF1/xFG7O+CGz62w8Y925ytuGgzBkVJ090eznnCjpw+lhNiNFmoqUjiJFjs/VSrqmC5bqdRrqF7YIs61uKl/EyAZaEoHZJazUFFauOjjPK0ksVbAAfqxG4nFmOG0URemSvNE= koehlma@Zaylee | ||
""" |
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,5 @@ | ||
[Match] | ||
Name=en* | ||
|
||
[Network] | ||
DHCP=yes |
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 @@ | ||
description = "setup network" |
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,7 @@ | ||
#!/bin/bash | ||
|
||
set -euo pipefail | ||
|
||
systemctl enable systemd-networkd.service | ||
|
||
install -m 644 "${RECIPE_DIR}/files/dhcp.network" "/etc/systemd/network/" |
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,6 @@ | ||
[repositories] | ||
rugpi-extra = { git = "https://github.com/silitics/rugpi-extra.git", branch = "v0.6" } | ||
|
||
[images.tryboot] | ||
layer = "customized" | ||
include_firmware = "none" |
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,28 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -euo pipefail | ||
|
||
DOCKER=${DOCKER:-"docker"} | ||
DOCKER_FLAGS=${DOCKER_FLAGS:-""} | ||
|
||
RUGPI_DEV=${RUGPI_DEV:-"false"} | ||
|
||
if [ "${RUGPI_DEV}" = "false" ]; then | ||
DOCKER_FLAGS="${DOCKER_FLAGS} --pull always" | ||
RUGPI_VERSION=${RUGPI_VERSION:-"main"} | ||
else | ||
RUGPI_VERSION=${RUGPI_VERSION:-"dev"} | ||
fi | ||
|
||
RUGPI_BAKERY_IMAGE=${RUGPI_BAKERY_IMAGE:-"ghcr.io/silitics/rugpi-bakery:${RUGPI_VERSION}"} | ||
|
||
if [ -t 0 ] && [ -t 1 ]; then | ||
DOCKER_FLAGS="${DOCKER_FLAGS} -it" | ||
fi | ||
|
||
exec $DOCKER run --rm --privileged \ | ||
$DOCKER_FLAGS \ | ||
-v "$(pwd)":/project \ | ||
-v /dev:/dev \ | ||
"${RUGPI_BAKERY_IMAGE}" \ | ||
"$@" |