3
0
forked from pool/util-linux

Accepting request 245630 from Base:System

- Update to version 2.25
  (using work of Ruediger Meier <sweet_f_a@gmx.de>):
  * based on the git master branch of util-linux
  * many fixes (including bnc#869355, bnc#871951 and
    bnc#871698#c49)
  * new Python binding sub-package for libmount: python-libmount
  * new library: libsmartcols
  * new commands: lslogins, setpriv
  * add fstrim systemd timer
  * better systemd integration
  * DROPPED command:
    * cytune: Upstream decided to remove tool untested for years
      that supports this old hardware.
- Dropped patches included in the upstream:
    (*git) Included with no changes
    (+git) Included with improvements
    (!git) Included with differences
  * support-other-tty-lines-not-vconsole.patch           (*b9c7390)
  * agetty-fooled-on-serial-line-due-plymouth.patch,
  * sulogin-fooled-on-tty-line-due-plymouth.patch        (*bb280f7)
  * agetty-on-s390-on-dev-3270-tty1-line.patch           (*f2bcda5)
  * sulogin-does-not-find-any-console.patch              (*624b204)
  * util-linux-setarch-uname26.patch                     (*f6eb160)
  * util-linux-ng-2.16-squashfs3-detect.patch            (*11402f5)
  * util-linux-lscpu-improve-hypervisor-detection.patch
                     (!b774473, b32488c, 5bd31c6, 0f0c558, 96ce475)
    WARNING, INCOMPATIBLE CHANGE: "lscpu -p" no more reports
    hypervisor, as it breaks standard behavior. Use standard output
    instead! (FATE#310255)
  * blkid-stop-scanning-on-I-O-error.patch               (+296d96e)

OBS-URL: https://build.opensuse.org/request/show/245630
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/util-linux?expand=0&rev=189
This commit is contained in:
Stephan Kulow 2014-08-25 10:59:47 +00:00 committed by Git OBS Bridge
commit 092f8a133f
32 changed files with 11310 additions and 3902 deletions

View File

@ -1,153 +0,0 @@
Even with TTYReset=no it seems with systemd or plymouth the termios
flags become changed from under the first agetty on a serial system
console as the flags are locked.
---
agetty.c | 75 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++------
1 file changed, 68 insertions(+), 7 deletions(-)
--- term-utils/agetty.c
+++ term-utils/agetty.c 2014-03-05 17:52:32.574235616 +0000
@@ -20,6 +20,7 @@
#include <sys/ioctl.h>
#include <sys/types.h>
#include <sys/stat.h>
+#include <sys/wait.h>
#include <fcntl.h>
#include <stdarg.h>
#include <ctype.h>
@@ -276,13 +277,15 @@ static void log_warn (const char *, ...)
static ssize_t append(char *dest, size_t len, const char *sep, const char *src);
static void check_username (const char* nm);
static void login_options_to_argv(char *argv[], int *argc, char *str, char *username);
+static int plymouth_command(const char* arg);
/* Fake hostname for ut_host specified on command line. */
static char *fakehost;
#ifdef DEBUGGING
+# include "closestream.h"
# ifndef DEBUG_OUTPUT
-# define DEBUG_OUTPUT "/dev/ttyp0"
+# define DEBUG_OUTPUT "/dev/tty10"
# endif
# define debug(s) do { fprintf(dbf,s); fflush(dbf); } while (0)
FILE *dbf;
@@ -320,8 +323,12 @@ int main(int argc, char **argv)
#ifdef DEBUGGING
dbf = fopen(DEBUG_OUTPUT, "w");
- for (int i = 1; i < argc; i++)
+ for (int i = 1; i < argc; i++) {
+ if (i > 1)
+ debug(" ");
debug(argv[i]);
+ }
+ debug("\n");
#endif /* DEBUGGING */
/* Parse command-line arguments. */
@@ -473,7 +480,6 @@ int main(int argc, char **argv)
if (options.osrelease)
free(options.osrelease);
#ifdef DEBUGGING
- fprintf(dbf, "read %c\n", ch);
if (close_stream(dbf) != 0)
log_err("write failed: %s", DEBUG_OUTPUT);
#endif
@@ -1104,6 +1110,27 @@ static void termio_init(struct options *
{
speed_t ispeed, ospeed;
struct winsize ws;
+ struct termios lock;
+ int i = (plymouth_command("--ping") == 0) ? 30 : 0;
+
+ while (i-- > 0) {
+ /*
+ * Even with TTYReset=no it seems with systemd or plymouth
+ * the termios flags become changed from under the first
+ * agetty on a serial system console as the flags are locked.
+ */
+ memset(&lock, 0, sizeof(struct termios));
+ if (ioctl(STDIN_FILENO, TIOCGLCKTRMIOS, &lock) < 0)
+ break;
+ if (!lock.c_iflag && !lock.c_oflag && !lock.c_cflag && !lock.c_lflag)
+ break;
+ debug("termios locked\n");
+ if (i == 15 && plymouth_command("quit") != 0)
+ break;
+ sleep(1);
+ }
+ memset(&lock, 0, sizeof(struct termios));
+ ioctl(STDIN_FILENO, TIOCSLCKTRMIOS, &lock);
if (op->flags & F_VCONSOLE) {
#if defined(IUTF8) && defined(KDGKBMODE)
@@ -1168,9 +1195,6 @@ static void termio_init(struct options *
* later on.
*/
- /* Flush input and output queues, important for modems! */
- tcflush(STDIN_FILENO, TCIOFLUSH);
-
#ifdef IUTF8
tp->c_iflag = tp->c_iflag & IUTF8;
if (tp->c_iflag & IUTF8)
@@ -1230,8 +1254,11 @@ static void termio_init(struct options *
if (op->flags & F_RTSCTS)
tp->c_cflag |= CRTSCTS;
#endif
+ /* Flush input and output queues, important for modems! */
+ tcflush(STDIN_FILENO, TCIOFLUSH);
- tcsetattr(STDIN_FILENO, TCSANOW, tp);
+ if (tcsetattr(STDIN_FILENO, TCSANOW, tp))
+ log_warn(_("setting terminal attributes failed: %m"));
/* Go to blocking input even in local mode. */
fcntl(STDIN_FILENO, F_SETFL,
@@ -1252,6 +1279,10 @@ static void reset_vc(const struct option
if (tcsetattr(STDIN_FILENO, TCSADRAIN, tp))
log_warn(_("setting terminal attributes failed: %m"));
+
+ /* Go to blocking input even in local mode. */
+ fcntl(STDIN_FILENO, F_SETFL,
+ fcntl(STDIN_FILENO, F_GETFL, 0) & ~O_NONBLOCK);
}
/* Extract baud rate from modem status message. */
@@ -2273,3 +2304,33 @@ err:
log_err(_("checkname failed: %m"));
}
+/*
+ * For the case plymouth is found on this system
+ */
+static int plymouth_command(const char* arg)
+{
+ const char *cmd = "/usr/bin/plymouth";
+ static int has_plymouth = 1;
+ pid_t pid;
+
+ if (!has_plymouth)
+ return 127;
+
+ pid = fork();
+ if (!pid) {
+ int fd = open("/dev/null", O_RDWR);
+ dup2(fd, 0);
+ dup2(fd, 1);
+ dup2(fd, 2);
+ close(fd);
+ execl(cmd, cmd, arg, (char *) NULL);
+ exit(127);
+ } else if (pid > 0) {
+ int status;
+ waitpid(pid, &status, 0);
+ if (status == 127)
+ has_plymouth = 0;
+ return status;
+ }
+ return 1;
+}

View File

@ -1,78 +0,0 @@
---
login-utils/sulogin.c | 8 +++++++-
term-utils/agetty.c | 15 ++++++++++-----
2 files changed, 17 insertions(+), 6 deletions(-)
--- term-utils/agetty.c
+++ term-utils/agetty.c 2014-05-08 08:08:26.384484940 +0000
@@ -51,7 +51,8 @@
# define DEFAULT_VCTERM "linux"
# endif
# if defined (__s390__) || defined (__s390x__)
-# define DEFAULT_TTYS0 "ibm327x"
+# define DEFAULT_TTYS0 "dumb"
+# define DEFAULT_TTY32 "ibm327x"
# define DEFAULT_TTYS1 "vt220"
# endif
# ifndef DEFAULT_STERM
@@ -571,6 +572,8 @@ static void login_options_to_argv(char *
*argc = i;
}
+#define is_speed(str) (strlen((str)) == strspn((str), "0123456789,"))
+
/* Parse command-line arguments. */
static void parse_args(int argc, char **argv, struct options *op)
{
@@ -749,7 +752,7 @@ static void parse_args(int argc, char **
}
/* Accept "tty", "baudrate tty", and "tty baudrate". */
- if ('0' <= argv[optind][0] && argv[optind][0] <= '9') {
+ if (is_speed(argv[optind])) {
/* Assume BSD style speed. */
parse_speeds(op, argv[optind++]);
if (argc < optind + 1) {
@@ -761,7 +764,7 @@ static void parse_args(int argc, char **
op->tty = argv[optind++];
if (argc > optind) {
char *v = argv[optind++];
- if ('0' <= *v && *v <= '9')
+ if (is_speed(v))
parse_speeds(op, v);
else
op->speeds[op->numspeed++] = bcode("9600");
@@ -1071,9 +1074,11 @@ static void open_tty(char *tty, struct t
* higher. Whereas the second serial line on a S/390(x) is
* a real character terminal which is compatible with VT220.
*/
- if (strcmp(op->tty, "ttyS0") == 0)
+ if (strcmp(op->tty, "ttyS0") == 0) /* linux/drivers/s390/char/con3215.c */
op->term = DEFAULT_TTYS0;
- else if (strcmp(op->tty, "ttyS1") == 0)
+ else if (strncmp(op->tty, "3270/tty", 8) == 0) /* linux/drivers/s390/char/con3270.c */
+ op->term = DEFAULT_TTY32;
+ else if (strcmp(op->tty, "ttyS1") == 0) /* linux/drivers/s390/char/sclp_vt220.c */
op->term = DEFAULT_TTYS1;
}
#endif
--- login-utils/sulogin.c
+++ login-utils/sulogin.c 2014-05-08 08:22:38.572781002 +0000
@@ -189,10 +189,16 @@ static void tcfinal(struct console *con)
setenv("TERM", "linux", 1);
return;
}
- if (con->flags & CON_NOTTY)
+ if (con->flags & CON_NOTTY) {
+ setenv("TERM", "dumb", 1);
return;
+ }
+#if defined (__s390__) || defined (__s390x__)
+ setenv("TERM", "dumb", 1);
+#else
setenv("TERM", "vt102", 1);
+#endif
tio = &con->tio;
fd = con->fd;

File diff suppressed because it is too large Load Diff

View File

@ -1,138 +0,0 @@
From 65245d440656a8df4352f9a5b9ec047bf4b6a663 Mon Sep 17 00:00:00 2001
From: Hannes Reinecke <hare@suse.de>
Date: Tue, 21 Jan 2014 09:16:46 +0100
Subject: [PATCH] blkid: stop scanning on I/O error
Whenever we fail to read from a device it's pointless to
continue with probing; we should be failing immediately.
Otherwise the system will continue logging I/O errors.
This patch updates the probe functions to return -1
on error and 1 if not found.
Signed-off-by: Hannes Reinecke <hare@suse.de>
---
libblkid/src/partitions/partitions.c | 13 +++++++++----
libblkid/src/probe.c | 13 +++++++++++--
libblkid/src/superblocks/superblocks.c | 13 ++++++++++---
3 files changed, 30 insertions(+), 9 deletions(-)
diff --git a/libblkid/src/partitions/partitions.c b/libblkid/src/partitions/partitions.c
index 6c915d9..98baece 100644
--- a/libblkid/src/partitions/partitions.c
+++ b/libblkid/src/partitions/partitions.c
@@ -540,7 +540,8 @@ static int idinfo_probe(blkid_probe pr, const struct blkid_idinfo *id,
if (pr->size <= 0 || (id->minsz && id->minsz > pr->size))
goto nothing; /* the device is too small */
- if (blkid_probe_get_idmag(pr, id, &off, &mag))
+ rc = blkid_probe_get_idmag(pr, id, &off, &mag);
+ if (rc != 0)
goto nothing;
/* final check by probing function */
@@ -548,12 +549,13 @@ static int idinfo_probe(blkid_probe pr, const struct blkid_idinfo *id,
DBG(LOWPROBE, blkid_debug(
"%s: ---> call probefunc()", id->name));
rc = id->probefunc(pr, mag);
- if (rc == -1) {
+ if (rc != 0) {
/* reset after error */
reset_partlist(blkid_probe_get_partlist(pr));
if (chn && !chn->binary)
blkid_probe_chain_reset_vals(pr, chn);
- DBG(LOWPROBE, blkid_debug("%s probefunc failed", id->name));
+ DBG(LOWPROBE, blkid_debug("%s probefunc failed, rc %d",
+ id->name, rc));
}
if (rc == 0 && mag && chn && !chn->binary)
rc = blkid_probe_set_magic(pr, off, mag->len,
@@ -599,7 +601,10 @@ static int partitions_probe(blkid_probe pr, struct blkid_chain *chn)
continue;
/* apply checks from idinfo */
- if (idinfo_probe(pr, idinfos[i], chn) != 0)
+ rc = idinfo_probe(pr, idinfos[i], chn);
+ if (rc < 0)
+ return rc;
+ if (rc > 0)
continue;
name = idinfos[i]->name;
diff --git a/libblkid/src/probe.c b/libblkid/src/probe.c
index 4b0c997..452c743 100644
--- a/libblkid/src/probe.c
+++ b/libblkid/src/probe.c
@@ -569,13 +569,17 @@ unsigned char *blkid_probe_get_buffer(blkid_probe pr,
if (!bf) {
ssize_t ret;
- if (blkid_llseek(pr->fd, pr->off + off, SEEK_SET) < 0)
+ if (blkid_llseek(pr->fd, pr->off + off, SEEK_SET) < 0) {
+ errno = 0;
return NULL;
+ }
/* allocate info and space for data by why call */
bf = calloc(1, sizeof(struct blkid_bufinfo) + len);
- if (!bf)
+ if (!bf) {
+ errno = 0;
return NULL;
+ }
bf->data = ((unsigned char *) bf) + sizeof(struct blkid_bufinfo);
bf->len = len;
@@ -587,7 +591,10 @@ unsigned char *blkid_probe_get_buffer(blkid_probe pr,
ret = read(pr->fd, bf->data, len);
if (ret != (ssize_t) len) {
+ DBG(LOWPROBE, blkid_debug("\tbuffer read: return %d error %d", ret, errno));
free(bf);
+ if (ret >= 0 || errno != EIO)
+ errno = 0;
return NULL;
}
list_add_tail(&bf->bufs, &pr->buffers);
@@ -794,6 +801,8 @@ int blkid_probe_get_idmag(blkid_probe pr, const struct blkid_idinfo *id,
off = (mag->kboff + (mag->sboff >> 10)) << 10;
buf = blkid_probe_get_buffer(pr, off, 1024);
+ if (!buf && errno)
+ return -1;
if (buf && !memcmp(mag->magic,
buf + (mag->sboff & 0x3ff), mag->len)) {
DBG(LOWPROBE, blkid_debug("\tmagic sboff=%u, kboff=%ld",
diff --git a/libblkid/src/superblocks/superblocks.c b/libblkid/src/superblocks/superblocks.c
index 565daf2..ad93b4e 100644
--- a/libblkid/src/superblocks/superblocks.c
+++ b/libblkid/src/superblocks/superblocks.c
@@ -380,15 +380,22 @@ static int superblocks_probe(blkid_probe pr, struct blkid_chain *chn)
DBG(LOWPROBE, blkid_debug("[%zd] %s:", i, id->name));
- if (blkid_probe_get_idmag(pr, id, &off, &mag))
+ rc = blkid_probe_get_idmag(pr, id, &off, &mag);
+ if (rc < 0)
+ break;
+ if (rc > 0)
continue;
/* final check by probing function */
if (id->probefunc) {
DBG(LOWPROBE, blkid_debug("\tcall probefunc()"));
- if (id->probefunc(pr, mag) != 0) {
+ rc = id->probefunc(pr, mag);
+ if (rc != 0) {
blkid_probe_chain_reset_vals(pr, chn);
- continue;
+ if (rc < 0)
+ break;
+ else
+ continue;
}
}
--
1.8.1.4

35
pre_checkin.sh Normal file
View File

@ -0,0 +1,35 @@
#!/bin/sh
if test util-linux.spec -ot python-libmount.spec ; then
echo "util-linux.spec is older than python-libmount.spec. Please merge changes manually and call pre-checkin.sh again."
exit 1
fi
if test util-linux.changes -ot python-libmount.changes ; then
echo "util-linux.changes is older than python-libmount.changes. Please merge changes manually and call pre-checkin.sh again."
exit 1
fi
if test util-linux.spec -ot util-linux-systemd.spec ; then
echo "util-linux.spec is older than util-linux-systemd.spec. Please merge changes manually and call pre-checkin.sh again."
exit 1
fi
if test util-linux.changes -ot util-linux-systemd.changes ; then
echo "util-linux.changes is older than util-linux-systemd.changes. Please merge changes manually and call pre-checkin.sh again."
exit 1
fi
sed '
s/spec file for package util-linux/spec file for package python-libmount/;
/^Name:/s/util-linux/python-libmount/;
' <util-linux.spec >python-libmount.spec
sed '
s/spec file for package util-linux/spec file for package util-linux-systemd/;
/^Name:/s/util-linux/util-linux-systemd/;
' <util-linux.spec >util-linux-systemd.spec
cp -a util-linux.changes python-libmount.changes
cp -a util-linux.changes util-linux-systemd.changes
touch util-linux.spec util-linux.changes

3997
python-libmount.changes Normal file

File diff suppressed because it is too large Load Diff

1328
python-libmount.spec Normal file

File diff suppressed because it is too large Load Diff

View File

@ -1,32 +0,0 @@
Enable sulogin to find a suitable console device even if the first line
in /proc/consoles does not have any major and minor number (bnc#862078)
---
sulogin-consoles.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
--- login-utils/sulogin-consoles.c
+++ login-utils/sulogin-consoles.c 2014-02-07 15:47:14.246235487 +0000
@@ -319,7 +319,7 @@ static int detect_consoles_from_proc(str
char fbuf[16 + 1];
DIR *dir = NULL;
FILE *fc = NULL;
- int maj, min, rc = 1;
+ int maj, min, rc = 1, matches;
DBG(dbgprint("trying /proc"));
@@ -332,10 +332,12 @@ static int detect_consoles_from_proc(str
if (!dir)
goto done;
- while (fscanf(fc, "%*s %*s (%16[^)]) %d:%d", fbuf, &maj, &min) == 3) {
+ while ((matches = fscanf(fc, "%*s %*s (%16[^)]) %d:%d", fbuf, &maj, &min)) >= 1) {
char *name;
dev_t comparedev;
+ if (matches != 3)
+ continue;
if (!strchr(fbuf, 'E'))
continue;
comparedev = makedev(maj, min);

View File

@ -1,72 +0,0 @@
Make sure that plymouth does not break sulogin.
---
sulogin.c | 51 ++++++++++++++++++++++++++++++++++++++++++++++++++-
1 file changed, 50 insertions(+), 1 deletion(-)
--- login-utils/sulogin.c
+++ login-utils/sulogin.c 2014-03-05 17:42:40.442235465 +0000
@@ -77,13 +77,62 @@ static volatile sig_atomic_t sigchild;
#endif
/*
+ * For the case plymouth is found on this system
+ */
+static int plymouth_command(const char* arg)
+{
+ const char *cmd = "/usr/bin/plymouth";
+ static int has_plymouth = 1;
+ pid_t pid;
+
+ if (!has_plymouth)
+ return 127;
+
+ pid = fork();
+ if (!pid) {
+ int fd = open("/dev/null", O_RDWR);
+ dup2(fd, 0);
+ dup2(fd, 1);
+ dup2(fd, 2);
+ close(fd);
+ execl(cmd, cmd, arg, (char *) NULL);
+ exit(127);
+ } else if (pid > 0) {
+ int status;
+ waitpid(pid, &status, 0);
+ if (status == 127)
+ has_plymouth = 0;
+ return status;
+ }
+ return 1;
+}
+
+/*
* Fix the tty modes and set reasonable defaults.
*/
static void tcinit(struct console *con)
{
int mode = 0, flags = 0;
struct termios *tio = &con->tio;
- int fd = con->fd;
+ struct termios lock;
+ int fd = con->fd, i = (plymouth_command("--ping")) ? 20 : 0;
+
+ while (i-- > 0) {
+ /*
+ * With plymouth the termios flags become changed after this
+ * function had changed the termios.
+ */
+ memset(&lock, 0, sizeof(struct termios));
+ if (ioctl(fd, TIOCGLCKTRMIOS, &lock) < 0)
+ break;
+ if (!lock.c_iflag && !lock.c_oflag && !lock.c_cflag && !lock.c_lflag)
+ break;
+ if (i == 15 && plymouth_command("quit") != 0)
+ break;
+ sleep(1);
+ }
+ memset(&lock, 0, sizeof(struct termios));
+ ioctl(fd, TIOCSLCKTRMIOS, &lock);
errno = 0;

View File

@ -1,104 +0,0 @@
---
login-utils/sulogin.c | 17 ++++++++++++-----
term-utils/agetty.c | 23 +++++++++++------------
2 files changed, 23 insertions(+), 17 deletions(-)
--- login-utils/sulogin.c
+++ login-utils/sulogin.c 2014-05-08 08:01:13.102622002 +0000
@@ -49,6 +49,11 @@
# include <selinux/get_context_list.h>
#endif
+#ifdef __linux__
+# include <sys/kd.h>
+# include <sys/param.h>
+#endif
+
#include "c.h"
#include "closestream.h"
#include "nls.h"
@@ -142,10 +147,14 @@ static void tcinit(struct console *con)
return;
}
- /* Handle serial lines here */
- if (ioctl(fd, TIOCMGET, (char *) &mode) == 0) {
+ /* Handle lines other than virtual consoles here */
+#if defined(KDGKBMODE)
+ if (ioctl(fd, KDGKBMODE, &mode) < 0)
+#endif
+ {
speed_t ispeed, ospeed;
struct winsize ws;
+ errno = 0;
/* this is a modem line */
con->flags |= CON_SERIAL;
@@ -191,9 +200,7 @@ static void tcinit(struct console *con)
goto setattr;
}
#if defined(IUTF8) && defined(KDGKBMODE)
- /* Detect mode of current keyboard setup, e.g. for UTF-8 */
- if (ioctl(fd, KDGKBMODE, &mode) < 0)
- mode = K_RAW;
+ /* Handle mode of current keyboard setup, e.g. for UTF-8 */
switch(mode) {
case K_UNICODE:
setlocale(LC_CTYPE, "C.UTF-8");
--- term-utils/agetty.c
+++ term-utils/agetty.c 2014-05-08 08:02:16.786235584 +0000
@@ -139,6 +139,7 @@ struct options {
int nice; /* Run login with this priority */
int numspeed; /* number of baud rates to try */
int clocal; /* CLOCAL_MODE_* */
+ int kbmode; /* Keyboard mode if virtual console */
speed_t speeds[MAX_SPEED]; /* baud rates to be tried */
};
@@ -936,7 +937,7 @@ static void update_utmp(struct options *
static void open_tty(char *tty, struct termios *tp, struct options *op)
{
const pid_t pid = getpid();
- int serial, closed = 0;
+ int closed = 0;
/* Set up new standard input, unless we are given an already opened port. */
@@ -1080,15 +1081,18 @@ static void open_tty(char *tty, struct t
#endif
/*
* Detect if this is a virtual console or serial/modem line.
- * In case of a virtual console the ioctl TIOCMGET fails and
- * the error number will be set to EINVAL.
+ * In case of a virtual console the ioctl KDGKBMODE succeeds
+ * whereas on other lines it will fails.
*/
- if (ioctl(STDIN_FILENO, TIOCMGET, &serial) < 0 && (errno == EINVAL)) {
+ if (ioctl(STDIN_FILENO, KDGKBMODE, &op->kbmode) == 0) {
op->flags |= F_VCONSOLE;
if (!op->term)
op->term = DEFAULT_VCTERM;
- } else if (!op->term)
- op->term = DEFAULT_STERM;
+ } else {
+ op->kbmode = K_RAW;
+ if (!op->term)
+ op->term = DEFAULT_STERM;
+ }
setenv("TERM", op->term, 1);
}
@@ -1122,12 +1126,7 @@ static void termio_init(struct options *
if (op->flags & F_VCONSOLE) {
#if defined(IUTF8) && defined(KDGKBMODE)
- int mode;
-
- /* Detect mode of current keyboard setup, e.g. for UTF-8 */
- if (ioctl(STDIN_FILENO, KDGKBMODE, &mode) < 0)
- mode = K_RAW;
- switch(mode) {
+ switch(op->kbmode) {
case K_UNICODE:
setlocale(LC_CTYPE, "C.UTF-8");
op->flags |= F_UTF8;

View File

@ -1,13 +0,0 @@
--- util-linux-2.23.1/sys-utils/Makemodule.am
+++ util-linux-2.23.1/sys-utils/Makemodule.am 2013-06-05 12:55:10.921439066 +0000
@@ -142,8 +142,8 @@ endif # LINUX
if BUILD_EJECT
usrbin_exec_PROGRAMS += eject
eject_SOURCES = sys-utils/eject.c
-eject_LDADD = $(LDADD) libmount.la libcommon.la
-eject_CFLAGS = $(AM_CFLAGS) -I$(ul_libmount_incdir)
+eject_LDADD = $(SUID_LDFLAGS) $(LDADD) libmount.la libcommon.la
+eject_CFLAGS = $(SUID_CFLAGS) $(AM_CFLAGS) -I$(ul_libmount_incdir)
dist_man_MANS += sys-utils/eject.1
endif

View File

@ -1,18 +0,0 @@
--- util-linux-2.24/libfdisk/src/dos.c.orig 2013-10-21 11:22:29.810014709 +0200
+++ util-linux-2.24/libfdisk/src/dos.c 2013-11-13 23:57:27.535962925 +0100
@@ -1107,6 +1107,7 @@
/* compute logical ending (c, h, s) */
long2chs(cxt, dos_partition_get_start(p) + dos_partition_get_size(p) - 1, &lec, &leh, &les);
+#if 0
/* Same physical / logical beginning? */
if (cxt->geom.cylinders <= 1024
&& (pbc != lbc || pbh != lbh || pbs != lbs)) {
@@ -1117,6 +1118,7 @@
pbc, pbh, pbs,
lbc, lbh, lbs);
}
+#endif
/* Same physical / logical ending? */
if (cxt->geom.cylinders <= 1024

View File

@ -1,17 +0,0 @@
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1
iQIcBAABAgAGBQJTWOMEAAoJEOS3HV7sOcKENCYP+wbqkV8Oj9rfvgQguiN7hFje
xGshx7s7R4q3ZOK3k7Iw6yln0vT/XWAieEmuy1SIitsQ7GWe81qMloJ85hGKeryQ
G6U/+T5RX3F3bpGBGAMrQ8Z1VM85+6Q84g4LbXK9QclVNpdYuIF68hs5KWjSlx+R
GhH87GpEVIskpTlNE7UmEGoxYm5sdmwb3pIg04SkVFPtvjlRxlTgL5uLjNc1d2tW
XVKgflMD6RLX/OeQTpmqPpfE8yQwwi20hph9ISQ/0cHXsp3Ab6Tx+hSZUlujQPZT
7ljuTioRplp0n7tBbE4Fu0r7BqummGgRTA8q1JakOCxs5UGDvhhILjNxf42jpkL4
g++J6M2IoiMPbZlXu3NQEwaTkbIRY4THnWj0SSZtc6WVNdcPggwV8sx9fuzVHYjR
+FPRkPLFMsTYg1FZDFFNHVU0DynzHhCvY2idWEFTUFxou71dS1EMlaF7yu8uHN1R
QJZqfl0K1s76uffnzU3ljTg6ZD6PgVSYrJj85Q4UBUjxz3FLlj7XP9n/rNZszmc0
YGRwmkifdiAh1g5vmax8LRPWs46450XUjd+U+d5NvAfLihtNhwsjlXs+Xqsnk9Do
Aq6IeyoVLO+pi2KRbYEWFzajUhBp5qpcNPjQHXn/1FOTuVFDpMwWhEhHrVb/SYlo
9qhwLq9ab+rI3J7Zgiqh
=JB8F
-----END PGP SIGNATURE-----

View File

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:1243d6c07f1c5b38aa4c3814c81a71c24cba7dafe08942916bf216a90a460ff0
size 3586580

17
util-linux-2.25.tar.sign Normal file
View File

@ -0,0 +1,17 @@
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1
iQIcBAABAgAGBQJTzjJFAAoJEOS3HV7sOcKEYVcQAKNAIwpaYSNL4H3PYVlj/t6p
z5LrX9wD6c0nmNriaK6sqpRbJt7zRt/e9Vzmgs3TkHHsM7F7jq7Zir2erDyN+XRL
AjdDAjdPEbhWLwIOqCApoXirZTx1iv8GBrp/vWWrnk3DEQi30yuZENx5g6BlXVTr
wGNt0cpk2Pm7Qd2VZXFSl/D8wRxedoP4iI4+oNoIE9Z/Hc339qM8GBnptaYc9xCB
1EZdnMEsAZoS/lG/NWW1JPqoVoQzNG8wzVU97xPdTCdZINTaXNJGo5fvMF37mt/D
bIQagMayt6+FLUUGCvTP843gt/P3R5yQmiBwvuRXfnXHCemWZa6eTP4hjI7xdZYC
sV5CG+EUUxm/2R9nuKFaTImMPf7kGywxbWsMb3o09XJ8iDZogLrIFa7cfcdobJw3
4sjFZxQ5SeWc7AJU8331b074VyL3w1eZreSZRX0CAXOYd/4p9k/fbIxLMN99iPd2
3fyWS2WvJ8Y58ZPCeSZw/ZEaXcOpXxd1it3vFoOz5Vhr67IHM4P5CrHB7+WZF4AH
BxsVr2jLKN2GzqOlBn3hKdWW6bDUCwRYEBGdshwtzGy/Sw3lvSXVfeSicYNlmrYD
a5WxujQvjiAf12OA0GydOzR3nBkjcpmwMe9pQypMG8YEIO+3dXYpV3m+WSAMYq1g
eO4GVmg4fthgme1SMXBY
=Et2U
-----END PGP SIGNATURE-----

3
util-linux-2.25.tar.xz Normal file
View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:47ba5a8bd8cdd55262699078a5612a95db17966c7f20c43e3fe492c90ce7980a
size 3681308

View File

@ -1,27 +0,0 @@
From 89a0fa3ca57be7440500dd207d96ea1e2908959f Mon Sep 17 00:00:00 2001
From: Ludwig Nussel <ludwig.nussel@suse.de>
Date: Wed, 20 Jun 2012 10:56:05 +0200
Subject: [PATCH] UGLY HACK: boot.localfs parses mount ouput and needs source
rather than target
---
sys-utils/mount.c | 3 +++
1 files changed, 3 insertions(+), 0 deletions(-)
diff --git a/sys-utils/mount.c b/sys-utils/mount.c
index 8706716..b28d67a 100644
--- a/sys-utils/mount.c
+++ b/sys-utils/mount.c
@@ -166,6 +166,9 @@ static int mount_all(struct libmnt_context *cxt)
while (mnt_context_next_mount(cxt, itr, &fs, &mntrc, &ignored) == 0) {
const char *tgt = mnt_fs_get_target(fs);
+ if (getenv("MOUNT_PRINT_SOURCE")) {
+ tgt = mnt_fs_get_srcpath(fs);
+ }
if (ignored) {
if (mnt_context_is_verbose(cxt))
--
1.7.7

View File

@ -0,0 +1,13 @@
Index: util-linux-2.25/bash-completion/Makemodule.am
===================================================================
--- util-linux-2.25.orig/bash-completion/Makemodule.am
+++ util-linux-2.25/bash-completion/Makemodule.am
@@ -122,7 +122,7 @@ endif
if BUILD_FDFORMAT
dist_bashcompletion_DATA += bash-completion/fdformat
endif
-if LINUX
+if BUILD_BLOCKDEV
dist_bashcompletion_DATA += bash-completion/blockdev
endif

View File

@ -1,274 +0,0 @@
This is a backport of patch from master branch.
commit a1ca32fb3862ccac7275d6b342805b6d99f20e39
Author: Lukas Czerner <lczerner@redhat.com>
Date: Tue Dec 3 16:24:44 2013 +0100
libblkid: Identify extN file system properly
Currently when trying to identify extN file system we're playing games
with searching for kernel modules and parsing /proc/filesystem. All of
this just because ext4 module can be used to mount ext3 and ext2 file
systems on recent kernel and also because of ext4dev.
However all of this is not necessary. Ext4 module which does support
mounting ext2 and ext3 file system is able to recognize and mount ext2
and ext3 type so there is no need to disguise it and ext4dev should only
be ever used for testing and not as fallback when other modules are
missing (use -t instead).
This also introduces a bug when in situation that we only have ext4
modules with ext2/ext3 support which is not loaded and we try to mount
ext2 file system we will mount it incorrectly as ext4. This will not
happen if the ext4 module is already loaded.
With this patch we remove all the unnecessary checks and return the real
type of the file system which is on the device. This fixes the issue.
However on the kernel which was not compiled with EXT4_USE_FOR_EXT23
support one would have to provide file system type (-t) to be able to
mount the file system with ext4 driver.
Signed-off-by: Lukas Czerner <lczerner@redhat.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
Index: util-linux-2.24.1/libblkid/src/superblocks/ext.c
===================================================================
--- util-linux-2.24.1.orig/libblkid/src/superblocks/ext.c
+++ util-linux-2.24.1/libblkid/src/superblocks/ext.c
@@ -18,7 +18,6 @@
#endif
#include <time.h>
-#include "linux_version.h"
#include "superblocks.h"
struct ext2_super_block {
@@ -132,140 +131,11 @@ struct ext2_super_block {
#define EXT3_FEATURE_RO_COMPAT_UNSUPPORTED ~EXT3_FEATURE_RO_COMPAT_SUPP
/*
- * Check to see if a filesystem is in /proc/filesystems.
- * Returns 1 if found, 0 if not
- */
-static int fs_proc_check(const char *fs_name)
-{
- FILE *f;
- char buf[80], *cp, *t;
-
- f = fopen("/proc/filesystems", "r" UL_CLOEXECSTR);
- if (!f)
- return 0;
- while (!feof(f)) {
- if (!fgets(buf, sizeof(buf), f))
- break;
- cp = buf;
- if (!isspace(*cp)) {
- while (*cp && !isspace(*cp))
- cp++;
- }
- while (*cp && isspace(*cp))
- cp++;
- if ((t = strchr(cp, '\n')) != NULL)
- *t = 0;
- if ((t = strchr(cp, '\t')) != NULL)
- *t = 0;
- if ((t = strchr(cp, ' ')) != NULL)
- *t = 0;
- if (!strcmp(fs_name, cp)) {
- fclose(f);
- return 1;
- }
- }
- fclose(f);
- return (0);
-}
-
-/*
- * Check to see if a filesystem is available as a module
- * Returns 1 if found, 0 if not
- */
-static int check_for_modules(const char *fs_name)
-{
-#ifdef __linux__
- struct utsname uts;
- FILE *f;
- char buf[1024], *cp;
- int namesz;
-
- if (uname(&uts))
- return 0;
- snprintf(buf, sizeof(buf), "/lib/modules/%s/modules.dep", uts.release);
-
- f = fopen(buf, "r" UL_CLOEXECSTR);
- if (!f)
- return 0;
-
- namesz = strlen(fs_name);
-
- while (!feof(f)) {
- if (!fgets(buf, sizeof(buf), f))
- break;
- if ((cp = strchr(buf, ':')) != NULL)
- *cp = 0;
- else
- continue;
- if ((cp = strrchr(buf, '/')) == NULL)
- continue;
- cp++;
-
- if (!strncmp(cp, fs_name, namesz) &&
- (!strcmp(cp + namesz, ".ko") ||
- !strcmp(cp + namesz, ".ko.gz"))) {
- fclose(f);
- return 1;
- }
- }
- fclose(f);
-#endif /* __linux__ */
- return 0;
-}
-
-/*
* Starting in 2.6.29, ext4 can be used to support filesystems
* without a journal.
*/
#define EXT4_SUPPORTS_EXT2 KERNEL_VERSION(2, 6, 29)
-static int system_supports_ext2(void)
-{
- static time_t last_check = 0;
- static int ret = -1;
- time_t now = time(0);
-
- if (ret != -1 || (now - last_check) < 5)
- return ret;
- last_check = now;
- ret = (fs_proc_check("ext2") || check_for_modules("ext2"));
- return ret;
-}
-
-static int system_supports_ext4(void)
-{
- static time_t last_check = 0;
- static int ret = -1;
- time_t now = time(0);
-
- if (ret != -1 || (now - last_check) < 5)
- return ret;
- last_check = now;
- ret = (fs_proc_check("ext4") || check_for_modules("ext4"));
- return ret;
-}
-
-static int system_supports_ext4dev(void)
-{
- static time_t last_check = 0;
- static int ret = -1;
- time_t now = time(0);
-
- if (ret != -1 || (now - last_check) < 5)
- return ret;
- last_check = now;
- ret = (fs_proc_check("ext4dev") || check_for_modules("ext4dev"));
- return ret;
-}
-
-static int system_supports_ext4_ext2(void)
-{
-#ifdef __linux__
- return get_linux_version() >= EXT4_SUPPORTS_EXT2;
-#else
- return 0;
-#endif
-}
/*
* reads superblock and returns:
* fc = feature_compat
@@ -357,15 +227,6 @@ static int probe_ext2(blkid_probe pr,
(fi & EXT2_FEATURE_INCOMPAT_UNSUPPORTED))
return 1;
- /*
- * If ext2 is not present, but ext4 or ext4dev are, then
- * disclaim we are ext2
- */
- if (!system_supports_ext2() &&
- (system_supports_ext4() || system_supports_ext4dev()) &&
- system_supports_ext4_ext2())
- return 1;
-
ext_get_info(pr, 2, es);
return 0;
}
@@ -408,34 +269,9 @@ static int probe_ext4dev(blkid_probe pr,
if (fi & EXT3_FEATURE_INCOMPAT_JOURNAL_DEV)
return 1;
- /*
- * If the filesystem does not have a journal and ext2 and ext4
- * is not present, then force this to be detected as an
- * ext4dev filesystem.
- */
- if (!(fc & EXT3_FEATURE_COMPAT_HAS_JOURNAL) &&
- !system_supports_ext2() && !system_supports_ext4() &&
- system_supports_ext4dev() &&
- system_supports_ext4_ext2())
- goto force_ext4dev;
-
- /*
- * If the filesystem is marked as OK for use by in-development
- * filesystem code, but ext4dev is not supported, and ext4 is,
- * then don't call ourselves ext4dev, since we should be
- * detected as ext4 in that case.
- *
- * If the filesystem is marked as in use by production
- * filesystem, then it can only be used by ext4 and NOT by
- * ext4dev, so always disclaim we are ext4dev in that case.
- */
- if (le32_to_cpu(es->s_flags) & EXT2_FLAGS_TEST_FILESYS) {
- if (!system_supports_ext4dev() && system_supports_ext4())
- return 1;
- } else
+ if (!(le32_to_cpu(es->s_flags) & EXT2_FLAGS_TEST_FILESYS))
return 1;
-force_ext4dev:
ext_get_info(pr, 4, es);
return 0;
}
@@ -454,22 +290,11 @@ static int probe_ext4(blkid_probe pr,
if (fi & EXT3_FEATURE_INCOMPAT_JOURNAL_DEV)
return 1;
- /*
- * If the filesystem does not have a journal and ext2 is not
- * present, then force this to be detected as an ext2
- * filesystem.
- */
- if (!(fc & EXT3_FEATURE_COMPAT_HAS_JOURNAL) &&
- !system_supports_ext2() && system_supports_ext4() &&
- system_supports_ext4_ext2())
- goto force_ext4;
-
/* Ext4 has at least one feature which ext3 doesn't understand */
if (!(frc & EXT3_FEATURE_RO_COMPAT_UNSUPPORTED) &&
!(fi & EXT3_FEATURE_INCOMPAT_UNSUPPORTED))
return 1;
-force_ext4:
/*
* If the filesystem is a OK for use by in-development
* filesystem code, and ext4dev is supported or ext4 is not
@@ -480,10 +305,8 @@ force_ext4:
* filesystem, then it can only be used by ext4 and NOT by
* ext4dev.
*/
- if (le32_to_cpu(es->s_flags) & EXT2_FLAGS_TEST_FILESYS) {
- if (system_supports_ext4dev() || !system_supports_ext4())
- return 1;
- }
+ if (le32_to_cpu(es->s_flags) & EXT2_FLAGS_TEST_FILESYS)
+ return 1;
ext_get_info(pr, 4, es);
return 0;

View File

@ -1,206 +0,0 @@
Index: util-linux-2.24.1/sys-utils/lscpu.c
===================================================================
--- util-linux-2.24.1.orig/sys-utils/lscpu.c
+++ util-linux-2.24.1/sys-utils/lscpu.c
@@ -32,6 +32,15 @@
#include <stdarg.h>
#include <sys/types.h>
#include <sys/stat.h>
+#include <stdint.h>
+#include <signal.h>
+#include <strings.h>
+#include <setjmp.h>
+#if defined(__x86_64__) || defined(__i386__)
+#ifdef HAVE_sys_io_h
+#include <sys/io.h>
+#endif
+#endif
#include "cpuset.h"
#include "nls.h"
@@ -59,6 +68,7 @@
#define _PATH_PROC_STATUS "/proc/self/status"
#define _PATH_PROC_VZ "/proc/vz"
#define _PATH_PROC_BC "/proc/bc"
+#define _PATH_PROC_DEVICETREE "/proc/device-tree"
#define _PATH_DEV_MEM "/dev/mem"
/* virtualization types */
@@ -86,7 +96,28 @@ const char *hv_vendors[] = {
[HYPER_UML] = "User-mode Linux",
[HYPER_INNOTEK] = "Innotek GmbH",
[HYPER_HITACHI] = "Hitachi",
- [HYPER_PARALLELS] = "Parallels"
+ [HYPER_PARALLELS] = "Parallels",
+ [HYPER_VBOX] = "Oracle",
+ [HYPER_OS400] = "OS/400",
+ [HYPER_PHYP] = "pHyp"
+};
+
+const int hv_vendor_pci[] = {
+ [HYPER_NONE] = 0x0000,
+ [HYPER_XEN] = 0x5853,
+ [HYPER_KVM] = 0x0000,
+ [HYPER_MSHV] = 0x1414,
+ [HYPER_VMWARE] = 0x15ad,
+ [HYPER_VBOX] = 0x80ee
+};
+
+const int hv_graphics_pci[] = {
+ [HYPER_NONE] = 0x0000,
+ [HYPER_XEN] = 0x0001,
+ [HYPER_KVM] = 0x0000,
+ [HYPER_MSHV] = 0x5353,
+ [HYPER_VMWARE] = 0x0710,
+ [HYPER_VBOX] = 0xbeef
};
/* CPU modes */
@@ -550,10 +581,111 @@ read_hypervisor_cpuid(struct lscpu_desc
desc->hyper = HYPER_VMWARE;
}
+#define VMWARE_BDOOR_MAGIC 0x564D5868
+#define VMWARE_BDOOR_PORT 0x5658
+#define VMWARE_BDOOR_CMD_GETVERSION 10
+
+#define VMWARE_BDOOR(eax, ebx, ecx, edx) \
+ __asm__("inl (%%dx)" : \
+ "=a"(eax), "=c"(ecx), "=d"(edx), "=b"(ebx) : \
+ "0"(VMWARE_BDOOR_MAGIC), "1"(VMWARE_BDOOR_CMD_GETVERSION), \
+ "2"(VMWARE_BDOOR_PORT), "3"(0) : \
+ "memory");
+
+static jmp_buf segv_handler_env;
+
+static void
+segv_handler(int sig, siginfo_t *info, void *ignored)
+{
+ siglongjmp(segv_handler_env, 1);
+}
+
+static int
+is_vmware_platform(void)
+{
+ uint32_t eax, ebx, ecx, edx;
+ struct sigaction act, oact;
+
+ /*
+ * The assembly routine for vmware detection works
+ * fine under vmware, even if ran as regular user. But
+ * on real HW or under other hypervisors, it segfaults (which is
+ * expected). So we temporarily install SIGSEGV handler to catch
+ * the signal. All this magic is needed because lscpu
+ * isn't supposed to require root privileges.
+ */
+ if (sigsetjmp(segv_handler_env, 1))
+ return 0;
+
+ bzero(&act, sizeof(act));
+ act.sa_sigaction = segv_handler;
+ act.sa_flags = SA_SIGINFO;
+
+ if (sigaction(SIGSEGV, &act, &oact))
+ err(EXIT_FAILURE, _("error: can not set signal handler"));
+
+ VMWARE_BDOOR(eax, ebx, ecx, edx);
+
+ if (sigaction(SIGSEGV, &oact, NULL))
+ err(EXIT_FAILURE, _("error: can not restore signal handler"));
+
+ return eax != (uint32_t)-1 && ebx == VMWARE_BDOOR_MAGIC;
+}
+
#else /* ! __x86_64__ */
static void
read_hypervisor_cpuid(struct lscpu_desc *desc __attribute__((__unused__)))
{
+#ifdef __powerpc__
+ /* powerpc:
+ * IBM iSeries: legacy, if /proc/iSeries exists, its para-virtualized on top of OS/400
+ * IBM pSeries: always has a hypervisor
+ * if partition-name is "full", its kind of "bare-metal": full-system-partition
+ * otherwise its some partition created by Hardware Management Console
+ * in any case, its always some sort of HVM
+ * KVM: "linux,kvm" in /hypervisor/compatible indicates a KVM guest
+ * Xen: not in use, not detected
+ */
+ if (path_exist("/proc/iSeries")) {
+ desc->hyper = HYPER_OS400;
+ desc->virtype = VIRT_FULL;
+ } else if (path_exist(_PATH_PROC_DEVICETREE "/ibm,partition-name")) {
+ FILE *fd;
+ desc->hyper = HYPER_PHYP;
+ desc->virtype = VIRT_FULL;
+ fd = fopen(_PATH_PROC_DEVICETREE "/ibm,partition-name", "r");
+ if (fd) {
+ char buf[256];
+ if (fscanf(fd, "%s", buf) == 1 && !strcmp(buf, "full"))
+ desc->virtype = VIRT_NONE;
+ fclose(fd);
+ }
+ } else if (path_exist(_PATH_PROC_DEVICETREE "/hypervisor/compatible")) {
+ FILE *fd;
+ fd = fopen(_PATH_PROC_DEVICETREE "/hypervisor/compatible", "r");
+ if (fd) {
+ char buf[256];
+ int i;
+ memset(buf, 0, sizeof(buf));
+ fread(buf, sizeof(buf) - 1, 1, fd);
+ fclose(fd);
+ for (i = 0; i < sizeof(buf);) {
+ if (!strcmp(&buf[i], "linux,kvm")) {
+ desc->hyper = HYPER_KVM;
+ desc->virtype = VIRT_FULL;
+ break;
+ }
+ i += strlen(&buf[i]);
+ i++;
+ }
+ }
+ }
+#endif
+}
+
+static int is_vmware_platform(void)
+{
+ return 0;
}
#endif
@@ -588,9 +720,18 @@ read_hypervisor(struct lscpu_desc *desc,
desc->hyper = HYPER_XEN;
/* Xen full-virt on non-x86_64 */
- } else if (has_pci_device(0x5853, 0x0001)) {
+ } else if (has_pci_device( hv_vendor_pci[HYPER_XEN], hv_graphics_pci[HYPER_XEN])) {
desc->hyper = HYPER_XEN;
desc->virtype = VIRT_FULL;
+ } else if (is_vmware_platform()) {
+ desc->hyper = HYPER_VMWARE;
+ desc->virtype = VIRT_FULL;
+ } else if (has_pci_device( hv_vendor_pci[HYPER_VMWARE], hv_graphics_pci[HYPER_VMWARE])) {
+ desc->hyper = HYPER_VMWARE;
+ desc->virtype = VIRT_FULL;
+ } else if (has_pci_device( hv_vendor_pci[HYPER_VBOX], hv_graphics_pci[HYPER_VBOX])) {
+ desc->hyper = HYPER_VBOX;
+ desc->virtype = VIRT_FULL;
/* IBM PR/SM */
} else if (path_exist(_PATH_PROC_SYSINFO)) {
Index: util-linux-2.24.1/sys-utils/lscpu.h
===================================================================
--- util-linux-2.24.1.orig/sys-utils/lscpu.h
+++ util-linux-2.24.1/sys-utils/lscpu.h
@@ -13,7 +13,10 @@ enum {
HYPER_UML,
HYPER_INNOTEK, /* VBOX */
HYPER_HITACHI,
- HYPER_PARALLELS /* OpenVZ/VIrtuozzo */
+ HYPER_PARALLELS, /* OpenVZ/VIrtuozzo */
+ HYPER_VBOX,
+ HYPER_OS400,
+ HYPER_PHYP
};
extern int read_hypervisor_dmi(void);

View File

@ -1,118 +0,0 @@
---
shlibs/blkid/src/superblocks/superblocks.c | 1
shlibs/blkid/src/superblocks/superblocks.h | 1
shlibs/blkid/src/superblocks/squashfs.c | 63 +++++++++++++++++++++++++++---------
3 files changed, 50 insertions(+), 15 deletions(-)
Index: util-linux-2.19/shlibs/blkid/src/superblocks/superblocks.c
===================================================================
--- util-linux-2.19.orig/libblkid/src/superblocks/superblocks.c
+++ util-linux-2.19/libblkid/src/superblocks/superblocks.c
@@ -131,6 +131,7 @@ static const struct blkid_idinfo *idinfo
&oracleasm_idinfo,
&vxfs_idinfo,
&squashfs_idinfo,
+ &squashfs3_idinfo,
&netware_idinfo,
&btrfs_idinfo,
&ubifs_idinfo,
Index: util-linux-2.19/shlibs/blkid/src/superblocks/superblocks.h
===================================================================
--- util-linux-2.19.orig/libblkid/src/superblocks/superblocks.h
+++ util-linux-2.19/libblkid/src/superblocks/superblocks.h
@@ -54,6 +54,7 @@ extern const struct blkid_idinfo luks_id
extern const struct blkid_idinfo highpoint37x_idinfo;
extern const struct blkid_idinfo highpoint45x_idinfo;
extern const struct blkid_idinfo squashfs_idinfo;
+extern const struct blkid_idinfo squashfs3_idinfo;
extern const struct blkid_idinfo netware_idinfo;
extern const struct blkid_idinfo sysv_idinfo;
extern const struct blkid_idinfo xenix_idinfo;
Index: util-linux-2.19/shlibs/blkid/src/superblocks/squashfs.c
===================================================================
--- util-linux-2.19.orig/libblkid/src/superblocks/squashfs.c
+++ util-linux-2.19/libblkid/src/superblocks/squashfs.c
@@ -31,20 +31,46 @@ struct sqsh_super_block {
static int probe_squashfs(blkid_probe pr, const struct blkid_idmag *mag)
{
struct sqsh_super_block *sq;
+ uint16_t major;
+ uint16_t minor;
sq = blkid_probe_get_sb(pr, mag, struct sqsh_super_block);
if (!sq)
return -1;
- if (strcmp(mag->magic, "sqsh") == 0 ||
- strcmp(mag->magic, "qshs") == 0)
- blkid_probe_sprintf_version(pr, "%u.%u",
- sq->s_major,
- sq->s_minor);
- else
- blkid_probe_sprintf_version(pr, "%u.%u",
- swab16(sq->s_major),
- swab16(sq->s_minor));
+ major = le16_to_cpu(sq->s_major);
+ minor = le16_to_cpu(sq->s_minor);
+ if (major < 4)
+ return -1;
+
+ blkid_probe_sprintf_version(pr, "%u.%u", major, minor);
+
+ return 0;
+}
+
+static int probe_squashfs3(blkid_probe pr, const struct blkid_idmag *mag)
+{
+ struct sqsh_super_block *sq;
+ uint16_t major;
+ uint16_t minor;
+
+ sq = blkid_probe_get_sb(pr, mag, struct sqsh_super_block);
+ if (!sq)
+ return -1;
+
+ if (strcmp(mag->magic, "sqsh") == 0) {
+ major = be16_to_cpu(sq->s_major);
+ minor = be16_to_cpu(sq->s_minor);
+ } else {
+ major = le16_to_cpu(sq->s_major);
+ minor = le16_to_cpu(sq->s_minor);
+ }
+
+ if (major > 3)
+ return -1;
+
+ blkid_probe_sprintf_version(pr, "%u.%u", major, minor);
+
return 0;
}
@@ -55,14 +81,21 @@ const struct blkid_idinfo squashfs_idinf
.probefunc = probe_squashfs,
.magics =
{
- { .magic = "sqsh", .len = 4 },
- { .magic = "hsqs", .len = 4 }, /* swap */
-
- /* LZMA version */
- { .magic = "qshs", .len = 4 },
- { .magic = "shsq", .len = 4 }, /* swap */
+ { .magic = "hsqs", .len = 4 },
{ NULL }
}
};
+const struct blkid_idinfo squashfs3_idinfo =
+{
+ .name = "squashfs3",
+ .usage = BLKID_USAGE_FILESYSTEM,
+ .probefunc = probe_squashfs3,
+ .magics =
+ {
+ { .magic = "sqsh", .len = 4 }, /* big endian */
+ { .magic = "hsqs", .len = 4 }, /* little endian */
+ { NULL }
+ }
+};

View File

@ -1,9 +1,11 @@
--- util-linux-2.23.1/libmount/src/context_loopdev.c Index: util-linux/libmount/src/context_loopdev.c
+++ util-linux-2.23.1/libmount/src/context_loopdev.c 2013-06-05 09:44:37.081939564 +0000 ===================================================================
@@ -213,6 +213,9 @@ int mnt_context_setup_loopdev(struct lib --- util-linux.orig/libmount/src/context_loopdev.c
+++ util-linux/libmount/src/context_loopdev.c
@@ -212,6 +212,9 @@ int mnt_context_setup_loopdev(struct lib
if (rc == 0 && (cxt->user_mountflags & MNT_MS_ENCRYPTION) && if (rc == 0 && (cxt->user_mountflags & MNT_MS_ENCRYPTION) &&
mnt_optstr_get_option(optstr, "encryption", &val, &len) == 0) { mnt_optstr_get_option(optstr, "encryption", &val, &len) == 0) {
DBG(CXT, mnt_debug_h(cxt, "encryption no longer supported")); DBG(CXT, ul_debugobj(cxt, "encryption no longer supported"));
+ // XXX: nasty for the lib but there's on better way to give a hint atm + // XXX: nasty for the lib but there's on better way to give a hint atm
+ fprintf(stderr, "mount: encryption no longer supported.\n" + fprintf(stderr, "mount: encryption no longer supported.\n"
+ " Please use /etc/crypttab instead (man 5 crypttab)\n"); + " Please use /etc/crypttab instead (man 5 crypttab)\n");

View File

@ -1,162 +0,0 @@
From 654e902731ea15a3494a3831b78d2b9f1cd1408d Mon Sep 17 00:00:00 2001
From: Ruediger Meier <ruediger.meier@ga-group.nl>
Date: Fri, 16 May 2014 17:01:43 +0200
Subject: [PATCH] Prevent excessive clock drift calculations
Squashed commit of the following:
commit f55b4b45126b657fe02f5f0d3d7fde740e6a6247
Author: Karel Zak <kzak@redhat.com>
Date: Tue May 6 12:51:42 2014 +0200
hwclock: fix typo
Reported-by: Stanislav Brabec <sbrabec@suse.cz>
Signed-off-by: Karel Zak <kzak@redhat.com>
commit db8fc5f37728810bdd5b865ac420c31714e35def
Author: Stanislav Brabec <sbrabec@suse.cz>
Date: Mon May 5 20:49:49 2014 +0200
hwclock: Check drift value in /etc/adjtime
Due to bug in older versions of hwclock, /etc/adjtime can contain
excessive drift value (up to many years per day). Prevent it
from applying.
Signed-off-by: Stanislav Brabec <sbrabec@suse.cz>
commit f196fd1a5f8fff63635fd88b5a0f0bbc96978df2
Author: Stanislav Brabec <sbrabec@suse.cz>
Date: Mon May 5 20:49:29 2014 +0200
hwclock: Prevent excessive drift values
Failure of CMOS battery can cause writing of excessive drift
values (up to many years per day).
This causes excessive hwclock adjustment next time, which may lead
to overflow in calculate_adjustment() (and hang before 4a44a54b).
Prevent this situation, check drift for limits and reset drift to zero
instead.
Steps to reproduce:
mv /etc/adjtime /etc/adjtime.backup
rm /etc/adjtime
hwclock --set --date 2001-01-01\ 01:00:00
changing of /etc/adjtime.
mv /etc/adjtime /etc/adjtime.saved
hwclock --set --date 2001-01-02\ 01:00:01
mv /etc/adjtime.saved /etc/adjtime
echo "======= The /etc/adjtime has a \"correct\" look:"
cat /etc/adjtime
hwclock --debug --systohc --utc
echo "======= The /etc/adjtime now has deeply failed drift value:"
cat /etc/adjtime
mv /etc/adjtime /etc/adjtime.saved
hwclock --set --date 2015-01-01\ 01:00:00
mv /etc/adjtime.saved /etc/adjtime
hwclock --debug --adjust
echo "======= And the last /etc/adjtime:"
cat /etc/adjtime
mv /etc/adjtime.backup /etc/adjtime
hwclock --systohc --utc
Signed-off-by: Stanislav Brabec <sbrabec@suse.cz>
Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
---
sys-utils/hwclock.c | 47 ++++++++++++++++++++++++++++++++++-------------
1 file changed, 34 insertions(+), 13 deletions(-)
diff --git a/sys-utils/hwclock.c b/sys-utils/hwclock.c
index 395b5c3..0abf01f 100644
--- a/sys-utils/hwclock.c
+++ b/sys-utils/hwclock.c
@@ -91,6 +91,11 @@ struct clock_ops *ur;
#define FLOOR(arg) ((arg >= 0 ? (int) arg : ((int) arg) - 1));
+/* Maximal clock adjustment in seconds per day.
+ (adjtime() glibc call has 2145 seconds limit on i386, so it is good enough for us as well,
+ 43219 is a maximal safe value preventing exact_adjustment overflow.) */
+#define MAX_DRIFT 2145.0
+
const char *adj_file_name = NULL;
struct adjtime {
@@ -1008,6 +1013,7 @@ adjust_drift_factor(struct adjtime *adjtime_p,
double adj_days, cal_days;
double exp_drift, unc_drift;
double factor_adjust;
+ double drift_factor;
/* Adjusted time units per hardware time unit */
atime_per_htime = 1.0 + adjtime_p->drift_factor / sec_per_day;
@@ -1033,16 +1039,28 @@ adjust_drift_factor(struct adjtime *adjtime_p,
/* Amount to add to previous drift factor */
factor_adjust = unc_drift / cal_days;
- if (debug)
- printf(_("Clock drifted %.1f seconds in the past "
- "%d seconds in spite of a drift factor of "
- "%f seconds/day.\n"
- "Adjusting drift factor by %f seconds/day\n"),
- unc_drift,
- (int)(nowtime - adjtime_p->last_calib_time),
- adjtime_p->drift_factor, factor_adjust);
-
- adjtime_p->drift_factor += factor_adjust;
+ /* New drift factor */
+ drift_factor = adjtime_p->drift_factor + factor_adjust;
+
+ if (abs(drift_factor) > MAX_DRIFT) {
+ if (debug)
+ printf(_("Clock drift factor was calculated as "
+ "%f seconds/day.\n"
+ "It is far too much. Resetting to zero.\n"),
+ drift_factor);
+ drift_factor = 0;
+ } else {
+ if (debug)
+ printf(_("Clock drifted %.1f seconds in the past "
+ "%d seconds in spite of a drift factor of "
+ "%f seconds/day.\n"
+ "Adjusting drift factor by %f seconds/day\n"),
+ unc_drift,
+ (int)(nowtime - adjtime_p->last_calib_time),
+ adjtime_p->drift_factor, factor_adjust);
+ }
+
+ adjtime_p->drift_factor = drift_factor;
}
adjtime_p->last_calib_time = nowtime;
@@ -1190,9 +1208,12 @@ do_adjustment(struct adjtime *adjtime_p,
adjtime_p->dirty = TRUE;
} else if (adjtime_p->last_adj_time == 0) {
if (debug)
- printf(_
- ("Not setting clock because last adjustment time is zero, "
- "so history is bad."));
+ printf(_("Not setting clock because last adjustment time is zero, "
+ "so history is bad.\n"));
+ } else if (abs(adjtime_p->drift_factor) > MAX_DRIFT) {
+ if (debug)
+ printf(_("Not setting clock because drift factor %f is far too high.\n"),
+ adjtime_p->drift_factor);
} else {
int adjustment;
/* Number of seconds we must insert in the Hardware Clock */
--
1.8.4.5

View File

@ -10,4 +10,5 @@ addFilter(".*W:.*files-duplicate.*/pam/su.*/pam.d/su-l.*")
addFilter(".*W:.*permissions-symlink.*/bin/su.*") addFilter(".*W:.*permissions-symlink.*/bin/su.*")
addFilter(".*W:.*permissions-symlink.*/bin/umount.*") addFilter(".*W:.*permissions-symlink.*/bin/umount.*")
addFilter(".*W:.*permissions-symlink.*/bin/mount.*") addFilter(".*W:.*permissions-symlink.*/bin/mount.*")
# UGLY HACK: rpmlint falsely declares problems with files-attr-not-set
addFilter("W: files-attr-not-set")

View File

@ -1,25 +0,0 @@
Index: util-linux-2.24/sys-utils/setarch.c
===================================================================
--- util-linux-2.24.orig/sys-utils/setarch.c
+++ util-linux-2.24/sys-utils/setarch.c
@@ -146,6 +146,7 @@ set_arch(const char *pers, unsigned long
int perval;
const char *target_arch, *result_arch;
} transitions[] = {
+ {UNAME26, "uname26", NULL},
{PER_LINUX32, "linux32", NULL},
{PER_LINUX, "linux64", NULL},
#if defined(__powerpc__) || defined(__powerpc64__)
Index: util-linux-2.24/sys-utils/Makemodule.am
===================================================================
--- util-linux-2.24.orig/sys-utils/Makemodule.am
+++ util-linux-2.24/sys-utils/Makemodule.am
@@ -89,7 +89,7 @@ usrbin_exec_PROGRAMS += setarch
dist_man_MANS += sys-utils/setarch.8
setarch_SOURCES = sys-utils/setarch.c
-SETARCH_LINKS = linux32 linux64
+SETARCH_LINKS = uname26 linux32 linux64
if ARCH_S390
SETARCH_LINKS += s390 s390x

3997
util-linux-systemd.changes Normal file

File diff suppressed because it is too large Load Diff

1328
util-linux-systemd.spec Normal file

File diff suppressed because it is too large Load Diff

View File

@ -1,3 +1,61 @@
-------------------------------------------------------------------
Fri Aug 8 22:17:29 CEST 2014 - sbrabec@suse.cz
- Update to version 2.25
(using work of Ruediger Meier <sweet_f_a@gmx.de>):
* based on the git master branch of util-linux
* many fixes (including bnc#869355, bnc#871951 and
bnc#871698#c49)
* new Python binding sub-package for libmount: python-libmount
* new library: libsmartcols
* new commands: lslogins, setpriv
* add fstrim systemd timer
* better systemd integration
* DROPPED command:
* cytune: Upstream decided to remove tool untested for years
that supports this old hardware.
- Dropped patches included in the upstream:
(*git) Included with no changes
(+git) Included with improvements
(!git) Included with differences
* support-other-tty-lines-not-vconsole.patch (*b9c7390)
* agetty-fooled-on-serial-line-due-plymouth.patch,
* sulogin-fooled-on-tty-line-due-plymouth.patch (*bb280f7)
* agetty-on-s390-on-dev-3270-tty1-line.patch (*f2bcda5)
* sulogin-does-not-find-any-console.patch (*624b204)
* util-linux-setarch-uname26.patch (*f6eb160)
* util-linux-ng-2.16-squashfs3-detect.patch (*11402f5)
* util-linux-lscpu-improve-hypervisor-detection.patch
(!b774473, b32488c, 5bd31c6, 0f0c558, 96ce475)
WARNING, INCOMPATIBLE CHANGE: "lscpu -p" no more reports
hypervisor, as it breaks standard behavior. Use standard output
instead! (FATE#310255)
* blkid-stop-scanning-on-I-O-error.patch (+296d96e)
* blkid-convert-superblocks-to-new-calling-convention.patch
(+37f4060)
* util-linux-libblkid-ext-probe.patch (*a1ca32f)
* util-linux-hwclock-drift-check.patch (*f196fd1)
* util-linux-hwclock-adjtime-check.patch (*db8fc5f)
- Dropped obsolete patch:
* util-linux-2.23.1-eject-fpie.patch (eject is no more SUID)
* util-linux-2.24-fdisk_remove_bogus_warnings.patch
(upstream fixed it in a different way)
* util-linux-HACK-boot.localfs.diff
(MOUNT_PRINT_SOURCE is no more referenced)
- Ported and renamed:
* util-linux-2.23.1-noenc-suse.diff
-> util-linux-noenc-suse.patch
- Split spec file to three stages:
* util-linux.spec: Everything that do not need python or systemd.
* util-linux-systemd.spec: Stuff that needs systemd:
util-linux-systemd and uuidd
NOTE: Not building systemd-less variants of utilities.
* python-libmount.spec: Just python-libmount
- Move bash-completion files to correct packages.
- Add patch util-linux-bash-completion-blockdev.patch.
- Add hacks to prevent damaging of spec files by format_spec_file
(bnc#891152, also edited util-linux-rpmlintrc).
------------------------------------------------------------------- -------------------------------------------------------------------
Sat Jul 26 11:44:57 UTC 2014 - dimstar@opensuse.org Sat Jul 26 11:44:57 UTC 2014 - dimstar@opensuse.org

1
util-linux.preamble Normal file
View File

@ -0,0 +1 @@
License: GPL-2.0+

View File

@ -0,0 +1,2 @@
Summary: Python bindings for the libmount library
Group: System/Filesystems

View File

@ -22,18 +22,48 @@
%bcond_with enable_last %bcond_with enable_last
Name: util-linux Name: util-linux
%define _name util-linux
# WARNING: After editing this file please call pre_checkin.sh to update spec files:
%define _name util-linux
# To prevent dependency loop in automatic build systems, we want to
# build util-linux in parts. To build all at once, set build_all to 1.
#
# build_util_linux: First stage build builds all except:
# build_util_linux_systemd: Builds util-linux-systemd and uuidd.
# build_python_libmount: Builds python-libmount.
%define build_all 0
%if "%{name}" == "python-libmount"
%define build_util_linux 0
%define build_util_linux_systemd 0
%define build_python_libmount 1
# To prevent dependency loops, verify signature only in third stage.
%define verify_sig 1
%else
%if "%{name}" == "util-linux-systemd"
%define build_util_linux 0
%define build_util_linux_systemd 1
%define build_python_libmount 0
%define verify_sig 0
%else
%if %build_all
%define build_util_linux 1
%define build_util_linux_systemd 1
%define build_python_libmount 1
%define verify_sig 1
%else
%define build_util_linux 1
%define build_util_linux_systemd 0
%define build_python_libmount 0
%define verify_sig 0
%endif
%endif
%endif
BuildRequires: audit-devel BuildRequires: audit-devel
BuildRequires: bc BuildRequires: bc
BuildRequires: binutils-devel BuildRequires: binutils-devel
BuildRequires: fdupes BuildRequires: fdupes
BuildRequires: gettext-devel BuildRequires: gettext-devel
# Use rpmbuild -D 'VERIFY_SIG 1' to verify signature during build or run BuildRequires: libcap-ng-devel
# one-shot check by
# xzcat util-linux-*.tar.xz | \
# sh -x gpg-offline --verify --package=util-linux *.tar.sign -
%if 0%{?VERIFY_SIG}
BuildRequires: gpg-offline
%endif
BuildRequires: libselinux-devel BuildRequires: libselinux-devel
BuildRequires: libsepol-devel BuildRequires: libsepol-devel
BuildRequires: libtool BuildRequires: libtool
@ -41,14 +71,37 @@ BuildRequires: ncurses-devel
BuildRequires: pam-devel BuildRequires: pam-devel
BuildRequires: pkg-config BuildRequires: pkg-config
BuildRequires: readline-devel BuildRequires: readline-devel
BuildRequires: utempter-devel
BuildRequires: zlib-devel
%if %verify_sig
BuildRequires: gpg-offline
%endif
%if %build_util_linux_systemd
%if 0%{?suse_version} <= 1230 %if 0%{?suse_version} <= 1230
BuildRequires: pkgconfig(systemd) BuildRequires: pkgconfig(systemd)
%else %else
BuildRequires: systemd-rpm-macros BuildRequires: systemd-rpm-macros
BuildRequires: pkgconfig(libsystemd-daemon)
BuildRequires: pkgconfig(libsystemd-journal)
%endif %endif
BuildRequires: utempter-devel %endif
BuildRequires: zlib-devel %if %build_python_libmount
Version: 2.24.2 BuildRequires: python-devel
%endif
#BEGIN SECOND STAGE DEPENDENCIES
%if !%build_util_linux
%if %build_util_linux_systemd
BuildRequires: libblkid-devel
BuildRequires: libmount-devel
BuildRequires: libsmartcols-devel
BuildRequires: libuuid-devel
%endif
%if %build_python_libmount
BuildRequires: libmount-devel
%endif
%endif
#END SECOND STAGE DEPENDENCIES
Version: 2.25
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
@ -57,16 +110,17 @@ 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/
Supplements: filesystem(minix) #BEGIN UGLY HACK
Provides: fsck-with-dev-lock = %{version} %if 0
# bnc#651598: # UGLY HACK: Real tags are moved to include file to prevent damage done by format_spec_file. This is just a trap for format_spec_file. (bnc#891152)
Provides: util-linux(fake+no-canonicalize) Summary: TRAP
PreReq: %install_info_prereq permissions
Recommends: %{name}-lang = %{version}
Summary: A collection of basic system utilities
License: GPL-2.0+ License: GPL-2.0+
Group: System/Base Group: System/Base
Source: ftp://ftp.kernel.org/pub/linux/utils/util-linux/v2.24/%{name}-%{version}.tar.xz %endif
# UGLY HACK: License tag is errorneously moved here on every call of format_spec_file. %%include cannot be broken by format_spec_file.
%include %{_sourcedir}/util-linux.preamble
#END UGLY HACK
Source: ftp://ftp.kernel.org/pub/linux/utils/util-linux/v2.25/%{_name}-%{version}.tar.xz
Source1: util-linux-rpmlintrc Source1: util-linux-rpmlintrc
Source4: raw.init Source4: raw.init
Source5: etc.raw Source5: etc.raw
@ -76,8 +130,8 @@ Source8: login.pamd
Source9: remote.pamd Source9: remote.pamd
Source10: su.pamd Source10: su.pamd
Source11: su.default Source11: su.default
Source12: ftp://ftp.kernel.org/pub/linux/utils/util-linux/v2.24/%{name}-%{version}.tar.sign Source12: ftp://ftp.kernel.org/pub/linux/utils/util-linux/v2.25/%{_name}-%{version}.tar.sign
Source13: %{name}.keyring Source13: %{_name}.keyring
# TODO: split to separate package # TODO: split to separate package
Source40: klogconsole.tar.bz2 Source40: klogconsole.tar.bz2
# XXX: Run a program in a new session and with controlling tty # XXX: Run a program in a new session and with controlling tty
@ -90,52 +144,43 @@ Source31: addnote.c
# #
Source50: uuidd.rc Source50: uuidd.rc
Source51: blkid.conf Source51: blkid.conf
# detachec parts of spec file
Source100: util-linux.preamble
Source101: util-linux.util-linux
Source102: util-linux.python-libmount
## ##
## util-linux patches ## util-linux patches
## ##
# 241372 - remove legacy warnings from fdisk
Patch1: util-linux-2.24-fdisk_remove_bogus_warnings.patch
Patch2: util-linux-2.23.1-eject-fpie.patch
# 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 Patch4: make-sure-sbin-resp-usr-sbin-are-in-PATH.diff
# disable encryption # PATCH-FEATURE-SUSE -- Report about disabled encryption to stderr.
Patch12: util-linux-2.23.1-noenc-suse.diff Patch12: util-linux-noenc-suse.patch
# PATCH-FIX-SUSE Be aware that there are e.g. xvc/hvc # PATCH-FIX-UPSTREAM util-linux-bash-completion-blockdev.patch sbrabec@suse.cz -- Fix bash-completion installation.
Patch14: support-other-tty-lines-not-vconsole.patch Patch13: util-linux-bash-completion-blockdev.patch
# PATCH-FIX-SUSE -- Let agetty not be fooled by locked termios srtucture
Patch15: agetty-fooled-on-serial-line-due-plymouth.patch
# PATCH-FIX-SUSE -- Let agetty detect /dev/3270/tty1 as device not as baud rate
Patch16: agetty-on-s390-on-dev-3270-tty1-line.patch
# PATCH-FIX-SUSE -- Make sure that plymouth does not break sulogin
Patch17: sulogin-fooled-on-tty-line-due-plymouth.patch
# PATCH-FIX-SUSE -- sulogin: find suitable console device even if first is not usable
Patch18: sulogin-does-not-find-any-console.patch
# PATCH-FEATURE-SLES util-linux-setarch-uname26.patch fate313476 sbrabec@suse.cz -- Support for uname26 binary.
Patch19: util-linux-setarch-uname26.patch
# hack for boot.localfs
Patch20: util-linux-HACK-boot.localfs.diff
# PATCH-FEATURE-SLES util-linux-ng-2.16-squashfs3-detect.patch bnc666893 mszeredi@suse.cz -- Detect squashfs version <= 3 as squashfs3 and version >= 4 as squashfs.
Patch21: util-linux-ng-2.16-squashfs3-detect.patch
# PATCH-FEATURE-SLES util-linux-lscpu-improve-hypervisor-detection.patch fate310255 puzel@novell.com -- Improve hypervisor detection.
Patch24: util-linux-lscpu-improve-hypervisor-detection.patch
# PATH-FIX-SLES blkid-stop-scanning-on-I-O-error.patch bnc859062 hare@suse.de -- Abort blkid probing on I/O errors
Patch30: blkid-stop-scanning-on-I-O-error.patch
# PATH-FIX-SLES lkid-convert-superblocks-to-new-calling-convention.patch bnc859062 hare@suse.de -- convert blkid probing functions to new calling sequence
Patch31: blkid-convert-superblocks-to-new-calling-convention.patch
# PATH-FIX-UPSTREAM util-linux-libblkid-ext-probe.patch bnc864703 sbrabec@suse.cz -- libblkid: Drop the broken ext2/ext3/ext4 discrimination logic.
Patch32: util-linux-libblkid-ext-probe.patch
# PATCH-FIX-UPSTREAM bnc871698 sbrabec@suse.cz
Patch33: util-linux-prevent-excessive-clock-drift-calculations.patch
## ##
## klogconsole ## klogconsole
## ##
Patch55: klogconsole-quiet.patch Patch55: klogconsole-quiet.patch
Patch56: klogconsole.diff Patch56: klogconsole.diff
BuildRoot: %{_tmppath}/%{name}-%{version}-build BuildRoot: %{_tmppath}/%{name}-%{version}-build
PreReq: %insserv_prereq %fillup_prereq /bin/sed
# #
%if %build_util_linux
Supplements: filesystem(minix)
Provides: fsck-with-dev-lock = %{version}
# bnc#651598:
Provides: util-linux(fake+no-canonicalize)
PreReq: %install_info_prereq permissions
PreReq: %insserv_prereq %fillup_prereq /bin/sed
Recommends: %{name}-lang = %{version}
#BEGIN UGLY HACK
%if 0
# UGLY HACK: Real tags are moved to include file to prevent damage done by format_spec_file. This is just a trap for format_spec_file. (bnc#891152)
Summary: TRAP
Group: System/Base
%endif
# UGLY HACK: Group tag is updated to bad value on every call of format_spec_file. %%include cannot be broken by format_spec_file.
%include %{_sourcedir}/util-linux.util-linux
#END UGLY HACK
%if %{with enable_eject} %if %{with enable_eject}
Provides: eject = 2.1.0-166.8 Provides: eject = 2.1.0-166.8
%endif %endif
@ -170,7 +215,37 @@ Obsoletes: uuid-runtime < %{version}-%{release}
Recommends: adjtimex Recommends: adjtimex
Recommends: time Recommends: time
Recommends: which Recommends: which
%else
# Exact copy of headers below is needed for spec cleaner that does not support
# if condition across preamble and subsequent sections.
%if %build_python_libmount
# Exact copy of the %%package tag from python-libmount section below:
#BEGIN UGLY HACK
%if 0
# UGLY HACK: Real tags are moved to include file to prevent damage done by format_spec_file. This is just a trap for format_spec_file. (bnc#891152)
Summary: TRAP
Group: System/Base
%endif
# UGLY HACK: Group tag is updated to bad value on every call of format_spec_file. %%include cannot be broken by format_spec_file.
%include %{_sourcedir}/util-linux.python-libmount
#END UGLY HACK
%else
%if %build_util_linux_systemd
# Exact copy of the %%package tag from systemd section below:
Summary: A collection of basic systemd utilities
Group: System/Base
Supplements: packageand(util-linux:systemd)
# Split-provides for upgrade from SLE < 12 and openSUSE <= 13.1
Provides: util-linux:/usr/lib/systemd/system/fstrim.service
# Service files are being migrated during the update from SLE < 12 and openSUSE <= 13.1
Conflicts: util-linux < 2.25
%else
# ERROR: No build_* variables are set.
%endif
%endif
%endif
%if %build_util_linux
%description %description
This package contains a large variety of low-level system utilities This package contains a large variety of low-level system utilities
that are necessary for a Linux system to function. It contains the that are necessary for a Linux system to function. It contains the
@ -201,19 +276,6 @@ Requires: libblkid-devel = %{version}
Files needed to develop applications using the library for filesystem Files needed to develop applications using the library for filesystem
detection. detection.
%package -n uuidd
Summary: Helper daemon to guarantee uniqueness of time-based UUIDs
Group: System/Filesystems
PreReq: %fillup_prereq
PreReq: %insserv_prereq
PreReq: permissions
PreReq: pwdutils
%description -n uuidd
The uuidd package contains a userspace daemon (uuidd) which guarantees
uniqueness of time-based UUID generation even at very high rates on
SMP systems.
%package -n libuuid1 %package -n libuuid1
Summary: Library to generate UUIDs Summary: Library to generate UUIDs
Group: System/Filesystems Group: System/Filesystems
@ -252,9 +314,6 @@ Summary: Development files for libmount1
Group: Development/Libraries/C and C++ Group: Development/Libraries/C and C++
Requires: libmount1 = %{version} Requires: libmount1 = %{version}
%description -n libmount-devel
Files to develop applications using the libmount library.
%package -n libmount-devel-static %package -n libmount-devel-static
Summary: Development files for libmount1 Summary: Development files for libmount1
Group: Development/Libraries/C and C++ Group: Development/Libraries/C and C++
@ -263,31 +322,91 @@ Requires: libmount-devel = %{version}
%description -n libmount-devel-static %description -n libmount-devel-static
Files to develop applications using the libmount library. Files to develop applications using the libmount library.
%description -n libmount-devel
Files to develop applications using the libmount library.
%package -n libsmartcols1
Summary: Column-based text sort engine
Group: System/Libraries
%description -n libsmartcols1
Library to sort human readable column-based text output.
%package -n libsmartcols-devel
Summary: Development files for libsmartcols1
Group: Development/Libraries/C and C++
Requires: libsmartcols1 = %{version}
%description -n libsmartcols-devel
Files to develop applications using the libsmartcols library.
%package -n libsmartcols-devel-static
Summary: Development files for libsmartcols1
Group: Development/Libraries/C and C++
Requires: libsmartcols-devel = %{version}
%description -n libsmartcols-devel-static
Files to develop applications using the libsmartcols library.
%lang_package %lang_package
%prep
%if 0%{?VERIFY_SIG}
xzcat %{S:0} | %gpg_verify %{S:12} -
%endif %endif
%setup -q -n %{name}-%{version} -b 40 %if %build_util_linux_systemd
%patch1 -p1 %if %build_util_linux
%patch2 -p1 %package systemd
# Do not forget to copy duplicate of this section to the preamble:
Summary: A collection of basic systemd utilities
Group: System/Base
Supplements: packageand(util-linux:systemd)
# Split-provides for upgrade from SLE < 12 and openSUSE <= 13.1
Provides: util-linux:/usr/lib/systemd/system/fstrim.service
# Service files are being migrated during the update from SLE < 12 and openSUSE <= 13.1
Conflicts: util-linux < 2.25
%description systemd
%else
%description
%endif
This package contains low-level util-linux utilities that use systemd.
%package -n uuidd
Summary: Helper daemon to guarantee uniqueness of time-based UUIDs
Group: System/Filesystems
PreReq: %fillup_prereq
PreReq: %insserv_prereq
PreReq: permissions
PreReq: pwdutils
# uuidd bash-completion moved to a correct package
Conflicts: util-linux < 2.25
%description -n uuidd
The uuidd package contains a userspace daemon (uuidd) which guarantees
uniqueness of time-based UUID generation even at very high rates on
SMP systems.
%endif
%if %build_python_libmount
%if %build_util_linux
%package -n python-libmount
# Do not forget to copy duplicate of this section to the preamble:
Summary: Python bindings for the libmount library
Group: System/Filesystems
%description -n python-libmount
%else
%description
%endif
This package contains the python bindings for util-linux libmount
library.
%endif
%prep
%if %verify_sig
xzcat %{S:0} | %gpg_verify -p %{_name} %{S:12} -
%endif
%setup -q -n %{_name}-%{version} -b 40
%patch4 -p1 %patch4 -p1
%patch12 -p1 %patch12 -p1
%patch14 -p0 %patch13 -p1
%patch15 -p0
%patch16 -p0
%patch17 -p0
%patch18 -p0
%patch19 -p1
#
%patch20 -p1
#
%patch21 -p1
%patch24 -p1
%patch30 -p1
%patch31 -p1
%patch32 -p1
%patch33 -p1
# #
# setctsid # setctsid
cp -p %{S:22} %{S:23} . cp -p %{S:22} %{S:23} .
@ -298,6 +417,7 @@ pushd ../klogconsole
popd popd
%build %build
%if %build_util_linux
pushd ../klogconsole pushd ../klogconsole
# klogconsole build # klogconsole build
make %{?_smp_mflags} CFLAGS="%{optflags}" CC="%{__cc}" make %{?_smp_mflags} CFLAGS="%{optflags}" CC="%{__cc}"
@ -306,6 +426,112 @@ popd
rm -f setctsid rm -f setctsid
make %{?_smp_mflags} setctsid CFLAGS="%{optflags}" CC="%{__cc}" make %{?_smp_mflags} setctsid CFLAGS="%{optflags}" CC="%{__cc}"
# #
#BEGIN SYSTEMD SAFETY CHECK
# With systemd, some utilities are built differently. Keep track of these
# sources to prevent building of systemd-less versions.
#
# WARNING: Never edit following line without doing all suggested in the echo below!
UTIL_LINUX_KNOWN_SYSTEMD_DEPS='./login-utils/lslogins.c ./misc-utils/logger.c ./misc-utils/uuidd.c '
UTIL_LINUX_FOUND_SYSTEMD_DEPS=$(grep -rl 'HAVE_LIBSYSTEMD' . | fgrep '.c' | LC_ALL=C sort | tr '\n' ' ')
if test "$UTIL_LINUX_KNOWN_SYSTEMD_DEPS" != "$UTIL_LINUX_FOUND_SYSTEMD_DEPS" ; then
echo "List of utilities depending on systemd have changed.
Please check the new util-linux-systemd file list, file removal and update of Conflicts for safe update!
Then update configure options to build what needed.
Only then you can safely update following spec file line:
UTIL_LINUX_KNOWN_SYSTEMD_DEPS='$UTIL_LINUX_FOUND_SYSTEMD_DEPS'"
exit 1
fi
#END SYSTEMD SAFETY CHECK
#BEGIN FIRST STAGE MODIFICATIONS
%if !%build_util_linux_systemd
sed -i 's/BUILD_LSLOGINS/FALSE/
s/BUILD_LOGGER/FALSE/
' misc-utils/Makemodule.am login-utils/Makemodule.am bash-completion/Makemodule.am
autoreconf -f -i
%endif
#END FIRST STAGE MODIFICATIONS
%else
#BEGIN SECOND STAGE MODIFICATIONS
# delete all make modules except wanted ones
sed -i '/^include/{
%if %build_python_libmount
/libmount\/Makemodule.am/b 1
%endif
%if %build_util_linux_systemd
# for lslogins
/login-utils/b 1
# for logger and uuidd
/misc-utils/b 1
# for fstrim.service and fstrim.timer
/sys-utils/b 1
# for uninstalled libcommon required by uuidd
/ lib\//b 1
# for bash completions
/bash-completion/b 1
# we always want tests (they are smart enough to skip irrelevant parts)
/tests/b 1
%endif
%if %build_python_libmount
/libmount\/python/b 1
%endif
d
:1
}' Makefile.am libmount/Makemodule.am
%if %build_python_libmount
# trick: we do not want to build libmount, but include subdirs
# We close prefious if FALSE and open new pairing with endif
sed -i '/^if BUILD_LIBMOUNT/d
/^if ENABLE_GTK_DOC/i \
if BUILD_LIBMOUNT
' libmount/Makemodule.am
# Do not install terminal-colors.d.5
sed -i '/dist_man_MANS/d' lib/Makemodule.am
%endif
# disable all make modules except wanted ones
sed -i '/^if BUILD_/{
%if %build_util_linux_systemd
/LSLOGINS/b 1
/LOGGER/b 1
/UUIDD/b 1
/BASH_COMPLETION/b 1
%endif
s/BUILD_.*/FALSE/
:1
}
' libmount/Makemodule.am misc-utils/Makemodule.am login-utils/Makemodule.am sys-utils/Makemodule.am bash-completion/Makemodule.am
%if %build_util_linux_systemd
# trick: we do not want to build fstrim, but we want to install fstrim systemd connectors
# We close prefious if FALSE and open new pairing with endif
sed -i '/^if HAVE_SYSTEMD/i \
endif\
if TRUE
' sys-utils/Makemodule.am
# Do not install terminal-colors.d.5
sed -i '/dist_man_MANS/d' lib/Makemodule.am
%endif
# Use installed first stage libraries
sed -i '
# extra space to not replace pylibmount.la
s/ libmount\.la/ -lmount/g
s/libuuid\.la/-luuid/g
s/libblkid\.la/-lblkid/g
s/libsmartcols\.la/-lsmartcols/g
' libmount/python/Makemodule.am misc-utils/Makemodule.am login-utils/Makemodule.am
# Ignore dependencies on optional (and not built in second stage) libraries
sed -i '
/AM_GNU_GETTEXT/d
s/UL_REQUIRES_BUILD(\[.*\], \[libuuid\])/dnl &/
s/UL_REQUIRES_BUILD(\[.*\], \[libsmartcols\])/dnl &/
' configure.ac
sed -i '
/SUBDIRS =/s/ po//
' Makefile.am
autoreconf -f -i
#END SECOND STAGE MODIFICATIONS
%endif
#
# util-linux itself
#
# Version check for libutempter # Version check for libutempter
# #
uhead=$(find %_includedir -name utempter.h 2>/dev/null) uhead=$(find %_includedir -name utempter.h 2>/dev/null)
@ -315,78 +541,115 @@ then
else else
uhead=--without-utempter uhead=--without-utempter
fi fi
#
# util-linux itself
#
autoreconf -fi
export SUID_CFLAGS="-fpie" export SUID_CFLAGS="-fpie"
export SUID_LDFLAGS="-pie" export SUID_LDFLAGS="-pie"
# override default localstatedir to /run # override default localstatedir to /run
# only used for volatile data # only used for volatile data
#
# SUSE now supports only systemd based system. We do not build
# sysvinit-only versions of UTIL_LINUX_SYSTEMD_SOURCES utilities.
%configure \ %configure \
--localstatedir=/run \ --localstatedir=/run \
--docdir=%{_docdir}/%{name} \ --docdir=%{_docdir}/%{_name} \
--with-audit \ --with-audit \
--with-gnu-ld \ --with-gnu-ld \
--with-ncurses \ --with-ncurses \
--with-selinux \ --with-selinux \
$uhead \ $uhead \
--with-systemdsystemunitdir=%_unitdir \
--with-bashcompletiondir=%{_datadir}/bash-completion \ --with-bashcompletiondir=%{_datadir}/bash-completion \
--enable-mesg \ --enable-all-programs \
--enable-partx \ --disable-reset \
--enable-raw \ --disable-use-tty-group \
--enable-write \ --disable-silent-rules \
--enable-line \ --enable-static \
--enable-tunelp \ --disable-rpath \
--enable-socket-activation \ %if %{without enable_last}
%if %{with enable_last}
--enable-last \
%else
--disable-last \ --disable-last \
%endif %endif
%if %{with enable_eject} %if %{without enable_eject}
--enable-eject \
%else
--disable-eject \ --disable-eject \
%endif %endif
%if %{with sysvinit_tools} %if %{with sysvinit_tools}
--enable-sulogin \
--enable-sulogin-emergency-mount \ --enable-sulogin-emergency-mount \
--enable-mountpoint \
%else %else
--disable-sulogin \ --disable-sulogin \
--disable-mountpoint \ --disable-mountpoint \
%endif %endif
%if %{with enable_su} %if %{without enable_su}
--enable-kill \
--enable-su \
%else
--disable-su \ --disable-su \
--disable-kill \ --disable-kill \
%endif %endif
--disable-use-tty-group \ %if %build_util_linux_systemd
--enable-static \ --enable-uuidd \
--disable-silent-rules \ --with-systemd \
--disable-rpath --with-systemdsystemunitdir=%{_unitdir} \
%else
--disable-uuidd \
--without-systemd \
%endif
%if %build_python_libmount
--with-python \
%else
--without-python \
%endif
# #
make %{?_smp_mflags} make %{?_smp_mflags}
# #
%if %build_util_linux
%{__cc} -fwhole-program %{optflags} -o mkzimage_cmdline %{S:29} %{__cc} -fwhole-program %{optflags} -o mkzimage_cmdline %{S:29}
%{__cc} -fwhole-program %{optflags} -o chrp-addnote %{SOURCE31} %{__cc} -fwhole-program %{optflags} -o chrp-addnote %{SOURCE31}
%endif
%check %check
if ! make check; then # mark some tests "known_fail"
echo "cat test diffs:" %ifarch ppc ppc64 ppc64le s390 s390x
find tests/diff -type f | xargs -r cat export TS_OPT_fdisk_bsd_known_fail="yes"
#exit 1 %endif
fi %ifarch %{ix86}
export TS_OPT_misc_setarch_known_fail="yes"
%endif
#
%ifarch armv7l armv7hl aarch64
%if 0%{?suse_version} > 1310
export TS_OPT_misc_setarch_known_fail="yes"
%endif
%endif
#
%ifarch armv6l armv6hl aarch64
export TS_OPT_fdisk_gpt_known_fail="yes"
export TS_OPT_fdisk_oddinput_known_fail="yes"
export TS_OPT_fdisk_sunlabel_known_fail="yes"
export TS_OPT_misc_ionice_known_fail="yes"
export TS_OPT_misc_swaplabel_known_fail="yes"
export TS_OPT_kill_name_to_number_known_fail="yes"
export TS_OPT_kill_print_pid_known_fail="yes"
export TS_OPT_kill_queue_known_fail="yes"
%endif
%ifarch aarch64 s390 s390x
export TS_OPT_utmpdump_known_fail="yes"
%endif
# FIXME: These sometimes fails:
export TS_OPT_libmount_lock_known_fail="yes"
%ifarch x86_64
# FIXME: Something is wrong here. This test never fails in SLE12:
export TS_OPT_ipcs_limits2_known_fail="yes"
%endif
#
# hacks
export PATH="$PATH:/sbin:/usr/sbin"
#
# do the check but don't abort yet
result="0"
make %{?_smp_mflags} check || result="1"
#
# always show test diffs (inclusive known_fail) and exit result
diffs_files="$(find tests/diff -type f | sort)"
echo "$diffs_files" | xargs -r cat
exit "$result"
%install %install
%if %build_util_linux
mkdir -p %{buildroot}{%{_sysconfdir}/{init.d,pam.d,default},%{_mandir}/man{1,8},/bin,/sbin,%{_bindir},%{_sbindir},%{_infodir}} mkdir -p %{buildroot}{%{_sysconfdir}/{init.d,pam.d,default},%{_mandir}/man{1,8},/bin,/sbin,%{_bindir},%{_sbindir},%{_infodir}}
mkdir -p %{buildroot}%{_localstatedir}/lib/libuuid/
mkdir -p %{buildroot}/run/uuidd/
install -m 744 %{SOURCE50} %{buildroot}%{_initddir}/uuidd
install -m 644 %{SOURCE51} %{buildroot}%{_sysconfdir}/blkid.conf install -m 644 %{SOURCE51} %{buildroot}%{_sysconfdir}/blkid.conf
install -m 644 %{SOURCE8} %{buildroot}%{_sysconfdir}/pam.d/login install -m 644 %{SOURCE8} %{buildroot}%{_sysconfdir}/pam.d/login
install -m 644 %{SOURCE9} %{buildroot}%{_sysconfdir}/pam.d/remote install -m 644 %{SOURCE9} %{buildroot}%{_sysconfdir}/pam.d/remote
@ -400,17 +663,18 @@ pushd ../klogconsole
# klogconsole install # klogconsole install
make install DEST=%{buildroot} make install DEST=%{buildroot}
popd popd
%endif
# #
# util-linux install # util-linux install
# #
%make_install %make_install
rm -f %{buildroot}/%{_libdir}/lib*.la rm -f %{buildroot}%{python_sitearch}/libmount/*.*a
%if %build_util_linux
#UsrMerge #UsrMerge
%if %{with enable_su} %if %{with enable_su}
ln -s %{_bindir}/kill %{buildroot}/bin ln -s %{_bindir}/kill %{buildroot}/bin
ln -s %{_bindir}/su %{buildroot}/bin ln -s %{_bindir}/su %{buildroot}/bin
%endif %endif
ln -s %{_bindir}/logger %{buildroot}/bin
ln -s %{_bindir}/dmesg %{buildroot}/bin ln -s %{_bindir}/dmesg %{buildroot}/bin
ln -s %{_bindir}/more %{buildroot}/bin ln -s %{_bindir}/more %{buildroot}/bin
ln -s %{_bindir}/mount %{buildroot}/bin ln -s %{_bindir}/mount %{buildroot}/bin
@ -449,12 +713,12 @@ ln -s %{_sbindir}/chcpu %{buildroot}/sbin
#EndUsrMerge #EndUsrMerge
install -m 644 %{SOURCE6} %{buildroot}%{_sysconfdir}/filesystems install -m 644 %{SOURCE6} %{buildroot}%{_sysconfdir}/filesystems
%ifnarch ppc ppc64 %ifnarch ppc ppc64
install -m 755 mkzimage_cmdline %{buildroot}/%{_bindir} install -m 755 mkzimage_cmdline %{buildroot}%{_bindir}
install -m 644 %{S:28} %{buildroot}%{_mandir}/man8 install -m 644 %{S:28} %{buildroot}%{_mandir}/man8
install -m 755 chrp-addnote %{buildroot}/%{_bindir} install -m 755 chrp-addnote %{buildroot}%{_bindir}
%endif %endif
# setctsid install # setctsid install
install -m 755 setctsid %{buildroot}/%{_sbindir} install -m 755 setctsid %{buildroot}%{_sbindir}
install -m 444 setctsid.8 %{buildroot}%{_mandir}/man8/ install -m 444 setctsid.8 %{buildroot}%{_mandir}/man8/
echo -e "#! /bin/bash\n/sbin/blockdev --flushbufs \$1" > %{buildroot}%{_sbindir}/flushb echo -e "#! /bin/bash\n/sbin/blockdev --flushbufs \$1" > %{buildroot}%{_sbindir}/flushb
chmod 755 %{buildroot}%{_sbindir}/flushb chmod 755 %{buildroot}%{_sbindir}/flushb
@ -464,7 +728,7 @@ install -m 755 $RPM_SOURCE_DIR/raw.init %{buildroot}%{_initddir}/raw
ln -sf ../..%{_sysconfdir}/init.d/raw %{buildroot}%{_sbindir}/rcraw ln -sf ../..%{_sysconfdir}/init.d/raw %{buildroot}%{_sbindir}/rcraw
# upstream moved getopt examples from datadir to docdir but we keep # upstream moved getopt examples from datadir to docdir but we keep
# the old location because we would need to fix the manpage first # the old location because we would need to fix the manpage first
mv %{buildroot}%{_docdir}/%{name}/getopt %{buildroot}%{_datadir}/ mv %{buildroot}%{_docdir}/%{_name}/getopt %{buildroot}%{_datadir}/
# Stupid hack so we don't have a tcsh dependency # Stupid hack so we don't have a tcsh dependency
chmod 644 %{buildroot}%{_datadir}/getopt/getopt*.tcsh chmod 644 %{buildroot}%{_datadir}/getopt/getopt*.tcsh
# Following files we don't want to package, so remove them # Following files we don't want to package, so remove them
@ -474,16 +738,15 @@ rm -f %{buildroot}%{_mandir}/man1/pg.1*
rm -f %{buildroot}%{_bindir}/chkdupexe rm -f %{buildroot}%{_bindir}/chkdupexe
rm -f %{buildroot}%{_mandir}/man1/chkdupexe.1 rm -f %{buildroot}%{_mandir}/man1/chkdupexe.1
# we use this tools from pwdutils # we use this tools from pwdutils
rm -f %{buildroot}/%{_bindir}/{chfn,chsh,newgrp} rm -f %{buildroot}%{_bindir}/{chfn,chsh,newgrp}
rm -f %{buildroot}/%{_sbindir}/{vigr,vipw} rm -f %{buildroot}%{_sbindir}/{vigr,vipw}
rm -f %{buildroot}/%{_mandir}/man1/{chfn.1*,chsh.1*,newgrp.1*} rm -f %{buildroot}%{_mandir}/man1/{chfn.1*,chsh.1*,newgrp.1*}
rm -f %{buildroot}/%{_mandir}/man8/{vigr.8*,vipw.8*} rm -f %{buildroot}%{_mandir}/man8/{vigr.8*,vipw.8*}
# login is always and only in /bin # login is always and only in /bin
mv %{buildroot}/%{_bindir}/login %{buildroot}/bin/ mv %{buildroot}%{_bindir}/login %{buildroot}/bin/
# arch dependent # arch dependent
%ifarch s390 s390x %ifarch s390 s390x
rm -f %{buildroot}%{_sysconfdir}/fdprm rm -f %{buildroot}%{_sysconfdir}/fdprm
rm -f %{buildroot}%{_bindir}/cytune
rm -f %{buildroot}%{_sbindir}/fdformat rm -f %{buildroot}%{_sbindir}/fdformat
rm -f %{buildroot}%{_sbindir}/hwclock rm -f %{buildroot}%{_sbindir}/hwclock
#UsrMerge #UsrMerge
@ -492,15 +755,14 @@ rm -f %{buildroot}/sbin/hwclock
rm -f %{buildroot}%{_sbindir}/klogconsole rm -f %{buildroot}%{_sbindir}/klogconsole
rm -f %{buildroot}%{_bindir}/setterm rm -f %{buildroot}%{_bindir}/setterm
rm -f %{buildroot}%{_sbindir}/tunelp rm -f %{buildroot}%{_sbindir}/tunelp
rm -f %{buildroot}/%{_mandir}/man8/cytune.8* rm -f %{buildroot}%{_mandir}/man8/fdformat.8*
rm -f %{buildroot}/%{_mandir}/man8/fdformat.8* rm -f %{buildroot}%{_mandir}/man8/hwclock.8*
rm -f %{buildroot}/%{_mandir}/man8/hwclock.8* rm -f %{buildroot}%{_mandir}/man8/klogconsole.8*
rm -f %{buildroot}/%{_mandir}/man8/klogconsole.8* rm -f %{buildroot}%{_mandir}/man8/tunelp.8*
rm -f %{buildroot}/%{_mandir}/man8/tunelp.8*
%endif %endif
%ifarch ia64 %sparc m68k %ifarch ia64 %sparc m68k
rm -f %{buildroot}/%{_mandir}/man8/cfdisk.8* rm -f %{buildroot}%{_mandir}/man8/cfdisk.8*
rm -f %{buildroot}/%{_mandir}/man8/sfdisk.8* rm -f %{buildroot}%{_mandir}/man8/sfdisk.8*
rm -f %{buildroot}%{_sbindir}/cfdisk rm -f %{buildroot}%{_sbindir}/cfdisk
#UsrMerge #UsrMerge
rm -f %{buildroot}/sbin/cfdisk rm -f %{buildroot}/sbin/cfdisk
@ -525,13 +787,29 @@ find %{buildroot}%{_bindir}/ -regextype posix-egrep -type l \
find %{buildroot}%{_mandir}/man8 -regextype posix-egrep \ find %{buildroot}%{_mandir}/man8 -regextype posix-egrep \
-regex ".*(linux32|linux64|s390|s390x|i386|ppc|ppc64|ppc32|sparc|sparc64|sparc32|sparc32bash|mips|mips64|mips32|ia64|x86_64|parisc|parisc32|parisc64)\.8.*" \ -regex ".*(linux32|linux64|s390|s390x|i386|ppc|ppc64|ppc32|sparc|sparc64|sparc32|sparc32bash|mips|mips64|mips32|ia64|x86_64|parisc|parisc32|parisc64)\.8.*" \
-printf "%{_mandir}/man8/%f*\n" >> %{name}.files -printf "%{_mandir}/man8/%f*\n" >> %{name}.files
%else
# install systemd files manually, don't use Makefile that expect build of utilities and its dependencies.
%endif
%if %build_util_linux_systemd
mkdir -p %{buildroot}%{_sysconfdir}/init.d
mkdir -p %{buildroot}/bin
mkdir -p %{buildroot}%{_sbindir}
mkdir -p %{buildroot}%{_localstatedir}/lib/libuuid
mkdir -p %{buildroot}/run/uuidd
install -m 744 %{SOURCE50} %{buildroot}%{_initddir}/uuidd
ln -s %{_bindir}/logger %{buildroot}/bin
# clock.txt from uuidd is a ghost file # clock.txt from uuidd is a ghost file
touch %{buildroot}%{_localstatedir}/lib/libuuid/clock.txt touch %{buildroot}%{_localstatedir}/lib/libuuid/clock.txt
# rcuuidd helper # rcuuidd helper
ln -sf ../..%{_sysconfdir}/init.d/uuidd %{buildroot}%{_sbindir}/rcuuidd ln -sf ../..%{_sysconfdir}/init.d/uuidd %{buildroot}%{_sbindir}/rcuuidd
# remove duplicate manpages %if !%build_util_linux
%fdupes -s %{buildroot}/%{_mandir} %make_install
%endif
%endif
# link duplicate manpages and python bindings
%fdupes -s %{buildroot}%{_prefix}
%if %build_util_linux
%post %post
%{fillup_and_insserv raw} %{fillup_and_insserv raw}
%set_permissions %{_bindir}/wall %{_bindir}/write %{_bindir}/mount %{_bindir}/umount %set_permissions %{_bindir}/wall %{_bindir}/write %{_bindir}/mount %{_bindir}/umount
@ -579,6 +857,18 @@ fi
%postun -n libmount1 -p /sbin/ldconfig %postun -n libmount1 -p /sbin/ldconfig
%post -n libsmartcols1 -p /sbin/ldconfig
%postun -n libsmartcols1 -p /sbin/ldconfig
%post -n libuuid1 -p /sbin/ldconfig
%postun -n libuuid1 -p /sbin/ldconfig
%files lang -f %{name}.lang
%endif
%if %build_util_linux_systemd
%pre -n uuidd %pre -n uuidd
%{_sbindir}/groupadd -r uuidd 2>/dev/null || : %{_sbindir}/groupadd -r uuidd 2>/dev/null || :
%{_sbindir}/useradd -r -g uuidd -c "User for uuidd" \ %{_sbindir}/useradd -r -g uuidd -c "User for uuidd" \
@ -595,22 +885,17 @@ fi
%{restart_on_update uuidd} %{restart_on_update uuidd}
%{insserv_cleanup} %{insserv_cleanup}
%post -n libuuid1 -p /sbin/ldconfig
%postun -n libuuid1 -p /sbin/ldconfig
%verifyscript -n uuidd %verifyscript -n uuidd
%verify_permissions -e %{_sbindir}/uuidd %verify_permissions -e %{_sbindir}/uuidd
%endif
%files lang -f %{name}.lang %if %build_util_linux
%files -f %{name}.files %files -f %{name}.files
# Common files for all archs # Common files for all archs
%defattr(-,root,root) %defattr(-,root,root)
# util-linux documentation files # util-linux documentation files
%doc Documentation/blkid.txt %doc Documentation/blkid.txt
%doc Documentation/cal.txt %doc Documentation/cal.txt
%doc Documentation/cfdisk.txt
%doc Documentation/col.txt %doc Documentation/col.txt
%doc Documentation/deprecated.txt %doc Documentation/deprecated.txt
%doc Documentation/fdisk.txt %doc Documentation/fdisk.txt
@ -642,7 +927,6 @@ fi
/bin/mount /bin/mount
/bin/umount /bin/umount
/bin/findmnt /bin/findmnt
/bin/logger
/bin/login /bin/login
/bin/lsblk /bin/lsblk
/sbin/agetty /sbin/agetty
@ -704,7 +988,6 @@ fi
%{_bindir}/lastb %{_bindir}/lastb
%endif %endif
%{_bindir}/line %{_bindir}/line
%{_bindir}/logger
%{_bindir}/look %{_bindir}/look
%{_bindir}/lsblk %{_bindir}/lsblk
%{_bindir}/lscpu %{_bindir}/lscpu
@ -722,6 +1005,7 @@ fi
%{_bindir}/script %{_bindir}/script
%{_bindir}/scriptreplay %{_bindir}/scriptreplay
%{_bindir}/setarch %{_bindir}/setarch
%{_bindir}/setpriv
%{_bindir}/setsid %{_bindir}/setsid
%{_bindir}/tailf %{_bindir}/tailf
%{_bindir}/taskset %{_bindir}/taskset
@ -805,7 +1089,6 @@ fi
%{_mandir}/man1/lastb.1.gz %{_mandir}/man1/lastb.1.gz
%endif %endif
%{_mandir}/man1/line.1.gz %{_mandir}/man1/line.1.gz
%{_mandir}/man1/logger.1.gz
%{_mandir}/man1/login.1.gz %{_mandir}/man1/login.1.gz
%{_mandir}/man1/look.1.gz %{_mandir}/man1/look.1.gz
%{_mandir}/man1/lscpu.1.gz %{_mandir}/man1/lscpu.1.gz
@ -819,6 +1102,7 @@ fi
%{_mandir}/man1/rename.1.gz %{_mandir}/man1/rename.1.gz
%{_mandir}/man1/rev.1.gz %{_mandir}/man1/rev.1.gz
%{_mandir}/man1/renice.1.gz %{_mandir}/man1/renice.1.gz
%{_mandir}/man1/setpriv.1.gz
%{_mandir}/man1/setsid.1.gz %{_mandir}/man1/setsid.1.gz
%{_mandir}/man1/script.1.gz %{_mandir}/man1/script.1.gz
%{_mandir}/man1/scriptreplay.1.gz %{_mandir}/man1/scriptreplay.1.gz
@ -838,6 +1122,7 @@ fi
%{_mandir}/man1/runuser.1.gz %{_mandir}/man1/runuser.1.gz
%{_mandir}/man1/uuidgen.1.gz %{_mandir}/man1/uuidgen.1.gz
%{_mandir}/man5/fstab.5.gz %{_mandir}/man5/fstab.5.gz
%{_mandir}/man5/terminal-colors.d.5.gz
%{_mandir}/man8/addpart.8.gz %{_mandir}/man8/addpart.8.gz
%{_mandir}/man8/agetty.8.gz %{_mandir}/man8/agetty.8.gz
%{_mandir}/man8/blockdev.8.gz %{_mandir}/man8/blockdev.8.gz
@ -893,7 +1178,12 @@ fi
%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
# FIXME: Fix directory ownership. # FIXME: Fix directory ownership.
%{_datadir}/bash-completion %dir %{_datadir}/bash-completion
%{_datadir}/bash-completion/*
%if %build_util_linux_systemd
%exclude %{_datadir}/bash-completion/logger
%exclude %{_datadir}/bash-completion/uuidd
%endif
%ifnarch ia64 m68k %ifnarch ia64 m68k
#XXX: post our patches upstream #XXX: post our patches upstream
#XXX: call fdupes on /usr/share/man #XXX: call fdupes on /usr/share/man
@ -914,7 +1204,6 @@ fi
%{_sbindir}/sfdisk %{_sbindir}/sfdisk
%endif %endif
%ifnarch s390 s390x %ifnarch s390 s390x
%{_bindir}/cytune
%{_sbindir}/fdformat %{_sbindir}/fdformat
#UsrMerge #UsrMerge
/sbin/hwclock /sbin/hwclock
@ -923,7 +1212,6 @@ fi
%{_sbindir}/klogconsole %{_sbindir}/klogconsole
%{_bindir}/setterm %{_bindir}/setterm
%{_sbindir}/tunelp %{_sbindir}/tunelp
%{_mandir}/man8/cytune.8.gz
%{_mandir}/man8/fdformat.8.gz %{_mandir}/man8/fdformat.8.gz
%{_mandir}/man8/hwclock.8.gz %{_mandir}/man8/hwclock.8.gz
%{_mandir}/man8/klogconsole.8.gz %{_mandir}/man8/klogconsole.8.gz
@ -932,8 +1220,8 @@ fi
%files -n libblkid1 %files -n libblkid1
%defattr(-, root, root) %defattr(-, root, root)
/%{_libdir}/libblkid.so.1 %{_libdir}/libblkid.so.1
/%{_libdir}/libblkid.so.1.* %{_libdir}/libblkid.so.1.*
%files -n libblkid-devel %files -n libblkid-devel
%defattr(-, root, root) %defattr(-, root, root)
@ -945,12 +1233,12 @@ fi
%files -n libblkid-devel-static %files -n libblkid-devel-static
%defattr(-, root, root) %defattr(-, root, root)
%{_libdir}/libblkid.a %{_libdir}/libblkid.*a
%files -n libmount1 %files -n libmount1
%defattr(-, root, root) %defattr(-, root, root)
/%{_libdir}/libmount.so.1 %{_libdir}/libmount.so.1
/%{_libdir}/libmount.so.1.* %{_libdir}/libmount.so.1.*
%files -n libmount-devel %files -n libmount-devel
%defattr(-, root, root) %defattr(-, root, root)
@ -961,24 +1249,28 @@ fi
%files -n libmount-devel-static %files -n libmount-devel-static
%defattr(-, root, root) %defattr(-, root, root)
%{_libdir}/libmount.a %{_libdir}/libmount.*a
%files -n uuidd %files -n libsmartcols1
%defattr(-, root, root) %defattr(-, root, root)
%verify(not mode) %attr(0755,root,root) %{_sbindir}/uuidd %{_libdir}/libsmartcols.so.1
%attr(-,uuidd,uuidd) %dir %{_localstatedir}/lib/libuuid %{_libdir}/libsmartcols.so.1.*
%ghost %{_localstatedir}/lib/libuuid/clock.txt
%attr(-,uuidd,uuidd) %ghost %dir /run/uuidd %files -n libsmartcols-devel
%{_initddir}/uuidd %defattr(-, root, root)
%{_mandir}/man8/uuidd.8.gz %{_libdir}/libsmartcols.so
%{_sbindir}/rcuuidd %dir %{_includedir}/libsmartcols
%{_unitdir}/uuidd.service %{_includedir}/libsmartcols/libsmartcols.h
%{_unitdir}/uuidd.socket %{_libdir}/pkgconfig/smartcols.pc
%files -n libsmartcols-devel-static
%defattr(-, root, root)
%{_libdir}/libsmartcols.*a
%files -n libuuid1 %files -n libuuid1
%defattr(-, root, root) %defattr(-, root, root)
/%{_libdir}/libuuid.so.1 %{_libdir}/libuuid.so.1
/%{_libdir}/libuuid.so.1.* %{_libdir}/libuuid.so.1.*
%files -n libuuid-devel %files -n libuuid-devel
%defattr(-, root, root) %defattr(-, root, root)
@ -990,6 +1282,47 @@ fi
%files -n libuuid-devel-static %files -n libuuid-devel-static
%defattr(-, root, root) %defattr(-, root, root)
%{_libdir}/libuuid.a %{_libdir}/libuuid.*a
%endif
%if %build_util_linux_systemd
%if %build_util_linux
%files systemd
%else
%files
%endif
%defattr(-, root, root)
/bin/logger
%{_bindir}/logger
%{_bindir}/lslogins
%{_datadir}/bash-completion/logger
%{_mandir}/man1/logger.1.gz
%{_mandir}/man1/lslogins.1.gz
%{_unitdir}/fstrim.service
%{_unitdir}/fstrim.timer
%files -n uuidd
%defattr(-, root, root)
%verify(not mode) %attr(0755,root,root) %{_sbindir}/uuidd
%attr(-,uuidd,uuidd) %dir %{_localstatedir}/lib/libuuid
%ghost %{_localstatedir}/lib/libuuid/clock.txt
%attr(-,uuidd,uuidd) %ghost %dir /run/uuidd
%{_datadir}/bash-completion/uuidd
%{_initddir}/uuidd
%{_mandir}/man8/uuidd.8.gz
%{_sbindir}/rcuuidd
%{_unitdir}/uuidd.service
%{_unitdir}/uuidd.socket
%endif
%if %build_python_libmount
%if %build_util_linux
%files -n python-libmount
%else
%files
%endif
%defattr(-, root, root)
%{python_sitearch}/libmount
%endif
%changelog %changelog

2
util-linux.util-linux Normal file
View File

@ -0,0 +1,2 @@
Summary: A collection of basic system utilities
Group: System/Base