Improved script portability #19
No reviewers
Labels
No Label
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: crt0mega/flash-it#19
Loading…
Reference in New Issue
No description provided.
Delete Branch "depsterr/master"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
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).
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
cp: der Aufruf von stat für './data/boot/*' ist nicht möglich: Datei oder Verzeichnis nicht gefunden
. It is just tells, that'./data/boot/*'
does not exist. Actually./data/boot/
exists and has content, it has to be some problem with the*
in/bin/sh
in combination with the implementation ofas_root
.Once this is done, it will also fix #21 and #22.
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
./data/boot/*
instead of the list of files. This can just be solved by allowing all users to read the directory before doing the copy.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.
This should be
something came out duplicated
thank you, solved!
Flash an boot successful for me.
Looks got to me, the bugs I have discovered have existed before already ;-) (#24)