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:
commit
092f8a133f
@ -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;
|
||||
+}
|
@ -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
@ -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
35
pre_checkin.sh
Normal 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
3997
python-libmount.changes
Normal file
File diff suppressed because it is too large
Load Diff
1328
python-libmount.spec
Normal file
1328
python-libmount.spec
Normal file
File diff suppressed because it is too large
Load Diff
@ -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);
|
@ -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;
|
||||
|
@ -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;
|
@ -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
|
||||
|
@ -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
|
@ -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-----
|
@ -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
17
util-linux-2.25.tar.sign
Normal 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
3
util-linux-2.25.tar.xz
Normal file
@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:47ba5a8bd8cdd55262699078a5612a95db17966c7f20c43e3fe492c90ce7980a
|
||||
size 3681308
|
@ -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
|
||||
|
13
util-linux-bash-completion-blockdev.patch
Normal file
13
util-linux-bash-completion-blockdev.patch
Normal 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
|
||||
|
@ -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;
|
@ -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);
|
@ -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 }
|
||||
+ }
|
||||
+};
|
||||
|
@ -1,9 +1,11 @@
|
||||
--- util-linux-2.23.1/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
|
||||
Index: util-linux/libmount/src/context_loopdev.c
|
||||
===================================================================
|
||||
--- 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) &&
|
||||
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
|
||||
+ fprintf(stderr, "mount: encryption no longer supported.\n"
|
||||
+ " Please use /etc/crypttab instead (man 5 crypttab)\n");
|
@ -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
|
||||
|
@ -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/umount.*")
|
||||
addFilter(".*W:.*permissions-symlink.*/bin/mount.*")
|
||||
|
||||
# UGLY HACK: rpmlint falsely declares problems with files-attr-not-set
|
||||
addFilter("W: files-attr-not-set")
|
||||
|
@ -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
3997
util-linux-systemd.changes
Normal file
File diff suppressed because it is too large
Load Diff
1328
util-linux-systemd.spec
Normal file
1328
util-linux-systemd.spec
Normal file
File diff suppressed because it is too large
Load Diff
@ -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
|
||||
|
||||
|
1
util-linux.preamble
Normal file
1
util-linux.preamble
Normal file
@ -0,0 +1 @@
|
||||
License: GPL-2.0+
|
2
util-linux.python-libmount
Normal file
2
util-linux.python-libmount
Normal file
@ -0,0 +1,2 @@
|
||||
Summary: Python bindings for the libmount library
|
||||
Group: System/Filesystems
|
699
util-linux.spec
699
util-linux.spec
File diff suppressed because it is too large
Load Diff
2
util-linux.util-linux
Normal file
2
util-linux.util-linux
Normal file
@ -0,0 +1,2 @@
|
||||
Summary: A collection of basic system utilities
|
||||
Group: System/Base
|
Loading…
Reference in New Issue
Block a user