-
Notifications
You must be signed in to change notification settings - Fork 58
Add SD card validation step to client-side installer #363
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
shitwolfymakes
wants to merge
6
commits into
X1Plus:main
Choose a base branch
from
fabra-ai:pr-add-installer-formatting-step
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
eb8e3fa
Updated build instructions
shitwolfymakes c6c83f9
Create build.sh
shitwolfymakes e8ad145
Update README.md
shitwolfymakes dcb949d
add SD card validation step
shitwolfymakes c3ab0d7
Added check if being run as root/sudo
shitwolfymakes b01b9e4
Updated error message
shitwolfymakes File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
#! /bin/bash | ||
|
||
### THIS ONLY WORKS IF THE USER HAS BEEN ADDED TO THE DOCKER GROUP | ||
### RUNNING THIS WITH `sudo ./build.sh` RESULTS IN DUBIOUS OWNERSHIP | ||
### ERRORS WHEN BUILDING THE FIRMWARE | ||
if [ "$EUID" -eq 0 ]; then | ||
echo "Please do not run as root/with sudo. Exiting..." | ||
exit 1 | ||
fi | ||
|
||
cd .. | ||
# check if x1plusbuild docker image exists | ||
if ! docker image ls --format '{{.Repository}}' | grep -q '^x1plusbuild$'; then | ||
echo "x1plusbuild docker image not found, building..." | ||
docker build -t x1plusbuild scripts/docker/ || exit 1 | ||
fi | ||
|
||
# build the installer | ||
echo "Building the electron app..." | ||
docker run -u "$(id -u)" -v "$(pwd)":/work x1plusbuild bash -c 'cd installer-clientside/x1p-js && npm i && npm run build' || exit 1 | ||
|
||
# build the firmware | ||
echo "Building the latest firmware..." | ||
[ -L latest.x1p ] && rm latest.x1p # delete the symlink to the old firmware before building the new one | ||
docker run -u "$(id -u)" -v "$(pwd)":/work x1plusbuild bash -c 'make && ln -s "$(jq -r '.cfwVersion' ota.json).x1p" latest.x1p' || exit 1 | ||
|
||
# package the installer with the latest build of the firmware | ||
echo "Packaging everything..." | ||
docker run -u "$(id -u)" -v "$(pwd)":/work x1plusbuild bash -c 'cd installer-clientside/install-gui && npm i && bash pack-em-all.sh' || exit 1 | ||
|
||
cd installer-clientside || exit 1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.