Skip to content

Commit

Permalink
extra: Bump to debian-12 and support efi image for amd64
Browse files Browse the repository at this point in the history
Bug: #42
Origin: #43
Signed-off-by: Philippe Coval <[email protected]>
Change-Id: Ia9d7b91872c0519b162f6ffc793e2747fa00d0ac
  • Loading branch information
rzr committed Apr 4, 2024
1 parent 5bc788e commit 65805b4
Show file tree
Hide file tree
Showing 20 changed files with 74 additions and 47 deletions.
6 changes: 3 additions & 3 deletions extra/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ architecture?=i386

mirror?=https://deb.debian.org/debian
scratchsize?=4G
suite?=bullseye
suite?=bookworm

flags?=-v
flags+=--scratchsize=${scratchsize}
Expand Down Expand Up @@ -82,11 +82,11 @@ rpi_4:
gzip -f -9 $<
stat -c '%y: %n' $@

port?=55522
run: pinball-i386-generic.img
kvm -m 512 \
-device e1000,netdev=net0 \
-netdev user,id=net0,hostfwd=tcp::55522-:22 \
-net nic,model=ne2k_pci -net user \
-netdev user,id=net0,hostfwd=tcp::${port}-:22 \
-machine pc $<

cleanall:
Expand Down
38 changes: 18 additions & 20 deletions extra/debos/machine/generic/actions.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
{{- $architecture := or .architecture "i386" -}}
{{- $bootloader := or .bootloader "grub-pc" -}}
{{- $machine := or .machine "generic" -}}
{{- $partitiontype := or .partitiontype "msdos" -}}
{{- $project := or .project "pinball" -}}
{{- $suite := or .suite "bullseye" -}}
{{- $suite := or .suite "bookworm" -}}
{{- $image := or .image (printf "%s-%s-%s.img" $project $architecture $machine) -}}

architecture: {{$architecture}}
Expand All @@ -11,33 +13,29 @@ actions:
- action: image-partition
imagename: {{$image}}
imagesize: 2GB
partitiontype: msdos
partitiontype: {{$partitiontype}}
mountpoints:
- mountpoint: /
partition: root
{{if eq $bootloader "grub-efi"}}
- mountpoint: /boot/efi
partition: efi
flags: [ boot ]
{{end}}
partitions:
{{if eq $bootloader "grub-efi"}}
- name: efi
fs: vfat
start: 0%
end: 128MB
{{end}}
- name: root
fs: ext4
start: 512
start: 128MB
end: 100%
flags: [boot]

- action: apt
packages:
{{if eq $architecture "i386" "amd64"}}
- grub-pc
{{end}}
{{if eq $suite "unstable" "sid" "testing" "bullseye"}}
- linux-image-generic
{{else}}
{{if eq $suite "buster" "stable"}}
{{if eq $architecture "i386"}}
- linux-image-686
{{else}}
- linux-image-{{$architecture}}
{{end}}
{{end}}
{{end}}
- {{$bootloader}}
- linux-image-{{$machine}}
- firmware-linux-free
- firmware-linux-nonfree

14 changes: 11 additions & 3 deletions extra/debos/machine/generic/image.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{{- $architecture := or .architecture "i386" -}}
{{- $bootloader := or .bootloader "grub-pc" -}}

architecture: {{$architecture}}

Expand All @@ -7,7 +8,14 @@ actions:
description: Install bootloader
chroot: true
command: >
{{if eq $architecture "i386" "amd64"}}
update-grub
&& grub-install /dev/disk/by-id/virtio-fakedisk-0
{{if eq $architecture "i386"}}
update-grub
&& grub-install /dev/disk/by-id/virtio-fakedisk-0
{{else}}
{{if eq $architecture "amd64"}}
update-grub
&& grub-install --target=x86_64-efi --no-nvram
&& mkdir -p /boot/efi/EFI/BOOT
&& cp /boot/efi/EFI/debian/grubx64.efi /boot/efi/EFI/BOOT/BOOTX64.EFI
{{end}}
{{end}}
6 changes: 5 additions & 1 deletion extra/debos/machine/generic/pinball-amd64.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
{{- $architecture := or .architecture "amd64" -}}
{{- $bootloader := or .bootloader "grub-efi" -}}
{{- $machine := or .machine "generic" -}}
{{- $mirror := or .mirror "https://deb.debian.org/debian" -}}
{{- $suite := or .suite "bullseye" -}}
{{- $partitiontype := or .partitiontype "gpt" -}}
{{- $suite := or .suite "bookworm" -}}

