-
Notifications
You must be signed in to change notification settings - Fork 14
ixbin: Add util script to update image contents #1042
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
Conversation
troglobit
left a comment
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.
Very nice work!
utils/ixbin
Outdated
| ensuredeps() | ||
| { | ||
| DEPS="fakeroot mksquashfs unsquashfs awk env mkimage truncate dtc fdtget rauc" | ||
| which -s $DEPS && return 0 |
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.
I get error about -s flag for which on Ubuntu 22.
Illegal option -s
Usage: /usr/bin/which [-a] args
Maybe something about the version for which changing between Ubuntu 22 and Ubuntu 24...?
which is mostly just an alias for type with some flags on some distros. I would probably use type here for better portability.
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.
Good catch! Here's another alternative I often use myself, example from another (POSIX shell compliant) script:
error()
{
printf "\033[1;31mError: %s\033[0m\n" "$*" >&2
}
fatal()
{
error "$*"
exit 1
}
# Check for required programs
for proggy in $DEPS; do
if ! command -v $proggy >/dev/null 2>&1; then
fatal "$proggy not found, required."
fi
doneThere 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.
TIL: which is not in POSIX.
The shame, the absolute SHAME! 😆
Updated the script to use command -v instead.
@abbenteprizer is it working as expected otherwise?
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.
The horror! Yes nice, great! Yes, the script seems to work. Just want to verify that it works as expected when on real hardware before +1.
Description
Checklist
Tick relevant boxes, this PR is-a or has-a: