Skip to content

Commit d436b3b

Browse files
committed
build: update dependencies
Signed-off-by: amannocci <adrien.mannocci@gmail.com>
1 parent 3d6c7fe commit d436b3b

10 files changed

Lines changed: 53 additions & 52 deletions

File tree

.github/workflows/ci.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
---
2-
32
name: CI
43

54
on:
@@ -16,9 +15,12 @@ jobs:
1615
runs-on: ubuntu-latest
1716
steps:
1817
- uses: actions/checkout@v4
18+
1919
- name: Install Task
2020
uses: arduino/setup-task@v2
21+
2122
- name: Install dependencies
2223
run: sudo apt install -y bats
24+
2325
- name: Run tests
2426
run: task test

scripts/lib.sh

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ BASE_PROJECT="$(dirname "${RELATIVE_DIR}")"
1919
# Outputs:
2020
# Log a message as action.
2121
#######################################
22-
function log::action {
22+
function log::action() {
2323
local disable_console_colors; disable_console_colors=$(env::get_or_empty "DISABLE_CONSOLE_COLORS")
2424
if [ -z "${disable_console_colors}" ]; then
2525
echo -e "\033[33m⇒\033[0m ${@}"
@@ -37,7 +37,7 @@ function log::action {
3737
# Outputs:
3838
# Log a message as failure.
3939
#######################################
40-
function log::failure {
40+
function log::failure() {
4141
local disable_console_colors; disable_console_colors=$(env::get_or_empty "DISABLE_CONSOLE_COLORS")
4242
if [ -z "${disable_console_colors}" ]; then
4343
echo -e "\033[31m✗\033[0m Failed to ${@}" >&2
@@ -55,7 +55,7 @@ function log::failure {
5555
# Outputs:
5656
# Log a message as success.
5757
#######################################
58-
function log::success {
58+
function log::success() {
5959
local disable_console_colors; disable_console_colors=$(env::get_or_empty "DISABLE_CONSOLE_COLORS")
6060
if [ -z "${disable_console_colors}" ]; then
6161
echo -e "\033[32m✓\033[0m Succeeded to ${@}"
@@ -72,7 +72,7 @@ function log::success {
7272
# 0 if the command is present.
7373
# 1 otherwise.
7474
#######################################
75-
function helper::commands_are_present {
75+
function helper::commands_are_present() {
7676
for cmd in "${@}"; do
7777
if ! [ -x "$(command -v "${cmd}")" ]; then
7878
helper::raise_error "locate command '${cmd}'"
@@ -87,7 +87,7 @@ function helper::commands_are_present {
8787
# Returns:
8888
# Always exit 1.
8989
#######################################
90-
function helper::raise_error {
90+
function helper::raise_error() {
9191
log::failure "$@"
9292
exit 1
9393
}
@@ -102,7 +102,7 @@ function helper::raise_error {
102102
# Returns:
103103
# Exit status of the command executed.
104104
#######################################
105-
function helper::exec {
105+
function helper::exec() {
106106
local silent_stdout; silent_stdout=$(env::get_or_empty "SILENT_STDOUT")
107107
local silent_stderr; silent_stderr=$(env::get_or_empty "SILENT_STDERR")
108108
local err_exit_ctx=$(shopt -o errexit)
@@ -136,7 +136,7 @@ function helper::exec {
136136
# Returns:
137137
# Exit status of the command executed.
138138
#######################################
139-
function helper::try {
139+
function helper::try() {
140140
helper::exec ${@:2}
141141
local status=$?
142142
if [ ${status} -eq 0 ]; then
@@ -163,7 +163,7 @@ function helper::try {
163163
# 0 if the environment variable is present.
164164
# 1 otherwise.
165165
#######################################
166-
function env::get {
166+
function env::get() {
167167
local var; var=$(printf '%s\n' "${!1}")
168168
if [ -z "${var}" ]; then
169169
helper::raise_error "retrieve environment '${1}' variable"
@@ -179,7 +179,7 @@ function env::get {
179179
# Outputs:
180180
# Environment variable value or default value.
181181
#######################################
182-
function env::get_or_default {
182+
function env::get_or_default() {
183183
local var; var=$(printf '%s\n' "${!1}")
184184
if [ -z "${var}" ]; then
185185
echo -e "${2}"
@@ -195,7 +195,7 @@ function env::get_or_default {
195195
# Outputs:
196196
# Environment variable value or empty value.
197197
#######################################
198-
function env::get_or_empty {
198+
function env::get_or_empty() {
199199
env::get_or_default "${1}" ""
200200
}
201201

@@ -209,7 +209,7 @@ function env::get_or_empty {
209209
# 0 if the environment variable is present or readed.
210210
# 1 otherwise.
211211
#######################################
212-
function env::get_or_read {
212+
function env::get_or_read() {
213213
local var; var=$(printf '%s\n' "${!1}")
214214
if [ -z "${var}" ]; then
215215
read -p "Value for ${1}: `echo $'\n> '`" var
@@ -222,7 +222,7 @@ function env::get_or_read {
222222
# Outputs:
223223
# Random char sequence containing alphanumeric.
224224
#######################################
225-
function str::random {
225+
function str::random() {
226226
cat /dev/urandom | env LC_ALL="C.UTF-8" LANG="C.UTF-8" LC_CTYPE="C" tr -dc 'a-z0-9' | fold -w 32 | head -n 1
227227
}
228228

src/etc/s6/boot/stage2

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ foreground {
99
foreground {
1010
# Copy user provided files to /run/ignity.
1111
if {
12-
if { s6-echo -n -- "[ignity/boot] Making user provided files available at /run/ignity" }
1312
foreground {
1413
forx i { "init" "finalize" "services" }
1514
importas -u i i
@@ -33,7 +32,7 @@ foreground {
3332
}
3433

3534
importas -u ? ?
36-
foreground { redirfd -w 1 /run/ignity/envs/IGNITY_STAGE2_EXITED s6-echo -n -- "${?}" }
35+
foreground { redirfd -w 1 /run/ignity/envs/IGNITY_STAGE2_EXITED s6-echo -n -- "${?}" }
3736
exit ${?}
3837
}
3938

@@ -42,7 +41,7 @@ foreground {
4241
foreground { with-env s6-setsid -gq -- $@ }
4342

4443
importas -u ? ?
45-
foreground { s6-echo -- "[ignity/cmd] ${1} exited ${?}" }
44+
foreground { s6-echo -- "[supervisor/cmd] ${1} exited ${?}" }
4645

4746
# Make CMD exit code available in stage3
4847
foreground { redirfd -w 1 /run/ignity/envs/IGNITY_STAGE2_EXITED s6-echo -n -- "${?}" }

src/etc/s6/boot/stage2-envs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,18 +5,18 @@ if { s6-dumpenv "/run/ignity/envs-container" }
55

66
if {
77
if -t { eltest -d /etc/ignity/envs }
8-
if { s6-echo "[ignity/env] Loading environment files" }
8+
if { s6-echo "[supervisor/env] Loading environment files" }
99
if {
1010
elglob -s -0 g "/etc/ignity/envs/*"
1111
forx -o 0 d { ${g} }
1212
importas -ui d d
1313
backtick -n i { s6-basename "${d}" }
1414
importas -ui file i
15-
if { s6-echo -- "[ignity/env] Loading environment file: ${file}..." }
15+
if { s6-echo -- "[supervisor/env] Loading environment file: ${file}..." }
1616
redirfd -r 0 /etc/ignity/envs/${file} load-envfile
1717
if { s6-dumpenv "/run/ignity/envs" }
1818
}
19-
if { s6-echo -- "[ignity/env] Environment files loaded" }
19+
if { s6-echo -- "[supervisor/env] Environment files loaded" }
2020
}
2121

2222
if { s6-hiercopy "/run/ignity/envs-container" "/run/ignity/envs" }

src/etc/s6/boot/stage2-init

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,20 +2,20 @@
22

33
if {
44
if -t { eltest -d /run/ignity/init }
5-
if { s6-echo "[ignity/init] Executing container init scripts" }
5+
if { s6-echo "[supervisor/init] Executing container init scripts" }
66
if {
77
elglob -s -0 g "/run/ignity/init/*"
88
forx -o 0 d { ${g} }
99
importas -ui d d
1010
backtick -n i { s6-basename "${d}" }
1111
importas -ui i i
12-
if { s6-echo -- "[ignity/init] Executing init script: ${i}..." }
12+
if { s6-echo -- "[supervisor/init] Executing init script: ${i}..." }
1313
foreground { /run/ignity/init/${i} }
1414
importas -u ? ?
15-
if { s6-echo -- "[ignity/init] Init script ${i} exited ${?}." }
15+
if { s6-echo -- "[supervisor/init] Init script ${i} exited ${?}." }
1616
exit ${?}
1717
}
18-
if { s6-echo -- "[ignity/init] Init scripts executed" }
18+
if { s6-echo -- "[supervisor/init] Init scripts executed" }
1919
}
2020

2121
$@

src/etc/s6/boot/stage2-services

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
if {
44
if -t { eltest -d /run/ignity/services }
5-
if { s6-echo "[ignity/service] Starting services" }
5+
if { s6-echo "[supervisor/service] Starting services" }
66
if {
77
elglob -0 g "/run/ignity/services/*"
88
forx -o 0 -p d { ${g} }
@@ -32,7 +32,7 @@ if {
3232
{ s6-svwait -t ${IGNITY_CMD_WAIT_FOR_SERVICES_MAXTIME} -U /run/ignity/services-state/${i} }
3333
s6-svwait -t ${IGNITY_CMD_WAIT_FOR_SERVICES_MAXTIME} -u /run/ignity/services-state/${i}
3434
}
35-
if { s6-echo -- "[ignity/service] Services started" }
35+
if { s6-echo -- "[supervisor/service] Services started" }
3636
}
3737

3838
$@

src/etc/s6/boot/stage3

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ importas -D 1 -u IGNITY_SYNC_DISKS IGNITY_SYNC_DISKS
1313
foreground { /etc/s6/boot/stage3-finalize }
1414

1515
# Wait service down
16-
foreground { s6-echo "[ignity/finalize] Waiting for services" }
16+
foreground { s6-echo "[supervisor/finalize] Waiting for services" }
1717
foreground {
1818
if { eltest -f /run/ignity/services-state }
1919
importas -D 16000 -u IGNITY_SERVICES_GRACETIME IGNITY_SERVICES_GRACETIME
@@ -25,20 +25,20 @@ foreground {
2525
# Sync before TERM'n
2626
foreground {
2727
if { eltest ${IGNITY_SYNC_DISKS} -eq 1 }
28-
foreground { s6-echo "[ignity/finalize] Syncing disks" }
28+
foreground { s6-echo "[supervisor/finalize] Syncing disks" }
2929
foreground { s6-sync }
3030
}
3131

3232
# Kill everything, gently.
33-
foreground { s6-echo "[ignity/finalize] Sending all processes the KILL signal" }
33+
foreground { s6-echo "[supervisor/finalize] Sending all processes the KILL signal" }
3434
foreground { s6-nuke -th } # foreground is process 1: it survives
3535
foreground {
3636
importas -D 3000 -u IGNITY_KILL_GRACETIME IGNITY_KILL_GRACETIME
3737
s6-sleep -m -- ${IGNITY_KILL_GRACETIME}
3838
}
3939

4040
# Last message, then close our pipes and give the logger some time.
41-
foreground { s6-echo "[ignity/finalize] Sending all processes the KILL signal and exiting" }
41+
foreground { s6-echo "[supervisor/finalize] Sending all processes the KILL signal and exiting" }
4242
fdclose 1 fdclose 2
4343
s6-sleep -m 200
4444

src/etc/s6/boot/stage3-finalize

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,22 +3,22 @@
33
importas -D 5000 -u IGNITY_KILL_FINALIZE_MAXTIME IGNITY_KILL_FINALIZE_MAXTIME
44
if {
55
if -t { eltest -d /run/ignity/finalize }
6-
if { s6-echo "[ignity/finalize] Executing container finalize scripts..." }
6+
if { s6-echo "[supervisor/finalize] Executing container finalize scripts..." }
77
if {
88
elglob -s -0 g "/run/ignity/finalize/*"
99
forx -o 0 d { ${g} }
1010
importas -ui d d
1111
backtick -n i { s6-basename "${d}" }
1212
importas -ui i i
13-
if { s6-echo -- "[ignity/finalize] Executing finalize script: ${i}... " }
13+
if { s6-echo -- "[supervisor/finalize] Executing finalize script: ${i}... " }
1414
foreground {
1515
s6-maximumtime -k ${IGNITY_KILL_FINALIZE_MAXTIME}
1616
/run/ignity/finalize/${i}
1717
}
1818
importas -u ? ?
19-
s6-echo -- "[ignity/finalize] Finalize script ${i} exited ${?}."
19+
s6-echo -- "[supervisor/finalize] Finalize script ${i} exited ${?}."
2020
}
21-
s6-echo -- "[ignity/finalize] Finalize scripts executed"
21+
s6-echo -- "[supervisor/finalize] Finalize scripts executed"
2222
}
2323

2424
$@

src/usr/bin/preboot

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,20 +26,20 @@ foreground {
2626

2727
if {
2828
if -t { eltest -d /etc/ignity/perms }
29-
if { s6-echo -- "[ignity/perm] Applying ownership & permissions fixes" }
29+
if { s6-echo -- "[supervisor/perm] Applying ownership & permissions fixes" }
3030
if {
3131
elglob -s -0 g "/etc/ignity/perms/*"
3232
forx -o 0 d { ${g} }
3333
importas -ui d d
3434
backtick -n i { s6-basename "${d}" }
3535
importas -ui i i
36-
if { s6-echo -- "[ignity/perm] Applying ownership & permission fixes: ${i}... " }
36+
if { s6-echo -- "[supervisor/perm] Applying ownership & permission fixes: ${i}... " }
3737
foreground { redirfd -r 0 /etc/ignity/perms/${i} fix-perms }
3838
importas -u ? ?
39-
if { s6-echo -- "[ignity/perm] Ownership & permission fixes ${i} exited ${?}." }
39+
if { s6-echo -- "[supervisor/perm] Ownership & permission fixes ${i} exited ${?}." }
4040
exit ${?}
4141
}
42-
if { s6-echo -- "[ignity/perm] Ownership & permissions fixes applied" }
42+
if { s6-echo -- "[supervisor/perm] Ownership & permissions fixes applied" }
4343
}
4444

45-
$@
45+
$@

0 commit comments

Comments
 (0)