architecture: {{$architecture}}

Expand All @@ -11,6 +13,8 @@ actions:
recipe: ../../pinball.yaml
variables:
architecture: {{$architecture}}
bootloader: {{$bootloader}}
machine: {{$machine}}
mirror: {{$mirror}}
partitiontype: {{$partitiontype}}
suite: {{$suite}}
6 changes: 5 additions & 1 deletion extra/debos/machine/generic/pinball-i386.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
{{- $architecture := or .architecture "i386" -}}
{{- $bootloader := or .bootloader "grub-pc" -}}
{{- $machine := or .machine "generic" -}}
{{- $mirror := or .mirror "https://deb.debian.org/debian" -}}
{{- $suite := or .suite "bullseye" -}}
{{- $partitiontype := or .partitiontype "msdos" -}}
{{- $suite := or .suite "bookworm" -}}

architecture: {{$architecture}}

Expand All @@ -11,6 +13,8 @@ actions:
recipe: ../../pinball.yaml
variables:
architecture: {{$architecture}}
bootloader: {{$bootloader}}
machine: {{$machine}}
mirror: {{$mirror}}
partitiontype: {{$partitiontype}}
suite: {{$suite}}
4 changes: 3 additions & 1 deletion extra/debos/machine/rpi_2/actions.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
{{- $kernel := or .kernel "linux-image-armmp" -}}
{{- $machine := or .machine "rpi_2" -}}
{{- $project := or .project "pinball" -}}
{{- $suite := or .suite "bullseye" -}}
{{- $suite := or .suite "bookworm" -}}
{{- $uboot_machine := or .uboot_machine (printf "%s" $machine) -}}
{{- $image := or .image (printf "%s-%s-%s.img" $project $architecture $machine) -}}

Expand Down Expand Up @@ -81,6 +81,8 @@ actions:
| tee -a /boot/firmware/config.txt
&& echo 'upstream_kernel=1'
| tee -a /boot/firmware/config.txt
&& echo 'disable_overscan=1'
| tee -a /boot/firmware/config.txt
&& cat /boot/firmware/config.txt
- action: run
Expand Down
2 changes: 1 addition & 1 deletion extra/debos/machine/rpi_2/pinball-rpi_2.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{{- $architecture := or .architecture "armhf" -}}
{{- $machine := or .machine "rpi_2" -}}
{{- $suite := or .suite "bullseye" -}}
{{- $suite := or .suite "bookworm" -}}
{{- $uboot_machine := or .uboot_machine "rpi_2" -}}

architecture: {{$architecture}}
Expand Down
2 changes: 1 addition & 1 deletion extra/debos/machine/rpi_3_32b/actions.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{{- $architecture := or .architecture "armhf" -}}
{{- $kernel := or .kernel "linux-image-armmp" -}}
{{- $machine := or .machine "rpi_3_32b" -}}
{{- $suite := or .suite "bullseye" -}}
{{- $suite := or .suite "bookworm" -}}
{{- $uboot_machine := or .uboot_machine "rpi_3_32b" -}}

architecture: {{$architecture}}
Expand Down
2 changes: 1 addition & 1 deletion extra/debos/machine/rpi_3_32b/image.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{{- $architecture := or .architecture "armhf" -}}
{{- $kernel := or .kernel "linux-image-armmp" -}}
{{- $machine := or .machine "rpi_3_32b" -}}
{{- $suite := or .suite "bullseye" -}}
{{- $suite := or .suite "bookworm" -}}

architecture: {{$architecture}}

Expand Down
2 changes: 1 addition & 1 deletion extra/debos/machine/rpi_3_32b/pinball-rpi_3_32b.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{{- $architecture := or .architecture "armhf" -}}
{{- $image := or .image "pinball-rpi_3_32b.img" -}}
{{- $machine := or .machine "rpi_3_32b" -}}
{{- $suite := or .suite "bullseye" -}}
{{- $suite := or .suite "bookworm" -}}
{{- $uboot_machine := or .uboot_machine "rpi_3_32b" -}}

