-
Notifications
You must be signed in to change notification settings - Fork 15
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
Improved script portability #19
Conversation
I've resolved the merge conflict in https://github.com/white-gecko/flash-it/tree/feature/mergePortable |
The build process appeared to terminate correctly but actually did not prepare the SD card for the boot, so it does not boot.
Sorry, the error output is in German |
working on a fix for the copying issue |
The issue seems to be that data/boot/ is only readable by root, and that the /* expands as the user running the script, not by sudo. Since the user cannot read this directory it expands to as_root chmod a+rx "$MOUNT_DATA/boot" Just gonna go through the script once, flashing to my SD card before I commit the changes. |
Ran the script! It now copies successfully. I'm not to sure what conflicts should be resolved to be able to merge this, but I guess I'll look into it. |
There we go! I merged master and redid the changes from the 4 commits since my fork. |
flash-it.sh
Outdated
printf '%s\n' "[1mWhich image do you want to flash?[0m" | ||
|
||
: $(( i = 0 )) | ||
for opt in "PinePhone 1.0 (Development) device" "PinePhone 1.1 (Brave Heart) or 1.2 (Community Editions) devicnePhone 1.1 (Brave Heart) or 1.2 (Community Editions) device" "PineTab device" "PineTab Dev device" "Dont Be Evil devkit"; do |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be
for opt in "PinePhone 1.0 (Development) device" "PinePhone 1.1 (Brave Heart) or 1.2 (Community Editions) device" "PineTab device" "PineTab Dev device" "Dont Be Evil devkit"; do
something came out duplicated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thank you, solved!
Flash an boot successful for me. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks got to me, the bugs I have discovered have existed before already ;-) (#24)
This PR improves the script portability in a multitude of ways. The script still retains all functionality and will be identical to the end user.
The most significant of which is porting the script from bash to sh, this means that systems which do not have bash preinstalled (e.g alpinelinux) don't have to install bash to run it.
The script has also been changed to support the busybox wget implementation, yet still use the
--show-progress
flag if present. The script can now also use curl instead of wget if wget is not installed but curl is.The script now also supports using other methods of running commands as root, meaning users who prefer
doas
tosudo
won't have to install sudo. Additionally, if neither doas nor sudo is found the script will now usesu
which should be present on all systems.The scripts indentation has also been fixed so that it's easier to tell what code belongs to which logical block. Multiple prints after each other have been replaced with single multiline prints. Printing to stderr and exiting has been moved into a function. Variables have been quoted in order to avoid unwanted splitting (which could case errors).