guysoft / CustomPiOS

A Raspberry Pi and other ARM devices distribution builder
GNU General Public License v3.0
497 stars 143 forks source link

Various fixes and improvements #204

Closed umlaeute closed 10 months ago

umlaeute commented 10 months ago

base build system

the make_custom_pi_os script now allows more variants to download directly, namely the non-lite variants of raspios.

the build_custom_os script (and therefore the build_dist script for the various custom distributions) now accepts a few options:

the custompios scriptlet now checks if sfdisk is available (and required), and aborts early with a warning. (on my Debian system, sfdisk lives in /sbin, which is not in my PATH. oftentimes i accidentally run ./build_dist as an ordinary (non-root) user, which would happily work away only to fail at the end when resizing the image. with this change it now fails after a few seconds, rather than after an hour, and i'm reminded to run through sudo...

in common.sh i've changed most echo invocations to use their colour variants (since the build log is so verbose with all those set -x, i really like the things that the build script wants to tell me to stand out visually).

also in common.sh, i've improved the detach_all_loopback() function, to test possible loop-devices for being a block device rather than a regular file.

modules

the pkgupgrade module now uses apt-get instead of apt

to quote from man apt:

SCRIPT USAGE AND DIFFERENCES FROM OTHER APT TOOLS

The apt(8) commandline is designed as an end-user tool and it may change behavior between versions. While it tries not to break backward compatibility this is not guaranteed either if a change seems beneficial for interactive use.

All features of apt(8) are available in dedicated APT tools like apt‐get(8) and apt‐cache(8) as well. apt(8) just changes the default value of some options (see apt.conf(5) and specifically the Binary scope). So you should prefer using these commands (potentially with some additional options enabled) in your scripts as they keep backward compatibility as much as possible.

there's a new PKGUPGRADE_CLEANUP variable that can be set to n (or really: anything except the default y), in which case the apt-cache is not cleaned up. this is cool if you do not want to download the tons of deb packages for each build without setting up an apt-cacher.

minor stuff

i've added a few .gitignore files to the dist_example, in order to make sure that image-files are not accidentally committed to my precious git repository.

i've also run codespell over the sources and fixed spelling errors.

finally, the build process now shows the date when the build was started resp. finished. i find it nice to see how long it took, even when not closely watching the script)

feel free to cherry pick, or just merge the whole bunch.

umlaeute commented 10 months ago

is there anything i can do to improve this PR in order to get it accepted? (like squashing commits that really belong together, e.g. 8535e22+ca61833, c1b3e5a+f5c58bd, or b10ed77+25bff8b)?

guysoft commented 10 months ago

Hey, I just need to find time to go over it. I just have a lot of family stuff going on the past few days. did not forget you.

Also - what did you use to detect all the spelling errors? :)

umlaeute commented 10 months ago

Sorry for being impatient. Thx for merging

umlaeute commented 10 months ago

Also - what did you use to detect all the spelling errors? :)

apt-get install codespell
codespell .