I have made some improvements to make_custom_pi_os after having some friction getting started on macos:
Improve portability of make_custom_pi_os
Use which to check for gsed and use it if available:
macos ships with BSD sed which doesn't support -i for in-place
editing
get the primary group of the current user with id -gn instead
of hardcoding it to ${USER} - macos doesn't create a group
with the same name as the user by default
Add quotes around a bunch of variables to prevent globbing /
word splitting
Use set -euo pipefail to make the script fail on errors and
undefined variables, rather than silently continuing
Use '-s' flag with curl to prevent it from printing the download
progress bar when retrieving version info
Check we can retrieve the filename of the latest Raspbian image
before downloading it
Print out the URL of the image we're downloading
Allow specifying variant when creating new custom os
Rather than just the hardcoded raspios_lite_armhf, users can now specify
raspios_lite_armhf or raspios_lite_arm64 with -v/--variant
Guard against space / hyphen in the destination folder
This causes some pain, as the default module uses this directory name for creating variables.
If these characters are just disallowed, this pain goes away
Hello!
I have made some improvements to
make_custom_pi_os
after having some friction getting started on macos:Improve portability of make_custom_pi_os
which
to check forgsed
and use it if available: macos ships with BSD sed which doesn't support-i
for in-place editingid -gn
instead of hardcoding it to${USER}
- macos doesn't create a group with the same name as the user by defaultset -euo pipefail
to make the script fail on errors and undefined variables, rather than silently continuingAllow specifying variant when creating new custom os
Rather than just the hardcoded
raspios_lite_armhf
, users can now specifyraspios_lite_armhf
orraspios_lite_arm64
with-v/--variant
Guard against space / hyphen in the destination folder
This causes some pain, as the default module uses this directory name for creating variables. If these characters are just disallowed, this pain goes away