diff --git a/.github/workflows/build-image.yml b/.github/workflows/build-image-arm64.yml similarity index 92% rename from .github/workflows/build-image.yml rename to .github/workflows/build-image-arm64.yml index fa9549093..2cf4488a5 100644 --- a/.github/workflows/build-image.yml +++ b/.github/workflows/build-image-arm64.yml @@ -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" diff --git a/.github/workflows/build-image-armhf.yml b/.github/workflows/build-image-armhf.yml new file mode 100644 index 000000000..5fbdb98bc --- /dev/null +++ b/.github/workflows/build-image-armhf.yml @@ -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" diff --git a/filesystem/resources/InstallResources/default.pa b/filesystem/resources/InstallResources/veyron/default.pa similarity index 100% rename from filesystem/resources/InstallResources/default.pa rename to filesystem/resources/InstallResources/veyron/default.pa diff --git a/filesystem/resources/InstallResources/headphone-acpi-toggle b/filesystem/resources/InstallResources/veyron/headphone-acpi-toggle similarity index 100% rename from filesystem/resources/InstallResources/headphone-acpi-toggle rename to filesystem/resources/InstallResources/veyron/headphone-acpi-toggle diff --git a/filesystem/resources/InstallResources/sound.sh b/filesystem/resources/InstallResources/veyron/sound.sh similarity index 100% rename from filesystem/resources/InstallResources/sound.sh rename to filesystem/resources/InstallResources/veyron/sound.sh diff --git a/kernel/makefile b/kernel/makefile index 28b6cbc86..7bb34fc73 100644 --- a/kernel/makefile +++ b/kernel/makefile @@ -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 @@ -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) diff --git a/scripts/InstallScripts/InstallPackages.sh b/scripts/InstallScripts/InstallPackages.sh index 69823ecb2..cb603c0a2 100755 --- a/scripts/InstallScripts/InstallPackages.sh +++ b/scripts/InstallScripts/InstallPackages.sh @@ -16,6 +16,47 @@ # You should have received a copy of the GNU General Public License # along with PrawnOS. If not, see . + +### 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 @@ -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 diff --git a/tests/build-image.sh b/tests/build-image-arm64.sh similarity index 87% rename from tests/build-image.sh rename to tests/build-image-arm64.sh index a4f3b0763..01a30d525 100755 --- a/tests/build-image.sh +++ b/tests/build-image-arm64.sh @@ -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" diff --git a/tests/build-image-armhf.sh b/tests/build-image-armhf.sh new file mode 100755 index 000000000..bfdf12882 --- /dev/null +++ b/tests/build-image-armhf.sh @@ -0,0 +1,41 @@ +#!/bin/bash + +# This file is part of PrawnOS (https://www.prawnos.com) +# Copyright (c) 2020 Austin English + +# 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 . + +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"