* make run fails: make-gpt.sh: 9: set: Illegal option -o pipefail
@ 2026-03-31 0:44 Dan Connolly
2026-03-31 3:17 ` Dan Connolly
0 siblings, 1 reply; 4+ messages in thread
From: Dan Connolly @ 2026-03-31 0:44 UTC (permalink / raw)
To: discuss
[-- Attachment #1: Type: text/plain, Size: 1902 bytes --]
Hi. Spectrum looks very interesting! I look forward to more progress.
I just added it to https://github.com/dckc/awesome-ocap#os
I tried kicking the tires... I set up the binary cache, cloned 2026-03-18
17:11 93839a1 , and then tried `nix-shell --run 'make run'`. My fans spun
for a little while building rust crates, and then I got:
Build completed.
------
Filesystem UUID: d14e3b49-df7d-487c-9d85-8f6f70b51af0
Filesystem total blocks: 2076633 (of 4096-byte blocks)
Filesystem total inodes: 86328
Filesystem total metadata blocks: 19765
Filesystem total deduplicated bytes (of source files): 0
mkdir -p build
veritysetup format \
--root-hash-file build/rootfs.verity.roothash \
-- build/rootfs build/rootfs.verity.superblock
VERITY header information for build/rootfs.verity.superblock.
UUID: 8d368df1-69bb-4f4b-9633-9e1555d3d492
Hash type: 1
Data blocks: 2076633
Data block size: 4096 [bytes]
Hash blocks: 16352
Hash block size: 4096 [bytes]
Hash algorithm: sha256
Salt:
64d5042171257c589206d50ed727edaeba98da7f7be5dfb3d38b5cf8a5c04288
Root hash:
7919b30b902cda65737af583b1b9c6defeff3a60ba668cc1012300dfd9fa9ef9
Hash device size: 66981888 [bytes]
echo >> build/rootfs.verity.roothash
touch -- build/verity-timestamp
../../scripts/make-gpt.sh build/live.img.tmp \
build/rootfs.verity.superblock:verity:$(../../scripts/format-uuid.sh
"$(dd if=build/rootfs.verity.roothash bs=32 skip=1 count=1
status=none)"):Spectrum_'0.0.0.verity' \
build/rootfs:root:$(../../scripts/format-uuid.sh "$(head -c 32
build/rootfs.verity.roothash)"):Spectrum_'0.0.0'
../../scripts/make-gpt.sh: 9: set: Illegal option -o pipefail
make: *** [Makefile:116: build/live.img] Error 2
I'm using nix on Ubuntu 24.04.4 LTS, not NixOS.
As to what version of nixpkgs I might have installed or something, I still
get dizzy every time I try to find out.
--
Dan Connolly
https://www.madmode.com
[-- Attachment #2: Type: text/html, Size: 2469 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread* Re: make run fails: make-gpt.sh: 9: set: Illegal option -o pipefail
2026-03-31 0:44 make run fails: make-gpt.sh: 9: set: Illegal option -o pipefail Dan Connolly
@ 2026-03-31 3:17 ` Dan Connolly
2026-04-29 13:57 ` Alyssa Ross
0 siblings, 1 reply; 4+ messages in thread
From: Dan Connolly @ 2026-03-31 3:17 UTC (permalink / raw)
To: discuss
[-- Attachment #1.1: Type: text/plain, Size: 677 bytes --]
On Mon, Mar 30, 2026 at 7:44 PM Dan Connolly <dckc@madmode.com> wrote:
> ../../scripts/make-gpt.sh build/live.img.tmp \
> build/rootfs.verity.superblock:verity:$(../../scripts/format-uuid.sh
> "$(dd if=build/rootfs.verity.roothash bs=32 skip=1 count=1
> status=none)"):Spectrum_'0.0.0.verity' \
> build/rootfs:root:$(../../scripts/format-uuid.sh "$(head -c 32
> build/rootfs.verity.roothash)"):Spectrum_'0.0.0'
> ../../scripts/make-gpt.sh: 9: set: Illegal option -o pipefail
>
A small fix (attached) worked for me.
Then I got a permission error, so I had to do:
sudo usermod -aG kvm $USER
newgrp kvm
--
Dan Connolly
https://www.madmode.com
[-- Attachment #1.2: Type: text/html, Size: 1194 bytes --]
[-- Attachment #2: 0001-fix-don-t-rely-on-bash-isms-in-bin-sh-scripts.patch --]
[-- Type: text/x-patch, Size: 1114 bytes --]
From 082882cc981566891ec17ccedd291b930502c91e Mon Sep 17 00:00:00 2001
From: Dan Connolly <dckc@madmode.com>
Date: Mon, 30 Mar 2026 22:11:39 -0500
Subject: [PATCH] fix: don't rely on bash-isms in /bin/sh scripts
---
scripts/genfiles.sh | 3 ++-
scripts/make-gpt.sh | 3 ++-
2 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/scripts/genfiles.sh b/scripts/genfiles.sh
index 0a5647a..c7e89c6 100755
--- a/scripts/genfiles.sh
+++ b/scripts/genfiles.sh
@@ -1,7 +1,8 @@
#!/bin/sh --
# SPDX-License-Identifier: EUPL-1.2+
# SPDX-FileCopyrightText: 2025 Demi Marie Obenour <demiobenour@gmail.com>
-set -euo pipefail
+set -eu
+(set -o pipefail) 2>/dev/null && set -o pipefail
export LC_ALL=C LANGUAGE=C
dir=$(git rev-parse --show-toplevel)
cd -- "$dir"
diff --git a/scripts/make-gpt.sh b/scripts/make-gpt.sh
index 998a54d..d1bea41 100755
--- a/scripts/make-gpt.sh
+++ b/scripts/make-gpt.sh
@@ -6,7 +6,8 @@
#
# usage: make-gpt.sh GPT_PATH PATH:PARTTYPE[:PARTUUID[:PARTLABEL[:PARTMiB]]]...
-set -euo pipefail
+set -eu
+(set -o pipefail) 2>/dev/null && set -o pipefail
ONE_MiB=1048576
--
2.49.0
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: make run fails: make-gpt.sh: 9: set: Illegal option -o pipefail
2026-03-31 3:17 ` Dan Connolly
@ 2026-04-29 13:57 ` Alyssa Ross
2026-05-01 3:26 ` Dan Connolly
0 siblings, 1 reply; 4+ messages in thread
From: Alyssa Ross @ 2026-04-29 13:57 UTC (permalink / raw)
To: Dan Connolly; +Cc: discuss
[-- Attachment #1: Type: text/plain, Size: 2085 bytes --]
Dan Connolly <dckc@madmode.com> writes:
> On Mon, Mar 30, 2026 at 7:44 PM Dan Connolly <dckc@madmode.com> wrote:
>
>> ../../scripts/make-gpt.sh build/live.img.tmp \
>> build/rootfs.verity.superblock:verity:$(../../scripts/format-uuid.sh
>> "$(dd if=build/rootfs.verity.roothash bs=32 skip=1 count=1
>> status=none)"):Spectrum_'0.0.0.verity' \
>> build/rootfs:root:$(../../scripts/format-uuid.sh "$(head -c 32
>> build/rootfs.verity.roothash)"):Spectrum_'0.0.0'
>> ../../scripts/make-gpt.sh: 9: set: Illegal option -o pipefail
>>
>
> A small fix (attached) worked for me.
Hi Dan, thanks for the patch and sorry for the late response.
This is actually not a bashism — POSIX adopted it in POSIX.1-2024, and
Ubuntu's version of dash supports it since Ubuntu 25.04 from what I can
tell, which means the most recent Ubuntu LTS, 26.04, should have it too.
I appreciate that 26.04 only came out a few days ago (weeks after you
wrote your message), but now that it has, my instinct is that it's
probably not worth supporting older LTSes. Every variance like this
needs to be cleaned up at some point in the future, and the older a
distro is the more likely it is that it's not going to work anyway due
to old kernel bugs or dropped support from VMMs. I might be a bit too
aggressive in my stance here though — what do you think?
> Then I got a permission error, so I had to do:
>
> sudo usermod -aG kvm $USER
> newgrp kvm
Interesting! Not much we can do about that in Spectrum, but I wonder
why Ubuntu chooses to vary from the systemd default, which lets any user
use KVM.
> From 082882cc981566891ec17ccedd291b930502c91e Mon Sep 17 00:00:00 2001
> From: Dan Connolly <dckc@madmode.com>
> Date: Mon, 30 Mar 2026 22:11:39 -0500
> Subject: [PATCH] fix: don't rely on bash-isms in /bin/sh scripts
>
> ---
> scripts/genfiles.sh | 3 ++-
> scripts/make-gpt.sh | 3 ++-
FWIW there are also some pipefail uses in Makefiles that would need to
be taken care of. I can do this separately if you prefer if I end up
applying this.
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 227 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: make run fails: make-gpt.sh: 9: set: Illegal option -o pipefail
2026-04-29 13:57 ` Alyssa Ross
@ 2026-05-01 3:26 ` Dan Connolly
0 siblings, 0 replies; 4+ messages in thread
From: Dan Connolly @ 2026-05-01 3:26 UTC (permalink / raw)
To: Alyssa Ross; +Cc: discuss
On Wed, Apr 29, 2026 at 8:57 AM Alyssa Ross <hi@alyssa.is> wrote:
> I appreciate that 26.04 only came out a few days ago (weeks after you
> wrote your message), but now that it has, my instinct is that it's
> probably not worth supporting older LTSes. ... — what do you think?
The future is unevenly distributed. :)
Supporting 2 generations of LTS is typical in my experience.
Personally, it'll probably be 6 to 18 months before I upgrade to 26.04.
I only upgraded to 24.04 in 2025-12.
Another angle: I just checked https://www.shellcheck.net/
It still says:
set -euo pipefail
^-- SC3040 (warning): In POSIX sh, set option pipefail is undefined.
It seems cost-effective to move a little slower here.
--
Dan Connolly
https://www.madmode.com
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2026-05-01 3:26 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-03-31 0:44 make run fails: make-gpt.sh: 9: set: Illegal option -o pipefail Dan Connolly
2026-03-31 3:17 ` Dan Connolly
2026-04-29 13:57 ` Alyssa Ross
2026-05-01 3:26 ` Dan Connolly
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).