3
0
forked from pool/util-linux

Accepting request 457126 from home:sbrabec:branches:util-linux-raw-fate321122

Rebase of https://build.opensuse.org/request/show/455783. No other changes.

OBS-URL: https://build.opensuse.org/request/show/457126
OBS-URL: https://build.opensuse.org/package/show/Base:System/util-linux?expand=0&rev=331
This commit is contained in:
Marcus Meissner 2017-02-15 14:53:56 +00:00 committed by Git OBS Bridge
parent 783484c315
commit d06095d526
7 changed files with 285 additions and 8 deletions

View File

@ -9,6 +9,24 @@ Fri Feb 10 10:40:23 UTC 2017 - fbui@suse.com
This also get rid of the only use of the rpm preset macros so we can This also get rid of the only use of the rpm preset macros so we can
kill them. kill them.
-------------------------------------------------------------------
Wed Feb 8 18:16:22 CET 2017 - sbrabec@suse.com
- Merge SLE12 SP3 changes to make the package compatible with
Tumbleweed, SLE12 SP3 and Leap 42.3.
- Drop patch tests-script-race-on-force-only.patch from SLE12 SP3
and Leap 42.3. Upstream has a different workaround.
https://github.com/karelzak/util-linux/issues/296
- INCOMPATIBLE CHANGE for SLE12 SP3 and Leap 42.3:
losetup -L changes its meaning from SLE12 SP1&SP2 specific
--logical-blocksize to the upstream --nooverlap).
--logical-blocksize can be used only with long option.
- Include SLE12 + Leap 42 exclusive feature, implemented by
hare@suse.de:
* losetup: Add support for setting logical blocksizes
(bsc#931634, FATE#319010)
+ util-linux-losetup-Add-support-for-setting-logical-blocksize.patch
------------------------------------------------------------------- -------------------------------------------------------------------
Tue Feb 7 20:07:55 CET 2017 - sbrabec@suse.com Tue Feb 7 20:07:55 CET 2017 - sbrabec@suse.com

View File

@ -16,7 +16,11 @@
# #
%if 0%{?suse_version} >= 1330
%bcond_without enable_last %bcond_without enable_last
%else
%bcond_with enable_last
%endif
Name: python-libmount Name: python-libmount
%define _name util-linux %define _name util-linux
@ -69,7 +73,7 @@ Name: python-libmount
%endif %endif
Summary: %main_summary Summary: %main_summary
License: GPL-2.0+ License: GPL-2.0+
Group: %group_pl Group: %main_group
BuildRequires: audit-devel BuildRequires: audit-devel
BuildRequires: bc BuildRequires: bc
BuildRequires: binutils-devel BuildRequires: binutils-devel
@ -150,7 +154,9 @@ Source51: blkid.conf
## util-linux patches ## util-linux patches
## ##
# PATCH-EXTEND-UPSTREAM: Let `su' handle /sbin and /usr/sbin in path # PATCH-EXTEND-UPSTREAM: Let `su' handle /sbin and /usr/sbin in path
Patch4: make-sure-sbin-resp-usr-sbin-are-in-PATH.diff Patch0: make-sure-sbin-resp-usr-sbin-are-in-PATH.diff
# PATCH-FEATURE-SLE util-linux-losetup-Add-support-for-setting-logical-blocksize.patch bsc931634 FATE319010 hare@suse.de -- Add support for setting logical blocksizes.
Patch1: util-linux-losetup-Add-support-for-setting-logical-blocksize.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-build BuildRoot: %{_tmppath}/%{name}-%{version}-build
# #
%if %build_util_linux %if %build_util_linux
@ -190,6 +196,13 @@ Obsoletes: uuid-runtime < %{version}-%{release}
Recommends: adjtimex Recommends: adjtimex
Recommends: time Recommends: time
Recommends: which Recommends: which
#
%if 0%{?suse_version} < 1330
# Using Conflicts as util-linux-losetup-Add-support-for-setting-logical-blocksize
# now uses bit 5 of lo_flags with meaning LO_FLAGS_BLOCKSIZE bsc#966891
#
Conflicts: kernel < 4.4
%endif
%else %else
%if %build_python_libmount %if %build_python_libmount
%else %else
@ -372,7 +385,6 @@ SMP systems.
%if %build_util_linux %if %build_util_linux
%package -n python-libmount %package -n python-libmount
Summary: %summary_pl Summary: %summary_pl
License: GPL-2.0+
Group: %group_pl Group: %group_pl
%description -n python-libmount %description -n python-libmount
@ -385,7 +397,11 @@ library.
%endif %endif
%prep %prep
%setup -q -n %{_name}-%{version} -b 40 %setup -q -n %{_name}-%{version} -b 40
%patch4 -p1 %patch0 -p1
%if 0%{?suse_version} < 1330
# logical block size support in loop does not exist in Tumbleweed and upstream kernel yet
%patch1 -p1
%endif
# #
# setctsid # setctsid
cp -p %{S:22} %{S:23} . cp -p %{S:22} %{S:23} .
@ -1116,6 +1132,8 @@ fi
%dir %{_datadir}/getopt %dir %{_datadir}/getopt
%attr (755,root,root) %{_datadir}/getopt/getopt-parse.bash %attr (755,root,root) %{_datadir}/getopt/getopt-parse.bash
%attr (755,root,root) %{_datadir}/getopt/getopt-parse.tcsh %attr (755,root,root) %{_datadir}/getopt/getopt-parse.tcsh
# These directories should be owned by bash-completion. But we don't want to
# install them on build, so own these two directories:
%dir %{_datadir}/bash-completion %dir %{_datadir}/bash-completion
%dir %{_datadir}/bash-completion/completions %dir %{_datadir}/bash-completion/completions
%{_datadir}/bash-completion/completions/* %{_datadir}/bash-completion/completions/*
@ -1252,6 +1270,15 @@ fi
/bin/logger /bin/logger
%{_bindir}/logger %{_bindir}/logger
%{_bindir}/lslogins %{_bindir}/lslogins
#BEGIN bootstrap_hack
%if 0%{?suse_version} < 1330
# Build images of some products use util-linux that does not come from this
# spec and does not own bash-completion dir. So we have to own own these two
# directories in util-linux-systemd as well:
%dir %{_datadir}/bash-completion
%dir %{_datadir}/bash-completion/completions
%endif
#END bootstrap_hack
%{_datadir}/bash-completion/completions/logger %{_datadir}/bash-completion/completions/logger
%{_datadir}/bash-completion/completions/lslogins %{_datadir}/bash-completion/completions/lslogins
%{_mandir}/man1/logger.1.gz %{_mandir}/man1/logger.1.gz

View File

@ -0,0 +1,140 @@
Index: util-linux-2.29/include/loopdev.h
===================================================================
--- util-linux-2.29.orig/include/loopdev.h
+++ util-linux-2.29/include/loopdev.h
@@ -41,6 +41,7 @@ enum {
LO_FLAGS_AUTOCLEAR = 4, /* kernel >= 2.6.25 */
LO_FLAGS_PARTSCAN = 8, /* kernel >= 3.2 */
LO_FLAGS_DIRECT_IO = 16, /* kernel >= 4.2 */
+ LO_FLAGS_BLOCKSIZE = 32, /* Tentative */
};
#define LO_NAME_SIZE 64
@@ -120,7 +121,8 @@ enum {
LOOPDEV_FL_NOIOCTL = (1 << 6),
LOOPDEV_FL_DEVSUBDIR = (1 << 7),
LOOPDEV_FL_CONTROL = (1 << 8), /* system with /dev/loop-control */
- LOOPDEV_FL_SIZELIMIT = (1 << 9)
+ LOOPDEV_FL_SIZELIMIT = (1 << 9),
+ LOOPDEV_FL_BLOCKSIZE = (1 << 10)
};
/*
@@ -173,6 +175,7 @@ int loopcxt_set_offset(struct loopdev_cx
int loopcxt_set_sizelimit(struct loopdev_cxt *lc, uint64_t sizelimit);
int loopcxt_set_flags(struct loopdev_cxt *lc, uint32_t flags);
int loopcxt_set_backing_file(struct loopdev_cxt *lc, const char *filename);
+int loopcxt_set_blocksize(struct loopdev_cxt *lc, uint64_t blocksize);
extern char *loopcxt_get_backing_file(struct loopdev_cxt *lc);
extern int loopcxt_get_backing_devno(struct loopdev_cxt *lc, dev_t *devno);
Index: util-linux-2.29/lib/loopdev.c
===================================================================
--- util-linux-2.29.orig/lib/loopdev.c
+++ util-linux-2.29/lib/loopdev.c
@@ -1115,6 +1115,26 @@ int loopcxt_set_backing_file(struct loop
}
/*
+ * @lc: context
+ * @blocksize: logical blocksize for the device
+ *
+ * The setting is removed by loopcxt_set_device() loopcxt_next()!
+ *
+ * Returns: 0 on success, <0 on error.
+ */
+int loopcxt_set_blocksize(struct loopdev_cxt *lc, uint64_t blocksize)
+{
+ if (!lc)
+ return -EINVAL;
+
+ lc->info.lo_init[0] = blocksize;
+ lc->info.lo_flags |= LO_FLAGS_BLOCKSIZE;
+
+ DBG(CXT, ul_debugobj(lc, "set blocksize=%llu", (long long unsigned int)lc->info.lo_init[0]));
+ return 0;
+}
+
+/*
* In kernels prior to v3.9, if the offset or sizelimit options
* are used, the block device's size won't be synced automatically.
* blockdev --getsize64 and filesystems will use the backing
Index: util-linux-2.29/sys-utils/losetup.c
===================================================================
--- util-linux-2.29.orig/sys-utils/losetup.c
+++ util-linux-2.29/sys-utils/losetup.c
@@ -398,6 +398,7 @@ static void usage(FILE *out)
fputs(_(" -o, --offset <num> start at offset <num> into file\n"), out);
fputs(_(" --sizelimit <num> device is limited to <num> bytes of the file\n"), out);
+ fputs(_(" -L, --logical-blocksize <size> set the logical block size to <size>\n"), out);
fputs(_(" -P, --partscan create a partitioned loop device\n"), out);
fputs(_(" -r, --read-only set up a read-only loop device\n"), out);
fputs(_(" --direct-io[=<on|off>] open backing file with O_DIRECT\n"), out);
@@ -447,7 +448,8 @@ static void warn_size(const char *filena
static int create_loop(struct loopdev_cxt *lc,
int nooverlap, int lo_flags, int flags,
- const char *file, uint64_t offset, uint64_t sizelimit)
+ const char *file, uint64_t offset, uint64_t sizelimit,
+ uint64_t blocksize)
{
int hasdev = loopcxt_has_device(lc);
int rc = 0;
@@ -533,6 +535,8 @@ static int create_loop(struct loopdev_cx
loopcxt_set_offset(lc, offset);
if (flags & LOOPDEV_FL_SIZELIMIT)
loopcxt_set_sizelimit(lc, sizelimit);
+ if (flags & LOOPDEV_FL_BLOCKSIZE)
+ loopcxt_set_blocksize(lc, blocksize);
if (lo_flags)
loopcxt_set_flags(lc, lo_flags);
if ((rc = loopcxt_set_backing_file(lc, file))) {
@@ -561,7 +565,7 @@ int main(int argc, char **argv)
struct loopdev_cxt lc;
int act = 0, flags = 0, no_overlap = 0, c;
char *file = NULL;
- uint64_t offset = 0, sizelimit = 0;
+ uint64_t offset = 0, sizelimit = 0, blocksize = 0;
int res = 0, showdev = 0, lo_flags = 0;
char *outarg = NULL;
int list = 0;
@@ -571,7 +575,8 @@ int main(int argc, char **argv)
OPT_SIZELIMIT = CHAR_MAX + 1,
OPT_SHOW,
OPT_RAW,
- OPT_DIO
+ OPT_DIO,
+ OPT_BLOCKSIZE
};
static const struct option longopts[] = {
{ "all", 0, 0, 'a' },
@@ -584,6 +589,7 @@ int main(int argc, char **argv)
{ "associated", 1, 0, 'j' },
{ "json", 0, 0, 'J' },
{ "list", 0, 0, 'l' },
+ { "logical-blocksize", 1, 0, 'L' },
{ "noheadings", 0, 0, 'n' },
{ "offset", 1, 0, 'o' },
{ "output", 1, 0, 'O' },
@@ -657,6 +663,10 @@ int main(int argc, char **argv)
act = A_SHOW;
file = optarg;
break;
+ case OPT_BLOCKSIZE:
+ blocksize = strtosize_or_err(optarg, _("failed to parse logical block size"));
+ flags |= LOOPDEV_FL_BLOCKSIZE;
+ break;
case 'l':
list = 1;
break;
@@ -789,7 +799,8 @@ int main(int argc, char **argv)
switch (act) {
case A_CREATE:
- res = create_loop(&lc, no_overlap, lo_flags, flags, file, offset, sizelimit);
+ res = create_loop(&lc, no_overlap, lo_flags, flags, file, offset,
+ sizelimit, blocksize);
if (res == 0) {
if (showdev)
printf("%s\n", loopcxt_get_device(&lc));

View File

@ -9,6 +9,24 @@ Fri Feb 10 10:40:23 UTC 2017 - fbui@suse.com
This also get rid of the only use of the rpm preset macros so we can This also get rid of the only use of the rpm preset macros so we can
kill them. kill them.
-------------------------------------------------------------------
Wed Feb 8 18:16:22 CET 2017 - sbrabec@suse.com
- Merge SLE12 SP3 changes to make the package compatible with
Tumbleweed, SLE12 SP3 and Leap 42.3.
- Drop patch tests-script-race-on-force-only.patch from SLE12 SP3
and Leap 42.3. Upstream has a different workaround.
https://github.com/karelzak/util-linux/issues/296
- INCOMPATIBLE CHANGE for SLE12 SP3 and Leap 42.3:
losetup -L changes its meaning from SLE12 SP1&SP2 specific
--logical-blocksize to the upstream --nooverlap).
--logical-blocksize can be used only with long option.
- Include SLE12 + Leap 42 exclusive feature, implemented by
hare@suse.de:
* losetup: Add support for setting logical blocksizes
(bsc#931634, FATE#319010)
+ util-linux-losetup-Add-support-for-setting-logical-blocksize.patch
------------------------------------------------------------------- -------------------------------------------------------------------
Tue Feb 7 20:07:55 CET 2017 - sbrabec@suse.com Tue Feb 7 20:07:55 CET 2017 - sbrabec@suse.com

View File

@ -16,7 +16,11 @@
# #
%if 0%{?suse_version} >= 1330
%bcond_without enable_last %bcond_without enable_last
%else
%bcond_with enable_last
%endif
Name: util-linux-systemd Name: util-linux-systemd
%define _name util-linux %define _name util-linux
@ -150,7 +154,9 @@ Source51: blkid.conf
## util-linux patches ## util-linux patches
## ##
# PATCH-EXTEND-UPSTREAM: Let `su' handle /sbin and /usr/sbin in path # PATCH-EXTEND-UPSTREAM: Let `su' handle /sbin and /usr/sbin in path
Patch4: make-sure-sbin-resp-usr-sbin-are-in-PATH.diff Patch0: make-sure-sbin-resp-usr-sbin-are-in-PATH.diff
# PATCH-FEATURE-SLE util-linux-losetup-Add-support-for-setting-logical-blocksize.patch bsc931634 FATE319010 hare@suse.de -- Add support for setting logical blocksizes.
Patch1: util-linux-losetup-Add-support-for-setting-logical-blocksize.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-build BuildRoot: %{_tmppath}/%{name}-%{version}-build
# #
%if %build_util_linux %if %build_util_linux
@ -190,6 +196,13 @@ Obsoletes: uuid-runtime < %{version}-%{release}
Recommends: adjtimex Recommends: adjtimex
Recommends: time Recommends: time
Recommends: which Recommends: which
#
%if 0%{?suse_version} < 1330
# Using Conflicts as util-linux-losetup-Add-support-for-setting-logical-blocksize
# now uses bit 5 of lo_flags with meaning LO_FLAGS_BLOCKSIZE bsc#966891
#
Conflicts: kernel < 4.4
%endif
%else %else
%if %build_python_libmount %if %build_python_libmount
%else %else
@ -384,7 +397,11 @@ library.
%endif %endif
%prep %prep
%setup -q -n %{_name}-%{version} -b 40 %setup -q -n %{_name}-%{version} -b 40
%patch4 -p1 %patch0 -p1
%if 0%{?suse_version} < 1330
# logical block size support in loop does not exist in Tumbleweed and upstream kernel yet
%patch1 -p1
%endif
# #
# setctsid # setctsid
cp -p %{S:22} %{S:23} . cp -p %{S:22} %{S:23} .
@ -1115,6 +1132,8 @@ fi
%dir %{_datadir}/getopt %dir %{_datadir}/getopt
%attr (755,root,root) %{_datadir}/getopt/getopt-parse.bash %attr (755,root,root) %{_datadir}/getopt/getopt-parse.bash
%attr (755,root,root) %{_datadir}/getopt/getopt-parse.tcsh %attr (755,root,root) %{_datadir}/getopt/getopt-parse.tcsh
# These directories should be owned by bash-completion. But we don't want to
# install them on build, so own these two directories:
%dir %{_datadir}/bash-completion %dir %{_datadir}/bash-completion
%dir %{_datadir}/bash-completion/completions %dir %{_datadir}/bash-completion/completions
%{_datadir}/bash-completion/completions/* %{_datadir}/bash-completion/completions/*
@ -1251,6 +1270,15 @@ fi
/bin/logger /bin/logger
%{_bindir}/logger %{_bindir}/logger
%{_bindir}/lslogins %{_bindir}/lslogins
#BEGIN bootstrap_hack
%if 0%{?suse_version} < 1330
# Build images of some products use util-linux that does not come from this
# spec and does not own bash-completion dir. So we have to own own these two
# directories in util-linux-systemd as well:
%dir %{_datadir}/bash-completion
%dir %{_datadir}/bash-completion/completions
%endif
#END bootstrap_hack
%{_datadir}/bash-completion/completions/logger %{_datadir}/bash-completion/completions/logger
%{_datadir}/bash-completion/completions/lslogins %{_datadir}/bash-completion/completions/lslogins
%{_mandir}/man1/logger.1.gz %{_mandir}/man1/logger.1.gz

View File

@ -9,6 +9,24 @@ Fri Feb 10 10:40:23 UTC 2017 - fbui@suse.com
This also get rid of the only use of the rpm preset macros so we can This also get rid of the only use of the rpm preset macros so we can
kill them. kill them.
-------------------------------------------------------------------
Wed Feb 8 18:16:22 CET 2017 - sbrabec@suse.com
- Merge SLE12 SP3 changes to make the package compatible with
Tumbleweed, SLE12 SP3 and Leap 42.3.
- Drop patch tests-script-race-on-force-only.patch from SLE12 SP3
and Leap 42.3. Upstream has a different workaround.
https://github.com/karelzak/util-linux/issues/296
- INCOMPATIBLE CHANGE for SLE12 SP3 and Leap 42.3:
losetup -L changes its meaning from SLE12 SP1&SP2 specific
--logical-blocksize to the upstream --nooverlap).
--logical-blocksize can be used only with long option.
- Include SLE12 + Leap 42 exclusive feature, implemented by
hare@suse.de:
* losetup: Add support for setting logical blocksizes
(bsc#931634, FATE#319010)
+ util-linux-losetup-Add-support-for-setting-logical-blocksize.patch
------------------------------------------------------------------- -------------------------------------------------------------------
Tue Feb 7 20:07:55 CET 2017 - sbrabec@suse.com Tue Feb 7 20:07:55 CET 2017 - sbrabec@suse.com

View File

@ -16,7 +16,11 @@
# #
%if 0%{?suse_version} >= 1330
%bcond_without enable_last %bcond_without enable_last
%else
%bcond_with enable_last
%endif
Name: util-linux Name: util-linux
%define _name util-linux %define _name util-linux
@ -150,7 +154,9 @@ Source51: blkid.conf
## util-linux patches ## util-linux patches
## ##
# PATCH-EXTEND-UPSTREAM: Let `su' handle /sbin and /usr/sbin in path # PATCH-EXTEND-UPSTREAM: Let `su' handle /sbin and /usr/sbin in path
Patch4: make-sure-sbin-resp-usr-sbin-are-in-PATH.diff Patch0: make-sure-sbin-resp-usr-sbin-are-in-PATH.diff
# PATCH-FEATURE-SLE util-linux-losetup-Add-support-for-setting-logical-blocksize.patch bsc931634 FATE319010 hare@suse.de -- Add support for setting logical blocksizes.
Patch1: util-linux-losetup-Add-support-for-setting-logical-blocksize.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-build BuildRoot: %{_tmppath}/%{name}-%{version}-build
# #
%if %build_util_linux %if %build_util_linux
@ -190,6 +196,13 @@ Obsoletes: uuid-runtime < %{version}-%{release}
Recommends: adjtimex Recommends: adjtimex
Recommends: time Recommends: time
Recommends: which Recommends: which
#
%if 0%{?suse_version} < 1330
# Using Conflicts as util-linux-losetup-Add-support-for-setting-logical-blocksize
# now uses bit 5 of lo_flags with meaning LO_FLAGS_BLOCKSIZE bsc#966891
#
Conflicts: kernel < 4.4
%endif
%else %else
%if %build_python_libmount %if %build_python_libmount
%else %else
@ -384,7 +397,11 @@ library.
%endif %endif
%prep %prep
%setup -q -n %{_name}-%{version} -b 40 %setup -q -n %{_name}-%{version} -b 40
%patch4 -p1 %patch0 -p1
%if 0%{?suse_version} < 1330
# logical block size support in loop does not exist in Tumbleweed and upstream kernel yet
%patch1 -p1
%endif
# #
# setctsid # setctsid
cp -p %{S:22} %{S:23} . cp -p %{S:22} %{S:23} .
@ -1115,6 +1132,8 @@ fi
%dir %{_datadir}/getopt %dir %{_datadir}/getopt
%attr (755,root,root) %{_datadir}/getopt/getopt-parse.bash %attr (755,root,root) %{_datadir}/getopt/getopt-parse.bash
%attr (755,root,root) %{_datadir}/getopt/getopt-parse.tcsh %attr (755,root,root) %{_datadir}/getopt/getopt-parse.tcsh
# These directories should be owned by bash-completion. But we don't want to
# install them on build, so own these two directories:
%dir %{_datadir}/bash-completion %dir %{_datadir}/bash-completion
%dir %{_datadir}/bash-completion/completions %dir %{_datadir}/bash-completion/completions
%{_datadir}/bash-completion/completions/* %{_datadir}/bash-completion/completions/*
@ -1251,6 +1270,15 @@ fi
/bin/logger /bin/logger
%{_bindir}/logger %{_bindir}/logger
%{_bindir}/lslogins %{_bindir}/lslogins
#BEGIN bootstrap_hack
%if 0%{?suse_version} < 1330
# Build images of some products use util-linux that does not come from this
# spec and does not own bash-completion dir. So we have to own own these two
# directories in util-linux-systemd as well:
%dir %{_datadir}/bash-completion
%dir %{_datadir}/bash-completion/completions
%endif
#END bootstrap_hack
%{_datadir}/bash-completion/completions/logger %{_datadir}/bash-completion/completions/logger
%{_datadir}/bash-completion/completions/lslogins %{_datadir}/bash-completion/completions/lslogins
%{_mandir}/man1/logger.1.gz %{_mandir}/man1/logger.1.gz