add special option for pi-gen for building piscsi images (#1107)

Co-authored-by: Tony Kuker <akuker@gmail.com>
This commit is contained in:
Tony Kuker 2023-02-26 20:29:32 -06:00 committed by GitHub
parent 1082b6a7b4
commit 059a31ba53
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 26 additions and 1 deletions

View File

@ -87,6 +87,12 @@ function initialChecks() {
fi
}
# Only to be used for pi-gen automated install
function cacheSudo() {
echo "Caching sudo password"
echo raspberry | sudo -v -S
}
# checks that the current user has sudoers privileges
function sudoCheck() {
if [[ $HEADLESS ]]; then
@ -1359,6 +1365,25 @@ function runChoice() {
installPackagesStandalone
compilePiscsi
;;
99)
echo "Hidden setup mode for running the pi-gen utility"
echo "This shouldn't be used by normal users"
sudoCache
createImagesDir
createCfgDir
updatePiscsiGit
installPackages
installHfdisk
fetchHardDiskDrivers
compilePiscsi
installPiscsi
enablePiscsiService
preparePythonCommon
cachePipPackages
installPiscsiWebInterface
installWebInterfaceService
echo "Automated install of the PiSCSI Service $(CONNECT_TYPE) complete!"
;;
-h|--help|h|help)
showMenu
;;
@ -1372,7 +1397,7 @@ function runChoice() {
function readChoice() {
choice=-1
until [ $choice -ge "0" ] && [ $choice -le "16" ]; do
until [ $choice -ge "0" ] && ([ $choice -eq "99" ] || [ $choice -le "16" ]) ; do
echo -n "Enter your choice (0-16) or CTRL-C to exit: "
read -r choice
done