architecture: {{$architecture}}
Expand Down
2 changes: 1 addition & 1 deletion extra/debos/machine/rpi_3_64b/actions.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{{- $architecture := or .architecture "arm64" -}}
{{- $kernel := or .kernel "linux-image-generic" -}}
{{- $machine := or .machine "rpi_3_64b" -}}
{{- $suite := or .suite "bullseye" -}}
{{- $suite := or .suite "bookworm" -}}
{{- $uboot_machine := or .uboot_machine "rpi_3" -}}

architecture: {{$architecture}}
Expand Down
2 changes: 1 addition & 1 deletion extra/debos/machine/rpi_3_64b/image.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{{- $architecture := or .architecture "arm64" -}}
{{- $kernel := or .kernel "linux-image-generic" -}}
{{- $machine := or .machine "rpi_3_64b" -}}
{{- $suite := or .suite "bullseye" -}}
{{- $suite := or .suite "bookworm" -}}

architecture: {{$architecture}}

Expand Down
2 changes: 1 addition & 1 deletion extra/debos/machine/rpi_3_64b/pinball-rpi_3_64b.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
{{- $image := or .image "pinball-rpi_3_64b.img" -}}
{{- $kernel := or .kernel "linux-image-generic" -}}
{{- $machine := or .machine "rpi_3_64b" -}}
{{- $suite := or .suite "bullseye" -}}
{{- $suite := or .suite "bookworm" -}}
{{- $uboot_machine := or .uboot_machine "rpi_3" -}}

architecture: {{$architecture}}
Expand Down
2 changes: 1 addition & 1 deletion extra/debos/machine/rpi_4/actions.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{{- $architecture := or .architecture "arm64" -}}
{{- $kernel := or .kernel "linux-image-generic" -}}
{{- $machine := or .machine "rpi_4" -}}
{{- $suite := or .suite "bullseye" -}}
{{- $suite := or .suite "bookworm" -}}
{{- $uboot_machine := or .uboot_machine "rpi4" -}}

architecture: {{$architecture}}
Expand Down
2 changes: 1 addition & 1 deletion extra/debos/machine/rpi_4/image.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{{- $architecture := or .architecture "arm64" -}}
{{- $kernel := or .kernel "linux-image-generic" -}}
{{- $machine := or .machine "rpi_4" -}}
{{- $suite := or .suite "bullseye" -}}
{{- $suite := or .suite "bookworm" -}}

architecture: {{$architecture}}

Expand Down
2 changes: 1 addition & 1 deletion extra/debos/machine/rpi_4/pinball-rpi_4.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{{- $architecture := or .architecture "arm64" -}}
{{- $machine := or .machine "rpi_4" -}}
{{- $mirror := or .mirror "https://deb.debian.org/debian" -}}
{{- $suite := or .suite "bullseye" -}}
{{- $suite := or .suite "bookworm" -}}
{{- $uboot_machine := or .uboot_machine "rpi_4" -}}

architecture: {{$architecture}}
Expand Down
10 changes: 8 additions & 2 deletions extra/debos/pinball.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@
{{- $machine := or .machine "generic" -}}
{{- $mirror := or .mirror "https://deb.debian.org/debian" -}}
{{- $project := or .project "pinball" -}}
{{- $suite := or .suite "bullseye" -}}
{{- $suite := or .suite "bookworm" -}}
{{- $bootloader := or .bootloader "grub-pc" -}}
{{- $partitiontype := or .partitiontype "msdos" -}}
{{- $uboot_machine := or .uboot_machine "generic" -}}
{{- $image := or .image (printf "%s-%s-%s.img" $project $architecture $machine) -}}

Expand All @@ -15,6 +17,7 @@ actions:
components:
- main
- non-free
- non-free-firmware
mirror: {{$mirror}}
variant: minbase

