From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from atuin.qyliss.net (localhost [IPv6:::1]) by atuin.qyliss.net (Postfix) with ESMTP id 4406B4CB0; Thu, 04 Sep 2025 23:47:50 +0000 (UTC) Received: by atuin.qyliss.net (Postfix, from userid 993) id 824764C54; Thu, 04 Sep 2025 23:47:45 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on atuin.qyliss.net X-Spam-Level: X-Spam-Status: No, score=-0.1 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,DMARC_PASS,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE autolearn=unavailable autolearn_force=no version=4.0.1 Received: from mail-yb1-xb30.google.com (mail-yb1-xb30.google.com [IPv6:2607:f8b0:4864:20::b30]) by atuin.qyliss.net (Postfix) with ESMTPS id 72AED4C50 for ; Thu, 04 Sep 2025 23:47:44 +0000 (UTC) Received: by mail-yb1-xb30.google.com with SMTP id 3f1490d57ef6-e96e45e47daso1341713276.3 for ; Thu, 04 Sep 2025 16:47:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1757029663; x=1757634463; darn=spectrum-os.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=z9X5+hv2GaSd6+pjfQNqTM+I2piR7VJEW7BohQVIcjc=; b=LI4gv0lfOvSY4rPCckJp9mI9pfAnaCNYTCgM4I9IW7iPhsrOmyp8w5fEzsP5lh+mbb d4TVNxN12NiL2bpq0QHqpTSWpKPUW5oxmr5coSDL7njT4buOxU45Xg1bu0QFVYesqvAR 5tj5T6zfSwz6/KezBMD/Xa10qGBQGxV2CcZxEdltuXR3N75CMNe16EekpjNv70mfsnqw 1gpCWzmRQfF9owkgi4ReWEAlJWVS+kdseohISxcKiIPHCGk2JCgDpP9e015RotLjLFLG m7UwrnxQjgTyFogYSgGKRPBRGpUSK6LhtOc/4wsYDwK+TZEHwIg+6OA/7NyItphBQWby owQQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1757029663; x=1757634463; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=z9X5+hv2GaSd6+pjfQNqTM+I2piR7VJEW7BohQVIcjc=; b=WrmAkLCUnf67yWRZKgSWmbRT3IM2q4MIRK3rr8rj5PiqMopLrzES1+N5ASqRO69cAN AT0xIZc+BlnT9kBHthfNbXRcmfnXLjt+dzGbuhQCv6wVNMlEgyz/RK28UpBvdbA4Q3FE qy8Rwm2xLtE0zsk+AfLPcV10r+ZpWs/pHUlejOCgNzgxtG2KmhdrpxpAIqS0ULSStep3 NQsirbxbg5B6PGkG8/3HxLACgs3uha2YE/ZekGr29i8CxcsAuBY06k0W49yaVtml/8bh 1lDZnFDSsU3Qi8T6xEuq9wAtbdmGem18CBI4h6ml+m7RKmhjNL7yaufFfkopt2yCd1O/ n2FA== X-Gm-Message-State: AOJu0Yyt6r6n3czGXwVNfh0XS5QtgeUq4OXUgVXgpxq4HzkFAu68UU7r 49PEE7XoQO7Ptaqh5BpbY8XOy6Zfis18sV3+b1KfRrVC+HcaLLjLKVxqEUDQgyJI X-Gm-Gg: ASbGncuujN05lkpFctnGob6g284Zt3+vyfCEgy7SryaF1NaIvQ5OS7ZrRefKVh2aeII dOzZ8XvIpgpWPfF+UKYLf6r4JJso1JREhJ5kQR6yTs+wFhv90B9eLMqcd0+xrAf/LSOI/7e3WOs d4KzqhknmZFM02SPTdDEbf/r9Nxu6+/P1/Hk5pqflpLJnVyEDpMCxzCVCUvOrROLx/wt8su6bid /Po1ug5lvQMV/IPENifqn4J/v8NojcQ/PF0ZBDirldWVEFsqHJso4radOwYRu8KPzNXo8YPVJ6g 2O5zoqvIXz5QbmoQUhUX52zWMFcH1hnjZeQI/9xlBlXfaySpGkWaCxjPnWsDIr7KUvJ/IxxNOAn q7/LEtM4CKw6N+EbcMgWuCQAE+hdtTNrHS3N4LslLO5vnDE43l4HSgs2QjDyUl87tsgb4TdLPFz AlOYIkLisVnFB7r5tvt46qbpMMQhAZjbDhwv0FxyIKT7I= X-Google-Smtp-Source: AGHT+IG7tA/F00JAq5NAMJBb91eaECZsqNDWRiF1wOGembnau6Npaw5h4/QzkB/xZDaJEgENe3ZS5g== X-Received: by 2002:a53:b109:0:b0:5f4:55cb:80d4 with SMTP id 956f58d0204a3-601779c9dacmr3331949d50.17.1757029663189; Thu, 04 Sep 2025 16:47:43 -0700 (PDT) Received: from localhost.localdomain (h96-60-249-169.cncrtn.broadband.dynamic.tds.net. [96.60.249.169]) by smtp.gmail.com with UTF8SMTPSA id 3f1490d57ef6-e9bbdf23067sm2705366276.2.2025.09.04.16.47.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 04 Sep 2025 16:47:42 -0700 (PDT) From: Demi Marie Obenour Date: Thu, 04 Sep 2025 17:26:24 -0400 Subject: [PATCH 02/20] scripts/make-erofs.sh: Do not read one byte at a time MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <20250904-systemd-v1-2-2a63b790a913@gmail.com> References: <20250904-systemd-v1-0-2a63b790a913@gmail.com> In-Reply-To: <20250904-systemd-v1-0-2a63b790a913@gmail.com> To: Spectrum OS Development X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1757021182; l=1158; i=demiobenour@gmail.com; s=20250729; h=from:subject:message-id; bh=wVJwyDN3lJv6IU+H5LcVzKGpeJBAiJigB3pXXO0M8Yw=; b=Rak2usnmjZCgFV6XsXnLD+5nhOlPEUOZqkX+fQFE32aJVrS5pa7xJRimZ9FnMG9QInSTB+lwA Yp6qriV96hJBghsrBBxS0FeWn5WQhJlCR7IzwSeQzyWWhveNdxtntAv X-Developer-Key: i=demiobenour@gmail.com; a=ed25519; pk=X57Q4/YQDj9t4SBeKaDwvXYKB6quZJVx/DE2Ly2out0= Message-ID-Hash: RGI2GGY5JAIGWEJIKZFLKXDHT6HV2R7D X-Message-ID-Hash: RGI2GGY5JAIGWEJIKZFLKXDHT6HV2R7D X-MailFrom: demiobenour@gmail.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-devel.spectrum-os.org-0; header-match-devel.spectrum-os.org-1; header-match-devel.spectrum-os.org-2; header-match-devel.spectrum-os.org-3; header-match-devel.spectrum-os.org-4; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: Demi Marie Obenour , Alyssa Ross X-Mailman-Version: 3.3.9 Precedence: list List-Id: Patches and low-level development discussion Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: POSIX requires that the shell read builtin not consume any bytes beyond the end-of-line character. For non-seekable files like pipes, this requirement can only be met by reading one byte at a time, which is very slow. Avoid this by reading the entire input into a temporary file and having sh read from the temporary file. Since regular files are seekable, sh can read many bytes and then seek back to the correct file position. Signed-off-by: Demi Marie Obenour --- scripts/make-erofs.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/scripts/make-erofs.sh b/scripts/make-erofs.sh index 88e3885e578a6fd85a61c6f2993a9addb7f44c37..3f211d848b938405510d0dbf6b11cf5512c9ef5d 100755 --- a/scripts/make-erofs.sh +++ b/scripts/make-erofs.sh @@ -20,6 +20,8 @@ if [ -z "${img-}" ]; then fi superroot="$(mktemp -d -- "$img.tmp.XXXXXXXXXX")" +cat > "$superroot/input_files" +exec < "$superroot/input_files" trap 'chmod -R +w -- "$root" && rm -rf -- "$superroot"' EXIT # $superroot has 0700 permissions, so create a subdirectory # with correct (0755) permissions and do all work there. -- 2.51.0