From 3d4be5f05900dc4c19081f29e40c57ef46b87182 Mon Sep 17 00:00:00 2001 From: Jelle van der Waa Date: Mon, 3 Jan 2022 18:25:56 +0100 Subject: [PATCH] stages/org.osbuild.pacman: Make /dev/stdin available Installing the mkinitcpio kernel preset's requires /dev/stdin to be available for calling install. --- stages/org.osbuild.pacman | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/stages/org.osbuild.pacman b/stages/org.osbuild.pacman index a7a8d450..e2f99ef5 100755 --- a/stages/org.osbuild.pacman +++ b/stages/org.osbuild.pacman @@ -85,18 +85,20 @@ def parse_input(inputs): def main(tree, inputs): pkgpath, packages = parse_input(inputs) + # The hook to generate kernel preset files requires /dev/stdin + # https://github.com/archlinux/svntogit-packages/blob/7f2711a77579a72414cef323bb5e914921177b38/linux/repos/core-i686/PKGBUILD#L114 script = f""" set -e mkdir -p {tree}/dev {tree}/sys {tree}/proc mount -o bind /dev {tree}/dev mount -o bind /sys {tree}/sys mount -o bind /proc {tree}/proc + ln -s /proc/self/fd/0 /dev/stdin """ machine_id_set_previously = os.path.exists(f"{tree}/etc/machine-id") if not machine_id_set_previously: # create a fake machine ID to improve reproducibility - print("creating a fake machine id") script += f""" mkdir -p {tree}/etc echo "ffffffffffffffffffffffffffffffff" > {tree}/etc/machine-id