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
1059fe0a
Commit
1059fe0a
authored
May 19, 2019
by
Igor Pecovnik
Browse files
Sources install optimisation
parent
856218e2
Changes
3
Hide whitespace changes
Inline
Side-by-side
debian-config-functions
View file @
1059fe0a
...
...
@@ -380,6 +380,8 @@ function reload_bsp(){
# install packages
echo
$PACKAGE_LIST
>>
/var/log/upgrade.log
debconf-apt-progress
--
apt
-y
-qq
--allow-downgrades
--no-install-recommends
--reinstall
-o
Dpkg::Options::
=
"--force-confdef"
-o
Dpkg::Options::
=
"--force-confold"
install
$PACKAGE_LIST
armbian-config
# clean apt cache
apt clean
if
[[
$?
=
1
]]
;
then
echo
"Something went wrong ... check logs."
;
exit
;
else
...
...
@@ -457,6 +459,8 @@ function other_kernel_version ()
find
"/boot/"
-name
"vmlinuz*"
-type
f
-delete
find
"/boot/"
-name
"*nitrd*"
-type
f
-delete
debconf-apt-progress
--
apt
-y
-qq
--allow-downgrades
--no-install-recommends
install
$PACKAGE_LIST
# clean apt cache
apt clean
if
[[
$?
=
0
]]
;
then
reboot
;
fi
else
dialog
--backtitle
"
$BACKTITLE
"
--title
"Warning"
--msgbox
"
\n
Test install failed. Can't change firmware
\n\n
Check /tmp/switch_kernel.log"
9 48
...
...
@@ -688,7 +692,7 @@ function configure_desktop ()
[[
$?
-eq
130
]]
&&
dpkg
--configure
-a
# clean apt cache
apt
-get
clean
apt clean
# add user to groups
for
additionalgroup
in
sudo
netdev audio video dialout plugdev input bluetooth systemd-journal ssh
;
do
...
...
debian-config-jobs
View file @
1059fe0a
...
...
@@ -169,6 +169,7 @@ function jobs ()
debconf-apt-progress
--
apt-get
-y
install
${
INSTALL_PKG
}
fi
# cleanup
apt clean
debconf-apt-progress
--
apt
-y
autoremove
fi
;;
...
...
@@ -182,10 +183,10 @@ function jobs ()
"Source"
)
if
!
is_package_manager_running
;
then
PACKAGE
=
$(
echo
"
$SOURCE_PKG
"
|
sed
"s/-next//"
|
sed
"s/-dev//"
|
sed
"s/-default//"
)
if
[[
-n
$(
dpkg
-l
|
grep
$SOURCE_PKG
)
]]
;
then
debconf-apt-progress
--
apt-get
-y
purge linux-source
*
# cleanup
debconf-apt-progress
--
apt
-y
autoremove
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
}
...
...
@@ -193,6 +194,9 @@ function jobs ()
(
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
rm
/usr/src/
$PACKAGE
".tar.xz"
/usr/src/
*
config.xz
apt clean
debconf-apt-progress
--
apt-get
-y
purge linux-source
*
debconf-apt-progress
--
apt
-y
autoremove
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
...
...
debian-config-submenu
View file @
1059fe0a
...
...
@@ -356,7 +356,7 @@ while true; do
SOURCE_PKG
=
$(
apt-cache
--names-only
search ^linux-source-
*
|
awk
'{ print $1 }'
|
grep
${
BRANCH
}
-
${
LINUXFAMILY
}
|
tail
-1
)
if
[[
-n
$SOURCE_PKG
]]
;
then
if
[[
-n
$(
dpkg
-l
|
grep
$SOURCE_PKG
)
]]
;
then
LIST+
=(
"Source"
"Remove kernel source"
)
;
else
\
if
ls
/usr/src/linux-source
*
1> /dev/null 2>&1
;
then
LIST+
=(
"Source"
"Remove kernel source"
)
;
else
\
LIST+
=(
"Source"
"Install kernel source"
)
;
fi
fi
...
...
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