Skip to content
Snippets Groups Projects
Verified Commit 357a7c25 authored by Louis's avatar Louis :fire:
Browse files

Add build configs for Picade

parent 2c469576
No related branches found
No related tags found
No related merge requests found
Pipeline #137 passed with stages
in 3 minutes and 4 seconds
...@@ -7,4 +7,9 @@ ...@@ -7,4 +7,9 @@
.idea/ .idea/
.vscode/ .vscode/
dist/ dist/
\ No newline at end of file
*.img
.packer_cache
*.dtbo
wpa_supplicant.conf
\ No newline at end of file
...@@ -53,6 +53,17 @@ build-web: top_tail ...@@ -53,6 +53,17 @@ build-web: top_tail
clean_dist: clean_dist:
rm -rf ./dist rm -rf ./dist
cabinet-builder:
docker build -t mhrf/cabinet-builder -f build/cabinet/builder.dockerfile build/cabinet
cabinet:
docker run --rm --privileged \
-v "$(CURRENT_DIRECTORY)/.packer_cache":/root/.cache/packer \
-v /dev:/dev \
-v $(CURRENT_DIRECTORY):/build \
-e DTBO_DEST=/build/build/cabinet \
mhrf/cabinet-builder build build/cabinet/cabinetos.json
top_tail: top_tail:
@echo "================================================" @echo "================================================"
@echo " Building ${PROJECT_NAME}" @echo " Building ${PROJECT_NAME}"
......
pcm.real {
type hw
card 0
device 0
}
pcm.dmixer {
type dmix
ipc_key 1024
ipc_perm 0666
slave.pcm "real"
slave {
period_time 0
period_size 1024
buffer_size 8192
rate 44100
}
bindings {
0 0
1 1
}
}
ctl.dmixer {
type hw
card 0
}
pcm.softvol {
type softvol
slave.pcm "dmixer"
control {
name "PCM" # Masquerade as the default "PCM" sound device on Pi
card 0
}
}
pcm.!default {
type plug
slave.pcm "softvol"
}
\ No newline at end of file
[Unit]
Description=Autostart Realm Fantastique On Boot
[Service]
Environment=DISPLAY=:0
ExecStart=/var/game/game_core
WorkingDirectory=/var/game/game_core
Restart=always
RestartSec=10s
KillMode=process
TimeoutSec=infinity
[Install]
WantedBy=graphical.target
\ No newline at end of file
FROM mkaczanowski/packer-builder-arm
RUN apt-get -yqq update && \
apt-get install -yqq git device-tree-compiler build-essential make && \
rm -rf /var/lib/apt/lists/*
WORKDIR /deps
RUN git clone --depth=1 https://github.com/pimoroni/picade-hat.git . && \
make
WORKDIR /build
# ENV DTBO_DEST "/build"
RUN touch "/shim.sh" && \
chmod u+x "/shim.sh" && \
echo '#!/usr/bin/env sh' >> "/shim.sh" && \
echo 'cp /deps/picade.dtbo $DTBO_DEST/picade.dtbo' >> "/shim.sh" && \
echo 'bash /entrypoint.sh $@' >> "/shim.sh"
ENTRYPOINT ["/shim.sh"]
\ No newline at end of file
{
"variables": {},
"builders": [{
"type": "arm",
"file_urls" : ["https://downloads.raspberrypi.org/raspios_arm64/images/raspios_arm64-2022-04-07/2022-04-04-raspios-bullseye-arm64.img.xz"],
"file_checksum_url": "https://downloads.raspberrypi.org/raspios_arm64/images/raspios_arm64-2022-04-07/2022-04-04-raspios-bullseye-arm64.img.xz.sha256",
"file_checksum_type": "sha256",
"file_target_extension": "xz",
"file_unarchive_cmd": ["xz", "-d", "$ARCHIVE_PATH"],
"image_build_method": "resize",
"image_path": "cabinetos.img",
"image_size": "4G",
"image_type": "dos",
"image_partitions": [
{
"name": "boot",
"type": "c",
"start_sector": "8192",
"filesystem": "vfat",
"size": "256M",
"mountpoint": "/boot"
},
{
"name": "root",
"type": "83",
"start_sector": "532480",
"filesystem": "ext4",
"size": "0",
"mountpoint": "/"
}
],
"image_chroot_env": ["PATH=/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin:/bin:/sbin"],
"qemu_binary_source_path": "/usr/bin/qemu-arm-static",
"qemu_binary_destination_path": "/usr/bin/qemu-arm-static"
}],
"provisioners": [
{
"type": "shell",
"inline": [
"touch /boot/ssh"
]
},
{
"type": "shell",
"inline": [
"apt-get -qq update",
"apt-get -y upgrade",
"apt-get install -y mesa-vulkan-drivers libvulkan-dev libvulkan1 vulkan-tools"
]
},
{
"type": "file",
"source": "build/cabinet/userconf.txt",
"destination": "/boot/userconf.txt"
},
{
"type": "file",
"source": "build/cabinet/config.txt",
"destination": "/boot/config.txt"
},
{
"type": "file",
"source": "build/cabinet/picade.dtbo",
"destination": "/boot/overlays/picade.dtbo"
},
{
"type": "file",
"source": "build/cabinet/asound.conf",
"destination": "/etc/asound.conf"
},
{
"type": "file",
"source": "build/cabinet/picade.udev.rules",
"destination": "/etc/udev/rules.d/10-picade.rules"
},
{
"type": "file",
"source": "build/cabinet/autoboot.service",
"destination": "/etc/systemd/system/game_core.service"
},
{
"type": "file",
"source": "build/cabinet/wpa_supplicant.conf",
"destination": "/etc/wpa_supplicant.conf"
},
{
"type": "shell",
"inline": [
"cd /var",
"wget -O game.zip https://lab.lcr.gr/microhacks/fantastqiue/-/jobs/artifacts/trunk/raw/dist/linux.arm64.zip?job=package-all",
"mkdir game",
"unzip game.zip -d game",
"mv game/game_core.arm64 game/game_core"
]
},
{
"type": "shell",
"inline": [
"rm /etc/xdg/autostart/piwiz.desktop",
"rm /etc/xdg/autostart/pprompt.desktop"
]
}
]
}
hdmi_force_hotplug=1
# Additional overlays and parameters are documented /boot/overlays/README
# Configure cabinet buttons
dtoverlay=picade
dtparam=up=17 # W
dtparam=down=31 # S
dtparam=left=30 # A
dtparam=right=32 # D
dtparam=button1=22 # U
dtparam=button2=23 # I
dtparam=button3=24 # O
dtparam=button4=36 # J
dtparam=button5=37 # K
dtparam=button6=38 # L
dtparam=enter=28 # Enter Key
dtparam=escape=1 # Escape Key
dtparam=coin=42 # Left Shift
dtparam=start=29 # Left Control
# Enable audio (loads snd_bcm2835)
dtparam=audio=on
# Automatically load overlays for detected cameras
camera_auto_detect=1
# Automatically load overlays for detected DSI displays
display_auto_detect=1
# Enable DRM VC4 V3D driver
dtoverlay=vc4-kms-v3d
max_framebuffers=2
# Run in 64-bit mode
arm_64bit=1
# Disable compensation for displays with overscan
disable_overscan=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
[all]
[pi4]
# Run as fast as firmware / board allows
arm_boost=1
[all]
\ No newline at end of file
SUBSYSTEM=="input", ATTRS{name}=="gpio_keys", ENV{ID_INPUT_KEYBOARD}="1"
\ No newline at end of file
pi:$6$bevy$gFy/K.UcTH6QpahcMQMOCfBuKUnX2lSwVqYg9CSkCDtWBmmcKt4BaFESMzJFTStGfjrCxeU5sgWfxt5KRfACZ/
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment