stages/org.osbuild.pacman: Make /dev/stdin available
Installing the mkinitcpio kernel preset's requires /dev/stdin to be available for calling install.
This commit is contained in:
parent
97202e53b0
commit
3d4be5f059
1 changed files with 3 additions and 1 deletions
|
|
@ -85,18 +85,20 @@ def parse_input(inputs):
|
||||||
def main(tree, inputs):
|
def main(tree, inputs):
|
||||||
pkgpath, packages = parse_input(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"""
|
script = f"""
|
||||||
set -e
|
set -e
|
||||||
mkdir -p {tree}/dev {tree}/sys {tree}/proc
|
mkdir -p {tree}/dev {tree}/sys {tree}/proc
|
||||||
mount -o bind /dev {tree}/dev
|
mount -o bind /dev {tree}/dev
|
||||||
mount -o bind /sys {tree}/sys
|
mount -o bind /sys {tree}/sys
|
||||||
mount -o bind /proc {tree}/proc
|
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")
|
machine_id_set_previously = os.path.exists(f"{tree}/etc/machine-id")
|
||||||
if not machine_id_set_previously:
|
if not machine_id_set_previously:
|
||||||
# create a fake machine ID to improve reproducibility
|
# create a fake machine ID to improve reproducibility
|
||||||
print("creating a fake machine id")
|
|
||||||
script += f"""
|
script += f"""
|
||||||
mkdir -p {tree}/etc
|
mkdir -p {tree}/etc
|
||||||
echo "ffffffffffffffffffffffffffffffff" > {tree}/etc/machine-id
|
echo "ffffffffffffffffffffffffffffffff" > {tree}/etc/machine-id
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue