forked from pool/util-linux
Accepting request 558203 from Base:System
Depends on rq#558192. - Update bash completion conflict to cover rfkill file conflict. - lsmem: Add support for zone awareness (bsc#1065471, FATE#324252). - Drop util-linux-losetup-Add-support-for-setting-logical-blocksize.patch. - Update to version 2.31. OBS-URL: https://build.opensuse.org/request/show/558203 OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/util-linux?expand=0&rev=223
This commit is contained in:
commit
8e87390c01
@ -1,7 +1,9 @@
|
|||||||
--- a/login-utils/su-common.c
|
Index: util-linux-2.31/login-utils/su-common.c
|
||||||
+++ b/login-utils/su-common.c
|
===================================================================
|
||||||
@@ -523,6 +523,117 @@ set_path(const struct passwd* pw)
|
--- util-linux-2.31.orig/login-utils/su-common.c
|
||||||
err (EXIT_FAILURE, _("failed to set the %s environment variable"), "PATH");
|
+++ util-linux-2.31/login-utils/su-common.c
|
||||||
|
@@ -944,6 +944,117 @@ static void setenv_path(const struct pas
|
||||||
|
err(EXIT_FAILURE, _("failed to set the PATH environment variable"));
|
||||||
}
|
}
|
||||||
|
|
||||||
+/* Add or clear /sbin and /usr/sbin for the su command
|
+/* Add or clear /sbin and /usr/sbin for the su command
|
||||||
@ -115,29 +117,29 @@
|
|||||||
+ return ret;
|
+ return ret;
|
||||||
+}
|
+}
|
||||||
+
|
+
|
||||||
/* Update `environ' for the new shell based on PW, with SHELL being
|
static void modify_environment(struct su_context *su, const char *shell)
|
||||||
the value for the SHELL environment variable. */
|
{
|
||||||
|
const struct passwd *pw = su->pwd;
|
||||||
|
@@ -982,6 +1093,22 @@ static void modify_environment(struct su
|
||||||
|
|
||||||
@@ -560,6 +671,22 @@ modify_environment (const struct passwd *pw, const char *shell)
|
if (getlogindefs_bool("ALWAYS_SET_PATH", 0))
|
||||||
xsetenv ("SHELL", shell, 1);
|
setenv_path(pw);
|
||||||
if (getlogindefs_bool ("ALWAYS_SET_PATH", 0))
|
+ else
|
||||||
set_path(pw);
|
|
||||||
+ else
|
|
||||||
+ {
|
|
||||||
+ char const *path = getenv ("PATH");
|
|
||||||
+ char *new = NULL;
|
|
||||||
+
|
|
||||||
+ if (pw->pw_uid)
|
|
||||||
+ new = clearsbin (path);
|
|
||||||
+ else
|
|
||||||
+ new = addsbin (path);
|
|
||||||
+
|
|
||||||
+ if (new)
|
|
||||||
+ {
|
+ {
|
||||||
+ xsetenv ("PATH", new, 1);
|
+ char const *path = getenv ("PATH");
|
||||||
+ free (new);
|
+ char *new = NULL;
|
||||||
|
+
|
||||||
|
+ if (pw->pw_uid)
|
||||||
|
+ new = clearsbin (path);
|
||||||
|
+ else
|
||||||
|
+ new = addsbin (path);
|
||||||
|
+
|
||||||
|
+ if (new)
|
||||||
|
+ {
|
||||||
|
+ xsetenv ("PATH", new, 1);
|
||||||
|
+ free (new);
|
||||||
|
+ }
|
||||||
+ }
|
+ }
|
||||||
+ }
|
|
||||||
|
|
||||||
if (pw->pw_uid)
|
if (pw->pw_uid) {
|
||||||
{
|
xsetenv("USER", pw->pw_name, 1);
|
||||||
|
@ -1,3 +1,53 @@
|
|||||||
|
-------------------------------------------------------------------
|
||||||
|
Mon Dec 18 15:30:56 CET 2017 - sbrabec@suse.com
|
||||||
|
|
||||||
|
- Update bash completion conflict to cover rfkill file conflict.
|
||||||
|
|
||||||
|
-------------------------------------------------------------------
|
||||||
|
Mon Dec 4 17:28:04 CET 2017 - sbrabec@suse.com
|
||||||
|
|
||||||
|
- lsmem: Add support for zone awareness (bsc#1065471, FATE#324252,
|
||||||
|
util-linux-lsmem-memory-zone-1.patch,
|
||||||
|
util-linux-lsmem-memory-zone-2.patch,
|
||||||
|
util-linux-lsmem-memory-zone-3.patch).
|
||||||
|
- Drop util-linux-losetup-Add-support-for-setting-logical-blocksize.patch.
|
||||||
|
Different implementations exists in the new kernel, and it has
|
||||||
|
a conflicting implementation in util-linux.
|
||||||
|
|
||||||
|
-------------------------------------------------------------------
|
||||||
|
Mon Nov 20 17:29:11 CET 2017 - sbrabec@suse.com
|
||||||
|
|
||||||
|
- Update to version 2.31:
|
||||||
|
* New utilities: uuidparse, rfkill.
|
||||||
|
* su has been refactored and extended to create pseudo terminal
|
||||||
|
(new option --pty, CVE-2016-2779, bsc#968674). This new
|
||||||
|
EXPERIMENTAL feature provides better isolation between root's
|
||||||
|
terminal and an unprivileged su.
|
||||||
|
* libuuid: Improved to match
|
||||||
|
* libuuid, uuidgen: support hash-based UUIDs v3 (md5) and v5
|
||||||
|
(sha1) as specified by RFC-4122. Provide UUID templates for
|
||||||
|
dns, url, oid, or x500.
|
||||||
|
* libblkid: Extended support for DM-integrity, HPE (aka
|
||||||
|
extended-XFS) and UBI superblock. New API to hide already
|
||||||
|
detected signatures.
|
||||||
|
* libfdisk: New API to modify grain, make possible to completely
|
||||||
|
disable dialog driven partitioning.
|
||||||
|
* libsmartcols: New API to move columns.
|
||||||
|
* column: --table-header-repeat to repeat table headers.
|
||||||
|
* libfdisk: Use BLKPG ioctls to inform the kernel about changes.
|
||||||
|
* fdisk: Improved ^C and ^D behavior.
|
||||||
|
* cfdisk: Dialog to resize partition.
|
||||||
|
* look: Follow the WORDLIST environment variable.
|
||||||
|
* losetup: Added support for --sector-size (FATE#319010).
|
||||||
|
* script: Follow the usual semantics for stop/continue signals.
|
||||||
|
* setpriv: New command line options --ambient-caps and
|
||||||
|
--init-groups.
|
||||||
|
* hwclock: Reduce system shutdown times, log --systz when using
|
||||||
|
libaudit.
|
||||||
|
* Other bug fixes.
|
||||||
|
- Drop upstreamed util-linux-use-tinfow.patch.
|
||||||
|
- Refreshed make-sure-sbin-resp-usr-sbin-are-in-PATH.diff.
|
||||||
|
|
||||||
-------------------------------------------------------------------
|
-------------------------------------------------------------------
|
||||||
Thu Sep 21 14:41:01 UTC 2017 - jengelh@inai.de
|
Thu Sep 21 14:41:01 UTC 2017 - jengelh@inai.de
|
||||||
|
|
||||||
|
@ -116,7 +116,7 @@ BuildRequires: libmount-devel
|
|||||||
%endif
|
%endif
|
||||||
%endif
|
%endif
|
||||||
#END SECOND STAGE DEPENDENCIES
|
#END SECOND STAGE DEPENDENCIES
|
||||||
Version: 2.30.1
|
Version: 2.31
|
||||||
Release: 0
|
Release: 0
|
||||||
# util-linux is a base package and uuidd pre-requiring pwdutils pulls
|
# util-linux is a base package and uuidd pre-requiring pwdutils pulls
|
||||||
# that into the core build cycle. pwdutils also pulls in the whole
|
# that into the core build cycle. pwdutils also pulls in the whole
|
||||||
@ -125,7 +125,7 @@ Release: 0
|
|||||||
# these tools as well
|
# these tools as well
|
||||||
#!BuildIgnore: pwdutils
|
#!BuildIgnore: pwdutils
|
||||||
Url: https://www.kernel.org/pub/linux/utils/util-linux/
|
Url: https://www.kernel.org/pub/linux/utils/util-linux/
|
||||||
Source: https://www.kernel.org/pub/linux/utils/util-linux/v2.30/util-linux-%{version}.tar.xz
|
Source: https://www.kernel.org/pub/linux/utils/util-linux/v%{version}/util-linux-%{version}.tar.xz
|
||||||
Source1: util-linux-rpmlintrc
|
Source1: util-linux-rpmlintrc
|
||||||
Source4: raw.service
|
Source4: raw.service
|
||||||
Source5: etc.raw
|
Source5: etc.raw
|
||||||
@ -135,7 +135,7 @@ Source8: login.pamd
|
|||||||
Source9: remote.pamd
|
Source9: remote.pamd
|
||||||
Source10: su.pamd
|
Source10: su.pamd
|
||||||
Source11: su.default
|
Source11: su.default
|
||||||
Source12: https://www.kernel.org/pub/linux/utils/util-linux/v2.30/util-linux-%{version}.tar.sign
|
Source12: https://www.kernel.org/pub/linux/utils/util-linux/v%{version}/util-linux-%{version}.tar.sign
|
||||||
Source13: %{_name}.keyring
|
Source13: %{_name}.keyring
|
||||||
Source14: runuser.pamd
|
Source14: runuser.pamd
|
||||||
# klogconsole, http://opensuse.github.com/kiwi, 7.02.25, git 859dc050
|
# klogconsole, http://opensuse.github.com/kiwi, 7.02.25, git 859dc050
|
||||||
@ -155,10 +155,12 @@ Source51: blkid.conf
|
|||||||
##
|
##
|
||||||
# PATCH-EXTEND-UPSTREAM: Let `su' handle /sbin and /usr/sbin in path
|
# PATCH-EXTEND-UPSTREAM: Let `su' handle /sbin and /usr/sbin in path
|
||||||
Patch0: 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.
|
# PATCH-FEATURE-UPSTREAM util-linux-lsmem-memory-zone-1.patch bsc1065471 FATE324252 sbrabec@suse.com -- lsmem: Add support for zone awareness.
|
||||||
Patch1: util-linux-losetup-Add-support-for-setting-logical-blocksize.patch
|
Patch1: util-linux-lsmem-memory-zone-1.patch
|
||||||
# PATCH-FIX-UPSTREAM util-linux-use-tinfow.patch bsc#1056171 sbrabec@suse.com -- Link against tinfow instead of tinfo.
|
# PATCH-FEATURE-UPSTREAM util-linux-lsmem-memory-zone-2.patch bsc1065471 FATE324252 sbrabec@suse.com -- lsmem: Add support for zone awareness.
|
||||||
Patch2: util-linux-use-tinfow.patch
|
Patch2: util-linux-lsmem-memory-zone-2.patch
|
||||||
|
# PATCH-FEATURE-UPSTREAM util-linux-lsmem-memory-zone-3.patch bsc1065471 FATE324252 sbrabec@suse.com -- lsmem: Add support for zone awareness.
|
||||||
|
Patch3: util-linux-lsmem-memory-zone-3.patch
|
||||||
BuildRoot: %{_tmppath}/%{name}-%{version}-build
|
BuildRoot: %{_tmppath}/%{name}-%{version}-build
|
||||||
#
|
#
|
||||||
%if %build_util_linux
|
%if %build_util_linux
|
||||||
@ -173,10 +175,13 @@ PreReq: %install_info_prereq permissions
|
|||||||
Recommends: %{name}-lang = %{version}
|
Recommends: %{name}-lang = %{version}
|
||||||
Provides: eject = 2.1.0-166.8
|
Provides: eject = 2.1.0-166.8
|
||||||
Provides: login = 4.0-33.7
|
Provides: login = 4.0-33.7
|
||||||
|
Provides: rfkill = 0.5-8.6
|
||||||
# File conflict of eject (up to 12.3 and SLE11).
|
# File conflict of eject (up to 12.3 and SLE11).
|
||||||
Obsoletes: eject < 2.1.0-166.8
|
Obsoletes: eject < 2.1.0-166.8
|
||||||
# File conflict of login (up to 12.1 and SLE11).
|
# File conflict of login (up to 12.1 and SLE11).
|
||||||
Obsoletes: login < 4.0-33.7
|
Obsoletes: login < 4.0-33.7
|
||||||
|
# File confluct (man page) of rfkill (up to Leap 15 and SLE 15).
|
||||||
|
Obsoletes: rfkill < 0.5-8.6
|
||||||
# File conflict of su and kill (up to 12.3 and SLE11).
|
# File conflict of su and kill (up to 12.3 and SLE11).
|
||||||
# It should be coreutils < 8.21-4, but coreutils provide Release-less symbol.
|
# It should be coreutils < 8.21-4, but coreutils provide Release-less symbol.
|
||||||
Conflicts: coreutils < 8.21
|
Conflicts: coreutils < 8.21
|
||||||
@ -184,8 +189,8 @@ Conflicts: coreutils < 8.21
|
|||||||
# File conflict of sulogin and utmpdump (up to 12.3 and SLE11).
|
# File conflict of sulogin and utmpdump (up to 12.3 and SLE11).
|
||||||
Conflicts: sysvinit-tools < 2.88+-87
|
Conflicts: sysvinit-tools < 2.88+-87
|
||||||
%endif
|
%endif
|
||||||
# File conflicts of completion files with <= Leap 42.1 and <= SLE12 SP1 (fixed by SLE12 Update, boo#977259#c3).
|
# rfkill conflicts of completion files with <= Leap 42.3 and < SLE15.
|
||||||
Conflicts: bash-completion <= 2.1-10
|
Conflicts: bash-completion <= 2.7-1.3
|
||||||
# The preset is provided by the presets branding package since 0.4 (bsc#1012850) and since 12.2 in SLE (boo#1029775)
|
# The preset is provided by the presets branding package since 0.4 (bsc#1012850) and since 12.2 in SLE (boo#1029775)
|
||||||
Conflicts: systemd-presets-branding < 12.2
|
Conflicts: systemd-presets-branding < 12.2
|
||||||
# bnc#805684:
|
# bnc#805684:
|
||||||
@ -213,12 +218,6 @@ 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
|
||||||
@ -418,11 +417,9 @@ library.
|
|||||||
%prep
|
%prep
|
||||||
%setup -q -n %{_name}-%{version} -b 40
|
%setup -q -n %{_name}-%{version} -b 40
|
||||||
%patch0 -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
|
%patch1 -p1
|
||||||
%endif
|
|
||||||
%patch2 -p1
|
%patch2 -p1
|
||||||
|
%patch3 -p1
|
||||||
#
|
#
|
||||||
# setctsid
|
# setctsid
|
||||||
cp -p %{S:22} %{S:23} .
|
cp -p %{S:22} %{S:23} .
|
||||||
@ -557,6 +554,8 @@ AUTOPOINT=true autoreconf -vfi
|
|||||||
--disable-silent-rules \
|
--disable-silent-rules \
|
||||||
--localstatedir=/run \
|
--localstatedir=/run \
|
||||||
--docdir=%{_docdir}/%{_name} \
|
--docdir=%{_docdir}/%{_name} \
|
||||||
|
--disable-makeinstall-chown \
|
||||||
|
--disable-makeinstall-setuid \
|
||||||
--with-audit \
|
--with-audit \
|
||||||
--with-btrfs \
|
--with-btrfs \
|
||||||
--with-gnu-ld \
|
--with-gnu-ld \
|
||||||
@ -993,6 +992,7 @@ getent passwd uuidd >/dev/null || \
|
|||||||
%{_bindir}/rename
|
%{_bindir}/rename
|
||||||
%{_bindir}/renice
|
%{_bindir}/renice
|
||||||
%{_bindir}/rev
|
%{_bindir}/rev
|
||||||
|
%{_bindir}/rfkill
|
||||||
%{_bindir}/script
|
%{_bindir}/script
|
||||||
%{_bindir}/scriptreplay
|
%{_bindir}/scriptreplay
|
||||||
%{_bindir}/setarch
|
%{_bindir}/setarch
|
||||||
@ -1005,6 +1005,7 @@ getent passwd uuidd >/dev/null || \
|
|||||||
%{_bindir}/mountpoint
|
%{_bindir}/mountpoint
|
||||||
%{_bindir}/utmpdump
|
%{_bindir}/utmpdump
|
||||||
%{_bindir}/uuidgen
|
%{_bindir}/uuidgen
|
||||||
|
%{_bindir}/uuidparse
|
||||||
%{_bindir}/uname26
|
%{_bindir}/uname26
|
||||||
%ifnarch ppc ppc64
|
%ifnarch ppc ppc64
|
||||||
%{_bindir}/chrp-addnote
|
%{_bindir}/chrp-addnote
|
||||||
@ -1108,6 +1109,7 @@ getent passwd uuidd >/dev/null || \
|
|||||||
%{_mandir}/man1/utmpdump.1.gz
|
%{_mandir}/man1/utmpdump.1.gz
|
||||||
%{_mandir}/man1/runuser.1.gz
|
%{_mandir}/man1/runuser.1.gz
|
||||||
%{_mandir}/man1/uuidgen.1.gz
|
%{_mandir}/man1/uuidgen.1.gz
|
||||||
|
%{_mandir}/man1/uuidparse.1.gz
|
||||||
%{_mandir}/man5/fstab.5.gz
|
%{_mandir}/man5/fstab.5.gz
|
||||||
%{_mandir}/man5/terminal-colors.d.5.gz
|
%{_mandir}/man5/terminal-colors.d.5.gz
|
||||||
%{_mandir}/man8/addpart.8.gz
|
%{_mandir}/man8/addpart.8.gz
|
||||||
@ -1142,6 +1144,7 @@ getent passwd uuidd >/dev/null || \
|
|||||||
%{_mandir}/man8/fsfreeze.8.gz
|
%{_mandir}/man8/fsfreeze.8.gz
|
||||||
%{_mandir}/man8/swaplabel.8.gz
|
%{_mandir}/man8/swaplabel.8.gz
|
||||||
%{_mandir}/man8/readprofile.8.gz
|
%{_mandir}/man8/readprofile.8.gz
|
||||||
|
%{_mandir}/man8/rfkill.8.gz
|
||||||
%{_mandir}/man8/chcpu.8.gz
|
%{_mandir}/man8/chcpu.8.gz
|
||||||
%ifnarch ppc ppc64
|
%ifnarch ppc ppc64
|
||||||
%{_mandir}/man8/mkzimage_cmdline.8.gz
|
%{_mandir}/man8/mkzimage_cmdline.8.gz
|
||||||
|
@ -1,17 +0,0 @@
|
|||||||
-----BEGIN PGP SIGNATURE-----
|
|
||||||
Version: GnuPG v2
|
|
||||||
|
|
||||||
iQIcBAABCAAGBQJZcHfsAAoJEOS3HV7sOcKEl7wP/jnzss0+A1BW5EVZywk69lDa
|
|
||||||
534rzlHJVyvysOXKD+zDk+Ky4Q8BYPizGQ4hYg/fhHvxgPVb8jrynwcNzdGEPjHV
|
|
||||||
OCQ1fikRgun2i77KoU2vZJ6vvo66mFRytKaoRAJRHhkkQQkcGlNPCcN0V+ZlBfn+
|
|
||||||
RWL50P0knqw/LK9NfKhASoI315p7nUypmqf+g3jxFNLjXXnHefUDLlZNn85oJLgf
|
|
||||||
Vsx/1IYk3MTOgDjAx5K24H31XNWOKaO/pvPezd1RPt6gc4EcKc2I/8AY+5yM5XAF
|
|
||||||
sCk6wCIjvf3+2B8K6XgUIBhABxgDnyQi8+lNqDUfR4NbufonzBZDpQLHfjN7XWgg
|
|
||||||
Zgfo7as21fM1vCuEuwOQbkbDFA4wso5kRgof+HfTDnLU3hDtbNiI/5ZH0cTf2qp9
|
|
||||||
8CwnSpxdES3Hw/eFkOaVMlwE4CoGJqZejMnOzNWo+b5lVqfmeSUgUxyvW3IDSUfm
|
|
||||||
+Zu9+MVL+T9YDkVuqB+rCeWSBxShev0+cRHP6p5NkWkGRgbCHkecZ7zZ9aFZ9Dsm
|
|
||||||
OE6nOot05oS8mUjpXyUs96VwbRqqBR54Tc3+DjBUjrpzlwajhz++g+XjAiwON5NT
|
|
||||||
ex30EbDFW/VRm3cWo4YH1MdesVcWqrqsrDRN0RyqZ/ctqOMgkQG6vNaQ6f3O2wgc
|
|
||||||
qFbsvhGu7NctRjuOj9UP
|
|
||||||
=cMtf
|
|
||||||
-----END PGP SIGNATURE-----
|
|
@ -1,3 +0,0 @@
|
|||||||
version https://git-lfs.github.com/spec/v1
|
|
||||||
oid sha256:1be4363a91ac428c9e43fc04dc6d2c66a19ec1e36f1105bd4b481540be13b841
|
|
||||||
size 4459284
|
|
16
util-linux-2.31.tar.sign
Normal file
16
util-linux-2.31.tar.sign
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
-----BEGIN PGP SIGNATURE-----
|
||||||
|
|
||||||
|
iQIzBAABCAAdFiEEsMZNFDAcxu+u32Dk5LcdXuw5woQFAlnoipIACgkQ5LcdXuw5
|
||||||
|
woSnthAAhqdxus2J9uxERU1JwMJxiDpjwZnRR3NFHvBlY04maoaniAsVlQG8uWWr
|
||||||
|
xE13jVkiG2hc+llt4UhDJA3sT0Hz1elNOKJD6fsZ598fptTYvF3fqLjstuJGCVyF
|
||||||
|
hDio8lqAqurnpX3jtyG0tNrT3CVIUU2jrTq9QXqpB8jq699ez8xulMdU+VEqmbOg
|
||||||
|
E5i5skWxfnaYxleXN8WkV+5WZx2tczWufLqVbLcUE7bOUyiEAubmXhbm9xgOJ8pX
|
||||||
|
cUrOverbfvopZYlIUB44UcNYyWsj12r7/aIQBh2q6xmv5wOOAiZzFMBh4eZu07vc
|
||||||
|
jZFKv2GYxVBU+e/1ERH0x4xbxCRXV9l1G9+V/H9GSbGCHK0+/0r7MzXf+QiADowx
|
||||||
|
YkqROTvfTagNVPBbzU0pNeTsQs+AZg49JhTcCBVtk1yxufOK3BuRqU5PtuDBQCw4
|
||||||
|
u8Z/kkZSdaOexJeaBJDhHEvPTCkAUBcuppU9tJ8dZ+3Orpdb8ghbBOxS3VUKIHn5
|
||||||
|
FAnaC7OLPPB2uBTKrG5JH+mUnXCTYfctEPB3D/Rnjsyjs+T8h6zf5cnQ6NFvXPxw
|
||||||
|
xm8FA3bcKvdSVcLwqFQLkvORfy1/Ju53HRDABSDLe4yjTUi8oAj4hqbR607/XPMA
|
||||||
|
ZYBRRZntdKNLcrQUjnawjaExXcR2oACocaZ8Ul+mpaXsmjKIEc8=
|
||||||
|
=u6TW
|
||||||
|
-----END PGP SIGNATURE-----
|
3
util-linux-2.31.tar.xz
Normal file
3
util-linux-2.31.tar.xz
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
version https://git-lfs.github.com/spec/v1
|
||||||
|
oid sha256:f9be7cdcf4fc5c5064a226599acdda6bdf3d86c640152ba01ea642d91108dc8a
|
||||||
|
size 4503892
|
@ -1,156 +0,0 @@
|
|||||||
From a60cc5c2eeaad7ea5ea0c4a74cc4af5e2dc3f6c2 Mon Sep 17 00:00:00 2001
|
|
||||||
From: Ruediger Meier <ruediger.meier@ga-group.nl>
|
|
||||||
Date: Tue, 4 Apr 2017 16:29:58 +0200
|
|
||||||
Subject: [PATCH]
|
|
||||||
util-linux-losetup-Add-support-for-setting-logical-blocksize.patch
|
|
||||||
|
|
||||||
Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
|
|
||||||
---
|
|
||||||
include/loopdev.h | 5 ++++-
|
|
||||||
lib/loopdev.c | 20 ++++++++++++++++++++
|
|
||||||
sys-utils/losetup.c | 19 +++++++++++++++----
|
|
||||||
3 files changed, 39 insertions(+), 5 deletions(-)
|
|
||||||
|
|
||||||
diff --git a/include/loopdev.h b/include/loopdev.h
|
|
||||||
index 953d2db..7c783bf 100644
|
|
||||||
--- a/include/loopdev.h
|
|
||||||
+++ b/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_cxt *lc, uint64_t offset);
|
|
||||||
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);
|
|
||||||
diff --git a/lib/loopdev.c b/lib/loopdev.c
|
|
||||||
index fd4f166..b85e2ce 100644
|
|
||||||
--- a/lib/loopdev.c
|
|
||||||
+++ b/lib/loopdev.c
|
|
||||||
@@ -1115,6 +1115,26 @@ int loopcxt_set_backing_file(struct loopdev_cxt *lc, const char *filename)
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
+ * @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
|
|
||||||
diff --git a/sys-utils/losetup.c b/sys-utils/losetup.c
|
|
||||||
index 2218d3b..d8f1bfa 100644
|
|
||||||
--- a/sys-utils/losetup.c
|
|
||||||
+++ b/sys-utils/losetup.c
|
|
||||||
@@ -399,6 +399,7 @@ static void usage(FILE *out)
|
|
||||||
fputs(USAGE_SEPARATOR, 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(_(" --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);
|
|
||||||
@@ -448,7 +449,8 @@ static void warn_size(const char *filename, uint64_t size)
|
|
||||||
|
|
||||||
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;
|
|
||||||
@@ -534,6 +536,8 @@ static int create_loop(struct loopdev_cxt *lc,
|
|
||||||
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))) {
|
|
||||||
@@ -562,7 +566,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;
|
|
||||||
@@ -572,7 +576,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", no_argument, NULL, 'a' },
|
|
||||||
@@ -585,6 +590,7 @@ int main(int argc, char **argv)
|
|
||||||
{ "associated", required_argument, NULL, 'j' },
|
|
||||||
{ "json", no_argument, NULL, 'J' },
|
|
||||||
{ "list", no_argument, NULL, 'l' },
|
|
||||||
+ { "logical-blocksize", required_argument, NULL, OPT_BLOCKSIZE },
|
|
||||||
{ "noheadings", no_argument, NULL, 'n' },
|
|
||||||
{ "offset", required_argument, NULL, 'o' },
|
|
||||||
{ "output", required_argument, NULL, 'O' },
|
|
||||||
@@ -658,6 +664,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;
|
|
||||||
@@ -790,7 +800,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));
|
|
||||||
--
|
|
||||||
1.8.5.6
|
|
||||||
|
|
536
util-linux-lsmem-memory-zone-1.patch
Normal file
536
util-linux-lsmem-memory-zone-1.patch
Normal file
@ -0,0 +1,536 @@
|
|||||||
|
From 60a7e9e94e49215b1e6ac6e33b69c3bd0a426b5e Mon Sep 17 00:00:00 2001
|
||||||
|
From: Gerald Schaefer <gerald.schaefer@de.ibm.com>
|
||||||
|
Date: Wed, 27 Sep 2017 19:44:44 +0200
|
||||||
|
Subject: [PATCH 1/3] lsmem/chmem: add memory zone awareness
|
||||||
|
|
||||||
|
With this patch, valid memory zones can be shown with lsmem, and chmem can
|
||||||
|
set memory online/offline in a specific memory zone, if allowed by the
|
||||||
|
kernel. The valid memory zones are read from the "valid_zones" sysfs
|
||||||
|
attribute, and setting memory online to a specific zone is done by
|
||||||
|
echoing "online_kernel" or "online_movable" to the "state" sysfs
|
||||||
|
attribute, in addition to the previous "online".
|
||||||
|
|
||||||
|
This patch also changes the default behavior of chmem, when setting memory
|
||||||
|
online without specifying a memory zone. If valid, memory will be set
|
||||||
|
online to the zone Movable. This zone is preferable for memory hotplug, as
|
||||||
|
it makes memory offline much more likely to succeed.
|
||||||
|
|
||||||
|
Signed-off-by: Gerald Schaefer <gerald.schaefer@de.ibm.com>
|
||||||
|
---
|
||||||
|
sys-utils/chmem.8 | 19 ++++++++
|
||||||
|
sys-utils/chmem.c | 136 ++++++++++++++++++++++++++++++++++++++++++++++++++----
|
||||||
|
sys-utils/lsmem.1 | 4 +-
|
||||||
|
sys-utils/lsmem.c | 98 ++++++++++++++++++++++++++++++++++++++-
|
||||||
|
4 files changed, 246 insertions(+), 11 deletions(-)
|
||||||
|
|
||||||
|
diff --git a/sys-utils/chmem.8 b/sys-utils/chmem.8
|
||||||
|
index a116bc9e7..dae7413d4 100644
|
||||||
|
--- a/sys-utils/chmem.8
|
||||||
|
+++ b/sys-utils/chmem.8
|
||||||
|
@@ -5,6 +5,7 @@ chmem \- configure memory
|
||||||
|
.B chmem
|
||||||
|
.RB [ \-h "] [" \-V "] [" \-v "] [" \-e | \-d "]"
|
||||||
|
[\fISIZE\fP|\fIRANGE\fP|\fB\-b\fP \fIBLOCKRANGE\fP]
|
||||||
|
+[-z ZONE]
|
||||||
|
.SH DESCRIPTION
|
||||||
|
The chmem command sets a particular size or range of memory online or offline.
|
||||||
|
.
|
||||||
|
@@ -25,6 +26,19 @@ and <last> is the number of the last memory block in the memory
|
||||||
|
range. Alternatively a single block can be specified. \fIBLOCKRANGE\fP requires
|
||||||
|
the \fB--blocks\fP option.
|
||||||
|
.
|
||||||
|
+.IP "\(hy" 2
|
||||||
|
+Specify \fIZONE\fP as the name of a memory zone, as shown in the output of the
|
||||||
|
+\fBlsmem -o +ZONES\fP command. The output shows one or more valid memory zones
|
||||||
|
+for each memory range. If multiple zones are shown, then the memory range
|
||||||
|
+currently belongs to the first zone. By default, chmem will set memory online
|
||||||
|
+to the zone Movable, if this is among the valid zones. This default can be
|
||||||
|
+changed by specifying the \fB--zone\fP option with another valid zone.
|
||||||
|
+For memory ballooning, it is recommended to select the zone Movable for memory
|
||||||
|
+online and offline, if possible. Memory in this zone is much more likely to be
|
||||||
|
+able to be offlined again, but it cannot be used for arbitrary kernel
|
||||||
|
+allocations, only for migratable pages (e.g. anonymous and page cache pages).
|
||||||
|
+Use the \fB\-\-help\fR option to see all available zones.
|
||||||
|
+.
|
||||||
|
.PP
|
||||||
|
\fISIZE\fP and \fIRANGE\fP must be aligned to the Linux memory block size, as
|
||||||
|
shown in the output of the \fBlsmem\fP command.
|
||||||
|
@@ -51,6 +65,11 @@ Set the specified \fIRANGE\fP, \fISIZE\fP, or \fIBLOCKRANGE\fP of memory offline
|
||||||
|
.BR \-e ", " \-\-enable
|
||||||
|
Set the specified \fIRANGE\fP, \fISIZE\fP, or \fIBLOCKRANGE\fP of memory online.
|
||||||
|
.TP
|
||||||
|
+.BR \-z ", " \-\-zone
|
||||||
|
+Select the memory \fIZONE\fP where to set the specified \fIRANGE\fP, \fISIZE\fP,
|
||||||
|
+or \fIBLOCKRANGE\fP of memory online or offline. By default, memory will be set
|
||||||
|
+online to the zone Movable, if possible.
|
||||||
|
+.TP
|
||||||
|
.BR \-h ", " \-\-help
|
||||||
|
Print a short help text, then exit.
|
||||||
|
.TP
|
||||||
|
diff --git a/sys-utils/chmem.c b/sys-utils/chmem.c
|
||||||
|
index d9bc95cc1..2f0680de8 100644
|
||||||
|
--- a/sys-utils/chmem.c
|
||||||
|
+++ b/sys-utils/chmem.c
|
||||||
|
@@ -49,6 +49,7 @@ struct chmem_desc {
|
||||||
|
unsigned int use_blocks : 1;
|
||||||
|
unsigned int is_size : 1;
|
||||||
|
unsigned int verbose : 1;
|
||||||
|
+ unsigned int have_zones : 1;
|
||||||
|
};
|
||||||
|
|
||||||
|
enum {
|
||||||
|
@@ -57,6 +58,38 @@ enum {
|
||||||
|
CMD_NONE
|
||||||
|
};
|
||||||
|
|
||||||
|
+enum zone_id {
|
||||||
|
+ ZONE_DMA = 0,
|
||||||
|
+ ZONE_DMA32,
|
||||||
|
+ ZONE_NORMAL,
|
||||||
|
+ ZONE_HIGHMEM,
|
||||||
|
+ ZONE_MOVABLE,
|
||||||
|
+ ZONE_DEVICE,
|
||||||
|
+};
|
||||||
|
+
|
||||||
|
+static char *zone_names[] = {
|
||||||
|
+ [ZONE_DMA] = "DMA",
|
||||||
|
+ [ZONE_DMA32] = "DMA32",
|
||||||
|
+ [ZONE_NORMAL] = "Normal",
|
||||||
|
+ [ZONE_HIGHMEM] = "Highmem",
|
||||||
|
+ [ZONE_MOVABLE] = "Movable",
|
||||||
|
+ [ZONE_DEVICE] = "Device",
|
||||||
|
+};
|
||||||
|
+
|
||||||
|
+/*
|
||||||
|
+ * name must be null-terminated
|
||||||
|
+ */
|
||||||
|
+static int zone_name_to_id(const char *name)
|
||||||
|
+{
|
||||||
|
+ size_t i;
|
||||||
|
+
|
||||||
|
+ for (i = 0; i < ARRAY_SIZE(zone_names); i++) {
|
||||||
|
+ if (!strcasecmp(name, zone_names[i]))
|
||||||
|
+ return i;
|
||||||
|
+ }
|
||||||
|
+ return -1;
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
static void idxtostr(struct chmem_desc *desc, uint64_t idx, char *buf, size_t bufsz)
|
||||||
|
{
|
||||||
|
uint64_t start, end;
|
||||||
|
@@ -68,22 +101,49 @@ static void idxtostr(struct chmem_desc *desc, uint64_t idx, char *buf, size_t bu
|
||||||
|
idx, start, end);
|
||||||
|
}
|
||||||
|
|
||||||
|
-static int chmem_size(struct chmem_desc *desc, int enable)
|
||||||
|
+static int chmem_size(struct chmem_desc *desc, int enable, int zone_id)
|
||||||
|
{
|
||||||
|
char *name, *onoff, line[BUFSIZ], str[BUFSIZ];
|
||||||
|
uint64_t size, index;
|
||||||
|
+ const char *zn;
|
||||||
|
int i, rc;
|
||||||
|
|
||||||
|
size = desc->size;
|
||||||
|
onoff = enable ? "online" : "offline";
|
||||||
|
i = enable ? 0 : desc->ndirs - 1;
|
||||||
|
|
||||||
|
+ if (enable && zone_id >= 0) {
|
||||||
|
+ if (zone_id == ZONE_MOVABLE)
|
||||||
|
+ onoff = "online_movable";
|
||||||
|
+ else
|
||||||
|
+ onoff = "online_kernel";
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
for (; i >= 0 && i < desc->ndirs && size; i += enable ? 1 : -1) {
|
||||||
|
name = desc->dirs[i]->d_name;
|
||||||
|
index = strtou64_or_err(name + 6, _("Failed to parse index"));
|
||||||
|
path_read_str(line, sizeof(line), _PATH_SYS_MEMORY "/%s/state", name);
|
||||||
|
- if (strcmp(onoff, line) == 0)
|
||||||
|
+ if (strncmp(onoff, line, 6) == 0)
|
||||||
|
continue;
|
||||||
|
+
|
||||||
|
+ if (desc->have_zones) {
|
||||||
|
+ path_read_str(line, sizeof(line),
|
||||||
|
+ _PATH_SYS_MEMORY "/%s/valid_zones", name);
|
||||||
|
+ if (zone_id >= 0) {
|
||||||
|
+ zn = zone_names[zone_id];
|
||||||
|
+ if (enable && !strcasestr(line, zn))
|
||||||
|
+ continue;
|
||||||
|
+ if (!enable && strncasecmp(line, zn, strlen(zn)))
|
||||||
|
+ continue;
|
||||||
|
+ } else if (enable) {
|
||||||
|
+ /* By default, use zone Movable for online, if valid */
|
||||||
|
+ if (strcasestr(line, zone_names[ZONE_MOVABLE]))
|
||||||
|
+ onoff = "online_movable";
|
||||||
|
+ else
|
||||||
|
+ onoff = "online";
|
||||||
|
+ }
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
idxtostr(desc, index, str, sizeof(str));
|
||||||
|
rc = path_write_str(onoff, _PATH_SYS_MEMORY"/%s/state", name);
|
||||||
|
if (rc == -1 && desc->verbose) {
|
||||||
|
@@ -115,15 +175,23 @@ static int chmem_size(struct chmem_desc *desc, int enable)
|
||||||
|
return size == 0 ? 0 : size == desc->size ? -1 : 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
-static int chmem_range(struct chmem_desc *desc, int enable)
|
||||||
|
+static int chmem_range(struct chmem_desc *desc, int enable, int zone_id)
|
||||||
|
{
|
||||||
|
char *name, *onoff, line[BUFSIZ], str[BUFSIZ];
|
||||||
|
uint64_t index, todo;
|
||||||
|
+ const char *zn;
|
||||||
|
int i, rc;
|
||||||
|
|
||||||
|
todo = desc->end - desc->start + 1;
|
||||||
|
onoff = enable ? "online" : "offline";
|
||||||
|
|
||||||
|
+ if (enable && zone_id >= 0) {
|
||||||
|
+ if (zone_id == ZONE_MOVABLE)
|
||||||
|
+ onoff = "online_movable";
|
||||||
|
+ else
|
||||||
|
+ onoff = "online_kernel";
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
for (i = 0; i < desc->ndirs; i++) {
|
||||||
|
name = desc->dirs[i]->d_name;
|
||||||
|
index = strtou64_or_err(name + 6, _("Failed to parse index"));
|
||||||
|
@@ -133,7 +201,7 @@ static int chmem_range(struct chmem_desc *desc, int enable)
|
||||||
|
break;
|
||||||
|
idxtostr(desc, index, str, sizeof(str));
|
||||||
|
path_read_str(line, sizeof(line), _PATH_SYS_MEMORY "/%s/state", name);
|
||||||
|
- if (strcmp(onoff, line) == 0) {
|
||||||
|
+ if (strncmp(onoff, line, 6) == 0) {
|
||||||
|
if (desc->verbose && enable)
|
||||||
|
fprintf(stdout, _("%s already enabled\n"), str);
|
||||||
|
else if (desc->verbose && !enable)
|
||||||
|
@@ -141,6 +209,29 @@ static int chmem_range(struct chmem_desc *desc, int enable)
|
||||||
|
todo--;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
+
|
||||||
|
+ if (desc->have_zones) {
|
||||||
|
+ path_read_str(line, sizeof(line),
|
||||||
|
+ _PATH_SYS_MEMORY "/%s/valid_zones", name);
|
||||||
|
+ if (zone_id >= 0) {
|
||||||
|
+ zn = zone_names[zone_id];
|
||||||
|
+ if (enable && !strcasestr(line, zn)) {
|
||||||
|
+ warnx(_("%s enable failed: Zone mismatch"), str);
|
||||||
|
+ continue;
|
||||||
|
+ }
|
||||||
|
+ if (!enable && strncasecmp(line, zn, strlen(zn))) {
|
||||||
|
+ warnx(_("%s disable failed: Zone mismatch"), str);
|
||||||
|
+ continue;
|
||||||
|
+ }
|
||||||
|
+ } else if (enable) {
|
||||||
|
+ /* By default, use zone Movable for online, if valid */
|
||||||
|
+ if (strcasestr(line, zone_names[ZONE_MOVABLE]))
|
||||||
|
+ onoff = "online_movable";
|
||||||
|
+ else
|
||||||
|
+ onoff = "online";
|
||||||
|
+ }
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
rc = path_write_str(onoff, _PATH_SYS_MEMORY"/%s/state", name);
|
||||||
|
if (rc == -1) {
|
||||||
|
if (enable)
|
||||||
|
@@ -237,6 +328,8 @@ static void parse_parameter(struct chmem_desc *desc, char *param)
|
||||||
|
static void __attribute__((__noreturn__)) usage(void)
|
||||||
|
{
|
||||||
|
FILE *out = stdout;
|
||||||
|
+ unsigned int i;
|
||||||
|
+
|
||||||
|
fputs(USAGE_HEADER, out);
|
||||||
|
fprintf(out, _(" %s [options] [SIZE|RANGE|BLOCKRANGE]\n"), program_invocation_short_name);
|
||||||
|
|
||||||
|
@@ -247,6 +340,14 @@ static void __attribute__((__noreturn__)) usage(void)
|
||||||
|
fputs(_(" -e, --enable enable memory\n"), out);
|
||||||
|
fputs(_(" -d, --disable disable memory\n"), out);
|
||||||
|
fputs(_(" -b, --blocks use memory blocks\n"), out);
|
||||||
|
+ fputs(_(" -z, --zone select memory zone ("), out);
|
||||||
|
+ for (i = 0; i < ARRAY_SIZE(zone_names); i++) {
|
||||||
|
+ fputs(zone_names[i], out);
|
||||||
|
+ if (i < ARRAY_SIZE(zone_names) - 1)
|
||||||
|
+ fputc('|', out);
|
||||||
|
+ }
|
||||||
|
+ fputs(")\n", out);
|
||||||
|
+
|
||||||
|
fputs(_(" -v, --verbose verbose output\n"), out);
|
||||||
|
fputs(USAGE_SEPARATOR, out);
|
||||||
|
printf(USAGE_HELP_OPTIONS(16));
|
||||||
|
@@ -259,7 +360,8 @@ static void __attribute__((__noreturn__)) usage(void)
|
||||||
|
int main(int argc, char **argv)
|
||||||
|
{
|
||||||
|
struct chmem_desc _desc = { }, *desc = &_desc;
|
||||||
|
- int cmd = CMD_NONE;
|
||||||
|
+ int cmd = CMD_NONE, zone_id = -1;
|
||||||
|
+ char *zone = NULL;
|
||||||
|
int c, rc;
|
||||||
|
|
||||||
|
static const struct option longopts[] = {
|
||||||
|
@@ -269,6 +371,7 @@ int main(int argc, char **argv)
|
||||||
|
{"help", no_argument, NULL, 'h'},
|
||||||
|
{"verbose", no_argument, NULL, 'v'},
|
||||||
|
{"version", no_argument, NULL, 'V'},
|
||||||
|
+ {"zone", required_argument, NULL, 'z'},
|
||||||
|
{NULL, 0, NULL, 0}
|
||||||
|
};
|
||||||
|
|
||||||
|
@@ -285,7 +388,7 @@ int main(int argc, char **argv)
|
||||||
|
|
||||||
|
read_info(desc);
|
||||||
|
|
||||||
|
- while ((c = getopt_long(argc, argv, "bdehvV", longopts, NULL)) != -1) {
|
||||||
|
+ while ((c = getopt_long(argc, argv, "bdehvVz:", longopts, NULL)) != -1) {
|
||||||
|
|
||||||
|
err_exclusive_options(c, longopts, excl, excl_st);
|
||||||
|
|
||||||
|
@@ -308,6 +411,9 @@ int main(int argc, char **argv)
|
||||||
|
case 'V':
|
||||||
|
printf(UTIL_LINUX_VERSION);
|
||||||
|
return EXIT_SUCCESS;
|
||||||
|
+ case 'z':
|
||||||
|
+ zone = xstrdup(optarg);
|
||||||
|
+ break;
|
||||||
|
default:
|
||||||
|
errtryhelp(EXIT_FAILURE);
|
||||||
|
}
|
||||||
|
@@ -320,10 +426,24 @@ int main(int argc, char **argv)
|
||||||
|
|
||||||
|
parse_parameter(desc, argv[optind]);
|
||||||
|
|
||||||
|
+ /* The valid_zones sysfs attribute was introduced with kernel 3.18 */
|
||||||
|
+ if (path_exist(_PATH_SYS_MEMORY "/memory0/valid_zones"))
|
||||||
|
+ desc->have_zones = 1;
|
||||||
|
+ else if (zone)
|
||||||
|
+ warnx(_("zone ignored, no valid_zones sysfs attribute present"));
|
||||||
|
+
|
||||||
|
+ if (zone && desc->have_zones) {
|
||||||
|
+ zone_id = zone_name_to_id(zone);
|
||||||
|
+ if (zone_id == -1) {
|
||||||
|
+ warnx(_("unknown memory zone: %s"), zone);
|
||||||
|
+ errtryhelp(EXIT_FAILURE);
|
||||||
|
+ }
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
if (desc->is_size)
|
||||||
|
- rc = chmem_size(desc, cmd == CMD_MEMORY_ENABLE ? 1 : 0);
|
||||||
|
+ rc = chmem_size(desc, cmd == CMD_MEMORY_ENABLE ? 1 : 0, zone_id);
|
||||||
|
else
|
||||||
|
- rc = chmem_range(desc, cmd == CMD_MEMORY_ENABLE ? 1 : 0);
|
||||||
|
+ rc = chmem_range(desc, cmd == CMD_MEMORY_ENABLE ? 1 : 0, zone_id);
|
||||||
|
|
||||||
|
return rc == 0 ? EXIT_SUCCESS :
|
||||||
|
rc < 0 ? EXIT_FAILURE : CHMEM_EXIT_SOMEOK;
|
||||||
|
diff --git a/sys-utils/lsmem.1 b/sys-utils/lsmem.1
|
||||||
|
index be2862d94..e7df50a4e 100644
|
||||||
|
--- a/sys-utils/lsmem.1
|
||||||
|
+++ b/sys-utils/lsmem.1
|
||||||
|
@@ -41,12 +41,12 @@ Do not print a header line.
|
||||||
|
.BR \-o , " \-\-output " \fIlist\fP
|
||||||
|
Specify which output columns to print. Use \fB\-\-help\fR
|
||||||
|
to get a list of all supported columns.
|
||||||
|
+The default list of columns may be extended if \fIlist\fP is
|
||||||
|
+specified in the format \fB+\fIlist\fP (e.g. \fBlsmem \-o +NODE\fP).
|
||||||
|
.TP
|
||||||
|
.BR \-P , " \-\-pairs"
|
||||||
|
Produce output in the form of key="value" pairs.
|
||||||
|
All potentially unsafe characters are hex-escaped (\\x<code>).
|
||||||
|
-The default list of columns may be extended if \fIlist\fP is
|
||||||
|
-specified in the format \fB+\fIlist\fP (e.g. \fBlsmem \-o +NODE\fP).
|
||||||
|
.TP
|
||||||
|
.BR \-r , " \-\-raw"
|
||||||
|
Produce output in raw format. All potentially unsafe characters are hex-escaped
|
||||||
|
diff --git a/sys-utils/lsmem.c b/sys-utils/lsmem.c
|
||||||
|
index aeffd29dd..1d26579fd 100644
|
||||||
|
--- a/sys-utils/lsmem.c
|
||||||
|
+++ b/sys-utils/lsmem.c
|
||||||
|
@@ -42,11 +42,25 @@
|
||||||
|
#define MEMORY_STATE_GOING_OFFLINE 2
|
||||||
|
#define MEMORY_STATE_UNKNOWN 3
|
||||||
|
|
||||||
|
+enum zone_id {
|
||||||
|
+ ZONE_DMA = 0,
|
||||||
|
+ ZONE_DMA32,
|
||||||
|
+ ZONE_NORMAL,
|
||||||
|
+ ZONE_HIGHMEM,
|
||||||
|
+ ZONE_MOVABLE,
|
||||||
|
+ ZONE_DEVICE,
|
||||||
|
+ ZONE_NONE,
|
||||||
|
+ ZONE_UNKNOWN,
|
||||||
|
+ MAX_NR_ZONES,
|
||||||
|
+};
|
||||||
|
+
|
||||||
|
struct memory_block {
|
||||||
|
uint64_t index;
|
||||||
|
uint64_t count;
|
||||||
|
int state;
|
||||||
|
int node;
|
||||||
|
+ int nr_zones;
|
||||||
|
+ int zones[MAX_NR_ZONES];
|
||||||
|
unsigned int removable:1;
|
||||||
|
};
|
||||||
|
|
||||||
|
@@ -72,7 +86,9 @@ struct lsmem {
|
||||||
|
want_state : 1,
|
||||||
|
want_removable : 1,
|
||||||
|
want_summary : 1,
|
||||||
|
- want_table : 1;
|
||||||
|
+ want_table : 1,
|
||||||
|
+ want_zones : 1,
|
||||||
|
+ have_zones : 1;
|
||||||
|
};
|
||||||
|
|
||||||
|
enum {
|
||||||
|
@@ -82,6 +98,18 @@ enum {
|
||||||
|
COL_REMOVABLE,
|
||||||
|
COL_BLOCK,
|
||||||
|
COL_NODE,
|
||||||
|
+ COL_ZONES,
|
||||||
|
+};
|
||||||
|
+
|
||||||
|
+static char *zone_names[] = {
|
||||||
|
+ [ZONE_DMA] = "DMA",
|
||||||
|
+ [ZONE_DMA32] = "DMA32",
|
||||||
|
+ [ZONE_NORMAL] = "Normal",
|
||||||
|
+ [ZONE_HIGHMEM] = "Highmem",
|
||||||
|
+ [ZONE_MOVABLE] = "Movable",
|
||||||
|
+ [ZONE_DEVICE] = "Device",
|
||||||
|
+ [ZONE_NONE] = "None", /* block contains more than one zone, can't be offlined */
|
||||||
|
+ [ZONE_UNKNOWN] = "Unknown",
|
||||||
|
};
|
||||||
|
|
||||||
|
/* column names */
|
||||||
|
@@ -102,6 +130,7 @@ static struct coldesc coldescs[] = {
|
||||||
|
[COL_REMOVABLE] = { "REMOVABLE", 0, SCOLS_FL_RIGHT, N_("memory is removable")},
|
||||||
|
[COL_BLOCK] = { "BLOCK", 0, SCOLS_FL_RIGHT, N_("memory block number or blocks range")},
|
||||||
|
[COL_NODE] = { "NODE", 0, SCOLS_FL_RIGHT, N_("numa node of memory")},
|
||||||
|
+ [COL_ZONES] = { "ZONES", 0, SCOLS_FL_RIGHT, N_("valid zones for the memory range")},
|
||||||
|
};
|
||||||
|
|
||||||
|
/* columns[] array specifies all currently wanted output column. The columns
|
||||||
|
@@ -120,6 +149,20 @@ static inline size_t err_columns_index(size_t arysz, size_t idx)
|
||||||
|
return idx;
|
||||||
|
}
|
||||||
|
|
||||||
|
+/*
|
||||||
|
+ * name must be null-terminated
|
||||||
|
+ */
|
||||||
|
+static int zone_name_to_id(const char *name)
|
||||||
|
+{
|
||||||
|
+ size_t i;
|
||||||
|
+
|
||||||
|
+ for (i = 0; i < ARRAY_SIZE(zone_names); i++) {
|
||||||
|
+ if (!strcasecmp(name, zone_names[i]))
|
||||||
|
+ return i;
|
||||||
|
+ }
|
||||||
|
+ return ZONE_UNKNOWN;
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
#define add_column(ary, n, id) \
|
||||||
|
((ary)[ err_columns_index(ARRAY_SIZE(ary), (n)) ] = (id))
|
||||||
|
|
||||||
|
@@ -214,6 +257,25 @@ static void add_scols_line(struct lsmem *lsmem, struct memory_block *blk)
|
||||||
|
else
|
||||||
|
str = xstrdup("-");
|
||||||
|
break;
|
||||||
|
+ case COL_ZONES:
|
||||||
|
+ if (lsmem->have_zones) {
|
||||||
|
+ char valid_zones[BUFSIZ];
|
||||||
|
+ int j, zone_id;
|
||||||
|
+
|
||||||
|
+ valid_zones[0] = '\0';
|
||||||
|
+ for (j = 0; j < blk->nr_zones; j++) {
|
||||||
|
+ zone_id = blk->zones[j];
|
||||||
|
+ if (strlen(valid_zones) +
|
||||||
|
+ strlen(zone_names[zone_id]) > BUFSIZ - 2)
|
||||||
|
+ break;
|
||||||
|
+ strcat(valid_zones, zone_names[zone_id]);
|
||||||
|
+ if (j + 1 < blk->nr_zones)
|
||||||
|
+ strcat(valid_zones, "/");
|
||||||
|
+ }
|
||||||
|
+ str = xstrdup(valid_zones);
|
||||||
|
+ } else
|
||||||
|
+ str = xstrdup("-");
|
||||||
|
+ break;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (str && scols_line_refer_data(line, i, str) != 0)
|
||||||
|
@@ -272,7 +334,9 @@ static int memory_block_get_node(char *name)
|
||||||
|
static void memory_block_read_attrs(struct lsmem *lsmem, char *name,
|
||||||
|
struct memory_block *blk)
|
||||||
|
{
|
||||||
|
+ char *token = NULL;
|
||||||
|
char line[BUFSIZ];
|
||||||
|
+ int i;
|
||||||
|
|
||||||
|
blk->count = 1;
|
||||||
|
blk->index = strtoumax(name + 6, NULL, 10); /* get <num> of "memory<num>" */
|
||||||
|
@@ -287,11 +351,26 @@ static void memory_block_read_attrs(struct lsmem *lsmem, char *name,
|
||||||
|
blk->state = MEMORY_STATE_GOING_OFFLINE;
|
||||||
|
if (lsmem->have_nodes)
|
||||||
|
blk->node = memory_block_get_node(name);
|
||||||
|
+
|
||||||
|
+ blk->nr_zones = 0;
|
||||||
|
+ if (lsmem->have_zones) {
|
||||||
|
+ path_read_str(line, sizeof(line), _PATH_SYS_MEMORY"/%s/%s", name,
|
||||||
|
+ "valid_zones");
|
||||||
|
+ token = strtok(line, " ");
|
||||||
|
+ }
|
||||||
|
+ for (i = 0; i < MAX_NR_ZONES; i++) {
|
||||||
|
+ if (token) {
|
||||||
|
+ blk->zones[i] = zone_name_to_id(token);
|
||||||
|
+ blk->nr_zones++;
|
||||||
|
+ token = strtok(NULL, " ");
|
||||||
|
+ }
|
||||||
|
+ }
|
||||||
|
}
|
||||||
|
|
||||||
|
static int is_mergeable(struct lsmem *lsmem, struct memory_block *blk)
|
||||||
|
{
|
||||||
|
struct memory_block *curr;
|
||||||
|
+ int i;
|
||||||
|
|
||||||
|
if (!lsmem->nblocks)
|
||||||
|
return 0;
|
||||||
|
@@ -308,6 +387,15 @@ static int is_mergeable(struct lsmem *lsmem, struct memory_block *blk)
|
||||||
|
if (curr->node != blk->node)
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
+ if (lsmem->want_zones && lsmem->have_zones) {
|
||||||
|
+ if (curr->nr_zones != blk->nr_zones)
|
||||||
|
+ return 0;
|
||||||
|
+ for (i = 0; i < curr->nr_zones; i++) {
|
||||||
|
+ if (curr->zones[i] == ZONE_UNKNOWN ||
|
||||||
|
+ curr->zones[i] != blk->zones[i])
|
||||||
|
+ return 0;
|
||||||
|
+ }
|
||||||
|
+ }
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
@@ -362,6 +450,12 @@ static void read_basic_info(struct lsmem *lsmem)
|
||||||
|
|
||||||
|
if (memory_block_get_node(lsmem->dirs[0]->d_name) != -1)
|
||||||
|
lsmem->have_nodes = 1;
|
||||||
|
+
|
||||||
|
+ /* The valid_zones sysfs attribute was introduced with kernel 3.18 */
|
||||||
|
+ if (path_exist(_PATH_SYS_MEMORY "/memory0/valid_zones"))
|
||||||
|
+ lsmem->have_zones = 1;
|
||||||
|
+ else if (lsmem->want_zones)
|
||||||
|
+ warnx(_("Cannot read zones, no valid_zones sysfs attribute present"));
|
||||||
|
}
|
||||||
|
|
||||||
|
static void __attribute__((__noreturn__)) usage(void)
|
||||||
|
@@ -553,6 +647,8 @@ int main(int argc, char **argv)
|
||||||
|
lsmem->want_node = 1;
|
||||||
|
if (has_column(COL_REMOVABLE))
|
||||||
|
lsmem->want_removable = 1;
|
||||||
|
+ if (has_column(COL_ZONES))
|
||||||
|
+ lsmem->want_zones = 1;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Read data and print output
|
||||||
|
--
|
||||||
|
2.15.0
|
||||||
|
|
107
util-linux-lsmem-memory-zone-2.patch
Normal file
107
util-linux-lsmem-memory-zone-2.patch
Normal file
@ -0,0 +1,107 @@
|
|||||||
|
From 0a4320f5e785e82337c3a657c55651004e3fd08d Mon Sep 17 00:00:00 2001
|
||||||
|
From: Gerald Schaefer <gerald.schaefer@de.ibm.com>
|
||||||
|
Date: Wed, 27 Sep 2017 19:44:45 +0200
|
||||||
|
Subject: [PATCH 2/3] tests/lsmem: update lsmem test with ZONES column
|
||||||
|
|
||||||
|
The existing s390 and x86_64 dumps already contain the valid_zones sysfs
|
||||||
|
attribute, so just add a new "lsmem -o +ZONES" test command and update
|
||||||
|
the expected results.
|
||||||
|
|
||||||
|
Signed-off-by: Gerald Schaefer <gerald.schaefer@de.ibm.com>
|
||||||
|
---
|
||||||
|
tests/expected/lsmem/lsmem-s390-zvm-6g | 21 ++++++++++++++++++
|
||||||
|
tests/expected/lsmem/lsmem-x86_64-16g | 39 ++++++++++++++++++++++++++++++++++
|
||||||
|
tests/ts/lsmem/lsmem | 1 +
|
||||||
|
3 files changed, 61 insertions(+)
|
||||||
|
|
||||||
|
diff --git a/tests/expected/lsmem/lsmem-s390-zvm-6g b/tests/expected/lsmem/lsmem-s390-zvm-6g
|
||||||
|
index 05af40d4d..9f4c805ad 100644
|
||||||
|
--- a/tests/expected/lsmem/lsmem-s390-zvm-6g
|
||||||
|
+++ b/tests/expected/lsmem/lsmem-s390-zvm-6g
|
||||||
|
@@ -106,3 +106,24 @@ $ lsmem --json --output RANGE,SIZE,STATE,REMOVABLE,BLOCK,NODE
|
||||||
|
{"range": "0x0000000140000000-0x000000017fffffff", "size": "1G", "state": "offline", "removable": "-", "block": "20-23", "node": "0"}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
+
|
||||||
|
+---
|
||||||
|
+
|
||||||
|
+$ lsmem -o +ZONES
|
||||||
|
+RANGE SIZE STATE REMOVABLE BLOCK ZONES
|
||||||
|
+0x0000000000000000-0x000000006fffffff 1.8G online yes 0-6 DMA
|
||||||
|
+0x0000000070000000-0x000000007fffffff 256M online no 7 DMA/Normal
|
||||||
|
+0x0000000080000000-0x000000009fffffff 512M online yes 8-9 Normal
|
||||||
|
+0x00000000a0000000-0x00000000bfffffff 512M online no 10-11 Normal
|
||||||
|
+0x00000000c0000000-0x00000000dfffffff 512M online yes 12-13 Normal
|
||||||
|
+0x00000000e0000000-0x00000000efffffff 256M offline - 14 Normal
|
||||||
|
+0x00000000f0000000-0x00000000ffffffff 256M online yes 15 Normal
|
||||||
|
+0x0000000100000000-0x000000010fffffff 256M online no 16 Normal
|
||||||
|
+0x0000000110000000-0x000000011fffffff 256M online no 17 Normal/Movable
|
||||||
|
+0x0000000120000000-0x000000012fffffff 256M online yes 18 Movable/Normal
|
||||||
|
+0x0000000130000000-0x000000013fffffff 256M online yes 19 Movable
|
||||||
|
+0x0000000140000000-0x000000017fffffff 1G offline - 20-23 Movable
|
||||||
|
+
|
||||||
|
+Memory block size: 256M
|
||||||
|
+Total online memory: 4.8G
|
||||||
|
+Total offline memory: 1.3G
|
||||||
|
diff --git a/tests/expected/lsmem/lsmem-x86_64-16g b/tests/expected/lsmem/lsmem-x86_64-16g
|
||||||
|
index 14d7d84f6..40316a584 100644
|
||||||
|
--- a/tests/expected/lsmem/lsmem-x86_64-16g
|
||||||
|
+++ b/tests/expected/lsmem/lsmem-x86_64-16g
|
||||||
|
@@ -269,3 +269,42 @@ $ lsmem --json --output RANGE,SIZE,STATE,REMOVABLE,BLOCK,NODE
|
||||||
|
{"range": "0x0000000438000000-0x000000043fffffff", "size": "128M", "state": "online", "removable": "no", "block": "135", "node": "0"}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
+
|
||||||
|
+---
|
||||||
|
+
|
||||||
|
+$ lsmem -o +ZONES
|
||||||
|
+RANGE SIZE STATE REMOVABLE BLOCK ZONES
|
||||||
|
+0x0000000000000000-0x0000000007ffffff 128M online no 0 None
|
||||||
|
+0x0000000008000000-0x0000000037ffffff 768M online yes 1-6 DMA32
|
||||||
|
+0x0000000038000000-0x000000003fffffff 128M online no 7 DMA32
|
||||||
|
+0x0000000040000000-0x0000000077ffffff 896M online yes 8-14 DMA32
|
||||||
|
+0x0000000078000000-0x000000007fffffff 128M online no 15 DMA32
|
||||||
|
+0x0000000080000000-0x00000000afffffff 768M online yes 16-21 DMA32
|
||||||
|
+0x00000000b0000000-0x00000000bfffffff 256M online no 22-23 DMA32
|
||||||
|
+0x0000000100000000-0x00000001a7ffffff 2.6G online no 32-52 Normal
|
||||||
|
+0x00000001a8000000-0x00000001afffffff 128M online yes 53 Normal
|
||||||
|
+0x00000001b0000000-0x00000001bfffffff 256M online no 54-55 Normal
|
||||||
|
+0x00000001c0000000-0x00000001ffffffff 1G online yes 56-63 Normal
|
||||||
|
+0x0000000200000000-0x0000000207ffffff 128M online no 64 Normal
|
||||||
|
+0x0000000208000000-0x000000021fffffff 384M online yes 65-67 Normal
|
||||||
|
+0x0000000220000000-0x0000000237ffffff 384M online no 68-70 Normal
|
||||||
|
+0x0000000238000000-0x0000000277ffffff 1G online yes 71-78 Normal
|
||||||
|
+0x0000000278000000-0x000000028fffffff 384M online no 79-81 Normal
|
||||||
|
+0x0000000290000000-0x0000000297ffffff 128M online yes 82 Normal
|
||||||
|
+0x0000000298000000-0x00000002a7ffffff 256M online no 83-84 Normal
|
||||||
|
+0x00000002a8000000-0x00000002c7ffffff 512M online yes 85-88 Normal
|
||||||
|
+0x00000002c8000000-0x00000002dfffffff 384M online no 89-91 Normal
|
||||||
|
+0x00000002e0000000-0x00000002efffffff 256M online yes 92-93 Normal
|
||||||
|
+0x00000002f0000000-0x000000034fffffff 1.5G online no 94-105 Normal
|
||||||
|
+0x0000000350000000-0x0000000357ffffff 128M online yes 106 Normal
|
||||||
|
+0x0000000358000000-0x000000036fffffff 384M online no 107-109 Normal
|
||||||
|
+0x0000000370000000-0x0000000377ffffff 128M online yes 110 Normal
|
||||||
|
+0x0000000378000000-0x00000003c7ffffff 1.3G online no 111-120 Normal
|
||||||
|
+0x00000003c8000000-0x00000003e7ffffff 512M online yes 121-124 Normal
|
||||||
|
+0x00000003e8000000-0x000000042fffffff 1.1G online no 125-133 Normal
|
||||||
|
+0x0000000430000000-0x0000000437ffffff 128M online yes 134 Normal
|
||||||
|
+0x0000000438000000-0x000000043fffffff 128M online no 135 None
|
||||||
|
+
|
||||||
|
+Memory block size: 128M
|
||||||
|
+Total online memory: 16G
|
||||||
|
+Total offline memory: 0B
|
||||||
|
diff --git a/tests/ts/lsmem/lsmem b/tests/ts/lsmem/lsmem
|
||||||
|
index 79c0523b9..b1313773e 100755
|
||||||
|
--- a/tests/ts/lsmem/lsmem
|
||||||
|
+++ b/tests/ts/lsmem/lsmem
|
||||||
|
@@ -49,6 +49,7 @@ for dump in $(ls $TS_SELF/dumps/*.tar.bz2 | sort); do
|
||||||
|
do_lsmem --all --output $LSCOLUMNS
|
||||||
|
do_lsmem --raw --output $LSCOLUMNS
|
||||||
|
do_lsmem --json --output $LSCOLUMNS
|
||||||
|
+ do_lsmem -o +ZONES
|
||||||
|
|
||||||
|
ts_finalize_subtest
|
||||||
|
done
|
||||||
|
--
|
||||||
|
2.15.0
|
||||||
|
|
44
util-linux-lsmem-memory-zone-3.patch
Normal file
44
util-linux-lsmem-memory-zone-3.patch
Normal file
@ -0,0 +1,44 @@
|
|||||||
|
From afee3f204247fbc8e4cfaa1698f3d98762544dd8 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Andre Wild <wild@linux.vnet.ibm.com>
|
||||||
|
Date: Wed, 27 Sep 2017 19:44:46 +0200
|
||||||
|
Subject: [PATCH 3/3] lsmem/chmem: add memory zone awareness to bash-completion
|
||||||
|
|
||||||
|
This patch extends the valid --output values with ZONES for the
|
||||||
|
lsmem bash-completion, and adds the --zone option for the chmem
|
||||||
|
bash-completion.
|
||||||
|
|
||||||
|
Signed-off-by: Andre Wild <wild@linux.vnet.ibm.com>
|
||||||
|
Signed-off-by: Gerald Schaefer <gerald.schaefer@de.ibm.com>
|
||||||
|
---
|
||||||
|
bash-completion/chmem | 1 +
|
||||||
|
bash-completion/lsmem | 2 +-
|
||||||
|
2 files changed, 2 insertions(+), 1 deletion(-)
|
||||||
|
|
||||||
|
diff --git a/bash-completion/chmem b/bash-completion/chmem
|
||||||
|
index 00b870dbd..3e3af87ac 100644
|
||||||
|
--- a/bash-completion/chmem
|
||||||
|
+++ b/bash-completion/chmem
|
||||||
|
@@ -16,6 +16,7 @@ _chmem_module()
|
||||||
|
--disable
|
||||||
|
--blocks
|
||||||
|
--verbose
|
||||||
|
+ --zone
|
||||||
|
--help
|
||||||
|
--version
|
||||||
|
"
|
||||||
|
diff --git a/bash-completion/lsmem b/bash-completion/lsmem
|
||||||
|
index 8f7a46ec3..9aa124569 100644
|
||||||
|
--- a/bash-completion/lsmem
|
||||||
|
+++ b/bash-completion/lsmem
|
||||||
|
@@ -9,7 +9,7 @@ _lsmem_module()
|
||||||
|
local prefix realcur OUTPUT_ALL OUTPUT
|
||||||
|
realcur="${cur##*,}"
|
||||||
|
prefix="${cur%$realcur}"
|
||||||
|
- OUTPUT_ALL='RANGE SIZE STATE REMOVABLE BLOCK NODE'
|
||||||
|
+ OUTPUT_ALL='RANGE SIZE STATE REMOVABLE BLOCK NODE ZONES'
|
||||||
|
for WORD in $OUTPUT_ALL; do
|
||||||
|
if ! [[ $prefix == *"$WORD"* ]]; then
|
||||||
|
OUTPUT="$WORD ${OUTPUT:-""}"
|
||||||
|
--
|
||||||
|
2.15.0
|
||||||
|
|
@ -1,3 +1,53 @@
|
|||||||
|
-------------------------------------------------------------------
|
||||||
|
Mon Dec 18 15:30:56 CET 2017 - sbrabec@suse.com
|
||||||
|
|
||||||
|
- Update bash completion conflict to cover rfkill file conflict.
|
||||||
|
|
||||||
|
-------------------------------------------------------------------
|
||||||
|
Mon Dec 4 17:28:04 CET 2017 - sbrabec@suse.com
|
||||||
|
|
||||||
|
- lsmem: Add support for zone awareness (bsc#1065471, FATE#324252,
|
||||||
|
util-linux-lsmem-memory-zone-1.patch,
|
||||||
|
util-linux-lsmem-memory-zone-2.patch,
|
||||||
|
util-linux-lsmem-memory-zone-3.patch).
|
||||||
|
- Drop util-linux-losetup-Add-support-for-setting-logical-blocksize.patch.
|
||||||
|
Different implementations exists in the new kernel, and it has
|
||||||
|
a conflicting implementation in util-linux.
|
||||||
|
|
||||||
|
-------------------------------------------------------------------
|
||||||
|
Mon Nov 20 17:29:11 CET 2017 - sbrabec@suse.com
|
||||||
|
|
||||||
|
- Update to version 2.31:
|
||||||
|
* New utilities: uuidparse, rfkill.
|
||||||
|
* su has been refactored and extended to create pseudo terminal
|
||||||
|
(new option --pty, CVE-2016-2779, bsc#968674). This new
|
||||||
|
EXPERIMENTAL feature provides better isolation between root's
|
||||||
|
terminal and an unprivileged su.
|
||||||
|
* libuuid: Improved to match
|
||||||
|
* libuuid, uuidgen: support hash-based UUIDs v3 (md5) and v5
|
||||||
|
(sha1) as specified by RFC-4122. Provide UUID templates for
|
||||||
|
dns, url, oid, or x500.
|
||||||
|
* libblkid: Extended support for DM-integrity, HPE (aka
|
||||||
|
extended-XFS) and UBI superblock. New API to hide already
|
||||||
|
detected signatures.
|
||||||
|
* libfdisk: New API to modify grain, make possible to completely
|
||||||
|
disable dialog driven partitioning.
|
||||||
|
* libsmartcols: New API to move columns.
|
||||||
|
* column: --table-header-repeat to repeat table headers.
|
||||||
|
* libfdisk: Use BLKPG ioctls to inform the kernel about changes.
|
||||||
|
* fdisk: Improved ^C and ^D behavior.
|
||||||
|
* cfdisk: Dialog to resize partition.
|
||||||
|
* look: Follow the WORDLIST environment variable.
|
||||||
|
* losetup: Added support for --sector-size (FATE#319010).
|
||||||
|
* script: Follow the usual semantics for stop/continue signals.
|
||||||
|
* setpriv: New command line options --ambient-caps and
|
||||||
|
--init-groups.
|
||||||
|
* hwclock: Reduce system shutdown times, log --systz when using
|
||||||
|
libaudit.
|
||||||
|
* Other bug fixes.
|
||||||
|
- Drop upstreamed util-linux-use-tinfow.patch.
|
||||||
|
- Refreshed make-sure-sbin-resp-usr-sbin-are-in-PATH.diff.
|
||||||
|
|
||||||
-------------------------------------------------------------------
|
-------------------------------------------------------------------
|
||||||
Thu Sep 21 14:41:01 UTC 2017 - jengelh@inai.de
|
Thu Sep 21 14:41:01 UTC 2017 - jengelh@inai.de
|
||||||
|
|
||||||
|
@ -116,7 +116,7 @@ BuildRequires: libmount-devel
|
|||||||
%endif
|
%endif
|
||||||
%endif
|
%endif
|
||||||
#END SECOND STAGE DEPENDENCIES
|
#END SECOND STAGE DEPENDENCIES
|
||||||
Version: 2.30.1
|
Version: 2.31
|
||||||
Release: 0
|
Release: 0
|
||||||
# util-linux is a base package and uuidd pre-requiring pwdutils pulls
|
# util-linux is a base package and uuidd pre-requiring pwdutils pulls
|
||||||
# that into the core build cycle. pwdutils also pulls in the whole
|
# that into the core build cycle. pwdutils also pulls in the whole
|
||||||
@ -125,7 +125,7 @@ Release: 0
|
|||||||
# these tools as well
|
# these tools as well
|
||||||
#!BuildIgnore: pwdutils
|
#!BuildIgnore: pwdutils
|
||||||
Url: https://www.kernel.org/pub/linux/utils/util-linux/
|
Url: https://www.kernel.org/pub/linux/utils/util-linux/
|
||||||
Source: https://www.kernel.org/pub/linux/utils/util-linux/v2.30/util-linux-%{version}.tar.xz
|
Source: https://www.kernel.org/pub/linux/utils/util-linux/v%{version}/util-linux-%{version}.tar.xz
|
||||||
Source1: util-linux-rpmlintrc
|
Source1: util-linux-rpmlintrc
|
||||||
Source4: raw.service
|
Source4: raw.service
|
||||||
Source5: etc.raw
|
Source5: etc.raw
|
||||||
@ -135,7 +135,7 @@ Source8: login.pamd
|
|||||||
Source9: remote.pamd
|
Source9: remote.pamd
|
||||||
Source10: su.pamd
|
Source10: su.pamd
|
||||||
Source11: su.default
|
Source11: su.default
|
||||||
Source12: https://www.kernel.org/pub/linux/utils/util-linux/v2.30/util-linux-%{version}.tar.sign
|
Source12: https://www.kernel.org/pub/linux/utils/util-linux/v%{version}/util-linux-%{version}.tar.sign
|
||||||
Source13: %{_name}.keyring
|
Source13: %{_name}.keyring
|
||||||
Source14: runuser.pamd
|
Source14: runuser.pamd
|
||||||
# klogconsole, http://opensuse.github.com/kiwi, 7.02.25, git 859dc050
|
# klogconsole, http://opensuse.github.com/kiwi, 7.02.25, git 859dc050
|
||||||
@ -155,10 +155,12 @@ Source51: blkid.conf
|
|||||||
##
|
##
|
||||||
# PATCH-EXTEND-UPSTREAM: Let `su' handle /sbin and /usr/sbin in path
|
# PATCH-EXTEND-UPSTREAM: Let `su' handle /sbin and /usr/sbin in path
|
||||||
Patch0: 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.
|
# PATCH-FEATURE-UPSTREAM util-linux-lsmem-memory-zone-1.patch bsc1065471 FATE324252 sbrabec@suse.com -- lsmem: Add support for zone awareness.
|
||||||
Patch1: util-linux-losetup-Add-support-for-setting-logical-blocksize.patch
|
Patch1: util-linux-lsmem-memory-zone-1.patch
|
||||||
# PATCH-FIX-UPSTREAM util-linux-use-tinfow.patch bsc#1056171 sbrabec@suse.com -- Link against tinfow instead of tinfo.
|
# PATCH-FEATURE-UPSTREAM util-linux-lsmem-memory-zone-2.patch bsc1065471 FATE324252 sbrabec@suse.com -- lsmem: Add support for zone awareness.
|
||||||
Patch2: util-linux-use-tinfow.patch
|
Patch2: util-linux-lsmem-memory-zone-2.patch
|
||||||
|
# PATCH-FEATURE-UPSTREAM util-linux-lsmem-memory-zone-3.patch bsc1065471 FATE324252 sbrabec@suse.com -- lsmem: Add support for zone awareness.
|
||||||
|
Patch3: util-linux-lsmem-memory-zone-3.patch
|
||||||
BuildRoot: %{_tmppath}/%{name}-%{version}-build
|
BuildRoot: %{_tmppath}/%{name}-%{version}-build
|
||||||
#
|
#
|
||||||
%if %build_util_linux
|
%if %build_util_linux
|
||||||
@ -173,10 +175,13 @@ PreReq: %install_info_prereq permissions
|
|||||||
Recommends: %{name}-lang = %{version}
|
Recommends: %{name}-lang = %{version}
|
||||||
Provides: eject = 2.1.0-166.8
|
Provides: eject = 2.1.0-166.8
|
||||||
Provides: login = 4.0-33.7
|
Provides: login = 4.0-33.7
|
||||||
|
Provides: rfkill = 0.5-8.6
|
||||||
# File conflict of eject (up to 12.3 and SLE11).
|
# File conflict of eject (up to 12.3 and SLE11).
|
||||||
Obsoletes: eject < 2.1.0-166.8
|
Obsoletes: eject < 2.1.0-166.8
|
||||||
# File conflict of login (up to 12.1 and SLE11).
|
# File conflict of login (up to 12.1 and SLE11).
|
||||||
Obsoletes: login < 4.0-33.7
|
Obsoletes: login < 4.0-33.7
|
||||||
|
# File confluct (man page) of rfkill (up to Leap 15 and SLE 15).
|
||||||
|
Obsoletes: rfkill < 0.5-8.6
|
||||||
# File conflict of su and kill (up to 12.3 and SLE11).
|
# File conflict of su and kill (up to 12.3 and SLE11).
|
||||||
# It should be coreutils < 8.21-4, but coreutils provide Release-less symbol.
|
# It should be coreutils < 8.21-4, but coreutils provide Release-less symbol.
|
||||||
Conflicts: coreutils < 8.21
|
Conflicts: coreutils < 8.21
|
||||||
@ -184,8 +189,8 @@ Conflicts: coreutils < 8.21
|
|||||||
# File conflict of sulogin and utmpdump (up to 12.3 and SLE11).
|
# File conflict of sulogin and utmpdump (up to 12.3 and SLE11).
|
||||||
Conflicts: sysvinit-tools < 2.88+-87
|
Conflicts: sysvinit-tools < 2.88+-87
|
||||||
%endif
|
%endif
|
||||||
# File conflicts of completion files with <= Leap 42.1 and <= SLE12 SP1 (fixed by SLE12 Update, boo#977259#c3).
|
# rfkill conflicts of completion files with <= Leap 42.3 and < SLE15.
|
||||||
Conflicts: bash-completion <= 2.1-10
|
Conflicts: bash-completion <= 2.7-1.3
|
||||||
# The preset is provided by the presets branding package since 0.4 (bsc#1012850) and since 12.2 in SLE (boo#1029775)
|
# The preset is provided by the presets branding package since 0.4 (bsc#1012850) and since 12.2 in SLE (boo#1029775)
|
||||||
Conflicts: systemd-presets-branding < 12.2
|
Conflicts: systemd-presets-branding < 12.2
|
||||||
# bnc#805684:
|
# bnc#805684:
|
||||||
@ -213,12 +218,6 @@ 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
|
||||||
@ -418,11 +417,9 @@ library.
|
|||||||
%prep
|
%prep
|
||||||
%setup -q -n %{_name}-%{version} -b 40
|
%setup -q -n %{_name}-%{version} -b 40
|
||||||
%patch0 -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
|
%patch1 -p1
|
||||||
%endif
|
|
||||||
%patch2 -p1
|
%patch2 -p1
|
||||||
|
%patch3 -p1
|
||||||
#
|
#
|
||||||
# setctsid
|
# setctsid
|
||||||
cp -p %{S:22} %{S:23} .
|
cp -p %{S:22} %{S:23} .
|
||||||
@ -557,6 +554,8 @@ AUTOPOINT=true autoreconf -vfi
|
|||||||
--disable-silent-rules \
|
--disable-silent-rules \
|
||||||
--localstatedir=/run \
|
--localstatedir=/run \
|
||||||
--docdir=%{_docdir}/%{_name} \
|
--docdir=%{_docdir}/%{_name} \
|
||||||
|
--disable-makeinstall-chown \
|
||||||
|
--disable-makeinstall-setuid \
|
||||||
--with-audit \
|
--with-audit \
|
||||||
--with-btrfs \
|
--with-btrfs \
|
||||||
--with-gnu-ld \
|
--with-gnu-ld \
|
||||||
@ -993,6 +992,7 @@ getent passwd uuidd >/dev/null || \
|
|||||||
%{_bindir}/rename
|
%{_bindir}/rename
|
||||||
%{_bindir}/renice
|
%{_bindir}/renice
|
||||||
%{_bindir}/rev
|
%{_bindir}/rev
|
||||||
|
%{_bindir}/rfkill
|
||||||
%{_bindir}/script
|
%{_bindir}/script
|
||||||
%{_bindir}/scriptreplay
|
%{_bindir}/scriptreplay
|
||||||
%{_bindir}/setarch
|
%{_bindir}/setarch
|
||||||
@ -1005,6 +1005,7 @@ getent passwd uuidd >/dev/null || \
|
|||||||
%{_bindir}/mountpoint
|
%{_bindir}/mountpoint
|
||||||
%{_bindir}/utmpdump
|
%{_bindir}/utmpdump
|
||||||
%{_bindir}/uuidgen
|
%{_bindir}/uuidgen
|
||||||
|
%{_bindir}/uuidparse
|
||||||
%{_bindir}/uname26
|
%{_bindir}/uname26
|
||||||
%ifnarch ppc ppc64
|
%ifnarch ppc ppc64
|
||||||
%{_bindir}/chrp-addnote
|
%{_bindir}/chrp-addnote
|
||||||
@ -1108,6 +1109,7 @@ getent passwd uuidd >/dev/null || \
|
|||||||
%{_mandir}/man1/utmpdump.1.gz
|
%{_mandir}/man1/utmpdump.1.gz
|
||||||
%{_mandir}/man1/runuser.1.gz
|
%{_mandir}/man1/runuser.1.gz
|
||||||
%{_mandir}/man1/uuidgen.1.gz
|
%{_mandir}/man1/uuidgen.1.gz
|
||||||
|
%{_mandir}/man1/uuidparse.1.gz
|
||||||
%{_mandir}/man5/fstab.5.gz
|
%{_mandir}/man5/fstab.5.gz
|
||||||
%{_mandir}/man5/terminal-colors.d.5.gz
|
%{_mandir}/man5/terminal-colors.d.5.gz
|
||||||
%{_mandir}/man8/addpart.8.gz
|
%{_mandir}/man8/addpart.8.gz
|
||||||
@ -1142,6 +1144,7 @@ getent passwd uuidd >/dev/null || \
|
|||||||
%{_mandir}/man8/fsfreeze.8.gz
|
%{_mandir}/man8/fsfreeze.8.gz
|
||||||
%{_mandir}/man8/swaplabel.8.gz
|
%{_mandir}/man8/swaplabel.8.gz
|
||||||
%{_mandir}/man8/readprofile.8.gz
|
%{_mandir}/man8/readprofile.8.gz
|
||||||
|
%{_mandir}/man8/rfkill.8.gz
|
||||||
%{_mandir}/man8/chcpu.8.gz
|
%{_mandir}/man8/chcpu.8.gz
|
||||||
%ifnarch ppc ppc64
|
%ifnarch ppc ppc64
|
||||||
%{_mandir}/man8/mkzimage_cmdline.8.gz
|
%{_mandir}/man8/mkzimage_cmdline.8.gz
|
||||||
|
@ -1,98 +0,0 @@
|
|||||||
From ad442a818c6eefabb8258a9949206e12f2296161 Mon Sep 17 00:00:00 2001
|
|
||||||
From: Karel Zak <kzak@redhat.com>
|
|
||||||
Date: Tue, 19 Sep 2017 12:55:49 +0200
|
|
||||||
Subject: [PATCH] build-sys: add libtinfow check
|
|
||||||
|
|
||||||
It seems some systems differentiate between tinfo and tinfow. And it
|
|
||||||
seems that mix ncursesw and tinfo (wide vs. non-wide char) is problem
|
|
||||||
for the systems.
|
|
||||||
|
|
||||||
Note that for example Fedora have ncursesw as well as ncurses, but
|
|
||||||
only one tinfo library. So, we need fallback this scenario.
|
|
||||||
|
|
||||||
Reported-by: Stanislav Brabec <sbrabec@suse.cz>
|
|
||||||
Signed-off-by: Karel Zak <kzak@redhat.com>
|
|
||||||
---
|
|
||||||
configure.ac | 24 +++++++++---------------
|
|
||||||
m4/ul.m4 | 27 +++++++++++++++++++++++++++
|
|
||||||
2 files changed, 36 insertions(+), 15 deletions(-)
|
|
||||||
|
|
||||||
diff --git a/configure.ac b/configure.ac
|
|
||||||
index c534b49f2..73cf22168 100644
|
|
||||||
--- a/configure.ac
|
|
||||||
+++ b/configure.ac
|
|
||||||
@@ -905,27 +905,21 @@ AC_ARG_WITH([tinfo], AS_HELP_STRING([--without-tinfo], [compile without libtinfo
|
|
||||||
[], [with_tinfo=auto]
|
|
||||||
)
|
|
||||||
have_tinfo=no
|
|
||||||
+have_tinfow=no
|
|
||||||
AS_IF([test "x$with_tinfo" != xno], [
|
|
||||||
- dnl Try pkg-config for libtinfo
|
|
||||||
- PKG_CHECK_MODULES(TINFO, [tinfo], [
|
|
||||||
- dnl pkg-config success
|
|
||||||
- have_tinfo=yes
|
|
||||||
- UL_PKG_STATIC([TINFO_LIBS_STATIC], [tinfo])], [
|
|
||||||
-
|
|
||||||
- dnl If pkg-config failed, fall back to classic searching.
|
|
||||||
- AC_CHECK_LIB([tinfo], [tgetent], [
|
|
||||||
- have_tinfo=yes
|
|
||||||
- TINFO_LIBS="-ltinfo"
|
|
||||||
- TINFO_LIBS_STATIC="-ltinfo"
|
|
||||||
- TINFO_CFLAGS=""])
|
|
||||||
+ AS_IF([test "x$have_ncursesw" = xyes], [
|
|
||||||
+ UL_TINFO_CHECK([tinfow])
|
|
||||||
+ ])
|
|
||||||
+ AS_IF([test "x$have_tinfow" = xno], [
|
|
||||||
+ UL_TINFO_CHECK([tinfo])
|
|
||||||
])
|
|
||||||
])
|
|
||||||
AC_SUBST([TINFO_LIBS])
|
|
||||||
AC_SUBST([TINFO_LIBS_STATIC])
|
|
||||||
AC_SUBST([TINFO_CFLAGS])
|
|
||||||
-AM_CONDITIONAL([HAVE_TINFO], [test "x$have_tinfo" = xyes])
|
|
||||||
-AS_IF([test "x$have_tinfo" = xyes], [
|
|
||||||
- AC_DEFINE(HAVE_LIBTINFO, 1, [Define if libtinfo available.])
|
|
||||||
+AM_CONDITIONAL([HAVE_TINFO], [test "x$have_tinfo" = xyes -o "x$have_tinfow" = xyes])
|
|
||||||
+AS_IF([test "x$have_tinfo" = xyes -o "x$have_tinfow" = xyes], [
|
|
||||||
+ AC_DEFINE(HAVE_LIBTINFO, 1, [Define if libtinfo or libtinfow available.])
|
|
||||||
])
|
|
||||||
|
|
||||||
|
|
||||||
diff --git a/m4/ul.m4 b/m4/ul.m4
|
|
||||||
index cfd2e68fc..351d9cb6b 100644
|
|
||||||
--- a/m4/ul.m4
|
|
||||||
+++ b/m4/ul.m4
|
|
||||||
@@ -498,3 +498,30 @@ AC_DEFUN([UL_NCURSES_CHECK], [
|
|
||||||
AS_IF([test "x$have_[]suffix" = xyes], [NCURSES_LIBS="-l[]suffix"])
|
|
||||||
])
|
|
||||||
])
|
|
||||||
+
|
|
||||||
+dnl
|
|
||||||
+dnl UL_TINFO_CHECK(NAME)
|
|
||||||
+dnl
|
|
||||||
+dnl Initializes $have_<name>, TINFO_LIBS and TINFO_CFLAGS variables.
|
|
||||||
+dnl
|
|
||||||
+dnl The expected <name> is tinfow or tinfo.
|
|
||||||
+dnl
|
|
||||||
+AC_DEFUN([UL_TINFO_CHECK], [
|
|
||||||
+ m4_define([suffix], $1)
|
|
||||||
+ m4_define([SUFFIX], m4_toupper($1))
|
|
||||||
+
|
|
||||||
+ PKG_CHECK_MODULES(SUFFIX, [$1], [
|
|
||||||
+ dnl pkg-config success
|
|
||||||
+ have_[]suffix=yes
|
|
||||||
+ TINFO_LIBS=${SUFFIX[]_LIBS}
|
|
||||||
+ TINFO_CFLAGS=${SUFFIX[]_CFLAGS}
|
|
||||||
+ UL_PKG_STATIC([TINFO_LIBS_STATIC], [$1])
|
|
||||||
+ ],[
|
|
||||||
+ dnl If pkg-config failed, fall back to classic searching.
|
|
||||||
+ AC_CHECK_LIB([$1], [tgetent], [
|
|
||||||
+ have_[]suffix=yes
|
|
||||||
+ TINFO_LIBS="-l[]suffix"
|
|
||||||
+ TINFO_LIBS_STATIC="-l[]suffix"
|
|
||||||
+ TINFO_CFLAGS=""])
|
|
||||||
+ ])
|
|
||||||
+])
|
|
||||||
--
|
|
||||||
2.14.1
|
|
||||||
|
|
@ -1,3 +1,53 @@
|
|||||||
|
-------------------------------------------------------------------
|
||||||
|
Mon Dec 18 15:30:56 CET 2017 - sbrabec@suse.com
|
||||||
|
|
||||||
|
- Update bash completion conflict to cover rfkill file conflict.
|
||||||
|
|
||||||
|
-------------------------------------------------------------------
|
||||||
|
Mon Dec 4 17:28:04 CET 2017 - sbrabec@suse.com
|
||||||
|
|
||||||
|
- lsmem: Add support for zone awareness (bsc#1065471, FATE#324252,
|
||||||
|
util-linux-lsmem-memory-zone-1.patch,
|
||||||
|
util-linux-lsmem-memory-zone-2.patch,
|
||||||
|
util-linux-lsmem-memory-zone-3.patch).
|
||||||
|
- Drop util-linux-losetup-Add-support-for-setting-logical-blocksize.patch.
|
||||||
|
Different implementations exists in the new kernel, and it has
|
||||||
|
a conflicting implementation in util-linux.
|
||||||
|
|
||||||
|
-------------------------------------------------------------------
|
||||||
|
Mon Nov 20 17:29:11 CET 2017 - sbrabec@suse.com
|
||||||
|
|
||||||
|
- Update to version 2.31:
|
||||||
|
* New utilities: uuidparse, rfkill.
|
||||||
|
* su has been refactored and extended to create pseudo terminal
|
||||||
|
(new option --pty, CVE-2016-2779, bsc#968674). This new
|
||||||
|
EXPERIMENTAL feature provides better isolation between root's
|
||||||
|
terminal and an unprivileged su.
|
||||||
|
* libuuid: Improved to match
|
||||||
|
* libuuid, uuidgen: support hash-based UUIDs v3 (md5) and v5
|
||||||
|
(sha1) as specified by RFC-4122. Provide UUID templates for
|
||||||
|
dns, url, oid, or x500.
|
||||||
|
* libblkid: Extended support for DM-integrity, HPE (aka
|
||||||
|
extended-XFS) and UBI superblock. New API to hide already
|
||||||
|
detected signatures.
|
||||||
|
* libfdisk: New API to modify grain, make possible to completely
|
||||||
|
disable dialog driven partitioning.
|
||||||
|
* libsmartcols: New API to move columns.
|
||||||
|
* column: --table-header-repeat to repeat table headers.
|
||||||
|
* libfdisk: Use BLKPG ioctls to inform the kernel about changes.
|
||||||
|
* fdisk: Improved ^C and ^D behavior.
|
||||||
|
* cfdisk: Dialog to resize partition.
|
||||||
|
* look: Follow the WORDLIST environment variable.
|
||||||
|
* losetup: Added support for --sector-size (FATE#319010).
|
||||||
|
* script: Follow the usual semantics for stop/continue signals.
|
||||||
|
* setpriv: New command line options --ambient-caps and
|
||||||
|
--init-groups.
|
||||||
|
* hwclock: Reduce system shutdown times, log --systz when using
|
||||||
|
libaudit.
|
||||||
|
* Other bug fixes.
|
||||||
|
- Drop upstreamed util-linux-use-tinfow.patch.
|
||||||
|
- Refreshed make-sure-sbin-resp-usr-sbin-are-in-PATH.diff.
|
||||||
|
|
||||||
-------------------------------------------------------------------
|
-------------------------------------------------------------------
|
||||||
Thu Sep 21 14:41:01 UTC 2017 - jengelh@inai.de
|
Thu Sep 21 14:41:01 UTC 2017 - jengelh@inai.de
|
||||||
|
|
||||||
|
@ -116,7 +116,7 @@ BuildRequires: libmount-devel
|
|||||||
%endif
|
%endif
|
||||||
%endif
|
%endif
|
||||||
#END SECOND STAGE DEPENDENCIES
|
#END SECOND STAGE DEPENDENCIES
|
||||||
Version: 2.30.1
|
Version: 2.31
|
||||||
Release: 0
|
Release: 0
|
||||||
# util-linux is a base package and uuidd pre-requiring pwdutils pulls
|
# util-linux is a base package and uuidd pre-requiring pwdutils pulls
|
||||||
# that into the core build cycle. pwdutils also pulls in the whole
|
# that into the core build cycle. pwdutils also pulls in the whole
|
||||||
@ -125,7 +125,7 @@ Release: 0
|
|||||||
# these tools as well
|
# these tools as well
|
||||||
#!BuildIgnore: pwdutils
|
#!BuildIgnore: pwdutils
|
||||||
Url: https://www.kernel.org/pub/linux/utils/util-linux/
|
Url: https://www.kernel.org/pub/linux/utils/util-linux/
|
||||||
Source: https://www.kernel.org/pub/linux/utils/util-linux/v2.30/util-linux-%{version}.tar.xz
|
Source: https://www.kernel.org/pub/linux/utils/util-linux/v%{version}/util-linux-%{version}.tar.xz
|
||||||
Source1: util-linux-rpmlintrc
|
Source1: util-linux-rpmlintrc
|
||||||
Source4: raw.service
|
Source4: raw.service
|
||||||
Source5: etc.raw
|
Source5: etc.raw
|
||||||
@ -135,7 +135,7 @@ Source8: login.pamd
|
|||||||
Source9: remote.pamd
|
Source9: remote.pamd
|
||||||
Source10: su.pamd
|
Source10: su.pamd
|
||||||
Source11: su.default
|
Source11: su.default
|
||||||
Source12: https://www.kernel.org/pub/linux/utils/util-linux/v2.30/util-linux-%{version}.tar.sign
|
Source12: https://www.kernel.org/pub/linux/utils/util-linux/v%{version}/util-linux-%{version}.tar.sign
|
||||||
Source13: %{_name}.keyring
|
Source13: %{_name}.keyring
|
||||||
Source14: runuser.pamd
|
Source14: runuser.pamd
|
||||||
# klogconsole, http://opensuse.github.com/kiwi, 7.02.25, git 859dc050
|
# klogconsole, http://opensuse.github.com/kiwi, 7.02.25, git 859dc050
|
||||||
@ -155,10 +155,12 @@ Source51: blkid.conf
|
|||||||
##
|
##
|
||||||
# PATCH-EXTEND-UPSTREAM: Let `su' handle /sbin and /usr/sbin in path
|
# PATCH-EXTEND-UPSTREAM: Let `su' handle /sbin and /usr/sbin in path
|
||||||
Patch0: 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.
|
# PATCH-FEATURE-UPSTREAM util-linux-lsmem-memory-zone-1.patch bsc1065471 FATE324252 sbrabec@suse.com -- lsmem: Add support for zone awareness.
|
||||||
Patch1: util-linux-losetup-Add-support-for-setting-logical-blocksize.patch
|
Patch1: util-linux-lsmem-memory-zone-1.patch
|
||||||
# PATCH-FIX-UPSTREAM util-linux-use-tinfow.patch bsc#1056171 sbrabec@suse.com -- Link against tinfow instead of tinfo.
|
# PATCH-FEATURE-UPSTREAM util-linux-lsmem-memory-zone-2.patch bsc1065471 FATE324252 sbrabec@suse.com -- lsmem: Add support for zone awareness.
|
||||||
Patch2: util-linux-use-tinfow.patch
|
Patch2: util-linux-lsmem-memory-zone-2.patch
|
||||||
|
# PATCH-FEATURE-UPSTREAM util-linux-lsmem-memory-zone-3.patch bsc1065471 FATE324252 sbrabec@suse.com -- lsmem: Add support for zone awareness.
|
||||||
|
Patch3: util-linux-lsmem-memory-zone-3.patch
|
||||||
BuildRoot: %{_tmppath}/%{name}-%{version}-build
|
BuildRoot: %{_tmppath}/%{name}-%{version}-build
|
||||||
#
|
#
|
||||||
%if %build_util_linux
|
%if %build_util_linux
|
||||||
@ -173,10 +175,13 @@ PreReq: %install_info_prereq permissions
|
|||||||
Recommends: %{name}-lang = %{version}
|
Recommends: %{name}-lang = %{version}
|
||||||
Provides: eject = 2.1.0-166.8
|
Provides: eject = 2.1.0-166.8
|
||||||
Provides: login = 4.0-33.7
|
Provides: login = 4.0-33.7
|
||||||
|
Provides: rfkill = 0.5-8.6
|
||||||
# File conflict of eject (up to 12.3 and SLE11).
|
# File conflict of eject (up to 12.3 and SLE11).
|
||||||
Obsoletes: eject < 2.1.0-166.8
|
Obsoletes: eject < 2.1.0-166.8
|
||||||
# File conflict of login (up to 12.1 and SLE11).
|
# File conflict of login (up to 12.1 and SLE11).
|
||||||
Obsoletes: login < 4.0-33.7
|
Obsoletes: login < 4.0-33.7
|
||||||
|
# File confluct (man page) of rfkill (up to Leap 15 and SLE 15).
|
||||||
|
Obsoletes: rfkill < 0.5-8.6
|
||||||
# File conflict of su and kill (up to 12.3 and SLE11).
|
# File conflict of su and kill (up to 12.3 and SLE11).
|
||||||
# It should be coreutils < 8.21-4, but coreutils provide Release-less symbol.
|
# It should be coreutils < 8.21-4, but coreutils provide Release-less symbol.
|
||||||
Conflicts: coreutils < 8.21
|
Conflicts: coreutils < 8.21
|
||||||
@ -184,8 +189,8 @@ Conflicts: coreutils < 8.21
|
|||||||
# File conflict of sulogin and utmpdump (up to 12.3 and SLE11).
|
# File conflict of sulogin and utmpdump (up to 12.3 and SLE11).
|
||||||
Conflicts: sysvinit-tools < 2.88+-87
|
Conflicts: sysvinit-tools < 2.88+-87
|
||||||
%endif
|
%endif
|
||||||
# File conflicts of completion files with <= Leap 42.1 and <= SLE12 SP1 (fixed by SLE12 Update, boo#977259#c3).
|
# rfkill conflicts of completion files with <= Leap 42.3 and < SLE15.
|
||||||
Conflicts: bash-completion <= 2.1-10
|
Conflicts: bash-completion <= 2.7-1.3
|
||||||
# The preset is provided by the presets branding package since 0.4 (bsc#1012850) and since 12.2 in SLE (boo#1029775)
|
# The preset is provided by the presets branding package since 0.4 (bsc#1012850) and since 12.2 in SLE (boo#1029775)
|
||||||
Conflicts: systemd-presets-branding < 12.2
|
Conflicts: systemd-presets-branding < 12.2
|
||||||
# bnc#805684:
|
# bnc#805684:
|
||||||
@ -213,12 +218,6 @@ 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
|
||||||
@ -418,11 +417,9 @@ library.
|
|||||||
%prep
|
%prep
|
||||||
%setup -q -n %{_name}-%{version} -b 40
|
%setup -q -n %{_name}-%{version} -b 40
|
||||||
%patch0 -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
|
%patch1 -p1
|
||||||
%endif
|
|
||||||
%patch2 -p1
|
%patch2 -p1
|
||||||
|
%patch3 -p1
|
||||||
#
|
#
|
||||||
# setctsid
|
# setctsid
|
||||||
cp -p %{S:22} %{S:23} .
|
cp -p %{S:22} %{S:23} .
|
||||||
@ -557,6 +554,8 @@ AUTOPOINT=true autoreconf -vfi
|
|||||||
--disable-silent-rules \
|
--disable-silent-rules \
|
||||||
--localstatedir=/run \
|
--localstatedir=/run \
|
||||||
--docdir=%{_docdir}/%{_name} \
|
--docdir=%{_docdir}/%{_name} \
|
||||||
|
--disable-makeinstall-chown \
|
||||||
|
--disable-makeinstall-setuid \
|
||||||
--with-audit \
|
--with-audit \
|
||||||
--with-btrfs \
|
--with-btrfs \
|
||||||
--with-gnu-ld \
|
--with-gnu-ld \
|
||||||
@ -993,6 +992,7 @@ getent passwd uuidd >/dev/null || \
|
|||||||
%{_bindir}/rename
|
%{_bindir}/rename
|
||||||
%{_bindir}/renice
|
%{_bindir}/renice
|
||||||
%{_bindir}/rev
|
%{_bindir}/rev
|
||||||
|
%{_bindir}/rfkill
|
||||||
%{_bindir}/script
|
%{_bindir}/script
|
||||||
%{_bindir}/scriptreplay
|
%{_bindir}/scriptreplay
|
||||||
%{_bindir}/setarch
|
%{_bindir}/setarch
|
||||||
@ -1005,6 +1005,7 @@ getent passwd uuidd >/dev/null || \
|
|||||||
%{_bindir}/mountpoint
|
%{_bindir}/mountpoint
|
||||||
%{_bindir}/utmpdump
|
%{_bindir}/utmpdump
|
||||||
%{_bindir}/uuidgen
|
%{_bindir}/uuidgen
|
||||||
|
%{_bindir}/uuidparse
|
||||||
%{_bindir}/uname26
|
%{_bindir}/uname26
|
||||||
%ifnarch ppc ppc64
|
%ifnarch ppc ppc64
|
||||||
%{_bindir}/chrp-addnote
|
%{_bindir}/chrp-addnote
|
||||||
@ -1108,6 +1109,7 @@ getent passwd uuidd >/dev/null || \
|
|||||||
%{_mandir}/man1/utmpdump.1.gz
|
%{_mandir}/man1/utmpdump.1.gz
|
||||||
%{_mandir}/man1/runuser.1.gz
|
%{_mandir}/man1/runuser.1.gz
|
||||||
%{_mandir}/man1/uuidgen.1.gz
|
%{_mandir}/man1/uuidgen.1.gz
|
||||||
|
%{_mandir}/man1/uuidparse.1.gz
|
||||||
%{_mandir}/man5/fstab.5.gz
|
%{_mandir}/man5/fstab.5.gz
|
||||||
%{_mandir}/man5/terminal-colors.d.5.gz
|
%{_mandir}/man5/terminal-colors.d.5.gz
|
||||||
%{_mandir}/man8/addpart.8.gz
|
%{_mandir}/man8/addpart.8.gz
|
||||||
@ -1142,6 +1144,7 @@ getent passwd uuidd >/dev/null || \
|
|||||||
%{_mandir}/man8/fsfreeze.8.gz
|
%{_mandir}/man8/fsfreeze.8.gz
|
||||||
%{_mandir}/man8/swaplabel.8.gz
|
%{_mandir}/man8/swaplabel.8.gz
|
||||||
%{_mandir}/man8/readprofile.8.gz
|
%{_mandir}/man8/readprofile.8.gz
|
||||||
|
%{_mandir}/man8/rfkill.8.gz
|
||||||
%{_mandir}/man8/chcpu.8.gz
|
%{_mandir}/man8/chcpu.8.gz
|
||||||
%ifnarch ppc ppc64
|
%ifnarch ppc ppc64
|
||||||
%{_mandir}/man8/mkzimage_cmdline.8.gz
|
%{_mandir}/man8/mkzimage_cmdline.8.gz
|
||||||
|
Loading…
Reference in New Issue
Block a user