Skip to content

xfsprogs: add patch to load default config file #295

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 42 additions & 0 deletions packages/xfsprogs/0001-mkfs-source-defaults-from-config-file.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
From eea379598278cc62a74c9932f624c89407a966f8 Mon Sep 17 00:00:00 2001
From: Sparks Song <[email protected]>
Date: Mon, 3 Feb 2025 22:44:31 +0000
Subject: [PATCH] mkfs: source defaults from config file to make nrext64
default off on multiple kernel versions

---
mkfs/xfs_mkfs.c | 11 +++++++++++
1 file changed, 11 insertions(+)

diff --git a/mkfs/xfs_mkfs.c b/mkfs/xfs_mkfs.c
index 6d2469c..87e7457 100644
--- a/mkfs/xfs_mkfs.c
+++ b/mkfs/xfs_mkfs.c
@@ -39,6 +39,9 @@
*/
#define WHACK_SIZE (128 * 1024)

+/* Default path for the mkfs.xfs configuration file */
+#define DEFAULT_CONFIG_PATH "/usr/share/xfsprogs/mkfs/default.conf"
+
/*
* XXX: The configured block and sector sizes are defined as global variables so
* that they don't need to be passed to getnum/cvtnum().
@@ -4428,6 +4431,14 @@ main(
* the options from this file parsed, we can then proceed with parameter
* and bounds checking and making the filesystem.
*/
+
+ if (cli.cfgfile == NULL) {
+ struct stat defcfg_statbuf;
+ if (stat(DEFAULT_CONFIG_PATH, &defcfg_statbuf) == 0) {
+ cli.cfgfile = DEFAULT_CONFIG_PATH;
+ }
+ }
+
cfgfile_parse(&cli);

protostring = setup_proto(cli.protofile);
--
2.47.0

4 changes: 3 additions & 1 deletion packages/xfsprogs/xfsprogs.spec
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ Source0: http://kernel.org/pub/linux/utils/fs/xfs/xfsprogs/xfsprogs-%{version}.t
Source1: http://kernel.org/pub/linux/utils/fs/xfs/xfsprogs/xfsprogs-%{version}.tar.sign
Source2: gpgkey-0C1D891C50A732E0680F7B644675A111E50B5FA6.asc

Patch1000: 0001-mkfs-source-defaults-from-config-file.patch

BuildRequires: %{_cross_os}glibc-devel
BuildRequires: %{_cross_os}libuuid-devel
BuildRequires: %{_cross_os}libinih-devel
Expand All @@ -29,7 +31,7 @@ Requires: %{name}

%prep
%{gpgverify} --data=<(xzcat %{S:0}) --signature=%{S:1} --keyring=%{S:2}
%autosetup -n xfsprogs-%{version}
%autosetup -n xfsprogs-%{version} -p1

%build
%cross_configure \
Expand Down