diff --git a/.gitignore b/.gitignore index de75c385d..c91de92fd 100644 --- a/.gitignore +++ b/.gitignore @@ -20,6 +20,9 @@ secrets.db /GIT_HASH.txt /VERSION.txt /embassyos-*.tar.gz +/eos-*.tar.gz /*.deb /target -/*.squashfs \ No newline at end of file +/*.squashfs +/debian +/DEBIAN \ No newline at end of file diff --git a/Makefile b/Makefile index b5c2b6193..b2e242558 100644 --- a/Makefile +++ b/Makefile @@ -70,6 +70,10 @@ lite-upgrade.img: raspios.img cargo-deps/aarch64-unknown-linux-gnu/release/nc-br ! test -f lite-upgrade.img || rm lite-upgrade.img ./build/raspberry-pi/make-upgrade-image.sh +eos_raspberrypi.img: raspios.img $(BUILD_SRC) eos.raspberrypi.squashfs $(VERSION_FILE) $(ENVIRONMENT_FILE) $(GIT_HASH_FILE) + ! test -f eos_raspberrypi.img || rm eos_raspberrypi.img + ./build/raspberry-pi/make-initialized-image.sh + # For creating os images. DO NOT USE install: all mkdir -p $(DESTDIR)/usr/bin diff --git a/build/RELEASE.md b/build/RELEASE.md new file mode 100644 index 000000000..a99cb0528 --- /dev/null +++ b/build/RELEASE.md @@ -0,0 +1,72 @@ +# Release Process + +## `embassyos_0.3.x-1_amd64.deb` + +- Description: debian package for x86_64 - intended to be installed on pureos +- Destination: GitHub Release Tag +- Requires: N/A +- Build steps: + - Clone `https://github.com/Start9Labs/embassy-os-deb` at `master` + - Run `make TAG=master` from that folder +- Artifact: `./embassyos_0.3.x-1_amd64.deb` + +## `eos---_amd64.iso` + +- Description: live usb image for x86_64 +- Destination: GitHub Release Tag +- Requires: `embassyos_0.3.x-1_amd64.deb` +- Build steps: + - Clone `https://github.com/Start9Labs/eos-image-recipes` at `master` + - Copy `embassyos_0.3.x-1_amd64.deb` to + `overlays/vendor/root/embassyos_0.3.x-1_amd64.deb` + - Run `./run-local-build.sh byzantium` from that folder +- Artifact: `./results/eos---_amd64.iso` + +## `eos.x86_64.squashfs` + +- Description: compressed embassyOS x86_64 filesystem image +- Destination: GitHub Release Tag, Registry @ + `resources/eos//eos.x86_64.squashfs` +- Requires: `eos---_amd64.iso` +- Build steps: + - From `https://github.com/Start9Labs/eos-image-recipes` at `master` + - `./extract-squashfs.sh results/eos---_amd64.iso` +- Artifact: `./results/eos.x86_64.squashfs` + +## `eos.raspberrypi.squashfs` + +- Description: compressed embassyOS raspberrypi filesystem image +- Destination: GitHub Release Tag, Registry @ + `resources/eos//eos.raspberrypi.squashfs` +- Requires: N/A +- Build steps: + - Clone `https://github.com/Start9Labs/embassy-os` at `master` + - `make embassyos-raspi.img` + - flash `embassyos-raspi.img` to raspberry pi + - boot raspberry pi with ethernet + - wait for chime + - you can watch logs using `nc 8080` + - unplug raspberry pi, put sd card back in build machine + - `./build/raspberry-pi/rip-image.sh` +- Artifact: `./eos.raspberrypi.squashfs` + +## `lite-upgrade.img` + +- Description: update image for users coming from 0.3.2.1 and before +- Destination: Registry @ `resources/eos//eos.img` +- Requires: `eos.raspberrypi.squashfs` +- Build steps: + - From `https://github.com/Start9Labs/embassy-os` at `master` + - `make lite-upgrade.img` +- Artifact `./lite-upgrade.img` + +## `eos---_raspberrypi.tar.gz` + +- Description: pre-initialized raspberrypi image +- Destination: GitHub Release Tag (as tar.gz) +- Requires: `eos.raspberrypi.squashfs` +- Build steps: + - From `https://github.com/Start9Labs/embassy-os` at `master` + - `make eos_raspberrypi.img` + - `tar --format=posix -cS -f- eos---_raspberrypi.img | gzip > eos---_raspberrypi.tar.gz` +- Artifact `./eos---_raspberrypi.tar.gz` diff --git a/build/raspberry-pi/make-initialized-image.sh b/build/raspberry-pi/make-initialized-image.sh new file mode 100755 index 000000000..da9adfa88 --- /dev/null +++ b/build/raspberry-pi/make-initialized-image.sh @@ -0,0 +1,64 @@ +#!/bin/bash + +set -e + +function partition_for () { + if [[ "$1" =~ [0-9]+$ ]]; then + echo "$1p$2" + else + echo "$1$2" + fi +} + +VERSION=$(cat VERSION.txt) +ENVIRONMENT=$(cat ENVIRONMENT.txt) +GIT_HASH=$(cat GIT_HASH.txt | head -c 7) +DATE=$(date +%Y%m%d) + +VERSION_FULL="$VERSION-$GIT_HASH" + +if [ -n "$ENVIRONMENT" ]; then + VERSION_FULL="$VERSION_FULL~$ENVIRONMENT" +fi + +TARGET_NAME=eos-${VERSION_FULL}-${DATE}_raspberrypi.img +TARGET_SIZE=$[(31116287+1)*512] + +rm -f $TARGET_NAME +truncate -s $TARGET_SIZE $TARGET_NAME +( + echo o + echo x + echo i + echo "0xcb15ae4d" + echo r + echo n + echo p + echo 1 + echo 2048 + echo 526335 + echo 1050623 + echo n + echo p + echo 2 + echo 1050624 + echo 31116287 + echo a + echo 1 + echo w +) | fdisk $TARGET_NAME +OUTPUT_DEVICE=$(sudo losetup --show -fP $TARGET_NAME) +sudo mkfs.ext4 `partition_for ${OUTPUT_DEVICE} 2` +sudo mkfs.vfat `partition_for ${OUTPUT_DEVICE} 1` + +TMPDIR=$(mktemp -d) + +sudo mount `partition_for ${OUTPUT_DEVICE} 2` $TMPDIR +sudo mkdir -p $TMPDIR/config +sudo mkdir -p $TMPDIR/next +sudo mkdir -p $TMPDIR/current/boot +sudo mount `partition_for ${OUTPUT_DEVICE} 1` $TMPDIR/current/boot +sudo unsquashfs -f -d $TMPDIR/current eos.raspberrypi.squashfs +sudo umount $TMPDIR/current/boot +sudo umount $TMPDIR +sudo losetup -d $OUTPUT_DEVICE \ No newline at end of file diff --git a/build/raspberry-pi/rip-image.sh b/build/raspberry-pi/rip-image.sh index d1574a88e..390b7cba7 100755 --- a/build/raspberry-pi/rip-image.sh +++ b/build/raspberry-pi/rip-image.sh @@ -19,8 +19,9 @@ fi sudo mount $ROOT_PARTITION $TMPDIR/ sudo mount $BOOT_PARTITION $TMPDIR/current/boot/ -sudo sed -i 's/PARTUUID=[a-f0-9]+/PARTUUID=cb15ae4d/g' $TMPDIR/current/etc/fstab -sudo sed -i 's/PARTUUID=[a-f0-9]+/PARTUUID=cb15ae4d/g' $TMPDIR/current/boot/cmdline.txt +sudo sed -i 's/PARTUUID=[a-f0-9]\+/PARTUUID=cb15ae4d/g' $TMPDIR/current/etc/fstab +sudo sed -i 's/PARTUUID=[a-f0-9]\+/PARTUUID=cb15ae4d/g' $TMPDIR/current/boot/cmdline.txt +rm -f eos.raspberrypi.squashfs sudo mksquashfs $TMPDIR/current/ eos.raspberrypi.squashfs sudo umount $TMPDIR/current/boot/ diff --git a/system-images/compat/Cargo.lock b/system-images/compat/Cargo.lock index 146b061d5..9f426efa8 100644 --- a/system-images/compat/Cargo.lock +++ b/system-images/compat/Cargo.lock @@ -950,7 +950,7 @@ dependencies = [ [[package]] name = "embassy-os" -version = "0.3.2-rev.1" +version = "0.3.3" dependencies = [ "aes", "async-stream",