Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Shellcheck ci #4

Draft
wants to merge 41 commits into
base: mickledore
Choose a base branch
from
Draft

Shellcheck ci #4

wants to merge 41 commits into from

Conversation

hnez
Copy link
Owner

@hnez hnez commented Dec 12, 2023

No description provided.

hnez and others added 4 commits November 30, 2023 10:30
Allow users to migrate custom files between installs.

Users can create files like this:

  $ cat /etc/rauc/migrate.d/git_config.conf
  /etc/gitconfig
  /home/root/.gitconfig

Which will result in the listed files being migrated to the new
RAUC slot.

Signed-off-by: Leonard Göhrs <[email protected]>
Fix an optional shellcheck warning to use double square brackets for bash
scripts:

  In meta-lxatac-software/recipes-core/bundles/files/hook.sh line 26:
  			if [ "${bundle_hash}" == "${cert_hash}" ]; then
                             ^-- SC2292 (style): Prefer [[ ]] over [ ] for tests in Bash/Ksh.

  In meta-lxatac-software/recipes-core/bundles/files/hook.sh line 39:
  	if [ ! -f "$1" ]; then
             ^-----------^ SC2292 (style): Prefer [[ ]] over [ ] for tests in Bash/Ksh.

Signed-off-by: Rouven Czerwinski <[email protected]>
Fix an optional shellcheck warning:

  In meta-lxatac-software/recipes-core/bundles/files/hook.sh line 60:
  			migrate "$x"
                                   ^-- SC2250 (style): Prefer putting braces around variable references even when not strictly required.

Signed-off-by: Rouven Czerwinski <[email protected]>
@hnez hnez force-pushed the shellcheck-ci branch 2 times, most recently from d59fc3b to 02ac4c7 Compare December 12, 2023 14:06
…ellcheck

Fix optional shellcheck warnings for hook.sh
meta-lxatac-software: bundles: hook.sh: migrate user-specified files
@hnez hnez force-pushed the shellcheck-ci branch 3 times, most recently from 9f28c95 to b7e16c6 Compare December 15, 2023 15:00
hnez and others added 15 commits December 18, 2023 10:09
The content of the /srv/www directory is exported by the tacd via HTTP.
If this directory does not exist the user gets a (true, but somewhat
confusing) 404 Not Found error if they try to access /srv via HTTP.

Usually a tmpfiles.d entry would be the way to go to create this directory,
but it causes issues for directories on the /srv file system.
See this comment copied from a similar commit for atftp.service:

The tmpfiles.d service runs very early in the boot process and even before
system-update.target. This means it would clutter the /srv directory in the
rootfs if the /srv partition was not yet mounted - because it was not generated
yet by systemd-repart.

Signed-off-by: Leonard Göhrs <[email protected]>
meta-lxatac-software: tacd: create /srv/www in tacd.service
This should make sure that we do not forget to update the DISTRO_VERSION
and DISTRO_CODENAME when a new tag is created or a new yocto version branch
is started.

Signed-off-by: Leonard Göhrs <[email protected]>
CI: add distribution version consistency checks
The gpiofind command was removed, so the tacd-failsafe command would
currently fail (which is kind of ironic).

Instead gpioset can be directly supplied with the GPIO names.
The GPIOs are not guaranteed to keep the assigned value once gpioset
exits, so we just keep it running for some time before trying to restart
the tacd.

Signed-off-by: Leonard Göhrs <[email protected]>
meta-lxatac-software: tacd: failsafe: gpiofind no longer exists
To follow a well honored tradition our first CI job we added failed
instantly when it landed in the main branch.
Now that the traditions have been honored we can fix it.

There were multiple things wrong with the previous version regarding
CI jobs running for a branch or tag (instead of jobs running for a pull
request):

  - The GITHUB_REF variable contains a name like "refs/heads/mickledore",
    not just "mickledore". We want GITHUB_REF_NAME.
  - The GITHUB_BASE_REF variable is also set for non pull request jobs,
    but it is set to an empy string. Check for that to decide if we are
    running in "pull request mode".
  - When running for a tag the branch name check for the os codename
    does not make sense. Skip it in that case.

Fixes: 7fa11b2 ("CI: add distribution version consistency checks")
Signed-off-by: Leonard Göhrs <[email protected]>
CI: fix distribution version consistency checks
meta-oe provides android-tools 29.0.6 in nanbield, which should be more
than new enough to suite our needs.

