Skip to content

Commit

Permalink
seperate out the veyron specific sound, touchpad setting. Won't have …
Browse files Browse the repository at this point in the history
…to do this once we have packages for these items

add new workflow for arm64
  • Loading branch information
SolidHal committed Aug 8, 2020
1 parent a726a08 commit bf71f6a
Show file tree
Hide file tree
Showing 9 changed files with 128 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@ jobs:
uses: actions/upload-artifact@v2
with:
name: image
path: "PrawnOS-Shiba-c201-git-*.img"
path: "PrawnOS-Shiba-arm64-git-*.img"
21 changes: 21 additions & 0 deletions .github/workflows/build-image-armhf.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# FIXME: currently just builds it, eventually, should use qemu to try to run
# the image (potentially as a separate action)
name: build-prawnos-image

on: [push]
jobs:
build:
name: build
runs-on: ubuntu-latest
steps:
- name: checkout project
uses: actions/checkout@master
- name: build image
run: docker run --mount type=bind,source=$PWD,target=/PrawnOS
--privileged=true -v/dev:/dev debian:buster
/bin/bash /PrawnOS/tests/build-image.sh "$GITHUB_SHA"
- name: publish image
uses: actions/upload-artifact@v2
with:
name: image
path: "PrawnOS-Shiba-armhf-git-*.img"
4 changes: 2 additions & 2 deletions kernel/makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ ifndef PRAWNOS_ROOT
PRAWNOS_ROOT := $(shell git rev-parse --show-toplevel)
endif
include $(PRAWNOS_ROOT)/scripts/BuildScripts/BuildCommon.mk
include $(PRAWNOS_ROOT)/initramfs/makefile

### TARGETED VARS ###
KERNEL_PATCHED := $(PRAWNOS_KERNEL_BUILD)/.kernel_patched
Expand Down Expand Up @@ -109,8 +110,7 @@ $(KERNEL_ATH9K_INSTALLED): $(KERNEL_PATCHED) $(ATH9K_BUILT)
cp $(ATH9K_9271_FW) $(KERNEL_ATH9K_FIRMWARES)/
cp $(ATH9K_7010_FW) $(KERNEL_ATH9K_FIRMWARES)/

$(PRAWNOS_KERNEL_BUILT): $(KERNEL_ATH9K_INSTALLED)
$(MAKE) -C $(PRAWNOS_INITRAMFS)
$(PRAWNOS_KERNEL_BUILT): $(KERNEL_ATH9K_INSTALLED) $(PRAWNOS_INITRAMFS_IMAGE)
rm -rf $(KERNEL_BUILD_LOG)
$(PRAWNOS_KERNEL_SCRIPTS_BUILD) $(KVER) $(KERNEL_RESOURCES) $(PRAWNOS_KERNEL_BUILD) $(PRAWNOS_INITRAMFS_IMAGE) $(TARGET) 2>&1 | tee $(KERNEL_BUILD_LOG)

Expand Down
66 changes: 59 additions & 7 deletions scripts/InstallScripts/InstallPackages.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,47 @@
# You should have received a copy of the GNU General Public License
# along with PrawnOS. If not, see <https://www.gnu.org/licenses/>.


### SHARED CONST AND VARS
# TODO: when these scripts are packaged, place these in a shared script instead of in every file that needs them
device_veyron_speedy="Google Speedy"
device_veyron_minnie="Google Minnie"
device_gru_kevin="Google Kevin"
device_gru_bob="Google Bob"

get_device() {
local device=$(tr -d '\0' < /sys/firmware/devicetree/base/model)
echo $device
}

get_emmc_devname() {
local device=$(get_device)
case "$device" in
$device_veyron_speedy) local devname=mmcblk2;;
$device_veyron_minnie) local devname=mmcblk2;;
$device_gru_kevin) local devname=mmcblk1;;
$device_gru_bob) local devname=mmcblk1;;
* ) echo "Unknown device! can't determine emmc devname. Please file an issue with the output of fdisk -l if you get this on a supported device"; exit 1;;
esac
echo $devname
}


get_sd_devname() {
local device=$(get_device)
case "$device" in
$device_veyron_speedy) local devname=mmcblk0;;
$device_veyron_minnie) local devname=mmcblk0;;
$device_gru_kevin) local devname=mmcblk0;;
$device_gru_bob) local devname=mmcblk0;;
* ) echo "Unknown device! can't determine sd card devname. Please file an issue with the output of fdisk -l if you get this on a supported device"; exit 1;;
esac
echo $devname
}

### END SHARED CONST AND VARS


DIR=/InstallResources
# Import the package lists
source $DIR/package_lists.sh
Expand Down Expand Up @@ -132,13 +173,24 @@ fi


#Copy in acpi, pulse audio, trackpad settings, funtion key settings
cp -rf $DIR/default.pa /etc/pulse/default.pa
# Disable flat-volumes in pulseaudio, fixes broken sound for some sources in firefox
echo "flat-volumes = no" > /etc/pulse/daemon.conf
cp -rf $DIR/sound.sh /etc/acpi/sound.sh
cp -rf $DIR/headphone-acpi-toggle /etc/acpi/events/headphone-acpi-toggle
mkdir /etc/X11/xorg.conf.d/
cp -rf $DIR/30-touchpad.conf /etc/X11/xorg.conf.d/
device_model=$(get_device)

if [[ $device_model == $device_veyron_speedy ]] || [[ $device_model == $device_veyron_minnie ]]
then
cp -rf $DIR/veyron/default.pa /etc/pulse/default.pa
# Disable flat-volumes in pulseaudio, fixes broken sound for some sources in firefox
echo "flat-volumes = no" > /etc/pulse/daemon.conf
cp -rf $DIR/veyron/sound.sh /etc/acpi/sound.sh
cp -rf $DIR/veyron/headphone-acpi-toggle /etc/acpi/events/headphone-acpi-toggle
mkdir /etc/X11/xorg.conf.d/
cp -rf $DIR/30-touchpad.conf /etc/X11/xorg.conf.d/
fi

if [[ $device_model == $device_gru_kevin ]] || [[ $device_model == $device_gru_bob ]]
then
echo "load-module module-alsa-sink device=sysdefault" > /etc/pulse/default.pa
fi


apt clean -y && apt autoremove --purge -y

Expand Down
8 changes: 4 additions & 4 deletions tests/build-image.sh → tests/build-image-arm64.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,23 +19,23 @@ set -e
set -x

GITHUB_SHA="$1"
TEST_TARGET=arm64

cd "$(dirname "$0")/.."

# Get dependencies
apt-get update

##TODO break out into two tests, one for ARMHF and another for ARM64
## even farther future TODO: break into tests for each package, step in build process

#required basic dependencies for build system
apt install make git
apt install -y make git

make install_dependencies_yes

# Note: there's an error for /proc/modules, but at least building the image works fine:
# libkmod: ERROR ../libkmod/libkmod-module.c:1657 kmod_module_new_from_loaded: could not open /proc/modules: No such file or directory
make image
make image TARGET=$TEST_TARGET

# rename the image to include git sha:
mv PrawnOS-Shiba-c201.img "PrawnOS-Shiba-$TARGET-git-${GITHUB_SHA}.img"
mv PrawnOS-Shiba-$TEST_TARGET.img "PrawnOS-Shiba-${TEST_TARGET}-git-${GITHUB_SHA}.img"
41 changes: 41 additions & 0 deletions tests/build-image-armhf.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
#!/bin/bash

# This file is part of PrawnOS (https://www.prawnos.com)
# Copyright (c) 2020 Austin English <austinenglish@gmail.com>

# PrawnOS is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2
# as published by the Free Software Foundation.

# PrawnOS 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 General Public License
# along with PrawnOS. If not, see <https://www.gnu.org/licenses/>.

set -e
set -x

GITHUB_SHA="$1"
TEST_TARGET=armhf

cd "$(dirname "$0")/.."

# Get dependencies
apt-get update

## even farther future TODO: break into tests for each package, step in build process

#required basic dependencies for build system
apt install -y make git

make install_dependencies_yes

# Note: there's an error for /proc/modules, but at least building the image works fine:
# libkmod: ERROR ../libkmod/libkmod-module.c:1657 kmod_module_new_from_loaded: could not open /proc/modules: No such file or directory
make image TARGET=$TEST_TARGET

# rename the image to include git sha:
mv PrawnOS-Shiba-$TEST_TARGET.img "PrawnOS-Shiba-${TEST_TARGET}-git-${GITHUB_SHA}.img"

0 comments on commit bf71f6a

Please sign in to comment.