-
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.
chore: improve builtin recipes and layers
- Loading branch information
Showing
47 changed files
with
290 additions
and
120 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 |
---|---|---|
@@ -0,0 +1,8 @@ | ||
root = true | ||
|
||
recipes = [ | ||
"alpine-bootstrap", | ||
] | ||
|
||
[parameters."alpine-bootstrap"] | ||
version = "3.20" |
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 |
---|---|---|
@@ -1,2 +1,2 @@ | ||
name = "Raspberry Pi OS (Bookworm)" | ||
url = "https://downloads.raspberrypi.com/raspios_lite_arm64/images/raspios_lite_arm64-2023-12-11/2023-12-11-raspios-bookworm-arm64-lite.img.xz" | ||
url = "https://downloads.raspberrypi.com/raspios_lite_arm64/images/raspios_lite_arm64-2024-03-15/2024-03-15-raspios-bookworm-arm64-lite.img.xz" |
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 |
---|---|---|
@@ -1,2 +1,2 @@ | ||
name = "Raspberry Pi OS (Bookworm)" | ||
url = "https://downloads.raspberrypi.com/raspios_lite_armhf/images/raspios_lite_armhf-2023-12-11/2023-12-11-raspios-bookworm-armhf-lite.img.xz" | ||
url = "https://downloads.raspberrypi.com/raspios_lite_armhf/images/raspios_lite_armhf-2024-03-15/2024-03-15-raspios-bookworm-armhf-lite.img.xz" |
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 |
---|---|---|
@@ -1,2 +1,2 @@ | ||
name = "Raspberry Pi OS (Bullseye)" | ||
url = "https://downloads.raspberrypi.com/raspios_oldstable_lite_arm64/images/raspios_oldstable_lite_arm64-2023-12-06/2023-12-05-raspios-bullseye-arm64-lite.img.xz" | ||
url = "https://downloads.raspberrypi.com/raspios_oldstable_lite_arm64/images/raspios_oldstable_lite_arm64-2024-03-12/2024-03-12-raspios-bullseye-arm64-lite.img.xz" |
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 |
---|---|---|
@@ -1,2 +1,2 @@ | ||
name = "Raspberry Pi OS (Bullseye)" | ||
url = "https://downloads.raspberrypi.com/raspios_oldstable_lite_armhf/images/raspios_oldstable_lite_armhf-2023-12-06/2023-12-05-raspios-bullseye-armhf-lite.img.xz" | ||
url = "https://downloads.raspberrypi.com/raspios_oldstable_lite_armhf/images/raspios_oldstable_lite_armhf-2024-03-12/2024-03-12-raspios-bullseye-armhf-lite.img.xz" |
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
3 changes: 3 additions & 0 deletions
3
bakery/repositories/core/recipes/alpine-grub-setup/files/second.grub.cfg
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 @@ | ||
linux /vmlinuz ro modules=sd-mod,usb-storage,ext4,vfat init=/usr/bin/rugpi-ctrl root=/dev/sda${rugpi_syspart} | ||
initrd /initrd.img | ||
boot |
5 changes: 5 additions & 0 deletions
5
bakery/repositories/core/recipes/alpine-grub-setup/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 = "setup Alpine for `generic-grub-*` targets" | ||
dependencies = [] | ||
|
||
[parameters] | ||
with_firmware = { default = "true" } |
24 changes: 24 additions & 0 deletions
24
bakery/repositories/core/recipes/alpine-grub-setup/steps/00-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,24 @@ | ||
#!/bin/sh | ||
|
||
set -eu | ||
|
||
apk update | ||
|
||
BOOT_DIR="${RUGPI_LAYER_DIR}/boot" | ||
|
||
mkdir -p "${BOOT_DIR}" | ||
|
||
echo "Installing kernel..." | ||
apk add linux-lts | ||
|
||
if [ "${RECIPE_PARAM_WITH_FIRMWARE}" = "true" ]; then | ||
echo "Installing firmware..." | ||
apk add linux-firmware | ||
fi | ||
|
||
echo "Copying kernel and initrd..." | ||
cp -L /boot/vmlinuz-lts "${BOOT_DIR}/vmlinuz" | ||
cp -L /boot/initramfs-lts "${BOOT_DIR}/initrd.img" | ||
|
||
echo "Installing second stage boot script..." | ||
cp "${RECIPE_DIR}/files/second.grub.cfg" "${BOOT_DIR}" |
12 changes: 0 additions & 12 deletions
12
bakery/repositories/core/recipes/apt-cleanup/steps/00-install.sh
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
7 changes: 0 additions & 7 deletions
7
bakery/repositories/core/recipes/apt-update/steps/00-install.sh
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
7 changes: 0 additions & 7 deletions
7
bakery/repositories/core/recipes/apt-upgrade/steps/00-install.sh
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
3 changes: 3 additions & 0 deletions
3
bakery/repositories/core/recipes/debian-grub-setup/files/second.grub.cfg
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 @@ | ||
linux /vmlinuz ro init=/usr/bin/rugpi-ctrl root=/dev/sda${rugpi_syspart} | ||
initrd /initrd.img | ||
boot |
6 changes: 6 additions & 0 deletions
6
bakery/repositories/core/recipes/debian-grub-setup/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,6 @@ | ||
description = "setup Debian for `generic-grub-*` targets" | ||
dependencies = [] | ||
|
||
[parameters] | ||
with_firmware = { default = "true" } | ||
with_nonfree = { default = "true" } |
51 changes: 51 additions & 0 deletions
51
bakery/repositories/core/recipes/debian-grub-setup/steps/00-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,51 @@ | ||
#!/bin/bash | ||
|
||
set -euo pipefail | ||
|
||
apt-get update -y | ||
|
||
BOOT_DIR="${RUGPI_LAYER_DIR}/boot" | ||
|
||
mkdir -p "${BOOT_DIR}" | ||
|
||
echo "Installing kernel..." | ||
case "${RUGPI_ARCH}" in | ||
"amd64") | ||
apt-get install -y \ | ||
linux-image-amd64 \ | ||
linux-headers-amd64 | ||
;; | ||
"arm64") | ||
apt-get install -y \ | ||
linux-image-arm64 \ | ||
linux-headers-arm64 | ||
;; | ||
*) | ||
echo "Unsupported architecture '${RUGPI_ARCH}'." | ||
exit 1 | ||
esac | ||
|
||
if [ "${RECIPE_PARAM_WITH_FIRMWARE}" == "true" ]; then | ||
echo "Installing free firmware..." | ||
apt-get install -y firmware-linux-free | ||
fi | ||
|
||
if [ "${RECIPE_PARAM_WITH_NONFREE}" == "true" ]; then | ||
# Make sure that the non-free sources are available. | ||
sed -i '/main/!b; /non-free/b; s/$/ non-free/' /etc/apt/sources.list | ||
sed -i '/main/!b; /non-free-firmware/b; s/$/ non-free-firmware/' /etc/apt/sources.list | ||
|
||
apt-get update -y | ||
|
||
if [ "${RECIPE_PARAM_WITH_FIRMWARE}" == "true" ]; then | ||
echo "Installing nonfree firmware..." | ||
apt-get install -y firmware-linux | ||
fi | ||
fi | ||
|
||
echo "Copying kernel and initrd..." | ||
cp -L /vmlinuz "${BOOT_DIR}" | ||
cp -L /initrd.img "${BOOT_DIR}" | ||
|
||
echo "Installing second stage boot script..." | ||
cp "${RECIPE_DIR}/files/second.grub.cfg" "${BOOT_DIR}" |
2 changes: 1 addition & 1 deletion
2
...ries/core/recipes/apt-cleanup/recipe.toml → ...ries/core/recipes/pkg-cleanup/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
18 changes: 18 additions & 0 deletions
18
bakery/repositories/core/recipes/pkg-cleanup/steps/00-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,18 @@ | ||
#!/bin/sh | ||
|
||
set -eu | ||
|
||
if [ "${RECIPE_PARAM_AUTOREMOVE}" = "true" ]; then | ||
if command -v apt-get; then | ||
apt-get autoremove -y | ||
fi | ||
fi | ||
|
||
if command -v apt-get; then | ||
apt-get clean -y | ||
rm -rf /var/lib/apt/lists/* | ||
fi | ||
|
||
if command -v apk; then | ||
rm -rf /var/cache/apk/* | ||
fi |
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 @@ | ||
description = "update package lists" | ||
priority = 900_000 # Execute before everything else. | ||
dependencies = ["pkg-cleanup"] |
11 changes: 11 additions & 0 deletions
11
bakery/repositories/core/recipes/pkg-update/steps/00-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,11 @@ | ||
#!/bin/sh | ||
|
||
set -eu | ||
|
||
if command -v apt-get; then | ||
apt-get update -y | ||
fi | ||
|
||
if command -v apk; then | ||
apk update | ||
fi |
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 @@ | ||
description = "upgrade all packages" | ||
priority = 899_900 # Execute before everything else but after `pkg-update`. | ||
dependencies = ["pkg-update"] |
11 changes: 11 additions & 0 deletions
11
bakery/repositories/core/recipes/pkg-upgrade/steps/00-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,11 @@ | ||
#!/bin/sh | ||
|
||
set -eu | ||
|
||
if command -v apt-get; then | ||
apt-get upgrade -y | ||
fi | ||
|
||
if command -v apk; then | ||
apk upgrade | ||
fi |
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 |
---|---|---|
@@ -1,2 +1,2 @@ | ||
description = "Raspberry Pi meta recipe" | ||
dependencies = ["pi-cleanup", "persist-fake-hwclock", "disable-swap", "rugpi-ctrl", "apt-upgrade"] | ||
dependencies = ["rpi-raspios-cleanup", "persist-fake-hwclock"] |
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 |
---|---|---|
@@ -1,5 +1,6 @@ | ||
description = "install and configure Rugpi Ctrl" | ||
priority = 700_000 # Execute very early. | ||
dependencies = ["pkg-update"] | ||
|
||
[parameters] | ||
rugpi_admin = { default = false } |
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 |
---|---|---|
@@ -1,3 +1,11 @@ | ||
parent = "alpine-base" | ||
# We use Alpine Linux 3.20 as a basis. | ||
parent = "core/alpine-3-20" | ||
|
||
recipes = ["setup"] | ||
recipes = [ | ||
# Setup Alpine for booting via Grub. | ||
"core/alpine-grub-setup", | ||
# Install Rugpi Ctrl into the image. | ||
"core/rugpi-ctrl", | ||
# Install a static website. | ||
"hello-world", | ||
] |
32 changes: 32 additions & 0 deletions
32
bakery/templates/alpine-grub-efi/recipes/hello-world/html/index.html
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,32 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<meta charset="utf-8"> | ||
|
||
<title>Rugpi: Hello World!</title> | ||
|
||
<style> | ||
@import url('https://fonts.googleapis.com/css2?family=Fira+Sans&display=swap'); | ||
|
||
html, body { | ||
background: #5dabf5; | ||
width: 100%; | ||
height: 100%; | ||
display: flex; | ||
flex-direction: column; | ||
justify-content: center; | ||
align-items: center; | ||
font-family: 'Fira Sans', sans-serif; | ||
} | ||
|
||
p { | ||
text-align: center; | ||
max-width: 80ch; | ||
} | ||
</style> | ||
</head> | ||
<body> | ||
<h1>Hello World! 👋</h1> | ||
<p>This is an example static web site served from a customized Rugpi system.</p> | ||
</body> | ||
</html> |
5 changes: 5 additions & 0 deletions
5
bakery/templates/alpine-grub-efi/recipes/hello-world/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 = "example recipe for installing a static website" | ||
dependencies = [ | ||
# Update the package lists such that we can install Nginx. | ||
"core/pkg-update" | ||
] |
Oops, something went wrong.