buildroot: bind mount mke2fs config

There was a bug in mke2fs (fixed in versionv 1.45.7, with commit
6fa8edd0) where mkfs.ext4 would fail because the default config,
created on the fly, would contain a syntax error. The program
would abort with:
  Syntax error in mke2fs config file (<default>, line #22)
    Unknown code prof 17

To avoid this error, we try to bind mount the config from the build
root.
This commit is contained in:
Christian Kellner 2021-02-16 18:23:02 +01:00 committed by Tom Gundersen
parent 47a81ff3ed
commit 6d52349370

View file

@ -180,6 +180,14 @@ class BuildRoot(contextlib.AbstractContextManager):
mounts += ["--bind", "/sys", "/sys"]
mounts += ["--ro-bind-try", "/sys/fs/selinux", "/sys/fs/selinux"]
# There was a bug in mke2fs (fixed in versionv 1.45.7) where mkfs.ext4
# would fail because the default config, created on the fly, would
# contain a syntax error. Therefore we bind mount the config from
# the build root, if it exists
mounts += ["--ro-bind-try",
os.path.join(self._rootdir, "etc/mke2fs.conf"),
"/etc/mke2fs.conf"]
# We execute our own modules by bind-mounting them from the host into
# the build-root. We have minimal requirements on the build-root, so
# these modules can be executed. Everything else we provide ourselves.