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
b6719f7d
Commit
b6719f7d
authored
Apr 09, 2020
by
Igor Pecovnik
Browse files
Hardening packages install
parent
b4d4bd82
Changes
1
Hide whitespace changes
Inline
Side-by-side
debian-config-functions
View file @
b6719f7d
...
@@ -368,18 +368,21 @@ function reload_bsp(){
...
@@ -368,18 +368,21 @@ function reload_bsp(){
clear
clear
debconf-apt-progress
--
apt-get update
debconf-apt-progress
--
apt-get update
debconf-apt-progress
--
apt-get
-o
Dpkg::Options::
=
"--force-confdef"
-o
Dpkg::Options::
=
"--force-confold"
-y
upgrade
# must exits
# must exits
PACKAGE_INSTALL
=
"linux-image-
${
BRANCH
}
-
${
LINUXFAMILY
}
linux-dtb-
${
BRANCH
}
-
${
LINUXFAMILY
}
"
PACKAGE_INSTALL
=
"linux-image-
${
BRANCH
}
-
${
LINUXFAMILY
}
linux-dtb-
${
BRANCH
}
-
${
LINUXFAMILY
}
"
PACKAGE_PURGE
=
"linux-image* linux-dtb*"
PACKAGE_PURGE
=
"linux-image* linux-dtb*"
# create install and remove logic
# create install and remove logic
if
[[
-n
$(
apt-cache search
--names-only
"^linux-
${
DISTROID
}
-root-
${
BRANCH
}
-
${
BOARD
}
"
)
]]
;
then
apt
--simulate
--allow-downgrades
-y
--no-install-recommends
install
linux-
${
DISTROID
}
-root-
${
BRANCH
}
-
${
BOARD
}
&>/dev/null
if
[[
$?
-eq
0
]]
;
then
PACKAGE_INSTALL+
=
" linux-
${
DISTROID
}
-root-
${
BRANCH
}
-
${
BOARD
}
"
PACKAGE_INSTALL+
=
" linux-
${
DISTROID
}
-root-
${
BRANCH
}
-
${
BOARD
}
"
PACKAGE_PURGE+
=
" linux-
${
DISTROID
}
-root*"
PACKAGE_PURGE+
=
" linux-
${
DISTROID
}
-root*"
fi
fi
if
[[
-n
$(
apt-cache search
--names-only
"^linux-u-boot-
${
BOARD
}
-
${
BRANCH
}
"
)
]]
;
then
apt
--simulate
--allow-downgrades
-y
--no-install-recommends
install
linux-u-boot-
${
BOARD
}
-
${
BRANCH
}
&>/dev/null
if
[[
$?
-eq
0
]]
;
then
PACKAGE_INSTALL+
=
" linux-u-boot-
${
BOARD
}
-
${
BRANCH
}
"
PACKAGE_INSTALL+
=
" linux-u-boot-
${
BOARD
}
-
${
BRANCH
}
"
PACKAGE_PURGE+
=
" linux-u-boot-
${
BOARD
}
-*"
PACKAGE_PURGE+
=
" linux-u-boot-
${
BOARD
}
-*"
fi
fi
...
@@ -393,7 +396,7 @@ function reload_bsp(){
...
@@ -393,7 +396,7 @@ function reload_bsp(){
PACKAGE_INSTALL+
=
" linux-headers-
${
BRANCH
}
-
${
FAMILY
}
"
PACKAGE_INSTALL+
=
" linux-headers-
${
BRANCH
}
-
${
FAMILY
}
"
PACKAGE_PURGE+
=
" linux-headers*"
PACKAGE_PURGE+
=
" linux-headers*"
fi
fi
debconf-apt-progress
--
apt
--download-only
--allow-downgrades
-y
--no-install-recommends
install
$PACKAGE_INSTALL
debconf-apt-progress
--
apt
--download-only
--allow-downgrades
-y
--no-install-recommends
install
$PACKAGE_INSTALL
# if download is ok, remove old packages
# if download is ok, remove old packages
if
[[
$?
=
0
]]
;
then
if
[[
$?
=
0
]]
;
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