mirror of
https://github.com/Start9Labs/start-os.git
synced 2026-03-26 02:11:53 +00:00
check environment (#1990)
* check environment * fix tests * don't rebuild sources * I'm going insane * WTF * Update check-environment.sh * Update product.yaml * Update write-image.sh
This commit is contained in:
7
.github/workflows/product.yaml
vendored
7
.github/workflows/product.yaml
vendored
@@ -120,9 +120,9 @@ jobs:
|
||||
run: |
|
||||
tar -mxvf frontend.tar frontend/config.json
|
||||
tar -mxvf frontend.tar frontend/dist
|
||||
tar -mxvf frontend.tar GIT_HASH.txt
|
||||
tar -mxvf frontend.tar ENVIRONMENT.txt
|
||||
tar -mxvf frontend.tar VERSION.txt
|
||||
tar -xvf frontend.tar GIT_HASH.txt
|
||||
tar -xvf frontend.tar ENVIRONMENT.txt
|
||||
tar -xvf frontend.tar VERSION.txt
|
||||
rm frontend.tar
|
||||
|
||||
- name: Cache raspiOS
|
||||
@@ -134,7 +134,6 @@ jobs:
|
||||
|
||||
- name: Build image
|
||||
run: |
|
||||
touch -d "1970-01-01T00:00:00Z" ENVIRONMENT.txt GIT_HASH.txt VERSION.txt
|
||||
make V=1 embassyos-raspi.img --debug
|
||||
|
||||
- uses: actions/upload-artifact@v3
|
||||
|
||||
6
Makefile
6
Makefile
@@ -116,12 +116,6 @@ raspios.img:
|
||||
unzip 2022-01-28-raspios-bullseye-arm64-lite.zip
|
||||
mv 2022-01-28-raspios-bullseye-arm64-lite.img raspios.img
|
||||
|
||||
product_key.txt:
|
||||
$(shell which echo) -n "X" > product_key.txt
|
||||
cat /dev/urandom | base32 | head -c11 | tr '[:upper:]' '[:lower:]' >> product_key.txt
|
||||
if [ "$(KEY)" != "" ]; then $(shell which echo) -n "$(KEY)" > product_key.txt; fi
|
||||
echo >> product_key.txt
|
||||
|
||||
snapshots: libs/snapshot_creator/Cargo.toml
|
||||
cd libs/ && ./build-v8-snapshot.sh
|
||||
cd libs/ && ./build-arm-v8-snapshot.sh
|
||||
|
||||
@@ -32,7 +32,7 @@ async fn setup_or_init(cfg_path: Option<PathBuf>) -> Result<(), Error> {
|
||||
let ctx = InstallContext::init(cfg_path).await?;
|
||||
|
||||
let embassy_ip_fqdn: ResourceFqdn = ResourceFqdn::IpAddr;
|
||||
let embassy_fqdn: ResourceFqdn = "pureos.local".parse()?;
|
||||
let embassy_fqdn: ResourceFqdn = "embassy.local".parse()?;
|
||||
|
||||
let localhost_fqdn = ResourceFqdn::LocalHost;
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#![recursion_limit = "256"]
|
||||
|
||||
pub const DEFAULT_MARKETPLACE: &str = "https://registry.start9.com";
|
||||
pub const COMMUNITY_MARKETPLACE: &str = "https://community-registry.start9.com";
|
||||
// pub const COMMUNITY_MARKETPLACE: &str = "https://community-registry.start9.com";
|
||||
pub const BUFFER_SIZE: usize = 1024;
|
||||
pub const HOST_IP: [u8; 4] = [172, 18, 0, 1];
|
||||
pub const TARGET: &str = current_platform::CURRENT_PLATFORM;
|
||||
|
||||
@@ -4,7 +4,7 @@ use serde_json::{json, Value};
|
||||
|
||||
use super::v0_3_0::V0_3_0_COMPAT;
|
||||
use super::*;
|
||||
use crate::{COMMUNITY_MARKETPLACE, DEFAULT_MARKETPLACE};
|
||||
use crate::DEFAULT_MARKETPLACE;
|
||||
|
||||
const V0_3_3: emver::Version = emver::Version::new(0, 3, 3, 0);
|
||||
|
||||
@@ -104,14 +104,12 @@ impl VersionT for Version {
|
||||
#[derive(Debug, Clone, Copy)]
|
||||
pub enum MarketPlaceUrls {
|
||||
Default,
|
||||
Community,
|
||||
}
|
||||
|
||||
impl MarketPlaceUrls {
|
||||
pub fn url(&self) -> String {
|
||||
let url_string = match self {
|
||||
MarketPlaceUrls::Default => DEFAULT_MARKETPLACE,
|
||||
MarketPlaceUrls::Community => COMMUNITY_MARKETPLACE,
|
||||
};
|
||||
format!("{url_string}/")
|
||||
}
|
||||
@@ -121,7 +119,7 @@ impl MarketPlaceUrls {
|
||||
fn test_that_ui_includes_url() {
|
||||
let ui: Value =
|
||||
serde_json::from_str(include_str!("../../../frontend/patchdb-ui-seed.json")).unwrap();
|
||||
for market_place in [MarketPlaceUrls::Default, MarketPlaceUrls::Community] {
|
||||
for market_place in [MarketPlaceUrls::Default] {
|
||||
let url = market_place.url();
|
||||
assert!(
|
||||
!ui["marketplace"]["known-hosts"][&url].is_null(),
|
||||
|
||||
@@ -25,7 +25,7 @@ sudo umount $TMPDIR
|
||||
sudo mount `partition_for ${OUTPUT_DEVICE} 2` $TMPDIR
|
||||
|
||||
sudo mkdir $TMPDIR/media/embassy/
|
||||
sudo make V=1 install ARCH=aarch64 OS_ARCH=raspberrypi DESTDIR=$TMPDIR --debug
|
||||
sudo ENVIRONMENT=$ENVIRONMENT make V=1 install ARCH=aarch64 OS_ARCH=raspberrypi DESTDIR=$TMPDIR --debug
|
||||
sudo sed -i 's/raspberrypi/embassy/g' $TMPDIR/etc/hostname
|
||||
sudo sed -i 's/raspberrypi/embassy/g' $TMPDIR/etc/hosts
|
||||
sudo cp cargo-deps/aarch64-unknown-linux-gnu/release/nc-broadcast $TMPDIR/usr/local/bin
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
#!/bin/bash
|
||||
|
||||
if ! [ -f ./ENVIRONMENT.txt ] || [ "$(cat ./ENVIRONMENT.txt)" != "$ENVIRONMENT" ]; then
|
||||
>&2 echo "Updating ENVIRONMENT.txt to $ENVIRONMENT"
|
||||
echo -n "$ENVIRONMENT" > ./ENVIRONMENT.txt
|
||||
fi
|
||||
|
||||
echo -n ./ENVIRONMENT.txt
|
||||
echo -n ./ENVIRONMENT.txt
|
||||
|
||||
Reference in New Issue
Block a user