Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
adam.huang
Config
Commits
5a0fc32b
Commit
5a0fc32b
authored
Sep 10, 2017
by
Igor Pecovnik
Browse files
Cleanup, typos
parent
bf56d86a
Changes
3
Hide whitespace changes
Inline
Side-by-side
debian-config-jobs
View file @
5a0fc32b
...
...
@@ -191,12 +191,12 @@ function jobs ()
if
[[
-n
$(
service hostapd status |
grep
-w
active |
grep
-w
running
)
]]
;
then
if
[[
-n
$HOSTAPDBRIDGE
]]
;
then
dialog
--title
" Hostapd service is running "
--colors
--backtitle
"
$BACKTITLE
"
--help-button
\
--help-label
"
Cancel
"
--yes-label
"Stop and reboot"
--no-label
"Edit"
--yesno
\
--help-label
"
Back
"
--yes-label
"Stop and reboot"
--no-label
"Edit"
--yesno
\
"
\n\Z
1Stop:
\Z
0 stop and reboot
\n\n\Z
1Edit:
\Z
0 change basic parameters: SSID, password and channel"
9 70
else
dialog
--title
" Hostapd service is running "
--colors
--backtitle
"
$BACKTITLE
"
--help-button
\
--help-label
"
Cancel
"
--yes-label
"Stop"
--no-label
"Edit"
--yesno
\
--help-label
"
Back
"
--yes-label
"Stop"
--no-label
"Edit"
--yesno
\
"
\n\Z
1Stop:
\Z
0 stop providing Access Point
\n\n\Z
1Edit:
\Z
0 change basic parameters: SSID, password and channel"
9 70
fi
exitstatus
=
$?
;
...
...
@@ -477,8 +477,8 @@ function jobs ()
# Freeze and unfreeze kernel and board support packages
#
"Hold"
|
"Unhold"
)
dialog
--title
" Updat
e
"
--backtitle
"
$BACKTITLE
"
--yes-label
"
$1
"
--no-label
"
Cancel
"
--yesno
\
"
\n
Do you want to
${
1
,,
}
kernel updates?"
7
50
dialog
--title
" Updat
ing
"
--backtitle
"
$BACKTITLE
"
--yes-label
"
$1
"
--no-label
"
Back
"
--yesno
\
"
\n
Do you want to
${
1
,,
}
kernel updates?"
7
42
if
[[
$?
=
0
]]
;
then
TARGET_BRANCH
=
$BRANCH
exceptions
"
$BRANCH
"
...
...
@@ -497,15 +497,20 @@ function jobs ()
"Desktop"
)
if
[[
-n
$(
service lightdm status 2> /dev/null |
grep
-w
active |
grep
-w
running
)
||
-n
$(
service nodm status |
grep
-w
active |
grep
-w
running
)
]]
;
then
dialog
--title
" Desktop is enabled and running "
--backtitle
"
$BACKTITLE
"
\
--yes-label
"Stop"
--no-label
"
Cancel
"
--yesno
"
\n
Do you want to stop and disable this service?"
7 50
--yes-label
"Stop"
--no-label
"
Back
"
--yesno
"
\n
Do you want to stop and disable this service?"
7 50
exitstatus
=
$?
;
[[
$exitstatus
=
0
]]
&&
service nodm stop
&&
service lightdm stop
&&
sed
-i
"s/^NODM_ENABLED=.*/NODM_ENABLED=false/"
/etc/default/nodm
[[
$exitstatus
=
0
]]
&&
service nodm stop
&&
service lightdm stop
&&
\
sed
-i
"s/^NODM_ENABLED=.*/NODM_ENABLED=false/"
/etc/default/nodm
else
dialog
--title
" Choose a display manager "
--backtitle
"
$BACKTITLE
"
--help-button
--help-label
"
Cancel
"
--yes-label
"Lightdm"
\
--no-label
"Nodm"
--yesno
"
\n
Lightdm = full featured login display manager
\n
Nodm = autoloading into desktop"
8 70
dialog
--colors
--title
" Choose a display manager "
--backtitle
"
$BACKTITLE
"
--help-button
--help-label
"
Back
"
--yes-label
"Lightdm"
\
--no-label
"Nodm"
--yesno
"
\n
\Z
1
Lightdm
\Z
0
= full featured login display manager
\n
\Z
1
Nodm
\Z
0
= autoloading into desktop"
8 70
exitstatus
=
$?
;
[[
$exitstatus
=
0
]]
&&
[[
-f
/etc/X11/default-display-manager
]]
&&
echo
"/usr/sbin/lightdm"
>
/etc/X11/default-display-manager
&&
debconf-apt-progress
--
apt-get
-o
Dpkg::Options::
=
"--force-confold"
-y
--no-install-recommends
install
lightdm-gtk-greeter lightdm
&&
systemctl start lightdm.service
[[
$exitstatus
=
1
]]
&&
[[
-f
/etc/X11/default-display-manager
]]
&&
echo
"/usr/sbin/nodm"
>
/etc/X11/default-display-manager
&&
sed
-i
"s/^NODM_ENABLED=.*/NODM_ENABLED=true/"
/etc/default/nodm
&&
service nodm start
[[
$exitstatus
=
0
]]
&&
[[
-f
/etc/X11/default-display-manager
]]
&&
\
echo
"/usr/sbin/lightdm"
>
/etc/X11/default-display-manager
&&
\
debconf-apt-progress
--
apt-get
-o
Dpkg::Options::
=
"--force-confold"
-y
--no-install-recommends
install
lightdm-gtk-greeter lightdm
&&
systemctl start lightdm.service
[[
$exitstatus
=
1
]]
&&
[[
-f
/etc/X11/default-display-manager
]]
&&
\
echo
"/usr/sbin/nodm"
>
/etc/X11/default-display-manager
&&
\
sed
-i
"s/^NODM_ENABLED=.*/NODM_ENABLED=true/"
/etc/default/nodm
&&
service nodm start
fi
;;
...
...
@@ -682,7 +687,7 @@ function jobs ()
# Toggle sshd options
#
"SSH
d
"
)
"SSH"
)
while
true
;
do
DIALOG_CANCEL
=
1
...
...
@@ -705,7 +710,7 @@ function jobs ()
exec
3>&1
selection
=
$(
dialog
--backtitle
"
$BACKTITLE
"
--title
" Toggle sshd options "
--clear
--cancel-label
\
"
Exit
"
--ok-label
"Save"
--checklist
"
\n
Choose what you want to enable or disable:
\n
"
\
"
Back
"
--ok-label
"Save"
--checklist
"
\n
Choose what you want to enable or disable:
\n
"
\
$LISTLENGHT
74 21
"
${
MOTD
[@]
}
"
2>&1 1>&3
)
exit_status
=
$?
exec
3>&-
...
...
@@ -737,7 +742,7 @@ function jobs ()
# Switch to daily builds
#
"Nightly"
)
dialog
--title
" Warning "
--backtitle
"
$BACKTITLE
"
--yes-label
"OK"
--no-label
"
Cancel
"
\
dialog
--title
" Warning "
--backtitle
"
$BACKTITLE
"
--yes-label
"OK"
--no-label
"
Back
"
\
--yesno
"
\n
You are switching to automated nightly repository which is untested and might break your system.
\
Are you fine with that?"
9 48
if
[[
$?
=
0
]]
;
then
...
...
@@ -745,7 +750,7 @@ function jobs ()
debconf-apt-progress
--
apt-get update
debconf-apt-progress
--
apt-get
-y
upgrade
dialog
--title
"Switching to nightly"
--backtitle
"
$BACKTITLE
"
--yes-label
"Reboot"
\
--no-label
"
Cancel
"
--yesno
"
\n
Reboot to apply new settings?"
7 34
--no-label
"
Back
"
--yesno
"
\n
Reboot to apply new settings?"
7 34
if
[[
$?
=
0
]]
;
then
reboot
;
fi
fi
;;
...
...
@@ -754,14 +759,13 @@ function jobs ()
# Switch to stable builds
#
"Stable"
)
dialog
--title
" Warning "
--backtitle
"
$BACKTITLE
"
--yes-label
"OK"
--no-label
"Cancel"
\
--yesno
"
\n
You are switching back to stable respository where you are going to get future updates.
\
Are you fine with that?"
9 44
dialog
--title
" Warning "
--backtitle
"
$BACKTITLE
"
--yes-label
"OK"
--no-label
"Back"
\
--yesno
"
\n
You are switching back to stable respository where you are going to get future updates. Are you fine with that?"
9 44
if
[[
$?
=
0
]]
;
then
sed
-i
's/beta.armbian.com/apt.armbian.com/'
/etc/apt/sources.list.d/armbian.list
debconf-apt-progress
--
apt-get update
debconf-apt-progress
--
apt-get
-y
upgrade
dialog
--title
"Switching to stable"
--backtitle
"
$BACKTITLE
"
--yes-label
"Reboot"
--no-label
"
Cancel
"
--yesno
\
dialog
--title
"Switching to stable"
--backtitle
"
$BACKTITLE
"
--yes-label
"Reboot"
--no-label
"
Back
"
--yesno
\
"
\n
Reboot to apply new settings?"
7 34
if
[[
$?
=
0
]]
;
then
reboot
;
fi
fi
...
...
@@ -774,7 +778,7 @@ function jobs ()
aval_kernel
if
[[
$exitstatus
=
0
]]
;
then
exceptions
"
$INSTALL_KERNEL
"
dialog
--title
" Install and reboot "
--backtitle
"
$BACKTITLE
"
--yes-label
"OK"
--no-label
"
Cancel
"
\
dialog
--title
" Install and reboot "
--backtitle
"
$BACKTITLE
"
--yes-label
"OK"
--no-label
"
Back
"
\
--yesno
"
\n
Switching to linux-image
${
TARGET_BRANCH
}
-
${
TARGET_FAMILY
}
\n\n
Make sure you know what you are doing!
\
\n\n
Board config will be reverted to defaults."
11 46
if
[[
$?
=
0
]]
;
then
...
...
@@ -791,12 +795,14 @@ function jobs ()
fi
# install new
INSTALL_DTB
=
""
[[
-n
$(
apt-cache search
--names-only
"^linux-dtb
$TARGET_BRANCH
-
$TARGET_FAMILY
"
)
]]
&&
INSTALL_DTB
=
"linux-dtb
$TARGET_BRANCH
-
$TARGET_FAMILY
"
[[
-n
$(
apt-cache search
--names-only
"^linux-dtb
$TARGET_BRANCH
-
$TARGET_FAMILY
"
)
]]
&&
\
INSTALL_DTB
=
"linux-dtb
$TARGET_BRANCH
-
$TARGET_FAMILY
"
debconf-apt-progress
--
apt-get
-y
--no-install-recommends
install
linux-image
${
TARGET_BRANCH
}
-
${
TARGET_FAMILY
}
\
linux-headers
${
TARGET_BRANCH
}
-
${
TARGET_FAMILY
}
linux-u-boot-
${
BOARD
}
-
${
UBOOT_BRANCH
}
\
linux-
$(
lsb_release
-cs
)
-root
$TARGET_BRANCH
-
$BOARD
$INSTALL_DTB
dialog
--title
"Kernel switch"
--backtitle
"
$BACKTITLE
"
--yes-label
"Yes"
--no-label
"Cancel"
--yesno
"
\n
New kernel was installed. Reboot?"
7 64
dialog
--title
"Kernel switch"
--backtitle
"
$BACKTITLE
"
--yes-label
"Yes"
--no-label
"Cancel"
\
--yesno
"
\n
New kernel was installed. Reboot?"
7 64
exitstatus
=
$?
;
[[
$exitstatus
=
0
]]
&&
reboot
fi
...
...
@@ -816,7 +822,8 @@ function jobs ()
else
debconf-apt-progress
--
apt-get
-o
Dpkg::Options::
=
"--force-confnew"
-y
--no-install-recommends
install
overlayroot
echo
'#!/bin/bash'
>
/etc/update-motd.d/97-overlayroot
echo
'if [ -n "$(mount | grep -w tmpfs-root)" ]; then echo -e "\n[\e[0m \e[1mremember: your system is in virtual read only mode\e[0m ]";fi'
>>
/etc/update-motd.d/97-overlayroot
echo
'if [ -n "$(mount | grep -w tmpfs-root)" ]; then \
echo -e "\n[\e[0m \e[1mremember: your system is in virtual read only mode\e[0m ]";fi'
>>
/etc/update-motd.d/97-overlayroot
chmod
+x /etc/update-motd.d/97-overlayroot
dialog
--title
"Root overlay"
--backtitle
"
$BACKTITLE
"
--yes-label
"Reboot"
\
--no-label
"Cancel"
--yesno
"
\n
Enable virtual read-only root and reboot."
7 45
...
...
@@ -824,5 +831,6 @@ function jobs ()
fi
;;
esac
}
\ No newline at end of file
debian-config-submenu
View file @
5a0fc32b
...
...
@@ -148,7 +148,8 @@ dialog --colors --backtitle "$BACKTITLE" --no-collapse --title " $1 " --clear --
#
function
check_ht_capab
()
{
declare
-a
arr
=(
"[HT40+][LDPC][SHORT-GI-20][SHORT-GI-40][TX-STBC][RX-STBC1][DSSS_CCK-40][SMPS-STATIC]"
"[HT40-][SHORT-GI-40][SHORT-GI-40][DSSS_CCK-40]"
"[SHORT-GI-20][SHORT-GI-40][HT40+]"
)
declare
-a
arr
=(
"[HT40+][LDPC][SHORT-GI-20][SHORT-GI-40][TX-STBC][RX-STBC1][DSSS_CCK-40][SMPS-STATIC]"
\
"[HT40-][SHORT-GI-40][SHORT-GI-40][DSSS_CCK-40]"
"[SHORT-GI-20][SHORT-GI-40][HT40+]"
)
local
j
=
0
for
i
in
"
${
arr
[@]
}
"
do
...
...
@@ -225,7 +226,9 @@ function ip_editor ()
2>&1 1>&3 |
{
read
-r
address
;
read
-r
netmask
;
read
-r
gateway
if
[[
$?
=
0
]]
;
then
echo
-e
"# armbian-config created
\n
source /etc/network/interfaces.d/*
\n\n
allow-hotplug
$2
\n
no-auto-down
$2
\n
iface
$2
inet static
\n\t
address
$address
\n\t
netmask
$netmask
\n\t
gateway
$gateway
\n\t
dns-nameservers 8.8.8.8"
>
$3
echo
-e
"# armbian-config created
\n
source /etc/network/interfaces.d/*
\n\n
allow-hotplug
$2
\
\n
no-auto-down
$2
\n
iface
$2
inet static
\
\n\t
address
$address
\n\t
netmask
$netmask
\n\t
gateway
$gateway
\n\t
dns-nameservers 8.8.8.8"
>
$3
fi
}
}
...
...
@@ -446,7 +449,11 @@ function connect_bt_interface ()
exec
3>&-
if
[[
$BT_ADAPTER
!=
""
]]
;
then
dialog
--backtitle
"
$BACKTITLE
"
--title
"Please wait"
--infobox
"
\n
Connecting to
$BT_ADAPTER
"
5 35
BT_EXEC
=
$(
expect
-c
'set prompt "#";set address '
$BT_ADAPTER
';spawn bluetoothctl;expect -re $prompt;send "disconnect $address\r";sleep 1;send "remove $address\r";sleep 1;expect -re $prompt;send "scan on\r";sleep 8;send "scan off\r";expect "Controller";send "trust $address\r";sleep 2;send "pair $address\r";sleep 2;send "connect $address\r";send_user "\nShould be paired now.\r";sleep 2;send "quit\r";expect eof'
)
BT_EXEC
=
$(
expect
-c
'set prompt "#";set address '
$BT_ADAPTER
';spawn bluetoothctl;expect -re $prompt;send "disconnect $address\r";
sleep 1;send "remove $address\r";sleep 1;expect -re $prompt;send "scan on\r";sleep 8;send "scan off\r";
expect "Controller";send "trust $address\r";sleep 2;send "pair $address\r";sleep 2;send "connect $address\r";
send_user "\nShould be paired now.\r";sleep 2;send "quit\r";expect eof'
)
echo
"
$BT_EXEC
"
>
/tmp/bt-connect-debug.log
if
[[
$(
echo
"
$BT_EXEC
"
|
grep
"Connection successful"
)
!=
""
]]
;
then
dialog
--backtitle
"
$BACKTITLE
"
--title
"Bluetooth"
--msgbox
"
\n
Your device is ready to use!"
7 32
...
...
@@ -470,7 +477,7 @@ while true; do
LIST+
=(
"Timezone"
"Change timezone
\Z
5(
$(
date
+%Z
)
)
\Z
0"
)
LIST+
=(
"Locales"
"Reconfigure language
\Z
5(
$(
locale |
grep
LANGUAGE |
cut
-d
=
-f2
|
cut
-d_
-f1
)
)
\Z
0 and character set"
)
LIST+
=(
"Hostname"
"Change your hostname
\Z
5(
$(
cat
/etc/hostname
)
)
\Z
0"
)
LIST+
=(
"SSH
d
"
"Reconfigure SSH daemon"
)
LIST+
=(
"SSH"
"Reconfigure SSH daemon"
)
LIST+
=(
"Firmware"
"Upgrade board firmware"
)
# detect desktop
...
...
softy
View file @
5a0fc32b
...
...
@@ -367,7 +367,7 @@ done
/sbin/folder2ram -enablesystemd
# Prevent accidentally destroying board performance by clicking around in OMV UI since
# OMV sets 'powersave' governor when touching 'Power Management' settings.
# OMV sets 'powersave' governor when touching 'Power Management' settings.
if [ -f /etc/default/cpufrequtils ]; then
. /etc/default/cpufrequtils
else
...
...
@@ -911,7 +911,7 @@ fi
# Install basic stuff
#
export LANG=C
#
export LANG=C
echo -e "\nChecking dependencies. This might take a while."
apt-get -qq -y --no-install-recommends install debconf-utils unzip build-essential html2text apt-transport-https dialog whiptail \
lsb-release bc expect html2text > /dev/null
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment