From 059a31ba5391516f10ee74dd537b1aa8537227f0 Mon Sep 17 00:00:00 2001 From: Tony Kuker <34318535+akuker@users.noreply.github.com> Date: Sun, 26 Feb 2023 20:29:32 -0600 Subject: [PATCH] add special option for pi-gen for building piscsi images (#1107) Co-authored-by: Tony Kuker --- easyinstall.sh | 27 ++++++++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) diff --git a/easyinstall.sh b/easyinstall.sh index 2b70994f..cb0efd17 100755 --- a/easyinstall.sh +++ b/easyinstall.sh @@ -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