From b5b87490790973b42dfcba961c865ef742f95b87 Mon Sep 17 00:00:00 2001 From: Curt Brune Date: Wed, 2 Dec 2015 09:43:00 -0800 Subject: [PATCH] add btrfs kernel support and btrf-progs utilities Enable btrfs support in the 4.1.x kernel series. Add the btrfs-progs utilities to the sysroot. The btrfs-progs are installed by default for x86_64 systems. Signed-off-by: Curt Brune --- build-config/Makefile | 3 + build-config/arch/armv7a.make | 3 + build-config/arch/powerpc-softfloat.make | 6 + build-config/arch/x86_64.make | 3 + .../conf/kernel/4.1.23/linux.armv7a.config | 7 +- .../4.1.23/linux.powerpc-softfloat.config | 7 +- .../conf/kernel/4.1.23/linux.x86_64.config | 7 +- .../conf/uclibc/0.9.33.2/uclibc.armv7a.config | 6 +- .../0.9.33.2/uclibc.powerpc-softfloat.config | 6 +- .../conf/uclibc/0.9.33.2/uclibc.x86_64.config | 6 +- build-config/make/btrfs-progs.make | 127 +++++++++++++++++ build-config/make/images.make | 5 + ...nfigure-refactor-backtrace-detection.patch | 131 ++++++++++++++++++ patches/btrfs-progs/series | 0 rootconf/default/etc/init.d/makedev.sh | 8 ++ upstream/btrfs-progs-v4.3.1.tar.xz.sha1 | 1 + 16 files changed, 314 insertions(+), 12 deletions(-) create mode 100644 build-config/make/btrfs-progs.make create mode 100644 patches/btrfs-progs/0001-configure-refactor-backtrace-detection.patch create mode 100644 patches/btrfs-progs/series create mode 100644 upstream/btrfs-progs-v4.3.1.tar.xz.sha1 diff --git a/build-config/Makefile b/build-config/Makefile index fc09fbed5..0b60d6712 100644 --- a/build-config/Makefile +++ b/build-config/Makefile @@ -322,6 +322,9 @@ endif ifeq ($(GRUB_ENABLE),yes) include make/grub.make endif +ifeq ($(BTRFS_PROGS_ENABLE),yes) + include make/btrfs-progs.make +endif ifeq ($(UEFI_ENABLE),yes) include make/efivar.make include make/efibootmgr.make diff --git a/build-config/arch/armv7a.make b/build-config/arch/armv7a.make index 891cee4d6..f593e4a59 100644 --- a/build-config/arch/armv7a.make +++ b/build-config/arch/armv7a.make @@ -48,6 +48,9 @@ PARTED_ENABLE = yes # Include ext3/4 file system tools EXT3_4_ENABLE = yes +# Include btrfs file system tools +BTRFS_PROGS_ENABLE = yes + # Default to include the i2ctools. A particular machine.make can # override this. I2CTOOLS_ENABLE ?= yes diff --git a/build-config/arch/powerpc-softfloat.make b/build-config/arch/powerpc-softfloat.make index a209a094f..4c5f9d849 100644 --- a/build-config/arch/powerpc-softfloat.make +++ b/build-config/arch/powerpc-softfloat.make @@ -26,6 +26,12 @@ UBOOT_ITB_ARCH = ppc # Include MTD utilities MTDUTILS_ENABLE ?= yes +# Include ext3/4 file system tools - also required for BTRFS +EXT3_4_ENABLE ?= yes + +# Include btrfs file system tools +BTRFS_PROGS_ENABLE ?= yes + PLATFORM_IMAGE_COMPLETE = $(IMAGE_BIN_STAMP) $(IMAGE_UPDATER_STAMP) UPDATER_IMAGE_PARTS = $(UPDATER_ITB) $(UPDATER_UBOOT) UPDATER_IMAGE_PARTS_COMPLETE = $(UPDATER_ITB) $(UBOOT_INSTALL_STAMP) diff --git a/build-config/arch/x86_64.make b/build-config/arch/x86_64.make index 4a2d98e51..2e80eca40 100644 --- a/build-config/arch/x86_64.make +++ b/build-config/arch/x86_64.make @@ -113,6 +113,9 @@ PARTED_ENABLE = yes # Include ext3/4 file system tools EXT3_4_ENABLE = yes +# Include btrfs file system tools +BTRFS_PROGS_ENABLE = yes + # Include GRUB tools GRUB_ENABLE = yes diff --git a/build-config/conf/kernel/4.1.23/linux.armv7a.config b/build-config/conf/kernel/4.1.23/linux.armv7a.config index f058475b8..71ae8d313 100644 --- a/build-config/conf/kernel/4.1.23/linux.armv7a.config +++ b/build-config/conf/kernel/4.1.23/linux.armv7a.config @@ -2440,7 +2440,12 @@ CONFIG_FS_MBCACHE=y # CONFIG_JFS_FS is not set # CONFIG_XFS_FS is not set # CONFIG_GFS2_FS is not set -# CONFIG_BTRFS_FS is not set +CONFIG_BTRFS_FS=y +# CONFIG_BTRFS_FS_POSIX_ACL is not set +# CONFIG_BTRFS_FS_CHECK_INTEGRITY is not set +# CONFIG_BTRFS_FS_RUN_SANITY_TESTS is not set +# CONFIG_BTRFS_DEBUG is not set +# CONFIG_BTRFS_ASSERT is not set # CONFIG_NILFS2_FS is not set # CONFIG_F2FS_FS is not set # CONFIG_FS_POSIX_ACL is not set diff --git a/build-config/conf/kernel/4.1.23/linux.powerpc-softfloat.config b/build-config/conf/kernel/4.1.23/linux.powerpc-softfloat.config index b2e14aef7..7ad0adc9b 100644 --- a/build-config/conf/kernel/4.1.23/linux.powerpc-softfloat.config +++ b/build-config/conf/kernel/4.1.23/linux.powerpc-softfloat.config @@ -2108,7 +2108,12 @@ CONFIG_JBD2=y CONFIG_FS_MBCACHE=y # CONFIG_REISERFS_FS is not set # CONFIG_JFS_FS is not set -# CONFIG_BTRFS_FS is not set +CONFIG_BTRFS_FS=y +# CONFIG_BTRFS_FS_POSIX_ACL is not set +# CONFIG_BTRFS_FS_CHECK_INTEGRITY is not set +# CONFIG_BTRFS_FS_RUN_SANITY_TESTS is not set +# CONFIG_BTRFS_DEBUG is not set +# CONFIG_BTRFS_ASSERT is not set # CONFIG_NILFS2_FS is not set # CONFIG_F2FS_FS is not set # CONFIG_FS_DAX is not set diff --git a/build-config/conf/kernel/4.1.23/linux.x86_64.config b/build-config/conf/kernel/4.1.23/linux.x86_64.config index e1b18a24f..e15a6fa1e 100644 --- a/build-config/conf/kernel/4.1.23/linux.x86_64.config +++ b/build-config/conf/kernel/4.1.23/linux.x86_64.config @@ -2417,7 +2417,12 @@ CONFIG_FS_MBCACHE=y # CONFIG_JFS_FS is not set # CONFIG_XFS_FS is not set # CONFIG_GFS2_FS is not set -# CONFIG_BTRFS_FS is not set +CONFIG_BTRFS_FS=y +# CONFIG_BTRFS_FS_POSIX_ACL is not set +# CONFIG_BTRFS_FS_CHECK_INTEGRITY is not set +# CONFIG_BTRFS_FS_RUN_SANITY_TESTS is not set +# CONFIG_BTRFS_DEBUG is not set +# CONFIG_BTRFS_ASSERT is not set # CONFIG_NILFS2_FS is not set # CONFIG_F2FS_FS is not set # CONFIG_FS_DAX is not set diff --git a/build-config/conf/uclibc/0.9.33.2/uclibc.armv7a.config b/build-config/conf/uclibc/0.9.33.2/uclibc.armv7a.config index 5c1518b70..1a1477b95 100644 --- a/build-config/conf/uclibc/0.9.33.2/uclibc.armv7a.config +++ b/build-config/conf/uclibc/0.9.33.2/uclibc.armv7a.config @@ -89,7 +89,7 @@ UCLIBC_HAS_LFS=y # MALLOC is not set # MALLOC_SIMPLE is not set MALLOC_STANDARD=y -# MALLOC_GLIBC_COMPAT is not set +MALLOC_GLIBC_COMPAT=y UCLIBC_DYNAMIC_ATEXIT=y # COMPAT_ATEXIT is not set UCLIBC_SUSV3_LEGACY=y @@ -203,8 +203,8 @@ UCLIBC_HAS_REGEX_OLD=y UCLIBC_HAS_FNMATCH=y UCLIBC_HAS_FNMATCH_OLD=y # UCLIBC_HAS_WORDEXP is not set -# UCLIBC_HAS_NFTW is not set -# UCLIBC_HAS_FTW is not set +UCLIBC_HAS_NFTW=y +UCLIBC_HAS_FTW=y UCLIBC_HAS_FTS=y UCLIBC_HAS_GLOB=y # UCLIBC_HAS_GNU_GLOB is not set diff --git a/build-config/conf/uclibc/0.9.33.2/uclibc.powerpc-softfloat.config b/build-config/conf/uclibc/0.9.33.2/uclibc.powerpc-softfloat.config index 18a091f26..5583fe8c3 100644 --- a/build-config/conf/uclibc/0.9.33.2/uclibc.powerpc-softfloat.config +++ b/build-config/conf/uclibc/0.9.33.2/uclibc.powerpc-softfloat.config @@ -90,7 +90,7 @@ UCLIBC_HAS_LFS=y # MALLOC is not set # MALLOC_SIMPLE is not set MALLOC_STANDARD=y -# MALLOC_GLIBC_COMPAT is not set +MALLOC_GLIBC_COMPAT=y UCLIBC_DYNAMIC_ATEXIT=y # COMPAT_ATEXIT is not set UCLIBC_SUSV3_LEGACY=y @@ -204,8 +204,8 @@ UCLIBC_HAS_REGEX_OLD=y UCLIBC_HAS_FNMATCH=y UCLIBC_HAS_FNMATCH_OLD=y # UCLIBC_HAS_WORDEXP is not set -# UCLIBC_HAS_NFTW is not set -# UCLIBC_HAS_FTW is not set +UCLIBC_HAS_NFTW=y +UCLIBC_HAS_FTW=y UCLIBC_HAS_FTS=y UCLIBC_HAS_GLOB=y # UCLIBC_HAS_GNU_GLOB is not set diff --git a/build-config/conf/uclibc/0.9.33.2/uclibc.x86_64.config b/build-config/conf/uclibc/0.9.33.2/uclibc.x86_64.config index 88cadfb73..734bd5093 100644 --- a/build-config/conf/uclibc/0.9.33.2/uclibc.x86_64.config +++ b/build-config/conf/uclibc/0.9.33.2/uclibc.x86_64.config @@ -86,7 +86,7 @@ UCLIBC_HAS_LFS=y # MALLOC is not set # MALLOC_SIMPLE is not set MALLOC_STANDARD=y -# MALLOC_GLIBC_COMPAT is not set +MALLOC_GLIBC_COMPAT=y UCLIBC_DYNAMIC_ATEXIT=y # COMPAT_ATEXIT is not set UCLIBC_SUSV3_LEGACY=y @@ -201,8 +201,8 @@ UCLIBC_HAS_REGEX_OLD=y UCLIBC_HAS_FNMATCH=y UCLIBC_HAS_FNMATCH_OLD=y # UCLIBC_HAS_WORDEXP is not set -# UCLIBC_HAS_NFTW is not set -# UCLIBC_HAS_FTW is not set +UCLIBC_HAS_NFTW=y +UCLIBC_HAS_FTW=y UCLIBC_HAS_FTS=y UCLIBC_HAS_GLOB=y # UCLIBC_HAS_GNU_GLOB is not set diff --git a/build-config/make/btrfs-progs.make b/build-config/make/btrfs-progs.make new file mode 100644 index 000000000..4ae1d5d4b --- /dev/null +++ b/build-config/make/btrfs-progs.make @@ -0,0 +1,127 @@ +#------------------------------------------------------------------------------- +# +# Copyright (C) 2015 Curt Brune +# +# SPDX-License-Identifier: GPL-2.0 +# +#------------------------------------------------------------------------------- +# +# This is a makefile fragment that defines the build of btrfs-progs +# + +BTRFSPROGS_VERSION = v4.3.1 +BTRFSPROGS_TARBALL = btrfs-progs-$(BTRFSPROGS_VERSION).tar.xz +BTRFSPROGS_TARBALL_URLS += $(ONIE_MIRROR) \ + https://www.kernel.org/pub/linux/kernel/people/kdave/btrfs-progs +BTRFSPROGS_BUILD_DIR = $(MBUILDDIR)/btrfs-progs +BTRFSPROGS_DIR = $(BTRFSPROGS_BUILD_DIR)/btrfs-progs-$(BTRFSPROGS_VERSION) + +BTRFSPROGS_SRCPATCHDIR = $(PATCHDIR)/btrfs-progs +BTRFSPROGS_DOWNLOAD_STAMP = $(DOWNLOADDIR)/btrfs-progs-download +BTRFSPROGS_SOURCE_STAMP = $(STAMPDIR)/btrfs-progs-source +BTRFSPROGS_PATCH_STAMP = $(STAMPDIR)/btrfs-progs-patch +BTRFSPROGS_CONFIGURE_STAMP = $(STAMPDIR)/btrfs-progs-configure +BTRFSPROGS_BUILD_STAMP = $(STAMPDIR)/btrfs-progs-build +BTRFSPROGS_INSTALL_STAMP = $(STAMPDIR)/btrfs-progs-install +BTRFSPROGS_STAMP = $(BTRFSPROGS_SOURCE_STAMP) \ + $(BTRFSPROGS_CONFIGURE_STAMP) \ + $(BTRFSPROGS_BUILD_STAMP) \ + $(BTRFSPROGS_INSTALL_STAMP) + +ifneq ($(EXT3_4_ENABLE),yes) + $(error BTRFS tools requires EXT3/4 support, but $$(EXT3_4_ENABLE) is not set) +endif + +PHONY += btrfs-progs btrfs-progs-download btrfs-progs-source \ + btrfs-progs-configure btrfs-progs-build btrfs-progs-install \ + btrfs-progs-clean btrfs-progs-download-clean + +BTRFSPROGS_LIBS = libbtrfs.so libbtrfs.so.0 libbtrfs.so.0.1 +BTRFSPROGS_SBIN = btrfs mkfs.btrfs btrfs-debug-tree btrfs-map-logical \ + btrfs-image btrfs-zero-log btrfs-find-root btrfstune \ + btrfs-show-super btrfs-select-super btrfs-convert \ + btrfsck + +btrfs-progs: $(BTRFSPROGS_STAMP) + +DOWNLOAD += $(BTRFSPROGS_DOWNLOAD_STAMP) +btrfs-progs-download: $(BTRFSPROGS_DOWNLOAD_STAMP) +$(BTRFSPROGS_DOWNLOAD_STAMP): $(PROJECT_STAMP) + $(Q) rm -f $@ && eval $(PROFILE_STAMP) + $(Q) echo "==== Getting upstream btrfs-progs ====" + $(Q) $(SCRIPTDIR)/fetch-package $(DOWNLOADDIR) $(UPSTREAMDIR) \ + $(BTRFSPROGS_TARBALL) $(BTRFSPROGS_TARBALL_URLS) + $(Q) touch $@ + +SOURCE += $(BTRFSPROGS_SOURCE_STAMP) +btrfs-progs-source: $(BTRFSPROGS_SOURCE_STAMP) +$(BTRFSPROGS_SOURCE_STAMP): $(TREE_STAMP) | $(BTRFSPROGS_DOWNLOAD_STAMP) + $(Q) rm -f $@ && eval $(PROFILE_STAMP) + $(Q) echo "==== Extracting upstream btrfs-progs ====" + $(Q) $(SCRIPTDIR)/extract-package $(BTRFSPROGS_BUILD_DIR) $(DOWNLOADDIR)/$(BTRFSPROGS_TARBALL) + $(Q) touch $@ + +btrfs-progs-patch: $(BTRFSPROGS_PATCH_STAMP) +$(BTRFSPROGS_PATCH_STAMP): $(BTRFSPROGS_SRCPATCHDIR)/* $(BTRFSPROGS_SOURCE_STAMP) + $(Q) rm -f $@ && eval $(PROFILE_STAMP) + $(Q) echo "==== Patching btrfs-progs ====" + $(Q) $(SCRIPTDIR)/apply-patch-series $(BTRFSPROGS_SRCPATCHDIR)/series $(BTRFSPROGS_DIR) + $(Q) touch $@ + +btrfs-progs-configure: $(BTRFSPROGS_CONFIGURE_STAMP) +$(BTRFSPROGS_CONFIGURE_STAMP): $(E2FSPROGS_INSTALL_STAMP) \ + $(BTRFSPROGS_PATCH_STAMP) | $(DEV_SYSROOT_INIT_STAMP) + $(Q) rm -f $@ && eval $(PROFILE_STAMP) + $(Q) echo "==== Configure btrfs-progs-$(BTRFSPROGS_VERSION) ====" + $(Q) cd $(BTRFSPROGS_DIR) && PATH='$(CROSSBIN):$(PATH)' \ + $(BTRFSPROGS_DIR)/configure \ + --prefix=$(DEV_SYSROOT)/usr \ + --host=$(TARGET) \ + --disable-documentation \ + --disable-backtrace \ + CC=$(CROSSPREFIX)gcc \ + CFLAGS="$(ONIE_CFLAGS)" \ + $(ONIE_PKG_CONFIG) + $(Q) touch $@ + +ifndef MAKE_CLEAN +BTRFSPROGS_NEW_FILES = $(shell test -d $(BTRFSPROGS_DIR) && test -f $(BTRFSPROGS_BUILD_STAMP) && \ + find -L $(BTRFSPROGS_DIR) -newer $(BTRFSPROGS_BUILD_STAMP) -type f \ + -print -quit) +endif + +btrfs-progs-build: $(BTRFSPROGS_BUILD_STAMP) +$(BTRFSPROGS_BUILD_STAMP): $(BTRFSPROGS_NEW_FILES) $(BTRFSPROGS_CONFIGURE_STAMP) + $(Q) rm -f $@ && eval $(PROFILE_STAMP) + $(Q) echo "==== Building btrfs-progs-$(BTRFSPROGS_VERSION) ====" + $(Q) PATH='$(CROSSBIN):$(PATH)' $(MAKE) -C $(BTRFSPROGS_DIR) + $(Q) touch $@ + +btrfs-progs-install: $(BTRFSPROGS_INSTALL_STAMP) +$(BTRFSPROGS_INSTALL_STAMP): $(SYSROOT_INIT_STAMP) $(BTRFSPROGS_BUILD_STAMP) + $(Q) rm -f $@ && eval $(PROFILE_STAMP) + $(Q) echo "==== Installing btrfs-progs in $(DEV_SYSROOT) ====" + $(Q) PATH='$(CROSSBIN):$(PATH)' $(MAKE) -C $(BTRFSPROGS_DIR) install + $(Q) for file in $(BTRFSPROGS_LIBS) ; do \ + cp -av $(DEV_SYSROOT)/usr/lib/$$file $(SYSROOTDIR)/usr/lib/ ; \ + done + $(Q) for file in $(BTRFSPROGS_SBIN) ; do \ + cp -av $(DEV_SYSROOT)/usr/bin/$$file $(SYSROOTDIR)/usr/sbin/ ; \ + done + $(Q) touch $@ + +USERSPACE_CLEAN += btrfs-progs-clean +btrfs-progs-clean: + $(Q) rm -rf $(BTRFSPROGS_BUILD_DIR) + $(Q) rm -f $(BTRFSPROGS_STAMP) + $(Q) echo "=== Finished making $@ for $(PLATFORM)" + +DOWNLOAD_CLEAN += btrfs-progs-download-clean +btrfs-progs-download-clean: + $(Q) rm -f $(BTRFSPROGS_DOWNLOAD_STAMP) $(DOWNLOADDIR)/btrfs-progs* + +#------------------------------------------------------------------------------- +# +# Local Variables: +# mode: makefile-gmake +# End: diff --git a/build-config/make/images.make b/build-config/make/images.make index cd0ca0618..962219a7a 100644 --- a/build-config/make/images.make +++ b/build-config/make/images.make @@ -92,6 +92,11 @@ ifeq ($(IPMITOOL_ENABLE),yes) PACKAGES_INSTALL_STAMPS += $(IPMITOOL_INSTALL_STAMP) endif +ifeq ($(BTRFS_PROGS_ENABLE),yes) + PACKAGES_INSTALL_STAMPS += $(BTRFSPROGS_INSTALL_STAMP) +endif + + ifndef MAKE_CLEAN SYSROOT_NEW_FILES = $(shell \ test -d $(ROOTCONFDIR)/default && \ diff --git a/patches/btrfs-progs/0001-configure-refactor-backtrace-detection.patch b/patches/btrfs-progs/0001-configure-refactor-backtrace-detection.patch new file mode 100644 index 000000000..f181322a7 --- /dev/null +++ b/patches/btrfs-progs/0001-configure-refactor-backtrace-detection.patch @@ -0,0 +1,131 @@ +From 9bef473d17ec01efe760462271791dfaaea280c0 Mon Sep 17 00:00:00 2001 +From: Thomas Petazzoni +Date: Wed, 29 Jul 2015 22:35:19 +0200 +Subject: [PATCH 1/3] configure: refactor backtrace() detection + +The current code assumes that if __GLIBC__ is not defined, backtrace +support is not available, and defines BTRFS_DISABLE_BACKTRACE. + +However, this macro is already defined by the configure.ac script when +--disable-backtrace is passed. This means that if you are using a C +library like musl which does not define __GLIBC__, and you pass +--disable-backtrace, you get a macro redefinition. + +Instead of relying on __GLIBC__, this commit implements a proper +configure.ac based detection of backtrace support: + + * If the user passes --enable-backtrace, we check if the backtrace() + function is available. If not, we abort the configure process with + an error. Otherwise we enable backtrace support by defining + HAVE_BACKTRACE. + + * If the user passes --disable-backtrace, then we don't enable + backtrace support. + + * If the user passes nothing special, we auto-detect: if backtrace() + is available, we use it, otherwise we simply warn at configure time + but not fail. + +Upstream-status: pending +Signed-off-by: Thomas Petazzoni +Signed-off-by: Brendan Heading +--- + configure.ac | 32 ++++++++++++++++++++++---------- + kerncompat.h | 9 ++++----- + 2 files changed, 26 insertions(+), 15 deletions(-) + +diff --git a/configure.ac b/configure.ac +index c3a22d1..e936a10 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -63,22 +63,34 @@ AC_DEFUN([PKG_STATIC], [ + fi + ]) + +- ++# Provide a --{enable,disable}-backtrace option. If not passed, set ++# enable_backtrace to 'auto' so that we try to enable backtrace ++# support if available, but if not available, we gracefully fallback ++# without backtrace support. + AC_ARG_ENABLE([backtrace], + AS_HELP_STRING([--disable-backtrace], [disable btrfs backtrace]), +- [], [enable_backtrace=yes] ++ [enable_backtrace=${enableval}], [enable_backtrace=auto] + ) + +-AS_IF([test "x$enable_backtrace" = xno], [ +- AC_DEFINE([BTRFS_DISABLE_BACKTRACE], [1], [disable backtrace stuff in kerncompat.h ]) +-]) +- +-if test "x$enable_backtrace" = xyes; then +- AC_CHECK_HEADERS([execinfo.h]) +- AC_CHECK_FUNCS([backtrace backtrace_symbols_fd], [], +- AC_MSG_ERROR([standard library does not have backtrace support])) ++# Backtrace support requested (enable_backtrace is either 'yes' or ++# 'auto'), so check for needed headers and functions. ++if test "x$enable_backtrace" != xno; then ++ AC_CHECK_HEADERS([execinfo.h]) ++ AC_CHECK_FUNCS([backtrace backtrace_symbols_fd]) + fi + ++if test "x$ac_cv_func_backtrace" = xno; then ++ # If backtrace support was requested but not available, we fail if ++ # --enable-backtrace was passed, or we simply warn if we're ++ # auto-detecting. ++ if test "x$enable_backtrace" = xyes ; then ++ AC_MSG_ERROR([standard library does not have backtrace support]) ++ elif test "x$enable_backtrace" = xauto ; then ++ AC_MSG_WARN([standard library does not have backtrace support, disabled]) ++ fi ++else ++ AC_DEFINE([HAVE_BACKTRACE], [1], [Enable backtrace support]) ++fi + + AC_ARG_ENABLE([documentation], + AS_HELP_STRING([--disable-documentation], [do not build domumentation]), +diff --git a/kerncompat.h b/kerncompat.h +index 5d92856..8318665 100644 +--- a/kerncompat.h ++++ b/kerncompat.h +@@ -33,11 +33,10 @@ + #include + + #ifndef __GLIBC__ +-#define BTRFS_DISABLE_BACKTRACE + #define __always_inline __inline __attribute__ ((__always_inline__)) + #endif + +-#ifndef BTRFS_DISABLE_BACKTRACE ++#ifdef HAVE_BACKTRACE + #include + #endif + +@@ -65,7 +64,7 @@ + #define ULONG_MAX (~0UL) + #endif + +-#ifndef BTRFS_DISABLE_BACKTRACE ++#ifdef HAVE_BACKTRACE + #define MAX_BACKTRACE 16 + static inline void print_trace(void) + { +@@ -285,7 +284,7 @@ static inline long IS_ERR(const void *ptr) + #define vmalloc(x) malloc(x) + #define vfree(x) free(x) + +-#ifndef BTRFS_DISABLE_BACKTRACE ++#ifdef HAVE_BACKTRACE + #define BUG_ON(c) assert_trace(#c, __FILE__, __func__, __LINE__, !(c)) + #else + #define BUG_ON(c) assert(!(c)) +@@ -293,7 +292,7 @@ static inline long IS_ERR(const void *ptr) + + #define WARN_ON(c) BUG_ON(c) + +-#ifndef BTRFS_DISABLE_BACKTRACE ++#ifdef HAVE_BACKTRACE + #define ASSERT(c) assert_trace(#c, __FILE__, __func__, __LINE__, (c)) + #else + #define ASSERT(c) assert(c) +-- +2.4.3 diff --git a/patches/btrfs-progs/series b/patches/btrfs-progs/series new file mode 100644 index 000000000..e69de29bb diff --git a/rootconf/default/etc/init.d/makedev.sh b/rootconf/default/etc/init.d/makedev.sh index 4b9f04d7b..252a197a0 100755 --- a/rootconf/default/etc/init.d/makedev.sh +++ b/rootconf/default/etc/init.d/makedev.sh @@ -116,6 +116,14 @@ vdevs=$(ls -d /sys/block/vd[a-z] 2&> /dev/null) && { done } +# create misc device btrfs-control, if enabled +btrfs_minor=$(grep btrfs-control /proc/misc | awk '{print $1}') +[ -n "$btrfs_minor" ] && { + mknod /dev/btrfs-control c 10 $btrfs_minor || { + log_failure_msg "Problems creating /dev/btrfs-control (10, $btrfs_minor)" + } +} + mkdir -p $ONIE_RUN_DIR #Create initial device nodes that use dynamic major node numbers. e.g ubi diff --git a/upstream/btrfs-progs-v4.3.1.tar.xz.sha1 b/upstream/btrfs-progs-v4.3.1.tar.xz.sha1 new file mode 100644 index 000000000..94d9e112f --- /dev/null +++ b/upstream/btrfs-progs-v4.3.1.tar.xz.sha1 @@ -0,0 +1 @@ +06905d28d23cb739b0985c6932e341d518a0f983 btrfs-progs-v4.3.1.tar.xz