Commit 7d6470f5 authored by Thomas Kaiser's avatar Thomas Kaiser Committed by GitHub
Browse files

Samba performance tweak, OMV4 installer skeleton

OMV4 confirmed to work but pretty useless yet without OMV Extras and flashmemory plugin. Developer stuff :)
parent 3dbec2af
......@@ -239,6 +239,10 @@ cat > /etc/samba/smb.conf.tmp << EOF
load printers = yes
printing = cups
printcap name = cups
min receivefile size = 16384
write cache size = 524288
getwd cache = yes
socket options = TCP_NODELAY IPTOS_LOWDELAY
[printers]
comment = All Printers
......@@ -279,6 +283,7 @@ if [[ $? = 0 ]]; then
fi
}
install_omv (){
#------------------------------------------------------------------------------------------------------------------------------------------
# Install OpenMediaVault 3
......@@ -302,8 +307,11 @@ deb https://openmediavault.github.io/packages/ erasmus-proposed main
# deb https://openmediavault.github.io/packages/ erasmus partner
EOF
read HOSTNAME </etc/hostname
read TZ </etc/timezone
debconf-apt-progress -- apt-get update
debconf-apt-progress -- apt-get --yes --force-yes --allow-unauthenticated install openmediavault-keyring openmediavault postfix
debconf-set-selections <<< "postfix postfix/mailname string ${HOSTNAME}"
debconf-apt-progress -- apt-get --yes --force-yes --allow-unauthenticated --fix-missing --no-install-recommends install openmediavault-keyring openmediavault postfix
URL='https://github.com/OpenMediaVault-Plugin-Developers/packages/raw/master/openmediavault-omvextrasorg_latest_all3.deb'; FILE=`mktemp`; wget "$URL" -qO $FILE && dpkg -i $FILE; rm $FILE
/usr/sbin/omv-update
......@@ -319,35 +327,104 @@ xmlstarlet ed -L -u "/config/services/flashmemory/enable" -v "1" /etc/openmediav
xmlstarlet ed -L -u "/config/services/ssh/enable" -v "1" /etc/openmediavault/config.xml
xmlstarlet ed -L -u "/config/services/ssh/permitrootlogin" -v "1" /etc/openmediavault/config.xml
xmlstarlet ed -L -u "/config/system/time/ntp/enable" -v "1" /etc/openmediavault/config.xml
read TZ </etc/timezone
xmlstarlet ed -L -u "/config/system/time/timezone" -v "${TZ}" /etc/openmediavault/config.xml
read HOSTNAME </etc/hostname
xmlstarlet ed -L -u "/config/system/network/dns/hostname" -v "${HOSTNAME}" /etc/openmediavault/config.xml
/usr/sbin/omv-rpc -u admin "perfstats" "set" '{"enable":false}'
/usr/sbin/omv-rpc -u admin "config" "applyChanges" '{ "modules": ["monit","rrdcached","collectd"],"force": true }'
sed -i 's|-j /var/lib/rrdcached/journal/ ||' /etc/init.d/rrdcached
/usr/sbin/omv-mkconf netatalk
/usr/sbin/omv-mkconf samba
/usr/sbin/omv-mkconf flashmemory
/usr/sbin/omv-mkconf ssh
/usr/sbin/omv-mkconf ntp
/usr/sbin/omv-mkconf timezone
/usr/sbin/omv-mkconf monit
/usr/sbin/omv-mkconf rrdcached
/usr/sbin/omv-mkconf collectd
for i in netatalk samba flashmemory ssh ntp timezone monit rrdcached collectd ; do
/usr/sbin/omv-mkconf $i
done
/sbin/folder2ram -enablesystemd
# Prevent accidentally destroying board performance by clicking around in OMV UI
. /etc/default/cpufrequtils
echo -e "OMV_CPUFREQUTILS_GOVERNOR=${GOVERNOR}" >>/etc/default/openmediavault
echo -e "OMV_CPUFREQUTILS_MINSPEED=${MIN_SPEED}" >>/etc/default/openmediavault
echo -e "OMV_CPUFREQUTILS_MAXSPEED=${MAX_SPEED}" >>/etc/default/openmediavault
if [ -f /etc/default/cpufrequtils ]; then
. /etc/default/cpufrequtils
echo -e "OMV_CPUFREQUTILS_GOVERNOR=${GOVERNOR}" >>/etc/default/openmediavault
echo -e "OMV_CPUFREQUTILS_MINSPEED=${MIN_SPEED}" >>/etc/default/openmediavault
echo -e "OMV_CPUFREQUTILS_MAXSPEED=${MAX_SPEED}" >>/etc/default/openmediavault
fi
omv-initsystem
check_port 80
}
install_omv4 (){
#------------------------------------------------------------------------------------------------------------------------------------------
# Install OpenMediaVault 4
#------------------------------------------------------------------------------------------------------------------------------------------
# Not yet recommended, OMV package repository lacks authentication, no flashmemory plugin available,
# same with all other OMV-Extras, only for developers and OMV contributors!
if [ $distribution != "stretch" ]; then
dialog --backtitle "$backtitle" --title "Dependencies not met" --msgbox "\nOpenMediaVault 4 can only be installed on Debian Stretch." 7 52
sleep 5
exit
fi
# sed -i "s/^# en_US.UTF-8/en_US.UTF-8/" /etc/locale.gen
# locale-gen
# update-locale LANG=en_US:en LC_ALL=en_US.UTF-8
# export LANG=C LC_ALL="en_US.UTF-8"
wget -qO - packages.openmediavault.org/public/archive.key | apt-key add -
apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 7AA630A1EDEE7D73
cat > /etc/apt/sources.list.d/openmediavault.list << EOF
deb https://openmediavault.github.io/packages/ arrakis main
## Uncomment the following line to add software from the proposed repository.
deb https://openmediavault.github.io/packages/ arrakis-proposed main
## This software is not part of OpenMediaVault, but is offered by third-party
## developers as a service to OpenMediaVault users.
# deb https://openmediavault.github.io/packages/ arrakis partner
EOF
debconf-apt-progress -- apt-get update
read HOSTNAME </etc/hostname
read TZ </etc/timezone
debconf-set-selections <<< "postfix postfix/mailname string ${HOSTNAME}"
debconf-apt-progress -- apt-get -y --allow-unauthenticated --fix-missing --no-install-recommends install openmediavault postfix
# URL='https://github.com/OpenMediaVault-Plugin-Developers/packages/raw/master/openmediavault-omvextrasorg_latest_all3.deb'; FILE=`mktemp`; wget "$URL" -qO $FILE && dpkg -i $FILE; rm $FILE
/usr/sbin/omv-update
# Install flashmemory plugin and netatalk by default, use nice logo for the latter,
# disable OMV monitoring by default
. /usr/share/openmediavault/scripts/helper-functions
apt-get -y -q --allow-unauthenticated install openmediavault-netatalk
AFP_Options="mimic model = Macmini"
SMB_Options="min receivefile size = 16384\nwrite cache size = 524288\ngetwd cache = yes\nsocket options = TCP_NODELAY IPTOS_LOWDELAY"
xmlstarlet ed -L -u "/config/services/afp/extraoptions" -v "$(echo -e "${AFP_Options}")" ${OMV_CONFIG_FILE}
xmlstarlet ed -L -u "/config/services/smb/extraoptions" -v "$(echo -e "${SMB_Options}")" ${OMV_CONFIG_FILE}
xmlstarlet ed -L -u "/config/services/flashmemory/enable" -v "1" ${OMV_CONFIG_FILE}
xmlstarlet ed -L -u "/config/services/ssh/enable" -v "1" ${OMV_CONFIG_FILE}
xmlstarlet ed -L -u "/config/services/ssh/permitrootlogin" -v "1" ${OMV_CONFIG_FILE}
xmlstarlet ed -L -u "/config/system/time/ntp/enable" -v "1" ${OMV_CONFIG_FILE}
xmlstarlet ed -L -u "/config/system/time/timezone" -v "${TZ}" ${OMV_CONFIG_FILE}
xmlstarlet ed -L -u "/config/system/network/dns/hostname" -v "${HOSTNAME}" ${OMV_CONFIG_FILE}
/usr/sbin/omv-rpc -u admin "perfstats" "set" '{"enable":false}'
/usr/sbin/omv-rpc -u admin "config" "applyChanges" '{ "modules": ["monit","rrdcached","collectd"],"force": true }'
sed -i 's|-j /var/lib/rrdcached/journal/ ||' /etc/init.d/rrdcached
for i in netatalk samba ssh ntp timezone monit rrdcached collectd ; do
/usr/sbin/omv-mkconf $i
done
# /sbin/folder2ram -enablesystemd
# Prevent accidentally destroying board performance by clicking around in OMV UI
if [ -f /etc/default/cpufrequtils ]; then
. /etc/default/cpufrequtils
echo -e "OMV_CPUFREQUTILS_GOVERNOR=${GOVERNOR}" >>/etc/default/openmediavault
echo -e "OMV_CPUFREQUTILS_MINSPEED=${MIN_SPEED}" >>/etc/default/openmediavault
echo -e "OMV_CPUFREQUTILS_MAXSPEED=${MAX_SPEED}" >>/etc/default/openmediavault
fi
/usr/sbin/omv-initsystem
check_port 80
}
install_tvheadend (){
#------------------------------------------------------------------------------------------------------------------------------------------
# TVheadend https://tvheadend.org/ unofficial port https://tvheadend.org/boards/5/topics/21528
......
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