Skip to content

Commit c40f836

Browse files
authored
Merge pull request #5404 from jlebon/pr/dracut-tweaks
libpriv/kernel: Pass through DRACUT_NO_XATTR more cleanly
2 parents b86f1fa + c71329e commit c40f836

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/libpriv/rpmostree-kernel.cxx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -465,10 +465,6 @@ rpmostree_run_dracut (int rootfs_dfd, const char *const *argv, const char *kver,
465465
{
466466
auto destdir = rpmostreecxx::cliwrap_destdir ();
467467

468-
/* We pass through DRACUT_NO_XATTR. */
469-
const char *noxattr = g_getenv ("DRACUT_NO_XATTR") ?: "";
470-
const char *noxattr_key = noxattr ? "DRACUT_NO_XATTR=" : "";
471-
472468
/* Shell wrapper around dracut to write to the O_TMPFILE fd;
473469
* at some point in the future we should add --fd X instead of -f
474470
* to dracut.
@@ -478,13 +474,13 @@ rpmostree_run_dracut (int rootfs_dfd, const char *const *argv, const char *kver,
478474
g_autofree char *rpmostree_dracut_wrapper
479475
= g_strdup_printf ("#!/usr/bin/bash\n"
480476
"set -euo pipefail\n"
481-
"export PATH=%s:${PATH} %s%s\n"
477+
"export PATH=%s:${PATH}\n"
482478
"extra_argv=; if (dracut --help; true) | grep -q -e --reproducible; then "
483479
"extra_argv=\"--reproducible\"; fi\n"
484480
"mkdir -p /tmp/dracut && dracut $extra_argv -v --add ostree "
485481
"--tmpdir=/tmp/dracut -f /tmp/initramfs.img \"$@\"\n"
486482
"cat /tmp/initramfs.img >/proc/self/fd/3\n",
487-
destdir.c_str (), noxattr_key, noxattr);
483+
destdir.c_str ());
488484
g_autoptr (GPtrArray) rebuild_argv = NULL;
489485
g_auto (GLnxTmpfile) tmpf = {
490486
0,
@@ -554,6 +550,10 @@ rpmostree_run_dracut (int rootfs_dfd, const char *const *argv, const char *kver,
554550
* try to create the other ones (/dev/null, /dev/kmsg, and /dev/console) since it'll fail anyway
555551
* (and print ugly messages) since we don't give it `CAP_MKNOD`. */
556552
bwrap->setenv ("DRACUT_NO_MKNOD", "1");
553+
/* We pass through DRACUT_NO_XATTR. */
554+
const char *noxattr = g_getenv ("DRACUT_NO_XATTR");
555+
if (noxattr)
556+
bwrap->setenv ("DRACUT_NO_XATTR", noxattr);
557557

558558
if (dracut_host_tmpdir)
559559
bwrap->bind_readwrite (dracut_host_tmpdir->path, "/tmp/dracut");

0 commit comments

Comments
 (0)