mirror of
https://github.com/Start9Labs/start-os.git
synced 2026-03-26 02:11:53 +00:00
Setup Scripts (#472)
* Init commit of setup scripts * Minor edit * Script edit and dir rename * Oops * Updated README * Updated scripts/readme * Additional Script/README updates * Further Script updates * BuildGuide updates * More git fuckery * Init commit of setup scripts * Minor edit * Script edit and dir rename * Oops * Updated scripts/readme * Script/README updates * Additional Script/README updates * Script/README edits * Copy script edit * Copy script edit * Filesystem script edit * More edits * Guide edit * Makefile * fixes ui build scripts to use submodules (#546) * fix product key generation Co-authored-by: Aiden McClelland <me@drbonez.dev> Co-authored-by: Keagan McClelland <keagan.mcclelland@gmail.com>
This commit is contained in:
committed by
Aiden McClelland
parent
72872ba52a
commit
33fe3e1059
118
Makefile
118
Makefile
@@ -1,75 +1,75 @@
|
||||
UNAME := $(shell uname -m)
|
||||
|
||||
EMBASSY_SRC := buster.img product_key appmgr/target/armv7-unknown-linux-gnueabihf/release/appmgr ui/www agent/dist/agent agent/config/agent.service lifeline/target/armv7-unknown-linux-gnueabihf/release/lifeline lifeline/lifeline.service setup.sh setup.service docker-daemon.json
|
||||
APPMGR_RELEASE_SRC := appmgr/target/armv7-unknown-linux-gnueabihf/release/appmgr
|
||||
LIFELINE_RELEASE_SRC := lifeline/target/armv7-unknown-linux-gnueabihf/release/lifeline
|
||||
|
||||
ifeq ($(UNAME), armv7l)
|
||||
EMBASSY_SRC := buster.img product_key appmgr/target/release/appmgr ui/www agent/dist/agent agent/config/agent.service lifeline/target/release/lifeline lifeline/lifeline.service setup.sh setup.service docker-daemon.json
|
||||
APPMGR_RELEASE_SRC := appmgr/target/release/appmgr
|
||||
LIFELINE_RELEASE_SRC := lifeline/target/release/lifeline
|
||||
endif
|
||||
EMBASSY_BINS := appmgr/target/aarch64-unknown-linux-gnu/release/embassyd appmgr/target/aarch64-unknown-linux-gnu/release/embassy-init appmgr/target/aarch64-unknown-linux-gnu/release/embassy-cli appmgr/target/aarch64-unknown-linux-gnu/release/embassy-sdk
|
||||
EMBASSY_UIS := ui/www setup-wizard/www diagnostic-ui/www
|
||||
EMBASSY_SRC := ubuntu.img product_key.txt $(EMBASSY_BINS) appmgr/embassyd.service appmgr/embassy-init.service $(EMBASSY_UIS) build/initialization.sh build/initialization.service
|
||||
|
||||
APPMGR_SRC := $(shell find appmgr/src) appmgr/Cargo.toml appmgr/Cargo.lock
|
||||
LIFELINE_SRC := $(shell find lifeline/src) lifeline/Cargo.toml lifeline/Cargo.lock
|
||||
AGENT_SRC := $(shell find agent/src) $(shell find agent/config) agent/stack.yaml agent/package.yaml agent/build.sh
|
||||
UI_SRC := $(shell find ui/src) \
|
||||
ui/angular.json \
|
||||
ui/browserslist \
|
||||
ui/client-manifest.yaml \
|
||||
ui/ionic.config.json \
|
||||
ui/postprocess.ts \
|
||||
ui/tsconfig.json \
|
||||
ui/tslint.json \
|
||||
ui/use-mocks.json
|
||||
UI_SRC := $(shell find ui/src)
|
||||
SETUP_WIZARD_SRC := $(shell find setup-wizard/src)
|
||||
DIAGNOSTIC_UI_SRC := $(shell find diagnostic-ui/src)
|
||||
PATCH_DB_CLIENT_SRC = $(shell find patch-db/client)
|
||||
|
||||
all: embassy.img
|
||||
all: eos.img
|
||||
|
||||
embassy.img: $(EMBASSY_SRC)
|
||||
chmod +x make_image.sh
|
||||
sudo ./make_image.sh
|
||||
clean:
|
||||
rm -f eos.img
|
||||
rm -f ubuntu.img
|
||||
rm -f product_key.txt
|
||||
sudo rm -f $(EMBASSY_BINS)
|
||||
rm -rf ui/node_modules
|
||||
rm -rf ui/www
|
||||
rm -rf setup-wizard/node_modules
|
||||
rm -rf setup-wizard/www
|
||||
rm -rf diagnostic-ui/node_modules
|
||||
rm -rf diagnostic-ui/www
|
||||
rm -rf patch-db/client/node_modules
|
||||
rm -rf patch-db/client/dist
|
||||
|
||||
buster.img:
|
||||
wget -O buster.zip https://downloads.raspberrypi.org/raspios_lite_armhf/images/raspios_lite_armhf-2020-08-24/2020-08-20-raspios-buster-armhf-lite.zip
|
||||
unzip buster.zip
|
||||
rm buster.zip
|
||||
mv 2020-08-20-raspios-buster-armhf-lite.img buster.img
|
||||
eos.img: $(EMBASSY_SRC)
|
||||
./build/make-image.sh
|
||||
|
||||
product_key:
|
||||
echo "X\c" > product_key
|
||||
cat /dev/random | base32 | head -c11 | tr '[:upper:]' '[:lower:]' >> product_key
|
||||
ubuntu.img:
|
||||
wget -O ubuntu.img.xz https://cdimage.ubuntu.com/releases/21.04/release/ubuntu-21.04-preinstalled-server-arm64+raspi.img.xz
|
||||
unxz ubuntu.img.xz
|
||||
|
||||
$(APPMGR_RELEASE_SRC): $(APPMGR_SRC)
|
||||
ifeq ($(UNAME), armv7l)
|
||||
cd appmgr && cargo update && cargo build --release --features=production
|
||||
arm-linux-gnueabihf-strip appmgr/target/release/appmgr
|
||||
else
|
||||
docker run --rm -it -v ~/.cargo/registry:/root/.cargo/registry -v "$(shell pwd)":/home/rust/src start9/rust-arm-cross:latest sh -c "(cd appmgr && cargo build --release --features=production)"
|
||||
docker run --rm -it -v ~/.cargo/registry:/root/.cargo/registry -v "$(shell pwd)":/home/rust/src start9/rust-arm-cross:latest arm-linux-gnueabi-strip appmgr/target/armv7-unknown-linux-gnueabihf/release/appmgr
|
||||
endif
|
||||
product_key.txt:
|
||||
echo "X\c" > product_key.txt
|
||||
cat /dev/random | base32 | head -c11 | tr '[:upper:]' '[:lower:]' >> product_key.txt
|
||||
|
||||
appmgr: $(APPMGR_RELEASE_SRC)
|
||||
|
||||
agent/dist/agent: $(AGENT_SRC)
|
||||
(cd agent && ./build.sh)
|
||||
|
||||
agent: agent/dist/agent
|
||||
$(EMBASSY_BINS): $(APPMGR_SRC)
|
||||
cd appmgr && ./build-prod.sh
|
||||
|
||||
ui/node_modules: ui/package.json
|
||||
npm --prefix ui install
|
||||
|
||||
ui/www: $(UI_SRC) ui/node_modules
|
||||
ui/www: $(UI_SRC) ui/node_modules patch-db/client/dist ui/config.json
|
||||
npm --prefix ui run build-prod
|
||||
|
||||
ui: ui/www
|
||||
ui/config.json:
|
||||
cp ui/config-sample.json ui/config.json
|
||||
|
||||
$(LIFELINE_RELEASE_SRC): $(LIFELINE_SRC)
|
||||
ifeq ($(UNAME), armv7l)
|
||||
cd lifeline && cargo build --release
|
||||
arm-linux-gnueabihf-strip lifeline/target/release/lifeline
|
||||
else
|
||||
docker run --rm -it -v ~/.cargo/registry:/root/.cargo/registry -v "$(shell pwd)":/home/rust/src start9/rust-arm-cross:latest sh -c "(cd lifeline && cargo build --release)"
|
||||
docker run --rm -it -v ~/.cargo/registry:/root/.cargo/registry -v "$(shell pwd)":/home/rust/src start9/rust-arm-cross:latest arm-linux-gnueabi-strip lifeline/target/armv7-unknown-linux-gnueabihf/release/lifeline
|
||||
endif
|
||||
setup-wizard/node_modules: setup-wizard/package.json
|
||||
npm --prefix setup-wizard install
|
||||
|
||||
setup-wizard/www: $(SETUP_WIZARD_SRC) setup-wizard/node_modules setup-wizard/config.json
|
||||
npm --prefix setup-wizard run build-prod
|
||||
|
||||
setup-wizard/config.json:
|
||||
cp setup-wizard/config-sample.json setup-wizard/config.json
|
||||
|
||||
diagnostic-ui/node_modules: diagnostic-ui/package.json
|
||||
npm --prefix diagnostic-ui install
|
||||
|
||||
diagnostic-ui/www: $(DIAGNOSTIC_UI_SRC) diagnostic-ui/node_modules diagnostic-ui/config.json
|
||||
npm --prefix diagnostic-ui run build-prod
|
||||
|
||||
diagnostic-ui/config.json:
|
||||
cp diagnostic-ui/config-sample.json diagnostic-ui/config.json
|
||||
|
||||
patch-db/client/node_modules: patch-db/client/package.json
|
||||
npm --prefix patch-db/client install
|
||||
|
||||
patch-db/client/dist: $(PATCH_DB_SRC) patch-db/client/node_modules
|
||||
npm --prefix patch-db/client run build
|
||||
|
||||
ui: $(EMBASSY_UIS)
|
||||
|
||||
lifeline: $(LIFELINE_RELEASE_SRC)
|
||||
|
||||
Reference in New Issue
Block a user