lorax/0001-Ensure-proc-exists-before-trying-to-touch-proc-modul.patch

46 lines
1.8 KiB
Diff
Raw Normal View History

From 6ba02f734c481dfb7fa3feab11b6831b449d82cb Mon Sep 17 00:00:00 2001
From: Adam Williamson <awilliam@redhat.com>
Date: Mon, 15 Jun 2020 17:05:02 -0700
Subject: [PATCH] Ensure /proc exists before trying to touch /proc/modules
The last few Rawhide composes failed because, when we try to
touch /proc/modules here (in treebuilder.py), /proc does not
exist in the inroot. I tried and failed all afternoon to figure
out *why* it suddenly doesn't exist; I'd still like to know, but
this at least should make it not an issue. `exist_ok=True` means
that if the dir already exists we'll do nothing and carry on.
Signed-off-by: Adam Williamson <awilliam@redhat.com>
---
src/pylorax/creator.py | 1 +
src/pylorax/treebuilder.py | 1 +
2 files changed, 2 insertions(+)
diff --git a/src/pylorax/creator.py b/src/pylorax/creator.py
index 7075d325..fc090a26 100644
--- a/src/pylorax/creator.py
+++ b/src/pylorax/creator.py
@@ -256,6 +256,7 @@ def rebuild_initrds_for_live(opts, sys_root_dir, results_dir):
raise Exception("No initrds found, cannot rebuild_initrds")
# Hush some dracut warnings. TODO: bind-mount proc in place?
+ os.makedirs(joinpaths(sys_root_dir, "/proc"), exist_ok=True)
open(joinpaths(sys_root_dir,"/proc/modules"),"w")
if opts.ostree:
diff --git a/src/pylorax/treebuilder.py b/src/pylorax/treebuilder.py
index cbb8872f..c30df638 100644
--- a/src/pylorax/treebuilder.py
+++ b/src/pylorax/treebuilder.py
@@ -309,6 +309,7 @@ class TreeBuilder(object):
raise Exception("No kernels found, cannot rebuild_initrds")
# Hush some dracut warnings. TODO: bind-mount proc in place?
+ os.makedirs(joinpaths(self.vars.inroot, "/proc"), exist_ok=True)
open(joinpaths(self.vars.inroot,"/proc/modules"),"w")
for kernel in self.kernels:
if prefix:
--
2.27.0