Commit 1cdb476e authored by Gauthier Provost's avatar Gauthier Provost
Browse files

Improve OMV install

* Remove OMV4 install since it has also been phased out by OMV team 
* Show install output
* Recommand user to reboot
* cleanup odroidxu4 (not tested on real target)
parent 90142ada
...@@ -553,34 +553,22 @@ if [ -f /etc/armbian-release ]; then ...@@ -553,34 +553,22 @@ if [ -f /etc/armbian-release ]; then
. /etc/armbian-release . /etc/armbian-release
fi fi
# Don't allow installation on Ubuntu # OMV5 Requirement
if [[ "$family" == "Ubuntu" ]]; then if [[ "$distribution" != "buster" ]]; then
dialog --backtitle "$BACKTITLE" --title "Dependencies not met" --msgbox "\nOpenMediaVault can only be installed on Debian." 7 52 dialog --backtitle "$BACKTITLE" --title "Dependencies not met" --msgbox "\nOpenMediaVault 5 can only be installed on Debian Buster." 7 52
sleep 5
exit 1
fi
# Warning / Notice before install
case $distribution in
wheezy|jessie)
dialog --backtitle "$BACKTITLE" --title "OMV3 is End of Life" --msgbox "\nUpgrade to a supported OS : Debian Stretch or Buster." 7 52
sleep 5 sleep 5
exit 1 exit 1
;; fi
esac
# Download OMV install script # Download OMV install script
wgeturl="https://github.com/OpenMediaVault-Plugin-Developers/installScript/raw/master/install" wgeturl="https://github.com/OpenMediaVault-Plugin-Developers/installScript/raw/master/install"
fancy_wget "$wgeturl" "-O ${TEMP_DIR}/omv_install.sh" fancy_wget "$wgeturl" "-O ${TEMP_DIR}/omv_install.sh"
# Remove Crony on Stretch since OMV4 depends on NTP
if [[ "$distribution" == "stretch" ]]; then
apt-get -y -qq remove chrony
fi
# Execute install script # Execute install script
echo "Now installing OpenMediaVault. Be patient, it will take several minutes..." clear
bash ${TEMP_DIR}/omv_install.sh &>> /var/log/omv_install.log echo "Starting OpenMediaVault install. Be patient, it will take several minutes..."
sleep 2
bash ${TEMP_DIR}/omv_install.sh -r
# Board Specific Tweak # Board Specific Tweak
echo "Now applying board tweak if required..." echo "Now applying board tweak if required..."
...@@ -591,13 +579,14 @@ lsusb | grep -q -i "05e3:0735" && sed -i "/exit 0/i echo 20 > /sys/class/block/s ...@@ -591,13 +579,14 @@ lsusb | grep -q -i "05e3:0735" && sed -i "/exit 0/i echo 20 > /sys/class/block/s
case ${BOARD} in case ${BOARD} in
odroidxu4) odroidxu4)
HMP_Fix='; taskset -c -p 4-7 $i '
apt install -y i2c-tools apt install -y i2c-tools
/usr/sbin/i2cdetect -y 1 | grep -q "60: 60" /usr/sbin/i2cdetect -y 1 | grep -q "60: 60"
if [ $? -eq 0 ]; then if [ $? -eq 0 ]; then
add-apt-repository -y ppa:kyle1117/ppa add-apt-repository -y ppa:kyle1117/ppa
sed -i 's/jessie/xenial/' /etc/apt/sources.list.d/kyle1117-ppa-jessie.list apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 3028C3C96AD57103
apt install -y -q cloudshell-lcd odroid-cloudshell cloudshell2-fan & sed -i 's/hirsute/focal/' /etc/apt/sources.list.d/kyle1117-ubuntu-ppa-hirsute.list
apt update
apt install -y -q cloudshell-lcd odroid-cloudshell cloudshell2-fan
lsusb -v | awk -F"__" '/RANDOM_/ {print $2}' | head -n1 | while read ; do lsusb -v | awk -F"__" '/RANDOM_/ {print $2}' | head -n1 | while read ; do
echo "ATTRS{idVendor}==\"152d\", ATTRS{idProduct}==\"0561\", KERNEL==\"sd*\", ENV{DEVTYPE}==\"disk\", SYMLINK=\"disk/by-id/\$env{ID_BUS}-CloudShell2-${REPLY}-\$env{ID_MODEL}\"" >> /etc/udev/rules.d/99-cloudshell2.rules echo "ATTRS{idVendor}==\"152d\", ATTRS{idProduct}==\"0561\", KERNEL==\"sd*\", ENV{DEVTYPE}==\"disk\", SYMLINK=\"disk/by-id/\$env{ID_BUS}-CloudShell2-${REPLY}-\$env{ID_MODEL}\"" >> /etc/udev/rules.d/99-cloudshell2.rules
echo "ATTRS{idVendor}==\"152d\", ATTRS{idProduct}==\"0561\", KERNEL==\"sd*\", ENV{DEVTYPE}==\"partition\", SYMLINK=\"disk/by-id/\$env{ID_BUS}-CloudShell2-${REPLY}-\$env{ID_MODEL}-part%n\"" >> /etc/udev/rules.d/99-cloudshell2.rules echo "ATTRS{idVendor}==\"152d\", ATTRS{idProduct}==\"0561\", KERNEL==\"sd*\", ENV{DEVTYPE}==\"partition\", SYMLINK=\"disk/by-id/\$env{ID_BUS}-CloudShell2-${REPLY}-\$env{ID_MODEL}-part%n\"" >> /etc/udev/rules.d/99-cloudshell2.rules
...@@ -608,20 +597,22 @@ case ${BOARD} in ...@@ -608,20 +597,22 @@ case ${BOARD} in
# Make mdadm display fault events on Fault LED # Make mdadm display fault events on Fault LED
# NOTE : this is not a permanent approach need to be improved via some OMV core code change # NOTE : this is not a permanent approach need to be improved via some OMV core code change
if [ -f /usr/sbin/mdadm-fault-led.sh ]; then if [ -f /usr/sbin/mdadm-fault-led.sh ]; then
if [[ "$distribution" == "stretch" ]]; then cat <<EOF > /srv/salt/omv/deploy/mdadm/25faultled.sls
sed -i -e "/HOMEHOST/a \\\n# Trigger Fault Led script when an event is detected\\nPROGRAM \/usr\/sbin\/mdadm-fault-led.sh" /usr/share/openmediavault/mkconf/mdadm
/usr/sbin/omv-mkconf mdadm
elif [[ "$distribution" == "buster" ]]; then
cat <<EOF > /srv/salt/omv/deploy/mdadm/25faultled.sls
mdadm_add_program_config: mdadm_add_program_config:
cmd.run: cmd.run:
- name: "echo -e '\n# Trigger Fault Led script when an event is detected\nPROGRAM /usr/sbin/mdadm-fault-led.sh' >> /etc/mdadm/mdadm.conf" - name: "echo -e '\n# Trigger Fault Led script when an event is detected\nPROGRAM /usr/sbin/mdadm-fault-led.sh' >> /etc/mdadm/mdadm.conf"
EOF EOF
/usr/sbin/omv-salt deploy run mdadm /usr/sbin/omv-salt deploy run mdadm
fi
fi fi
;; ;;
esac esac
if check_if_installed openmediavault; then
dialog --colors --backtitle "$BACKTITLE" --no-collapse --title "OMV Installation" --yesno "\nIt is recommended to reboot your system to finish OMV setup. Do you want to reboot now?" 8 80
if [[ $? == 0 ]]; then
reboot
fi
fi
} }
install_tvheadend () install_tvheadend ()
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment