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
253d2cf4
Commit
253d2cf4
authored
Mar 26, 2020
by
Igor Pecovnik
Browse files
Fix kernel source install via command
parent
7d7ebb11
Changes
3
Hide whitespace changes
Inline
Side-by-side
debian-config
View file @
253d2cf4
...
...
@@ -76,8 +76,10 @@ if [[ $1 == "--help" ]]; then
echo
"Update, upgrade and reboot:
${
BASH_SOURCE
[0]
}
main=System selection=Firmware"
echo
"Change to ZSH:
${
BASH_SOURCE
[0]
}
main=System selection=ZSH"
echo
"Change to BASH:
${
BASH_SOURCE
[0]
}
main=System selection=BASH"
echo
"Install headers:
${
BASH_SOURCE
[0]
}
main=Software selection=Headers"
echo
"Install sources:
${
BASH_SOURCE
[0]
}
main=Software selection=Sources"
echo
"Install headers:
${
BASH_SOURCE
[0]
}
main=Software selection=Headers_install"
echo
"Remove headers:
${
BASH_SOURCE
[0]
}
main=Software selection=Headers_remove"
echo
"Install kernel source:
${
BASH_SOURCE
[0]
}
main=Software selection=Source_install"
echo
"Remove kernel source:
${
BASH_SOURCE
[0]
}
main=Software selection=Source_remove"
echo
"Install Avahi mDNS/DNS-SD daemon:
${
BASH_SOURCE
[0]
}
main=Software selection=Avahi"
exit
fi
...
...
debian-config-jobs
View file @
253d2cf4
...
...
@@ -153,46 +153,46 @@ unset selection
#
# Install kernel headers
#
"Headers"
)
"Headers
_install
"
)
if
!
is_package_manager_running
;
then
TARGET_BRANCH
=
$BRANCH
exceptions
"
$BRANCH
"
REMOVE_PKG
=
"linux-headers-*"
if
[[
-f
/etc/armbian-release
]]
;
then
INSTALL_PKG
=
"linux-headers
${
TARGET_
BRANCH
}
-
${
TARGET_
FAMILY
}
"
;
INSTALL_PKG
=
"linux-headers
-
${
BRANCH
}
-
${
LINUX
FAMILY
}
"
;
else
INSTALL_PKG
=
"linux-headers-
$(
uname
-r
|
sed
's/'
-
$(
dpkg
--print-architecture
)
'//'
)
"
;
fi
if
[[
-n
$(
dpkg
-l
|
grep
linux-headers
)
]]
;
then
debconf-apt-progress
--
apt-get
-y
purge
${
REMOVE_PKG
}
rm
-rf
/usr/src/linux-headers
*
else
debconf-apt-progress
--
apt-get
-y
install
${
INSTALL_PKG
}
fi
# cleanup
apt clean
debconf-apt-progress
--
apt
-y
autoremove
debconf-apt-progress
--
apt-get
-y
install
${
INSTALL_PKG
}
fi
;;
#
# Remove kernel headers
#
"Headers_remove"
)
if
!
is_package_manager_running
;
then
REMOVE_PKG
=
"linux-headers-*"
if
[[
-n
$(
dpkg
-l
|
grep
linux-headers
)
]]
;
then
debconf-apt-progress
--
apt-get
-y
purge
${
REMOVE_PKG
}
rm
-rf
/usr/src/linux-headers
*
else
debconf-apt-progress
--
apt-get
-y
install
${
INSTALL_PKG
}
fi
# cleanup
apt clean
debconf-apt-progress
--
apt
-y
autoremove
fi
;;
#
# Install kernel source
#
"Source"
)
"Source
_install
"
)
if
!
is_package_manager_running
;
then
PACKAGE
=
$(
echo
"
$SOURCE_PKG
"
|
sed
"s/-current//"
|
sed
"s/-dev//"
|
sed
"s/-legacy//"
)
if
[[
-n
$PACKAGE
]]
;
then
if
ls
/usr/src/linux-source
*
1> /dev/null 2>&1
;
then
debconf-apt-progress
--
apt-get
-y
purge linux-source
*
debconf-apt-progress
--
apt
-y
autoremove
apt clean
rm
-r
/usr/src/linux-source
*
else
debconf-apt-progress
--
apt-get
-y
install
${
SOURCE_PKG
}
debconf-apt-progress
--
apt-get
-y
install
${
SOURCE_PKG
}
mkdir
-p
/usr/src/
$PACKAGE
(
pv
-n
/usr/src/
$PACKAGE
".tar.xz"
| xz
-d
-T0
- |
tar
xf -
-C
/usr/src/
$PACKAGE
)
2>&1 | dialog
--colors
--backtitle
"
$BACKTITLE
"
--title
" Please wait! "
--gauge
"
\n
Decompressing kernel sources to /usr/src/
$PACKAGE
"
8 80
xz
-d
/usr/src/
*
config.xz
--stdout
>
/usr/src/
$PACKAGE
/.config
...
...
@@ -203,13 +203,32 @@ unset selection
if
[[
-z
$scripted
]]
;
then
dialog
--colors
--backtitle
"
$BACKTITLE
"
--no-collapse
--title
" Kernel source "
--clear
--msgbox
"
\n
You will find pre-configured kernel sources in /usr/src/
$PACKAGE
"
7 72
fi
fi
fi
fi
;;
#
# Install kernel source
#
"Source_remove"
)
if
!
is_package_manager_running
;
then
PACKAGE
=
$(
echo
"
$SOURCE_PKG
"
|
sed
"s/-current//"
|
sed
"s/-dev//"
|
sed
"s/-legacy//"
)
if
[[
-n
$PACKAGE
]]
;
then
if
ls
/usr/src/linux-source
*
1> /dev/null 2>&1
;
then
debconf-apt-progress
--
apt-get
-y
purge linux-source
*
debconf-apt-progress
--
apt
-y
autoremove
apt clean
rm
-r
/usr/src/linux-source
*
fi
fi
fi
;;
# Toggle mini and full firmware
#
...
...
debian-config-submenu
View file @
253d2cf4
...
...
@@ -361,13 +361,13 @@ while true; do
LIST+
=(
"Benchmarking"
"sbc-bench board benchmarking"
)
[[
-f
/usr/bin/armbianmonitor
]]
&&
LIST+
=(
"Diagnostics"
"Send diagnostics"
)
if
[[
-n
$(
dpkg
-l
|
grep
linux-headers
)
]]
;
then
LIST+
=(
"Headers
"
"R
emove
kernel headers"
)
;
else
\
LIST+
=(
"Headers
"
"I
nstall
kernel headers"
)
;
fi
if
[[
-n
$(
dpkg
-l
|
grep
linux-headers
)
]]
;
then
LIST+
=(
"Headers
_r
emove
"
"
kernel headers"
)
;
else
\
LIST+
=(
"Headers
_i
nstall
"
"
kernel headers"
)
;
fi
SOURCE_PKG
=
$(
apt-cache
--names-only
search ^linux-source-
*
|
awk
'{ print $1 }'
|
grep
${
BRANCH
}
-
${
LINUXFAMILY
}
|
tail
-1
)
if
[[
-n
$SOURCE_PKG
]]
;
then
if
ls
/usr/src/linux-source
*
1> /dev/null 2>&1
;
then
LIST+
=(
"Source
"
"R
emove
kernel source"
)
;
else
\
LIST+
=(
"Source
"
"I
nstall
kernel source"
)
;
fi
if
ls
/usr/src/linux-source
*
1> /dev/null 2>&1
;
then
LIST+
=(
"Source
_r
emove
"
"
kernel source"
)
;
else
\
LIST+
=(
"Source
_i
nstall
"
"
kernel source"
)
;
fi
fi
if
[[
-f
/etc/armbian.txt
]]
;
then
...
...
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