Without that fix, shellcheck -x complains a lot:
In build.sh line 53:
mkdir -p "$(dirname ${dst_path})"
^---------^
SC2086 (info): Double quote to prevent globbing and word splitting.
In build.sh line 82:
git -C "${dst_path}" am $(realpath ${patch})
^------------------^
SC2046 (warning): Quote this to prevent word splitting.
git -C "${dst_path}" am $(realpath ${patch})
^------^
SC2086 (info): Double quote to prevent globbing and word splitting.
In build.sh line 112:
opt="$(eval echo \$$i)"
^--
SC2086 (info): Double quote to prevent globbing and word splitting.
In build.sh line 127:
untitled_path="$(eval echo \$$(expr $i + 1))"
^------------^
SC2046 (warning): Quote this to prevent word splitting.
untitled_path="$(eval echo \$$(expr $i + 1))"
^--^
SC2003 (style): expr is antiquated.
Consider rewriting this using $((..)), ${} or [[ ]].
untitled_path="$(eval echo \$$(expr $i + 1))"
^--
SC2086 (info): Double quote to prevent globbing and word splitting.
In build.sh line 128:
i="$(expr "$i" + 1)"
^--^
SC2003 (style): expr is antiquated.
Consider rewriting this using $((..)), ${} or [[ ]].
In build.sh line 136:
i="$(expr "$i" + 1)"
^--^
SC2003 (style): expr is antiquated.
Consider rewriting this using $((..)), ${} or [[ ]].
Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
GNU Boot can be installed on some I945 ThinkPads without disassembling
them. To do that it requires both a patched flashrom and bucts.
This build them and also integrate Guix in GNU Boot as a dependency to
build them.
This will enable us to later on ship these utilities and then update
the installation instructions to use them somehow.
It also makes sure that we have proper authorship of the patch used
for flashrom and also unify the two flashrom patches not to require
two different flashrom binaries.
Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
Acked-by: Adrien 'neox' Bourmault <neox@gnu.org>
The goal here is to be able to add configure options later on.
Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
Acked-by: Adrien 'neox' Bourmault <neox@gnu.org>
Without this fix, running shellcheck -x on
resources/scripts/misc/guix.sh returns many errors.
For each guix version declaration we have something like that:
In resources/scripts/misc/guix.sh line 21:
guix_v0_0="6365068393254e1131ab80eb0d68a759e7fd2256"
^-------^ SC2034 (warning): guix_v0_0 appears unused.
Verify use (or export if used externally).
and here the variables are actually used in this code:
guix_version_commit()
{
version="$1"
eval echo "$(echo \$guix_"${version}" | sed 's#\.#_#g')"
}
so we workaround by disabling that test for each version declaration.
Then shellcheck cannot find "$GUIX_PROFILE"/etc/profile:
In resources/scripts/misc/guix.sh line 91:
. "$GUIX_PROFILE"/etc/profile
^-------------------------^ SC1091 (info):
Not following: ./etc/profile: openBinaryFile:
does not exist (No such file or directory)
so we disabled that test for this line.
After that we have many issues with quoting like this one:
In resources/scripts/misc/guix.sh line 104:
eval echo $(echo \$guix_"${version}" | sed 's#\.#_#g')
^-- SC2046 (warning):
Quote this to prevent word splitting.
or this one:
In resources/scripts/misc/guix.sh line 233:
major="$(echo ${version} | awk -F . '{print $1}')"
^--------^ SC2086 (info):
Double quote to prevent globbing and word splitting.
these were fixed.
We also improved a test by using grep -q:
In resources/scripts/misc/guix.sh line 272:
elif [ -n "$(echo ${revision} | grep '\.')" ] ; then
^-- SC2143 (style):
Use grep -q instead of comparing output with [ -n .. ]
And finally in guix_version_commit a sed was avoided by using bash
replacement, and when that was not possible (in guix_next_version),
the shellcheck test for that was disabled.
Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
Acked-by: Adrien 'neox' Bourmault <neox@gnu.org>
For some reason, 'make release' produces the following files:
- release/roms/gnuboot-lbwww-20211122-328-gafe01fb_default.tar.xz
- release/roms/gnuboot-lbwww-20211122-328-gafe01fb_fam15h_rdimm.tar.xz
- release/roms/gnuboot-lbwww-20211122-328-gafe01fb_fam15h_udimm.tar.xz
This commit works around that issue.
Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
Acked-by: Adrien 'neox' Bourmault <neox@gnu.org>
In the commit 4744953f73 ("u-boot-libre:
move to different tasks."), the distclean task of u-boot-libre was
removed, so this broke the lint tests as that file was not removed
from the list of files to check in tests/lint.
Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
Acked-by: Adrien 'neox' Bourmault <neox@gnu.org>
This helps avoiding duplicate lines and make it easier to find things.
Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
Acked-by: Adrien 'neox' Bourmault <neox@gnu.org>
Without that fix we have the following issue on PureOS byzantium:
$ resources/packages/coreboot/distclean
resources/packages/coreboot/distclean: 19:
resources/packages/coreboot/../../scripts/tasks/distclean.sh:
Bad substitution
resources/packages/coreboot/distclean: 20: .:
cannot open /../../..//resources/scripts/misc/sysexits.sh:
No such file
This happens because packages/coreboot/distclean uses #!/bin/sh and
that the default sh shell isn't using bash:
$ readlink $(which sh)
dash
and using bash instead works fine:
$ bash resources/packages/coreboot/distclean ; echo $?
0
all the other distclean scripts in packages/*/ have exactly the same
issue. The tests/distlean script is also affected since it also
sources the distclean task.
So we use #!/usr/bin/env bash as it work with both Guix and regular
more or less FHS compliant distributions.
This issue was introduced by the commit
c7e28dc660 ("packages: Add distclean").
Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
Acked-by: Adrien 'neox' Bourmault <neox@gnu.org>
Without that fix, running 'shellcheck -x build' produces the following
errors/warnings:
In update line 81:
case "${option}" in
^-- SC1009 (info):
The mentioned syntax error was in this case expression.
In update line 82:
list)
^-- SC1073 (error):
Couldn't parse this case item. Fix to allow more checks.
In update line 92:
all)
^-- SC1072 (error):
Fix any mentioned problems and try again.
^-- SC1074 (error):
Did you forget the ;; after the previous case item?
After fixing these and rerunning 'shellcheck -x build', we then have
the following errors/warnings:
In update line 23:
[ "x${DEBUG+set}" = 'xset' ] && set -v
^-------------^ SC2268 (style):
Avoid x-prefix in comparisons as it no longer serves a purpose.
In update line 32:
ls -d resources/packages/*/update/ | \
^-- SC2012 (info):
Use find instead of ls to better handle non-alphanumeric filenames.
In update line 40:
ls -d resources/packages/"${package}"/update/* | \
^-- SC2012 (info):
Use find instead of ls to better handle non-alphanumeric filenames.
In update line 95:
resources/packages/"${package}"/update/"${option}" $@
^-- SC2068 (error):
Double quote array expansions to avoid re-splitting elements.
In update line 102:
"${pkg_dir}"/update/"${option}" $@
^-- SC2068 (error):
Double quote array expansions to avoid re-splitting elements.
so we fix them as well.
Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
Acked-by: Adrien 'neox' Bourmault <neox@gnu.org>
Without that fix, running 'shellcheck -x build' produces the following
errors/warnings:
In download line 26:
[ "x${DEBUG+set}" = 'xset' ] && set -v
^-------------^ SC2268 (style):
Avoid x-prefix in comparisons as it no longer serves a purpose.
In download line 37:
[ "x${NODELETE+set}" = 'xset' ] && deleteblobs="false"
^----------------^ SC2268 (style):
Avoid x-prefix in comparisons as it no longer serves a purpose.
In download line 102:
NODELETE= "${script}"
^-- SC1007 (warning):
Remove space after = if trying to assign a value (for empty string,
use var='' ... ).
In download line 117:
NODELETE= resources/packages/"${package}"/download
^-- SC1007 (warning):
Remove space after = if trying to assign a value (for empty string,
use var='' ... ).
In download line 123:
NODELETE= resources/packages/"${package}"/download $@
^-- SC1007 (warning):
Remove space after = if trying to assign a value (for empty string,
use var='' ... ).
^-- SC2068 (error):
Double quote array expansions to avoid re-splitting elements.
In download line 125:
resources/packages/"${package}"/download $@
^-- SC2068 (error):
Double quote array expansions to avoid re-splitting elements.
In download line 131:
./.gitcheck clean
^---------------^ SC2317 (info):
Command appears to be unreachable. Check usage (or ignore if invoked
indirectly).
Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
Acked-by: Adrien 'neox' Bourmault <neox@gnu.org>
Without that fix, running 'shellcheck -x build' produces the following
errors/warnings:
In modify line 23:
[ "x${DEBUG+set}" = 'xset' ] && set -v
^-------------^ SC2268 (style):
Avoid x-prefix in comparisons as it no longer serves a purpose.
In modify line 106:
resources/packages/"${package}"/modify/"${option}" $@
^-- SC2068 (error):
Double quote array expansions to avoid re-splitting elements.
In modify line 113:
"${pkg_dir}"/modify/"${option}" $@
^-- SC2068 (error):
Double quote array expansions to avoid re-splitting elements.
Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
Acked-by: Adrien 'neox' Bourmault <neox@gnu.org>
Without that fix, running 'shellcheck -x build' produces the following
errors/warnings:
In build line 25:
[ "x${DEBUG+set}" = 'xset' ] && set -v
^-------------^ SC2268 (style): Avoid x-prefix in comparisons
as it no longer serves a purpose.
In build line 131:
resources/packages/"${package}"/"${task}" $@
^-- SC2068 (error):
Double quote array expansions to avoid re-splitting elements.
In build line 138:
"${pkg_dir}"/"${task}" $@
^-- SC2068 (error):
Double quote array expansions to avoid re-splitting elements.
Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
Acked-by: Adrien 'neox' Bourmault <neox@gnu.org>
The various scripts present in GNU Boot are very fragile, so it's a
good idea to have a pristine GNU Boot source code for making releases.
The issue is that 'git clean -dfx' doesn't remove existing git
repositories like coreboot/ grub/ etc, so we need additional code to
take care of that.
Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
Acked-by: Adrien 'neox' Bourmault <neox@gnu.org>
The various build scripts are scattered around in multiple
places. This make it hard for contributors to understand what they
need to modify.
Most GNU Boot users are interested in running GNU/Linux or BSD
operating systems. And the way to install software on these
operating systems is through a package manager. So most users and
contributors already know the package manager abstraction.
So using that abstraction makes it easier to find where things are.
The scripts to install dependencies don't really fit the new structure
but for now we move them in to make sure that everything works
fine. This could be fixed later on and migrated to a single
dependencies packages by auto-detecting the distribution with
/etc/os-release.
Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
Acked-by: Adrien 'neox' Bourmault <neox@gnu.org>
Signed-off-by: Adrien 'neox' Bourmault <neox@gnu.org>
This should enable various distributions and build system to reuse
the generated script to deblob u-boot releases themselves.
Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
This should enable various distributions and build system to reuse
that blob to deblob u-boot releases themselves.
Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
The tar options come from the tutorial to remove archives metadata at
reproducible-builds.org[1].
[1]https://reproducible-builds.org/docs/archives/
Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>