Signed-off-by: Leonard Göhrs <[email protected]>
In addition to latest-and-greatest being the way to go this also fixes
issues with newer compilers complaining about uint32_t being used without
including stdint.h. See [1] for the respective upstream commit.

[1]: nxp-imx/mfgtools@24fd043

Signed-off-by: Leonard Göhrs <[email protected]>
The libiio version in meta-oe was updated and we no longer have to carry the
backported patch.

Likewise with the dt-utils patch and meta-rauc.

Our ".rootfs.ext4" -> ".ext4" workarounds in lxatac-core-bundle-base.bb and
emmc-image/lxatac/genimage.config are also no longer required.

The perf package now handles the libtraceevent dependency correctly and we
do not need that bbappend anymore.

Signed-off-by: Leonard Göhrs <[email protected]>
The remaining fields are filled in when the user is actually created,
having it in these files may be missleading when changes to the file
do not propagate into the generated image.

Signed-off-by: Leonard Göhrs <[email protected]>
The tacos base install does not install / configure systemd-journal-upload,
but the Pengutronix-Internal derived images do.
Register the uid/gid here, as systemd-journal-upload is generally useful
when managing a fleet of TACs.

Signed-off-by: Leonard Göhrs <[email protected]>
meta-lxatac-software: passwd: reserve uid/gid for systemd-journal-upload
…rsion

Currently the rauc version in rauc-1.11.1.bb is newer than the version
in rauc_git.bb. This is obviously an uncommon situation, but it made
us aware that we set RAUC_USE_DEVEL_VERSION=1 without a clear reason
or need.

Released RAUC has all the features we need. Use it.

Signed-off-by: Leonard Göhrs <[email protected]>
hnez and others added 17 commits January 19, 2024 09:46
Currently the update notifications on the LXA TAC LCD and web interface
do not work because the tacd can not get informations about the RAUC
bundle on the update server via RAUC's DBus API.

This is because the process that RAUC spawns to handle the nbd bridge
for http streaming crashes due to an unitialized pointer access.

This patch is taken from RAUC pull request 1332 [1], which fixes the issue.

[1]: rauc/rauc#1332

Signed-off-by: Leonard Göhrs <[email protected]>
meta-lxatac-bsp: rauc: add patch to fix RAUC info / update notifications
This effectively bumps the Debian version to the most recent release at
that time.
This way we will not need to update the script with every Debian
release.

This also aligns the behavior with `container-start.sh` that simply
pulls `debian` if no container is present.
And this also defaults to `latest`.

Signed-off-by: Chris Fiege <[email protected]>
poky/meta-*: update to most recent nanbield branches
meta-lxatac-software/containers: Update to debian:latest
The official GitHub action runner client is written in C# and uses
(as far as I could figure out) the non-free(?) part of the .NET
Framework, making it hard to build.

This alternative client is written in Go and relatively easy to build.
We'll have to see how compatible it is in practice.

The need for nodejs on the TAC is due to all "uses:" steps for
runners being implemented in javascript (*sigh*).

To configure a runner you have to into the Actions setting of your GitHub
repository, and add a new self-hosted runner.
After configuring the OS and Architecture (Linux / ARM) you can use the
presented token to register the runner:

  $ mkdir -p /etc/github-act-runner
  $ cd /etc/github-act-runner
  $ github-act-runner configure \
      --name $(uname -n)
      --token 01234567899876543210012345678
      --labels dut-raspberrypi
      --url https://github.com/user/repository

Signed-off-by: Leonard Göhrs <[email protected]>
To configure a runner you have to into the CI/CD setting of your GitLab
repository, and add a new project runner.
After configuring a few aspects of the runner you are presented with a
token to use on the TAC:

  root@lxatac:~ gitlab-runner register
      --url https://gitlab.com
      --token glrt-01234567899876543210

Signed-off-by: Leonard Göhrs <[email protected]>
GitHub/GitLab Action/Pipeline Runners
This was suggested by shellcheck.

Signed-off-by: Leonard Göhrs <[email protected]>
Barebox shell rules are not 1:1 equivalent to "/bin/sh" rules,
ignore this error.

Signed-off-by: Leonard Göhrs <[email protected]>
This change is less mechanic than the previous tac-gadget shellcheck
change and required some more thinking, which is why it is split
out from the rest.

Signed-off-by: Leonard Göhrs <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants