Re: [PATCH 04/20] scripts/make-erofs.sh: Validate all paths

Alyssa Ross
2025-09-21T12:09:46Z

[-- Attachment #1: Type: text/plain, Size: 937 bytes --]

Alyssa Ross <hi@alyssa.is> writes:

> Demi Marie Obenour <demiobenour@gmail.com> writes:
>
>> On 9/8/25 04:36, Alyssa Ross wrote:
>>> Demi Marie Obenour <demiobenour@gmail.com> writes:
>>>> + (-*)
>>>> + printf 'Path "%s" begins with -\n' "$i" >&2
>>>> + exit 1
>>>> + ;;
>>>> + (/nix/store/*|[!/]*)
>>>
>>> It's technically possible to use Nix with a different store path, so I'd
>>> like to avoid anything that requires us to hardcode /nix/store.
>>
>> Right now, the generated images depend on the store paths, so
>> the scripts would need to be adapted to support this. If we
>> are going to generalize this, I recommend using a proper
>> scripting language like Python, Perl, or Lua.
>
> The only place I see where we hardcode a store path is
> host/initramfs/default.nix, which is a bug and easy to fix with Nix
> code.

(Fixed in 15ca6c4 ("host/initramfs: don't hardcode Nix store directory").)

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 227 bytes --]