Expand All @@ -24,7 +27,7 @@ actions:
cat /etc/os-release
cat<<EOF
URL: https://purl.org/rzr/pinball#
architecture: {{$architecture}}
image: {{$image}}
machine: {{$machine}}
Expand All @@ -49,6 +52,8 @@ actions:
image: {{$image}}
machine: {{$machine}}
uboot_machine: {{$uboot_machine}}
bootloader: {{$bootloader}}
partitiontype: {{$partitiontype}}

- action: run
chroot: true
Expand Down Expand Up @@ -82,6 +87,7 @@ actions:
recipe: machine/{{$machine}}/image.yaml
variables:
architecture: {{$architecture}}
bootloader: {{$bootloader}}
image: {{$image}}
machine: {{$machine}}
uboot_machine: {{$uboot_machine}}
13 changes: 9 additions & 4 deletions extra/profile/pinball/etc/pinball/pinball-session.sh
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,11 @@ mkdir -p "${HOME}" ||:

echo "# Delay launcher's gap: ${PINBALL_DISPLAY_MANAGER}"
if [ "weston" = "${PINBALL_DISPLAY_MANAGER}" ] ; then
while [ ! -e "${XDG_RUNTIME_DIR}/wayland-0" ] ; do
while ! ls "${XDG_RUNTIME_DIR}/wayland-"* ; do
sleep 1
done
WAYLAND_DISPLAY=$(find "${XDG_RUNTIME_DIR}" -iname "wayland-[0-9]" -exec basename "{}" \; | head -n1)
export WAYLAND_DISPLAY
sleep 5
fi

Expand All @@ -43,8 +45,8 @@ if [ "" = "${PINBALL_SCREEN}" ] ; then
PINBALL_SCREEN=$(grep -n "^${PINBALL_RESOLUTION}$" /sys/class/drm/card*/modes \
| sed -e 's|/sys/class/drm/card[^-]*-\(.*\)/.*|\1|g' \
| sort | head -n1 || echo "TODO")
grep "${PINBALL_RESOLUTION}" /sys/class/drm/card*"-${PINBALL_SCREEN}/modes" ||:
fi
grep "${PINBALL_RESOLUTION}" /sys/class/drm/card*"-${PINBALL_SCREEN}/modes" ||:

if [ ! -z ${DISPLAY} ] ; then # X11
xsetroot -solid "${PINBALL_BGCOLOR}" ||:
Expand Down Expand Up @@ -85,10 +87,13 @@ aplay /usr/share/games/pinball/tux/lock.wav \
|| for id in $(ls /proc/asound/card*/id \
| sed -e 's|/proc/asound/card\(.*\)/id|\1|g' \
) ; do
export ALSA_CARD="$id"
ALSA_CARD="$id" \
aplay /usr/share/games/pinball/tux/bump.wav \
&& break || unset ALSA_CARD
&& break || ALSA_CARD=""
sleep 1
done

[ "" = "${ALSA_CARD}" ] || export ALSA_CARD
echo "# ALSA_CARD=${ALSA_CARD}"
aplay /usr/share/games/pinball/tux/loop.wav ||:

Expand Down
2 changes: 1 addition & 1 deletion extra/profile/pinball/etc/pinball/pinball.env.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ HOME="/tmp/pinball"

# Graphical system : weston or xinit
PINBALL_DISPLAY_MANAGER='weston'
XDG_RUNTIME_DIR='/run/user/0'
#XDG_RUNTIME_DIR='/run/user/0'
#PINBALL_DISPLAY_MANAGER="xinit"
#DISPLAY=':0'
#XINITRC="/etc/pinball/pinball-session.sh"
Expand Down
2 changes: 1 addition & 1 deletion extra/profile/pinball/etc/pinball/weston.service
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Environment="DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/root/dbus/user_bus_soc
ExecStartPre=/usr/bin/sudo /bin/mkdir -p /run/user/0/dbus
ExecStartPre=/usr/bin/sudo /bin/chown -R root:root /run/user/0/dbus
ExecStartPre=/bin/chmod -R 0700 /run/user/0
ExecStart=/usr/bin/openvt -v -w -s -- su root -l -c "/usr/bin/weston-launch -- 2>&1 | tee /var/log/weston.log"
ExecStart=/usr/bin/weston --tty=2

[Install]
Alias=display-manager.service
Expand Down

0 comments on commit 65805b4

Please sign in to comment.