diff --git a/device/device-raspberry-pi/APKBUILD b/device/device-raspberry-pi/APKBUILD index e50122227..c7ae757ab 100644 --- a/device/device-raspberry-pi/APKBUILD +++ b/device/device-raspberry-pi/APKBUILD @@ -29,14 +29,14 @@ package() { } kernel_rpi() { - pkgdesc="Kernel for the Raspberry Pi Zero & 1 (from Alpine, depends on non free firmware!)" + pkgdesc="Kernel for the Raspberry Pi 1 (from Alpine, depends on non free firmware!)" depends="$pkgname linux-rpi" install="$subpkgname.post-install" mkdir "$subpkgdir" } kernel_rpi2() { - pkgdesc="Kernel for the Raspberry Pi 2 & 3 (from Alpine, depends on non free firmware!)" + pkgdesc="Kernel for the Raspberry Pi 2 (from Alpine, depends on non free firmware!)" depends="$pkgname linux-rpi2" install="$subpkgname.post-install" mkdir "$subpkgdir" diff --git a/device/device-raspberry-pi0/95-vchiq-permissions.rules b/device/device-raspberry-pi0/95-vchiq-permissions.rules new file mode 100644 index 000000000..1237f5fed --- /dev/null +++ b/device/device-raspberry-pi0/95-vchiq-permissions.rules @@ -0,0 +1 @@ +SUBSYSTEM=="vchiq", GROUP="video", MODE="0660" diff --git a/device/device-raspberry-pi0/APKBUILD b/device/device-raspberry-pi0/APKBUILD new file mode 100644 index 000000000..0026860ae --- /dev/null +++ b/device/device-raspberry-pi0/APKBUILD @@ -0,0 +1,32 @@ +# Reference: +pkgname="device-raspberry-pi0" +pkgdesc="Raspberry Pi Zero" +pkgver=0.1 +pkgrel=0 +url="https://postmarketos.org" +license="MIT" +arch="armhf" +options="!check !archcheck" +depends="postmarketos-base raspberrypi-bootloader linux-rpi" +makedepends="devicepkg-dev" +install="$pkgname.post-install" +source="deviceinfo config.txt usercfg.txt cmdline.txt 95-vchiq-permissions.rules" + +build() { + devicepkg_build $startdir $pkgname +} + +package() { + devicepkg_package $startdir $pkgname + install -Dm644 "$srcdir"/config.txt "$pkgdir"/boot/config.txt + install -Dm644 "$srcdir"/usercfg.txt "$pkgdir"/boot/usercfg.txt + install -Dm644 "$srcdir"/cmdline.txt "$pkgdir"/boot/cmdline.txt + install -Dm644 "$srcdir"/95-vchiq-permissions.rules \ + "$pkgdir"/etc/udev/rules.d/95-vchiq-permissions.rules +} + +sha512sums="fb8a1c8462a9236fee1dd6a12f90e10790aa3c08344860205ae0e4e41ce5c0355204faa6b299722328ee8dc9a02f582a0e16a67be4472fbed871a4b05cb1964f deviceinfo +8130aef9d8c128ef2dea4443a433cbea1e32e791e32336c4525e0bf8f531899a8e8c5ed9c2da251439fe25f2811f8886905922004221bb33a66587bd4ec174b7 config.txt +e3856c0885599896036a204aaf0f63094a671b02d3cb85d483db60185cd10b397f419d30a8bffbb0a70bbab0b238a6ab2c6384bd2821ac34b7def9d9c6f3aecb usercfg.txt +8ddb659a189ad2b2b2f0fa78043e4cbefcfd6c81fd35f5cc10fc8c7b77b5a0bfb8f02b4db4d5df51fbe0529b883eb572d465f44efa1a2d41231852657791b218 cmdline.txt +7e5505cb07d5b4a81bd28443d508336b5c547356538f1c06f91ed93ad0d7d456d4f74f1d24df5a2e08c17e74f0a66607352ac4874e967e9a91dfec9522d2d58d 95-vchiq-permissions.rules" diff --git a/device/device-raspberry-pi0/cmdline.txt b/device/device-raspberry-pi0/cmdline.txt new file mode 100644 index 000000000..f840915fb --- /dev/null +++ b/device/device-raspberry-pi0/cmdline.txt @@ -0,0 +1 @@ +dwc_otg.lpm_enable=0 console=serial0,115200 console=tty1 PMOS_NO_OUTPUT_REDIRECT diff --git a/device/device-raspberry-pi0/config.txt b/device/device-raspberry-pi0/config.txt new file mode 100644 index 000000000..d1ae07ce8 --- /dev/null +++ b/device/device-raspberry-pi0/config.txt @@ -0,0 +1,5 @@ +disable_splash=0 +boot_delay=0 +kernel=vmlinuz-rpi +initramfs initramfs-rpi +include usercfg.txt diff --git a/device/device-raspberry-pi0/device-raspberry-pi0.post-install b/device/device-raspberry-pi0/device-raspberry-pi0.post-install new file mode 100644 index 000000000..65c5c53ba --- /dev/null +++ b/device/device-raspberry-pi0/device-raspberry-pi0.post-install @@ -0,0 +1,5 @@ +#!/bin/sh + +kernver=$(cat /usr/share/kernel/rpi/kernel.release) +cd /usr/lib/linux-${kernver}/ +find . -type f -regex ".*\.dtbo\?$" -exec install -Dm644 {} /boot/{} \; diff --git a/device/device-raspberry-pi0/deviceinfo b/device/device-raspberry-pi0/deviceinfo new file mode 100644 index 000000000..f2f191bfc --- /dev/null +++ b/device/device-raspberry-pi0/deviceinfo @@ -0,0 +1,25 @@ +# Reference: +# Please use double quotes only. You can source this file in shell scripts. + +deviceinfo_format_version="0" +deviceinfo_name="Raspberry Pi Zero" +deviceinfo_manufacturer="Raspberry Pi" +deviceinfo_codename="raspberry-pi0" +deviceinfo_date="" +deviceinfo_dtb="" +deviceinfo_modules_initfs="dwc2 af_packet usb_f_ecm g_ether" +deviceinfo_arch="armhf" +deviceinfo_disable_dhcpd="false" + +# Device related +deviceinfo_keyboard="false" +deviceinfo_external_storage="true" +deviceinfo_screen_width="1920" +deviceinfo_screen_height="1080" +deviceinfo_dev_touchscreen="" +deviceinfo_dev_touchscreen_calibration="" +deviceinfo_dev_keyboard="" + +# Bootloader related +deviceinfo_flash_method="none" +deviceinfo_boot_filesystem="fat16" diff --git a/device/device-raspberry-pi0/usercfg.txt b/device/device-raspberry-pi0/usercfg.txt new file mode 100644 index 000000000..f14a02ce2 --- /dev/null +++ b/device/device-raspberry-pi0/usercfg.txt @@ -0,0 +1,33 @@ +# configure GPU memory in megabytes +gpu_mem=128 + +# uncomment line to enable serial on ttyS0 +# NOTE: This fixes the core_freq to 250Mh +#enable_uart=1 + +# load dwc2 USB driver +dtoverlay=dwc2 + +# have a properly sized image +disable_overscan=1 + +# for sound over HDMI +hdmi_drive=2 + +# rotate the HDMI display +# 0 => no rotation +# 1 => 90 degrees clockwise +# 2 => 180 degrees clockwise +# 3 => 270 degrees clockwise +#display_hdmi_rotate=0 + +# Uncomment some or all of these to enable the optional hardware interfaces +#dtparam=i2c_arm=on +#dtparam=i2s=on +#dtparam=spi=on + +# custom CVT mode for HDMI +# see https://www.raspberrypi.org/documentation/configuration/config-txt/video.md +#hdmi_group=2 +#hdmi_mode=87 +#hdmi_cvt 800 480 60 6 0 0 0