Commit Graph

14 Commits

Author SHA1 Message Date
Denis 'GNUtoo' Carikli 491225f38a
website-build: build.sh: make it pass shellcheck.
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>
Acked-by: Adrien 'neox' Bourmault <neox@gnu.org>
2024-05-27 23:58:49 +02:00
Denis 'GNUtoo' Carikli d13f8ecf50
website-build: check.sh: make it pass shellcheck.
Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
Acked-by: Adrien 'neox' Bourmault <neox@gnu.org>
2024-05-27 23:58:33 +02:00
Denis 'GNUtoo' Carikli 7df6d6169b
Build bucts and patched flashrom for I945 ThinkPads with Guix.
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>
2024-05-12 22:56:04 +02:00
Denis 'GNUtoo' Carikli b175bd85a5
Add topdir ./configure.
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>
2024-05-12 22:56:04 +02:00
Denis 'GNUtoo' Carikli 34007c4baf
scripts: misc: guix.sh: make it pass shellcheck.
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>
2024-05-12 22:56:04 +02:00
Denis 'GNUtoo' Carikli 2d11302693
tests: lint: fix u-boot-libre test.
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>
2023-12-11 11:41:37 +01:00
Denis 'GNUtoo' Carikli 190d9f37bd
packages: also ship website tarball.
Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
Acked-by: Adrien 'neox' Bourmault <neox@gnu.org>
2023-12-09 16:00:05 +01:00
Denis 'GNUtoo' Carikli 1943c8ce72
tests: lint: sort files to check alphabetically.
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>
2023-12-09 15:57:38 +01:00
Denis 'GNUtoo' Carikli 7bf153a207
update: make it pass shellcheck
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>
2023-12-06 17:32:33 +01:00
Denis 'GNUtoo' Carikli 68cb3ac110
download: make it pass shellcheck
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>
2023-12-06 17:32:30 +01:00
Denis 'GNUtoo' Carikli 2a5e494ac9
modify: make it pass shellcheck
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>
2023-12-06 17:32:28 +01:00
Denis 'GNUtoo' Carikli e0159d22f4
build: make it pass shellcheck
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>
2023-12-06 17:32:25 +01:00
Denis 'GNUtoo' Carikli c7e28dc660
packages: Add distclean
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>
2023-12-06 17:32:18 +01:00
Denis 'GNUtoo' Carikli 25c5ac1d8d
Add code style checks to track regressions.
Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
Acked-by: Adrien 'neox' Bourmault <neox@gnu.org>
2023-11-12 01:42:03 +01:00