diff --git a/btrfsprogs.changes b/btrfsprogs.changes index b6764c7..b8e1327 100644 --- a/btrfsprogs.changes +++ b/btrfsprogs.changes @@ -1,3 +1,10 @@ +------------------------------------------------------------------- +Tue Oct 25 15:58:46 UTC 2016 - jeffm@suse.com + +- Add ability to provide site specific defaults for mkfs (FATE#320615). + * Only used for SLES11 defaults. +- Added patch mkfs-default-features.patch + ------------------------------------------------------------------- Tue Oct 18 00:00:00 CEST 2016 - dsterba@suse.cz diff --git a/btrfsprogs.spec b/btrfsprogs.spec index 4624054..92fb5ec 100644 --- a/btrfsprogs.spec +++ b/btrfsprogs.spec @@ -40,12 +40,14 @@ Source: https://www.kernel.org/pub/linux/kernel/people/kdave/btrfs-progs # support for mkinitrd in < 13.1 Source1: boot-btrfs.sh Source4: setup-btrfs.sh +Source5: sles11-defaults.h Patch163: 0163-btrfs-progs-fsck-fix-segfault.patch Patch167: 0167-Btrfs-progs-make-find_and_setup_root-return-an-error.patch Patch168: 0168-Btrfs-progs-don-t-bug-out-if-we-can-t-find-the-last-.patch Patch1000: local-version-override.patch +Patch1001: mkfs-default-features.patch BuildRequires: asciidoc BuildRequires: autoconf @@ -141,9 +143,15 @@ thing. %patch167 -p1 %patch168 -p1 %patch1000 -p1 +%patch1001 -p1 %build ./autogen.sh +%if 0%{?suse_version} == 1110 +cp %{SOURCE5} . +export CFLAGS="%optflags -include sles11-defaults.h" +%endif + %configure make V=1 %{?_smp_mflags} all \ %if %build_static diff --git a/mkfs-default-features.patch b/mkfs-default-features.patch new file mode 100644 index 0000000..12c2af1 --- /dev/null +++ b/mkfs-default-features.patch @@ -0,0 +1,30 @@ +From: Jeff Mahoney +Subject: mkfs: allow site to override defaults +Patch-mainline: Never, a real solution with a config file is required +References: FATE#320615 + +This is a simple method to allow us to set site defaults for mkfs by +adding -include to cflags. + +Signed-off-by: Jeff Mahoney +--- + utils.h | 4 ++++ + 1 file changed, 4 insertions(+) + +--- a/utils.h ++++ b/utils.h +@@ -28,10 +28,14 @@ + + #define BTRFS_MKFS_SYSTEM_GROUP_SIZE (4 * 1024 * 1024) + #define BTRFS_MKFS_SMALL_VOLUME_SIZE (1024 * 1024 * 1024) ++#ifndef BTRFS_MKFS_DEFAULT_NODE_SIZE + #define BTRFS_MKFS_DEFAULT_NODE_SIZE 16384 ++#endif ++#ifndef BTRFS_MKFS_DEFAULT_FEATURES + #define BTRFS_MKFS_DEFAULT_FEATURES \ + (BTRFS_FEATURE_INCOMPAT_EXTENDED_IREF \ + | BTRFS_FEATURE_INCOMPAT_SKINNY_METADATA) ++#endif + + /* + * Avoid multi-device features (RAID56) and mixed block groups diff --git a/sles11-defaults.h b/sles11-defaults.h new file mode 100644 index 0000000..d6cedac --- /dev/null +++ b/sles11-defaults.h @@ -0,0 +1,5 @@ +#ifndef _SLES11_DEFAULTS_H +#define _SLES11_DEFAULTS_H +#define BTRFS_MKFS_DEFAULT_NODE_SIZE sysconf(_SC_PAGESIZE) +#define BTRFS_MKFS_DEFAULT_FEATURES BTRFS_FEATURE_INCOMPAT_EXTENDED_IREF +#endif