From 9057854aa9acc757e1ac09c4e300566babe2af5f Mon Sep 17 00:00:00 2001 From: Adam Boardman Date: Tue, 4 Apr 2023 19:51:11 +0100 Subject: [PATCH] Adding Astro stuff --- astroslide.yaml | 125 +++++++++++++++ gemian-common.yaml | 1 - .../astroslide/etc/chromium.d/use-egl.conf | 1 + .../astroslide-connectivity.conf | 2 + overlay/astroslide/etc/ofono/main.conf | 2 + .../etc/ofono/ril_subscription.conf | 39 +++++ .../etc/pulse/arm_droid_card_custom.pa | 1 + .../astroslide/etc/pulse/default.pa.gemian | 142 ++++++++++++++++++ .../etc/udev/rules.d/80-keyboard.rules | 1 + scripts/setup-user.sh | 6 +- 10 files changed, 316 insertions(+), 4 deletions(-) create mode 100644 astroslide.yaml create mode 100644 overlay/astroslide/etc/chromium.d/use-egl.conf create mode 100644 overlay/astroslide/etc/modules-load.d/astroslide-connectivity.conf create mode 100644 overlay/astroslide/etc/ofono/main.conf create mode 100644 overlay/astroslide/etc/ofono/ril_subscription.conf create mode 100644 overlay/astroslide/etc/pulse/arm_droid_card_custom.pa create mode 100644 overlay/astroslide/etc/pulse/default.pa.gemian create mode 100644 overlay/astroslide/etc/udev/rules.d/80-keyboard.rules diff --git a/astroslide.yaml b/astroslide.yaml new file mode 100644 index 0000000..93a7862 --- /dev/null +++ b/astroslide.yaml @@ -0,0 +1,125 @@ +{{- $image := or .image "gemian-astroslide.tgz" -}} +{{- $output := or .output "tarball" -}} +{{- $variant := or .variant "mate" -}} + +architecture: arm64 + +actions: + - action: recipe + description: Setup Gemian rootfs + recipe: gemian-common.yaml + + - action: overlay + description: Adding Astro Slide overlay + source: overlay/astroslide + destination: / + + - action: apt + description: Installing additional Debian packages + packages: [ curl, gnupg, openssh-server, sudo ] + + - action: apt + description: Installing Astro Slide-specific packages + target-device: mt6873 + packages: +# - bluebinder +# - media-hub +# - gemian-system +# - lxc-android + - lxc + - debhelper + - lxcfs + - uidmap + - libglx-mesa0 + - libgl1-mesa-dri + - astro-linux-kernel + - devscripts + - build-essential + - kexec-tools + + - action: run + description: Generate /usr/share/kernel/astroslide-boot.img for Astro Slide + chroot: true + command: /usr/sbin/update-gemian-boot-image astroslide + + - action: run + description: Generate /usr/share/kernel/astroslide-boot-lvm-gemian-bullseye.img for Astro Slide + chroot: true + command: /usr/sbin/update-gemian-boot-image astroslide gemian-bullseye + + - action: run + chroot: true + command: echo astroslide > /etc/hostname + + - action: run + chroot: true + command: echo "127.0.0.1 astroslide" >> /etc/hosts + + - action: run + chroot: true + description: Add apt sandbox user to Android inet group + command: sed -i 's/_apt:x:100:65534/_apt:x:100:3003/g' /etc/passwd + + - action: run + chroot: true + description: depmod kernel modules + command: depmod -a 4.4.146 + +{{ if eq $variant "lxqt" }} +# - action: recipe +# recipe: variants/lxqt.yaml +{{ end }} + +{{ if eq $variant "mate" }} +# - action: apt +# description: Installing MATE desktop environment +# packages: +# - lxdm +# - mate-desktop-environment +# - xserver-xorg +# - xserver-xorg-input-evdev +{{ end }} + +{{ if eq $variant "kde-plasma" }} +# - action: recipe +# recipe: variants/kde-plasma.yaml +{{ end }} + +# - action: run +# chroot: true +# description: Fix default DPI +# command: sed -e "s@\\[server\\]@[server]\\narg=/usr/bin/Xorg -dpi 192\n@" -i /etc/lxdm/lxdm.conf + + - action: run + chroot: true + description: Removing xserver-xorg-input-libinput as it does not work with touchscreen yet + command: apt remove xserver-xorg-input-libinput + + - action: run + chroot: true + description: Removing /var/log/journal to avoid persisant journaling + command: rm -rf /var/log/journal/ + +{{ if eq $output "tarball" }} + - action: pack + file: {{ $image }} + compression: gz +{{ end }} + +{{ if eq $output "image" }} + - action: image-file + imagename: {{ $image }} + imagesize: 6000000000 + + fs: ext4 + fsname: "gemian" + + - action: run + description: Allow jenkins user to access file + command: chown jenkins.jenkins {{ $image }} + + - action: filesystem-deploy + setup-fstab: false + setup-kernel-cmdline: false + description: Deploying filesystem onto image +{{ end }} diff --git a/gemian-common.yaml b/gemian-common.yaml index a324c06..d54b39f 100644 --- a/gemian-common.yaml +++ b/gemian-common.yaml @@ -71,7 +71,6 @@ actions: - xfonts-scalable - xfonts-utils - - action: run chroot: true description: Enabling libhybris EGL libs diff --git a/overlay/astroslide/etc/chromium.d/use-egl.conf b/overlay/astroslide/etc/chromium.d/use-egl.conf new file mode 100644 index 0000000..ae08a98 --- /dev/null +++ b/overlay/astroslide/etc/chromium.d/use-egl.conf @@ -0,0 +1 @@ +; export CHROMIUM_FLAGS="$CHROMIUM_FLAGS --use-gl=egl" diff --git a/overlay/astroslide/etc/modules-load.d/astroslide-connectivity.conf b/overlay/astroslide/etc/modules-load.d/astroslide-connectivity.conf new file mode 100644 index 0000000..7e7ffc7 --- /dev/null +++ b/overlay/astroslide/etc/modules-load.d/astroslide-connectivity.conf @@ -0,0 +1,2 @@ +gps_drv +fmradio_drv diff --git a/overlay/astroslide/etc/ofono/main.conf b/overlay/astroslide/etc/ofono/main.conf new file mode 100644 index 0000000..cff37d0 --- /dev/null +++ b/overlay/astroslide/etc/ofono/main.conf @@ -0,0 +1,2 @@ +[ModemManager] +AutoSelectDataSim=always diff --git a/overlay/astroslide/etc/ofono/ril_subscription.conf b/overlay/astroslide/etc/ofono/ril_subscription.conf new file mode 100644 index 0000000..0f3e681 --- /dev/null +++ b/overlay/astroslide/etc/ofono/ril_subscription.conf @@ -0,0 +1,39 @@ +# Ofono configuration for Planet Cosmo Communicator + +[Settings] +#EmptyConfig=false +#Identity=radio:radio +#3GLTEHandover=true +#SetRadioCapability=auto + +emptyPinQuery=false +useDataProfiles=true + +[ril_0] +transport=binder:name=slot1 +name=slot1 + +#socket=/dev/socket/rild +#sub=SUB1 +#slot=0 +#timeout=0 +#technologies=all +#enable4G=true +#uiccWorkaround=true +#ecclistFile=/var/lib/ofono/ril.ecclist +#allowDataReq=auto +#dataCallFormat=auto +#dataCallRetryLimit=4 +#dataCallRetryDelay=200 +#remoteHangupReasons=20 +#localHangupReasons=23 +#enableVoicecall=true +#enableCellBroadcast=true +#startTimeout=20000 +#legacyImeiQuery=false +#lteNetworkMode=9 +#networkModeTimeout=20000 + +[ril_1] +transport=binder:name=slot2 +name=slot2 diff --git a/overlay/astroslide/etc/pulse/arm_droid_card_custom.pa b/overlay/astroslide/etc/pulse/arm_droid_card_custom.pa new file mode 100644 index 0000000..87b6471 --- /dev/null +++ b/overlay/astroslide/etc/pulse/arm_droid_card_custom.pa @@ -0,0 +1 @@ +load-module module-droid-card rate=48000 quirks=+no_hw_volume,-output_deep_buffer diff --git a/overlay/astroslide/etc/pulse/default.pa.gemian b/overlay/astroslide/etc/pulse/default.pa.gemian new file mode 100644 index 0000000..485d1b5 --- /dev/null +++ b/overlay/astroslide/etc/pulse/default.pa.gemian @@ -0,0 +1,142 @@ +#!/usr/bin/pulseaudio -nF +# +# This file is part of PulseAudio. +# +# PulseAudio is free software; you can redistribute it and/or modify it +# under the terms of the GNU Lesser General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# PulseAudio is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public License +# along with PulseAudio; if not, see . + +# This startup script is used only if PulseAudio is started per-user +# (i.e. not in system mode) + +.nofail + +.fail + +load-module module-droid-keepalive + + +### Automatically augment property information from .desktop files +### stored in /usr/share/application +load-module module-augment-properties + +load-module module-null-sink sink_name=sink.null rate=48000 + +load-module module-stream-restore + +### Switch when connected by default (ubports) +load-module module-switch-on-connect ignore_virtual=yes +### Should be after module-*-restore but before module-*-detect (sfos) +load-module module-switch-on-port-available + + +### If droid-card needs other arguments than the default, have the new +### load-module line in /etc/pulse/arm_droid_card_custom.pa +.ifexists /etc/pulse/arm_droid_card_custom.pa + .include /etc/pulse/arm_droid_card_custom.pa +.else + load-module module-droid-card rate=48000 +.endif + +### Needed on many new devices. HADK guide explains how to implement this fully +.ifexists module-droid-glue.so + .nofail + load-module module-droid-glue + .fail +.endif + +.ifexists module-droid-hidl-28.so + .nofail + load-module module-droid-hidl-28 + .fail +.endif + +load-module module-null-sink sink_name=sink.fake.sco rate=8000 channels=1 +load-module module-null-source source_name=source.fake.sco rate=8000 channels=1 +#load-module module-bluetooth-discover bluez4_args="sco_sink=sink.fake.sco sco_source=source.fake.sco" bluez5_args="headset=droid" +load-module module-bluetooth-discover +load-module module-bluetooth-policy + +#load-module module-policy-enforcement + +load-module module-role-ducking trigger_roles=alarm,notification,warning ducking_roles=x-maemo volume=-200dB + +### Load several protocols +.ifexists module-esound-protocol-unix.so +load-module module-esound-protocol-unix +.endif +load-module module-native-protocol-unix + +### Network access (may be configured with paprefs, so leave this commented +### here if you plan to use paprefs) +#load-module module-esound-protocol-tcp +#load-module module-native-protocol-tcp +#load-module module-zeroconf-publish + +### Load the RTP receiver module (also configured via paprefs, see above) +#load-module module-rtp-recv + +### Load the RTP sender module (also configured via paprefs, see above) +#load-module module-null-sink sink_name=rtp format=s16be channels=2 rate=44100 sink_properties="device.description='RTP Multicast Sink'" +#load-module module-rtp-send source=rtp.monitor + +### Load additional modules from GSettings. This can be configured with the paprefs tool. +### Please keep in mind that the modules configured by paprefs might conflict with manually +### loaded modules. +.ifexists module-gsettings.so +.nofail +load-module module-gsettings +.fail +.endif + + +### Make sure we always have a sink around, even if it is a null sink. +load-module module-always-sink + +### Honour intended role device property +load-module module-intended-roles + +### Automatically suspend sinks/sources that become idle for too long +load-module module-suspend-on-idle timeout=1 + +### If autoexit on idle is enabled we want to make sure we only quit +### when no local session needs us anymore. +.ifexists module-console-kit.so +load-module module-console-kit +.endif +.ifexists module-systemd-login.so +load-module module-systemd-login +.endif + +### Load DBus protocol +.ifexists module-dbus-protocol.so +load-module module-dbus-protocol +.endif + +### Move orphan streams to placeholder sinks or sources so that playback doesn't get +### interrupted. Policy enforcement module then moves the streams to new appropriate +### sinks or sources. +#load-module module-rescue-streams sink_name=sink.null source_name=sink.null.monitor + +### Enable positioned event sounds +load-module module-position-event-sounds + +### Modules to allow auto-loading of filters (such as echo cancellation) +### on demand. module-filter-heuristics tries to determine what filters +### make sense, and module-filter-apply does the heavy-lifting of +### loading modules and rerouting streams. +load-module module-filter-heuristics +load-module module-filter-apply + +### Make some devices default +set-default-sink sink.primary_output +set-default-source source.droid diff --git a/overlay/astroslide/etc/udev/rules.d/80-keyboard.rules b/overlay/astroslide/etc/udev/rules.d/80-keyboard.rules new file mode 100644 index 0000000..b2da74e --- /dev/null +++ b/overlay/astroslide/etc/udev/rules.d/80-keyboard.rules @@ -0,0 +1 @@ +SUBSYSTEM=="input", ATTRS{name}=="Integrated keyboard", ENV{XKBMODEL}="planetcosmo" diff --git a/scripts/setup-user.sh b/scripts/setup-user.sh index e8bca33..885ef03 100755 --- a/scripts/setup-user.sh +++ b/scripts/setup-user.sh @@ -221,9 +221,9 @@ useradd --gid 9998 --no-create-home --home-dir /nonexistent --no-user-group --sy groupadd --gid 9999 aid_nobody useradd --gid 9999 --no-create-home --home-dir /nonexistent --no-user-group --system --shell /usr/sbin/nologin --uid 9999 aid_nobody -groupadd -g 100000 cosmo -useradd -m -u 100000 -g 100000 -G audio,input,video,sudo,dialout,aid_media,aid_system,aid_graphics,aid_input,aid_radio,aid_wakelock,aid_audio,aid_net_bt_admin,aid_net_bt,aid_inet,aid_net_raw,aid_net_admin -s /bin/bash cosmo -echo cosmo:cosmo | chpasswd +groupadd -g 100000 gemian +useradd -m -u 100000 -g 100000 -G audio,input,video,sudo,dialout,aid_media,aid_system,aid_graphics,aid_input,aid_radio,aid_wakelock,aid_audio,aid_net_bt_admin,aid_net_bt,aid_inet,aid_net_raw,aid_net_admin -s /bin/bash gemian +echo gemian:gemian | chpasswd usermod systemd-timesync -a -G aid_inet usermod avahi -a -G aid_inet