Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
Guido Gunther
image-builder
Commits
f9e60b5b
Commit
f9e60b5b
authored
Jun 18, 2019
by
Guido Gunther
💤
Browse files
root.sh: Check for parameters
This makes shellcheck more happy and the code more robust towards changes.
parent
6c7e6532
Changes
1
Hide whitespace changes
Inline
Side-by-side
root.sh
View file @
f9e60b5b
...
...
@@ -5,6 +5,20 @@
# SPDX-License-Identifier: GPL-3.0+
#
# Parmeters passed in via image builder:
# Mandatory
:
"
${
apt_sources
:?
'apt_sources'
not set
}
"
:
"
${
distro
:?
'distro'
not set
}
"
:
"
${
packages
:?
'packages'
not set
}
"
:
"
${
pureos_board
:?
'pureos_board'
not set
}
"
# Optional
:
"
${
build_tarball
:-}
"
:
"
${
ci_pkgs
:-}
"
:
"
${
fdt_file
:-}
"
:
"
${
kernel_deb
:-}
"
:
"
${
patched
:-}
"
:
"
${
qemu
:-}
"
# distro and basedir set by calling script
basedir
=
"
$1
"
...
...
@@ -201,8 +215,11 @@ function setup_locale()
function
install_pkgs
()
{
chroot
"
${
basedir
}
"
apt-get
-y
update
# Need to split package list
# shellcheck disable=SC2086
if
!
chroot
"
${
basedir
}
"
apt
-y
install
${
packages
}
;
then
echo
"Package installation failed, this might help to diagnose the problem:"
# shellcheck disable=SC2086
chroot
"
${
basedir
}
"
apt
-y
-o
Debug::pkgProblemResolver
=
yes install
-y
--simulate
${
packages
}
fi
}
...
...
@@ -210,6 +227,7 @@ function install_pkgs()
function
setup_apt
()
{
# shellcheck disable=SC2001
echo
"
${
apt_sources
}
"
|
sed
's/|/\n/g'
>
"
${
basedir
}
/etc/apt/sources.list"
echo
"Set sources list to:"
cat
"
${
basedir
}
/etc/apt/sources.list"
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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