mirror of
https://github.com/Start9Labs/start-os.git
synced 2026-03-26 02:11:53 +00:00
Bugfix/pi config (#2276)
* move some install scripts to init * fix pi config.txt * move some image stuff to the squashfs build * no need to clean up fake-apt * use max temp
This commit is contained in:
10
.github/workflows/startos-iso.yaml
vendored
10
.github/workflows/startos-iso.yaml
vendored
@@ -22,7 +22,7 @@ on:
|
|||||||
- next
|
- next
|
||||||
|
|
||||||
env:
|
env:
|
||||||
NODEJS_VERSION: '18.15.0'
|
NODEJS_VERSION: "18.15.0"
|
||||||
ENVIRONMENT: '${{ fromJson(format(''["{0}", ""]'', github.event.inputs.environment || ''dev''))[github.event.inputs.environment == ''<NONE>''] }}'
|
ENVIRONMENT: '${{ fromJson(format(''["{0}", ""]'', github.event.inputs.environment || ''dev''))[github.event.inputs.environment == ''<NONE>''] }}'
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
@@ -31,7 +31,8 @@ jobs:
|
|||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
platform: [x86_64, x86_64-nonfree, aarch64, aarch64-nonfree, raspberrypi]
|
platform:
|
||||||
|
[x86_64, x86_64-nonfree, aarch64, aarch64-nonfree, raspberrypi]
|
||||||
runs-on: ubuntu-22.04
|
runs-on: ubuntu-22.04
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
||||||
@@ -93,7 +94,8 @@ jobs:
|
|||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
platform: [x86_64, x86_64-nonfree, aarch64, aarch64-nonfree, raspberrypi]
|
platform:
|
||||||
|
[x86_64, x86_64-nonfree, aarch64, aarch64-nonfree, raspberrypi]
|
||||||
runs-on: ubuntu-22.04
|
runs-on: ubuntu-22.04
|
||||||
needs: [dpkg]
|
needs: [dpkg]
|
||||||
steps:
|
steps:
|
||||||
@@ -168,4 +170,4 @@ jobs:
|
|||||||
- uses: actions/upload-artifact@v3
|
- uses: actions/upload-artifact@v3
|
||||||
with:
|
with:
|
||||||
name: raspberrypi.img
|
name: raspberrypi.img
|
||||||
path: eos-*_raspberrypi.img
|
path: startos-*_raspberrypi.img
|
||||||
|
|||||||
3
Makefile
3
Makefile
@@ -18,7 +18,7 @@ FRONTEND_DIAGNOSTIC_UI_SRC := $(shell find frontend/projects/diagnostic-ui)
|
|||||||
FRONTEND_INSTALL_WIZARD_SRC := $(shell find frontend/projects/install-wizard)
|
FRONTEND_INSTALL_WIZARD_SRC := $(shell find frontend/projects/install-wizard)
|
||||||
PATCH_DB_CLIENT_SRC := $(shell find patch-db/client -not -path patch-db/client/dist)
|
PATCH_DB_CLIENT_SRC := $(shell find patch-db/client -not -path patch-db/client/dist)
|
||||||
GZIP_BIN := $(shell which pigz || which gzip)
|
GZIP_BIN := $(shell which pigz || which gzip)
|
||||||
ALL_TARGETS := $(EMBASSY_BINS) system-images/compat/docker-images/$(ARCH).tar system-images/utils/docker-images/$(ARCH).tar system-images/binfmt/docker-images/$(ARCH).tar $(EMBASSY_SRC) $(ENVIRONMENT_FILE) $(GIT_HASH_FILE) $(VERSION_FILE)
|
ALL_TARGETS := $(EMBASSY_BINS) system-images/compat/docker-images/$(ARCH).tar system-images/utils/docker-images/$(ARCH).tar system-images/binfmt/docker-images/$(ARCH).tar $(EMBASSY_SRC) $(shell if [ "$(OS_ARCH)" = "raspberrypi" ]; then echo cargo-deps/aarch64-unknown-linux-gnu/release/pi-beep; fi) $(ENVIRONMENT_FILE) $(GIT_HASH_FILE) $(VERSION_FILE)
|
||||||
|
|
||||||
ifeq ($(REMOTE),)
|
ifeq ($(REMOTE),)
|
||||||
mkdir = mkdir -p $1
|
mkdir = mkdir -p $1
|
||||||
@@ -75,6 +75,7 @@ install: $(ALL_TARGETS)
|
|||||||
$(call cp,backend/target/$(ARCH)-unknown-linux-gnu/release/embassyd,$(DESTDIR)/usr/bin/embassyd)
|
$(call cp,backend/target/$(ARCH)-unknown-linux-gnu/release/embassyd,$(DESTDIR)/usr/bin/embassyd)
|
||||||
$(call cp,backend/target/$(ARCH)-unknown-linux-gnu/release/embassy-cli,$(DESTDIR)/usr/bin/embassy-cli)
|
$(call cp,backend/target/$(ARCH)-unknown-linux-gnu/release/embassy-cli,$(DESTDIR)/usr/bin/embassy-cli)
|
||||||
$(call cp,backend/target/$(ARCH)-unknown-linux-gnu/release/avahi-alias,$(DESTDIR)/usr/bin/avahi-alias)
|
$(call cp,backend/target/$(ARCH)-unknown-linux-gnu/release/avahi-alias,$(DESTDIR)/usr/bin/avahi-alias)
|
||||||
|
if [ "$(OS_ARCH)" = "raspberrypi" ]; then $(call cp,cargo-deps/aarch64-unknown-linux-gnu/release/pi-beep,$(DESTDIR)/usr/bin/pi-beep); fi
|
||||||
|
|
||||||
$(call mkdir,$(DESTDIR)/usr/lib)
|
$(call mkdir,$(DESTDIR)/usr/lib)
|
||||||
$(call rm,$(DESTDIR)/usr/lib/embassy)
|
$(call rm,$(DESTDIR)/usr/lib/embassy)
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ use futures::FutureExt;
|
|||||||
use rpc_toolkit::command;
|
use rpc_toolkit::command;
|
||||||
use rpc_toolkit::yajrc::RpcError;
|
use rpc_toolkit::yajrc::RpcError;
|
||||||
use serde::{Deserialize, Deserializer, Serialize, Serializer};
|
use serde::{Deserialize, Deserializer, Serialize, Serializer};
|
||||||
|
use tokio::process::Command;
|
||||||
use tokio::sync::broadcast::Receiver;
|
use tokio::sync::broadcast::Receiver;
|
||||||
use tokio::sync::RwLock;
|
use tokio::sync::RwLock;
|
||||||
use tracing::instrument;
|
use tracing::instrument;
|
||||||
@@ -17,8 +18,8 @@ use crate::logs::{
|
|||||||
LogResponse, LogSource,
|
LogResponse, LogSource,
|
||||||
};
|
};
|
||||||
use crate::shutdown::Shutdown;
|
use crate::shutdown::Shutdown;
|
||||||
use crate::util::display_none;
|
|
||||||
use crate::util::serde::{display_serializable, IoFormat};
|
use crate::util::serde::{display_serializable, IoFormat};
|
||||||
|
use crate::util::{display_none, Invoke};
|
||||||
use crate::{Error, ErrorKind, ResultExt};
|
use crate::{Error, ErrorKind, ResultExt};
|
||||||
|
|
||||||
pub const SYSTEMD_UNIT: &'static str = "embassyd";
|
pub const SYSTEMD_UNIT: &'static str = "embassyd";
|
||||||
@@ -512,13 +513,30 @@ async fn launch_disk_task(
|
|||||||
|
|
||||||
#[instrument(skip_all)]
|
#[instrument(skip_all)]
|
||||||
async fn get_temp() -> Result<Celsius, Error> {
|
async fn get_temp() -> Result<Celsius, Error> {
|
||||||
let temp_file = "/sys/class/thermal/thermal_zone0/temp";
|
let temp = serde_json::from_slice::<serde_json::Value>(
|
||||||
let milli = tokio::fs::read_to_string(temp_file)
|
&Command::new("sensors")
|
||||||
.await
|
.arg("-j")
|
||||||
.with_ctx(|_| (crate::ErrorKind::Filesystem, temp_file))?
|
.invoke(ErrorKind::Filesystem)
|
||||||
.trim()
|
.await?,
|
||||||
.parse::<f64>()?;
|
)
|
||||||
Ok(Celsius(milli / 1000.0))
|
.with_kind(ErrorKind::Deserialization)?
|
||||||
|
.as_object()
|
||||||
|
.into_iter()
|
||||||
|
.flatten()
|
||||||
|
.flat_map(|(_, v)| v.as_object())
|
||||||
|
.flatten()
|
||||||
|
.flat_map(|(_, v)| v.as_object())
|
||||||
|
.flatten()
|
||||||
|
.filter_map(|(k, v)| {
|
||||||
|
if k.ends_with("_input") {
|
||||||
|
v.as_f64()
|
||||||
|
} else {
|
||||||
|
None
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.reduce(f64::max)
|
||||||
|
.ok_or_else(|| Error::new(eyre!("No temperatures available"), ErrorKind::Filesystem))?;
|
||||||
|
Ok(Celsius(temp))
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, Clone)]
|
#[derive(Debug, Clone)]
|
||||||
|
|||||||
@@ -21,6 +21,7 @@ iotop
|
|||||||
iw
|
iw
|
||||||
jq
|
jq
|
||||||
libavahi-client3
|
libavahi-client3
|
||||||
|
lm-sensors
|
||||||
lvm2
|
lvm2
|
||||||
magic-wormhole
|
magic-wormhole
|
||||||
ncdu
|
ncdu
|
||||||
|
|||||||
@@ -20,16 +20,8 @@ mount --bind /sys /media/embassy/next/sys
|
|||||||
mount --bind /proc /media/embassy/next/proc
|
mount --bind /proc /media/embassy/next/proc
|
||||||
mount --bind /boot /media/embassy/next/boot
|
mount --bind /boot /media/embassy/next/boot
|
||||||
|
|
||||||
rm /media/embassy/next/usr/local/bin/apt
|
|
||||||
rm /media/embassy/next/usr/local/bin/apt-get
|
|
||||||
rm /media/embassy/next/usr/local/bin/aptitude
|
|
||||||
|
|
||||||
chroot /media/embassy/next $@
|
chroot /media/embassy/next $@
|
||||||
|
|
||||||
ln -sf /usr/lib/embassy/scripts/fake-apt /media/embassy/next/usr/local/bin/apt
|
|
||||||
ln -sf /usr/lib/embassy/scripts/fake-apt /media/embassy/next/usr/local/bin/apt-get
|
|
||||||
ln -sf /usr/lib/embassy/scripts/fake-apt /media/embassy/next/usr/local/bin/aptitude
|
|
||||||
|
|
||||||
umount /media/embassy/next/run
|
umount /media/embassy/next/run
|
||||||
umount /media/embassy/next/dev
|
umount /media/embassy/next/dev
|
||||||
umount /media/embassy/next/sys
|
umount /media/embassy/next/sys
|
||||||
|
|||||||
@@ -1 +0,0 @@
|
|||||||
console=serial0,115200 console=tty1 root=PARTUUID=cb15ae4d-02 rootfstype=ext4 fsck.repair=yes rootwait cgroup_enable=cpuset cgroup_memory=1 cgroup_enable=memory quiet init=/usr/lib/embassy/scripts/init_resize.sh
|
|
||||||
@@ -1,86 +0,0 @@
|
|||||||
# For more options and information see
|
|
||||||
# http://rpf.io/configtxt
|
|
||||||
# Some settings may impact device functionality. See link above for details
|
|
||||||
|
|
||||||
# uncomment if you get no picture on HDMI for a default "safe" mode
|
|
||||||
#hdmi_safe=1
|
|
||||||
|
|
||||||
# uncomment the following to adjust overscan. Use positive numbers if console
|
|
||||||
# goes off screen, and negative if there is too much border
|
|
||||||
#overscan_left=16
|
|
||||||
#overscan_right=16
|
|
||||||
#overscan_top=16
|
|
||||||
#overscan_bottom=16
|
|
||||||
|
|
||||||
# uncomment to force a console size. By default it will be display's size minus
|
|
||||||
# overscan.
|
|
||||||
#framebuffer_width=1280
|
|
||||||
#framebuffer_height=720
|
|
||||||
|
|
||||||
# uncomment if hdmi display is not detected and composite is being output
|
|
||||||
#hdmi_force_hotplug=1
|
|
||||||
|
|
||||||
# uncomment to force a specific HDMI mode (this will force VGA)
|
|
||||||
#hdmi_group=1
|
|
||||||
#hdmi_mode=1
|
|
||||||
|
|
||||||
# uncomment to force a HDMI mode rather than DVI. This can make audio work in
|
|
||||||
# DMT (computer monitor) modes
|
|
||||||
#hdmi_drive=2
|
|
||||||
|
|
||||||
# uncomment to increase signal to HDMI, if you have interference, blanking, or
|
|
||||||
# no display
|
|
||||||
#config_hdmi_boost=4
|
|
||||||
|
|
||||||
# uncomment for composite PAL
|
|
||||||
#sdtv_mode=2
|
|
||||||
|
|
||||||
#uncomment to overclock the arm. 700 MHz is the default.
|
|
||||||
#arm_freq=800
|
|
||||||
|
|
||||||
# Uncomment some or all of these to enable the optional hardware interfaces
|
|
||||||
#dtparam=i2c_arm=on
|
|
||||||
#dtparam=i2s=on
|
|
||||||
#dtparam=spi=on
|
|
||||||
|
|
||||||
# Uncomment this to enable infrared communication.
|
|
||||||
#dtoverlay=gpio-ir,gpio_pin=17
|
|
||||||
#dtoverlay=gpio-ir-tx,gpio_pin=18
|
|
||||||
|
|
||||||
# Additional overlays and parameters are documented /boot/overlays/README
|
|
||||||
|
|
||||||
# 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]
|
|
||||||
gpu_mem=16
|
|
||||||
dtoverlay=pwm-2chan,disable-bt
|
|
||||||
initramfs initrd.img-6.1.21-v8+
|
|
||||||
@@ -61,13 +61,9 @@ sudo unsquashfs -f -d $TMPDIR startos.raspberrypi.squashfs
|
|||||||
REAL_GIT_HASH=$(cat $TMPDIR/usr/lib/embassy/GIT_HASH.txt)
|
REAL_GIT_HASH=$(cat $TMPDIR/usr/lib/embassy/GIT_HASH.txt)
|
||||||
REAL_VERSION=$(cat $TMPDIR/usr/lib/embassy/VERSION.txt)
|
REAL_VERSION=$(cat $TMPDIR/usr/lib/embassy/VERSION.txt)
|
||||||
REAL_ENVIRONMENT=$(cat $TMPDIR/usr/lib/embassy/ENVIRONMENT.txt)
|
REAL_ENVIRONMENT=$(cat $TMPDIR/usr/lib/embassy/ENVIRONMENT.txt)
|
||||||
sudo cp ./build/raspberrypi/cmdline.txt $TMPDIR/boot/
|
sudo sed -i 's| boot=embassy| init=/usr/lib/embassy/scripts/init_resize\.sh|' $TMPDIR/boot/cmdline.txt
|
||||||
sudo cp ./build/raspberrypi/config.txt $TMPDIR/boot/
|
|
||||||
sudo cp ./build/raspberrypi/fstab $TMPDIR/etc/
|
sudo cp ./build/raspberrypi/fstab $TMPDIR/etc/
|
||||||
sudo mkdir -p $TMPDIR/etc/embassy
|
sudo cp ./build/raspberrypi/init_resize.sh $TMPDIR/usr/lib/embassy/scripts/init_resize.sh
|
||||||
sudo cp ./build/raspberrypi/config.yaml $TMPDIR/etc/embassy
|
|
||||||
sudo cp ./build/raspberrypi/init_resize.sh $TMPDIR//usr/lib/embassy/scripts/init_resize.sh
|
|
||||||
sudo cp ./cargo-deps/aarch64-unknown-linux-gnu/release/pi-beep $TMPDIR/usr/local/bin/beep
|
|
||||||
sudo umount $TMPDIR/boot
|
sudo umount $TMPDIR/boot
|
||||||
sudo umount $TMPDIR
|
sudo umount $TMPDIR
|
||||||
sudo losetup -d $OUTPUT_DEVICE
|
sudo losetup -d $OUTPUT_DEVICE
|
||||||
|
|||||||
Reference in New Issue
Block a user