added some sanity checks and dependencies
This commit is contained in:
parent
0ed6ab00fe
commit
202fd34ab1
|
|
@ -6,15 +6,17 @@ This script is "interactive". Meaning that it asks you questions when run to cus
|
|||
|
||||
|
||||
## Dependencies:
|
||||
* bash
|
||||
* wget
|
||||
* git
|
||||
* systemd
|
||||
* dialog
|
||||
* parted
|
||||
* libarchive
|
||||
|
||||
## Installing:
|
||||
To use this script, please make sure that the following is correct:
|
||||
|
||||
* your default Shell is Bash.
|
||||
* an SD card with at least 4 GB storage is plugged in.
|
||||
|
||||
## Known Issues:
|
||||
|
|
@ -24,7 +26,7 @@ To use this script, please make sure that the following is correct:
|
|||
To use this script, simple run it as normal user after you make it executable:
|
||||
```
|
||||
chmod +x manjaro-arm-installer
|
||||
./manjaro-arm-installer
|
||||
bash /manjaro-arm-installer
|
||||
```
|
||||
|
||||
## Other notes:
|
||||
|
|
|
|||
|
|
@ -13,6 +13,31 @@ PASSWORD=""
|
|||
ROOTPASSWORD=""
|
||||
SDCARD=""
|
||||
|
||||
# Sanity checks for dependencies
|
||||
|
||||
if [ ! -f /usr/bin/sudo ]
|
||||
echo "sudo command is missing! Please install sudo!"
|
||||
exit 1
|
||||
elif [ ! -f /usr/bin/git ]
|
||||
echo "git command is missing! Please install git!"
|
||||
exit 1
|
||||
elif [ ! -f /usr/bin/parted ]
|
||||
echo "parted command is missing! Please install parted!"
|
||||
exit 1
|
||||
elif [ ! -f /usr/bin/systemd-nspawn ]
|
||||
echo "systemd-nspawn command is missing! Please install systemd!"
|
||||
exit 1
|
||||
elif [ ! -f /usr/bin/wget ]
|
||||
echo "wget command is missing! Please install wget!"
|
||||
exit 1
|
||||
elif [ ! -f /usr/bin/dialog ]
|
||||
echo "dialog command is missing! Please install dialog!"
|
||||
exit 1
|
||||
elif [ ! -f /usr/bin/bsdtar ]
|
||||
echo "bsdtar command is missing! Please install libarchive!"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
|
||||
# Functions
|
||||
msg() {
|
||||
|
|
@ -283,9 +308,9 @@ DEVICE=$(dialog --clear --title "Manjaro ARM Installer" \
|
|||
"rpi3" "Raspberry Pi 3" \
|
||||
"oc2" "Odroid C2" \
|
||||
"pinebook" "PineBook" \
|
||||
"rpi2" "Raspberry Pi 2 (not maintained)" \
|
||||
"oc1" "Odroid C1/C1+ (not maintained)" \
|
||||
"xu4" "Odroid XU4 (not maintained)" 3>&1 1>&2 2>&3 3>&-)
|
||||
"rpi2" "Raspberry Pi 2 (unmaintained)" \
|
||||
"oc1" "Odroid C1/C1+ (unmaintained)" \
|
||||
"xu4" "Odroid XU4 (unmaintained)" 3>&1 1>&2 2>&3 3>&-)
|
||||
|
||||
|
||||
#The if statement makes sure that the user has put in something in the previous prompt. If not (left blank or pressed cancel) the script will end
|
||||
|
|
@ -295,7 +320,7 @@ EDITION=$(dialog --clear --title "Manjaro ARM Installer" \
|
|||
--menu "Choose an edition:" 20 50 5 \
|
||||
"minimal" "Minimal Edition (Just CLI)" \
|
||||
"lxqt" "Full LXQT Desktop and apps (lightweight)" \
|
||||
"kde" "Full KDE Desktop (Heavy)" \
|
||||
"kde" "Full KDE/Plasma Desktop (Heavy)" \
|
||||
"mate" "Full MATE desktop and apps (lightweight, not maintained)" \
|
||||
"i3" "Mininal i3 WM with apps (very light)" 3>&1 1>&2 2>&3 3>&-)
|
||||
|
||||
|
|
@ -356,7 +381,7 @@ while read -r line; do
|
|||
W+=($line "")
|
||||
done < <( lsblk -adn -o NAME )
|
||||
SDCARD=$(dialog --title "Manjaro ARM Installer" \
|
||||
--menu "Chose your SDCard" 20 50 10 \
|
||||
--menu "Chose your SDCard - Be sure the correct drive is selected!" 20 50 15 \
|
||||
"${W[@]}" 3>&2 2>&1 1>&3)
|
||||
|
||||
# add /dev/ to the selected option above
|
||||
|
|
@ -367,15 +392,23 @@ else
|
|||
fi
|
||||
|
||||
|
||||
# List all the responses upon completion (remove this for production)
|
||||
# List all the responses upon completion to be verified
|
||||
clear
|
||||
echo "Device = $DEVICE"
|
||||
echo "Edition = $EDITION"
|
||||
echo "User name = $USER"
|
||||
echo "Password for $USER = ********** ($PASSWORD)" #password is here for testing purposes
|
||||
echo "Root Password = ********** ($ROOTPASSWORD)" #password is here for testing purposes
|
||||
echo "Password for $USER = ($PASSWORD)"
|
||||
echo "Root Password = ($ROOTPASSWORD)"
|
||||
echo "SDCard = $SDCARD"
|
||||
|
||||
echo "Are the above settings correct?"
|
||||
select yn in "Yes" "No"; do
|
||||
case $yn in
|
||||
Yes ) echo "Continuing..."; break;;
|
||||
No ) exit 1;;
|
||||
esac
|
||||
done
|
||||
|
||||
if [[ "$DEVICE" = "oc1" ]] || [[ "$DEVICE" = "rpi2" ]] || [[ "$DEVICE" = "xu4" ]]; then
|
||||
ARCH='armv7h'
|
||||
else
|
||||
|
|
|
|||
Loading…
Reference in New Issue