mirror of
https://github.com/Start9Labs/start-os.git
synced 2026-03-30 12:11:56 +00:00
🛠️ Adding BuildGuide branch for the ease of use (#252)
* Create BuildGuide.md * bug fixes * Update BuildGuide.md * Update make_image.sh * Update BuildGuide.md * Update make_image.sh additional improvements and "done" message added. Thanks @k0gen! * Update BuildGuide.md Added intro notes and made minor adjustments to the guide. * Update setup.sh Required adjustments to prevent reboot when following BuildGuide.md * Update BuildGuide.md Improvements to final setup steps * bug fix additional improvements and "done" message added. Thanks @k0gen! * Update Makefile Changes to facilitate building process when using the BuildGuide * Update BuildGuide.md Avoiding manual changes to Makefile and cleaning up step 7 * Update BuildGuide.md Switching from sftp to cp for one line command simplification * Update BuildGuide.md Simplified method of transferring .img to desktop. Thanks @k0gen! * Update BuildGuide.md update to latest openssl https://www.openssl.org/news/openssl-1.1.1-notes.html * Update BuildGuide.md Simplified step 6 and added new required dependency * Update BuildGuide.md Added hint on how to check `agent` log * Update setup.sh Added missing dependency * Update BuildGuide.md Simplified step 6 * Simplifying Rust installation One line install, reboot is no longer needed. * make_image.sh +x Make it executable before running * Step no longer needed chmod +x done by Makefile * Update BuildGuide.md Added dependency for Rust setup * Adding BuildGuide branch for the ease of use * Forgot about the guide file :) * Update BuildGuide.md apt -y by default and some environment add-ons Co-authored-by: Tommy Smith <63304263+t0mmysm1th@users.noreply.github.com>
This commit is contained in:
@@ -1,5 +1,10 @@
|
||||
#!/bin/bash
|
||||
|
||||
arch=$(uname -m)
|
||||
if [[ $arch == armv7l ]]; then
|
||||
dev_target="target"
|
||||
else
|
||||
dev_target="target/armv7-unknown-linux-musleabihf"
|
||||
fi
|
||||
mv buster.img embassy.img
|
||||
product_key=$(cat product_key)
|
||||
loopdev=$(losetup -f -P embassy.img --show)
|
||||
@@ -9,6 +14,12 @@ mkdir -p "${root_mountpoint}"
|
||||
mkdir -p "${boot_mountpoint}"
|
||||
mount "${loopdev}p2" "${root_mountpoint}"
|
||||
mount "${loopdev}p1" "${boot_mountpoint}"
|
||||
mkdir -p "${root_mountpoint}/root/agent"
|
||||
mkdir -p "${root_mountpoint}/etc/docker"
|
||||
mkdir -p "${root_mountpoint}/home/pi/.ssh"
|
||||
echo -n "" > "${root_mountpoint}/home/pi/.ssh/authorized_keys"
|
||||
chown -R pi:pi "${root_mountpoint}/home/pi/.ssh"
|
||||
echo -n "" > "${boot_mountpoint}/ssh"
|
||||
echo "${product_key}" > "${root_mountpoint}/root/agent/product_key"
|
||||
echo -n "start9-" > "${root_mountpoint}/etc/hostname"
|
||||
echo -n "${product_key}" | shasum -t -a 256 | cut -c1-8 >> "${root_mountpoint}/etc/hostname"
|
||||
@@ -18,20 +29,23 @@ echo -n "${product_key}" | shasum -t -a 256 | cut -c1-8 >> "${root_mountpoint}/e
|
||||
mv "${root_mountpoint}/etc/hosts.tmp" "${root_mountpoint}/etc/hosts"
|
||||
cp agent/dist/agent "${root_mountpoint}/usr/local/bin/agent"
|
||||
chmod 700 "${root_mountpoint}/usr/local/bin/agent"
|
||||
cp appmgr/target/armv7-unknown-linux-musleabihf/release/appmgr "${root_mountpoint}/usr/local/bin/appmgr"
|
||||
cp "appmgr/${dev_target}/release/appmgr" "${root_mountpoint}/usr/local/bin/appmgr"
|
||||
chmod 700 "${root_mountpoint}/usr/local/bin/appmgr"
|
||||
cp lifeline/target/armv7-unknown-linux-musleabihf/release/lifeline "${root_mountpoint}/usr/local/bin/lifeline"
|
||||
cp "lifeline/${dev_target}/release/lifeline" "${root_mountpoint}/usr/local/bin/lifeline"
|
||||
chmod 700 "${root_mountpoint}/usr/local/bin/lifeline"
|
||||
cp docker-daemon.json "${root_mountpoint}/etc/docker/daemon.json"
|
||||
cp setup.sh "${root_mountpoint}/root/setup.sh"
|
||||
chmod 700 "${root_mountpoint}/root/setup.sh"
|
||||
cp setup.service /etc/systemd/system/setup.service
|
||||
cp lifeline/lifeline.service /etc/systemd/system/lifeline.service
|
||||
cp agent/config/agent.service /etc/systemd/system/agent.service
|
||||
cat "${boot_mountpoint}/config.txt" | grep -v "dtoverlay=pwm-2chan" > "${boot_mountpoint}/config.txt.tmp"
|
||||
cp setup.service "${root_mountpoint}/etc/systemd/system/setup.service"
|
||||
ln -s /etc/systemd/system/setup.service "${root_mountpoint}/etc/systemd/system/getty.target.wants/setup.service"
|
||||
cp lifeline/lifeline.service "${root_mountpoint}/etc/systemd/system/lifeline.service"
|
||||
cp agent/config/agent.service "${root_mountpoint}/etc/systemd/system/agent.service"
|
||||
cat "${boot_mountpoint}/config.txt" | grep -v "dtoverlay=" > "${boot_mountpoint}/config.txt.tmp"
|
||||
echo "dtoverlay=pwm-2chan" >> "${boot_mountpoint}/config.txt.tmp"
|
||||
mv "${boot_mountpoint}/config.txt.tmp" "${boot_mountpoint}/config.txt"
|
||||
umount "${root_mountpoint}"
|
||||
rm -r "${root_mountpoint}"
|
||||
umount "${boot_mountpoint}"
|
||||
rm -r "${boot_mountpoint}"
|
||||
losetup -d ${loopdev}
|
||||
losetup -d ${loopdev}
|
||||
echo "DONE! Here is your EmbassyOS key: ${product_key}"
|
||||
Reference in New Issue
Block a user