|
|
073af0 |
From 6aa496e3128321f911dae10bf1a0f32c5e9a11fd Mon Sep 17 00:00:00 2001
|
|
|
073af0 |
From: Jonathan Lebon <jonathan@jlebon.com>
|
|
|
073af0 |
Date: Tue, 29 Oct 2019 16:38:56 -0400
|
|
|
073af0 |
Subject: [PATCH 1/2] libpriv/kernel: Use g_build_filename instead of
|
|
|
073af0 |
g_strconcat
|
|
|
073af0 |
|
|
|
073af0 |
It's much easier to mess up with the latter than the former when
|
|
|
073af0 |
building filenames. There's a bunch more all over the codebase; just did
|
|
|
073af0 |
this bit to be consistent with the next commit which also uses it.
|
|
|
073af0 |
---
|
|
|
073af0 |
src/libpriv/rpmostree-kernel.c | 6 +++---
|
|
|
073af0 |
1 file changed, 3 insertions(+), 3 deletions(-)
|
|
|
073af0 |
|
|
|
073af0 |
diff --git a/src/libpriv/rpmostree-kernel.c b/src/libpriv/rpmostree-kernel.c
|
|
|
073af0 |
index 9eb052bd..2266f9c7 100644
|
|
|
073af0 |
--- a/src/libpriv/rpmostree-kernel.c
|
|
|
073af0 |
+++ b/src/libpriv/rpmostree-kernel.c
|
|
|
073af0 |
@@ -353,7 +353,7 @@ rpmostree_finalize_kernel (int rootfs_dfd,
|
|
|
073af0 |
GError **error)
|
|
|
073af0 |
{
|
|
|
073af0 |
const char slash_bootdir[] = "boot";
|
|
|
073af0 |
- g_autofree char *modules_bootdir = g_strconcat ("usr/lib/modules/", kver, NULL);
|
|
|
073af0 |
+ g_autofree char *modules_bootdir = g_build_filename ("usr/lib/modules", kver, NULL);
|
|
|
073af0 |
|
|
|
073af0 |
/* Calculate the sha256sum of the kernel+initramfs (called the "boot
|
|
|
073af0 |
* checksum"). We checksum the initramfs from the tmpfile fd (via mmap()) to
|
|
|
073af0 |
@@ -371,7 +371,7 @@ rpmostree_finalize_kernel (int rootfs_dfd,
|
|
|
073af0 |
}
|
|
|
073af0 |
const char *boot_checksum_str = g_checksum_get_string (boot_checksum);
|
|
|
073af0 |
|
|
|
073af0 |
- g_autofree char *kernel_modules_path = g_strconcat (modules_bootdir, "/vmlinuz", NULL);;
|
|
|
073af0 |
+ g_autofree char *kernel_modules_path = g_build_filename (modules_bootdir, "vmlinuz", NULL);
|
|
|
073af0 |
/* It's possible the bootdir is already the modules directory; in that case,
|
|
|
073af0 |
* we don't need to rename.
|
|
|
073af0 |
*/
|
|
|
073af0 |
@@ -394,7 +394,7 @@ rpmostree_finalize_kernel (int rootfs_dfd,
|
|
|
073af0 |
}
|
|
|
073af0 |
|
|
|
073af0 |
/* Replace the initramfs */
|
|
|
073af0 |
- g_autofree char *initramfs_modules_path = g_strconcat (modules_bootdir, "/initramfs.img", NULL);
|
|
|
073af0 |
+ g_autofree char *initramfs_modules_path = g_build_filename (modules_bootdir, "initramfs.img", NULL);
|
|
|
073af0 |
if (unlinkat (rootfs_dfd, initramfs_modules_path, 0) < 0)
|
|
|
073af0 |
{
|
|
|
073af0 |
if (errno != ENOENT)
|
|
|
073af0 |
--
|
|
|
073af0 |
2.21.0
|
|
|
073af0 |
|