OBS User unknown 2009-07-03 15:12:19 +00:00 committed by Git OBS Bridge
parent 98111f1857
commit 4b96fe3e14
23 changed files with 870 additions and 3970 deletions

471
HEAD.patch Normal file
View File

@ -0,0 +1,471 @@
diff --git a/disk-utils/raw.c b/disk-utils/raw.c
index bc64b34..f634b60 100644
--- a/disk-utils/raw.c
+++ b/disk-utils/raw.c
@@ -40,11 +40,11 @@ int master_fd;
int raw_minor;
void open_raw_ctl(void);
-int query(int minor, int quiet);
+int query(int minor, const char *raw_name, int quiet);
int bind (int minor, int block_major, int block_minor);
-static void usage(int err)
+static void usage(int err)
{
fprintf(stderr,
_("Usage:\n"
@@ -99,7 +99,7 @@ int main(int argc, char *argv[])
if (optind < argc)
usage(1);
for (i = 1; i < RAW_NR_MINORS; i++)
- query(i, 1);
+ query(i, NULL, 1);
exit(0);
}
@@ -117,7 +117,10 @@ int main(int argc, char *argv[])
* causes udev to *remove* /dev/rawctl
*/
rc = sscanf(raw_name, RAWDEVDIR "raw%d", &raw_minor);
- if (rc == 1 && raw_minor == 0) {
+ if (rc != 1)
+ usage(1);
+
+ if (raw_minor == 0) {
fprintf (stderr,
_("Device '%s' is control raw dev "
"(use raw<N> where <N> is greater than zero)\n"),
@@ -125,28 +128,8 @@ int main(int argc, char *argv[])
exit(2);
}
- err = stat(raw_name, &statbuf);
- if (err) {
- fprintf (stderr, _("Cannot locate raw device '%s' (%s)\n"),
- raw_name, strerror(errno));
- exit(2);
- }
-
- if (!S_ISCHR(statbuf.st_mode)) {
- fprintf (stderr, _("Raw device '%s' is not a character dev\n"),
- raw_name);
- exit(2);
- }
- if (major(statbuf.st_rdev) != RAW_MAJOR) {
- fprintf (stderr, _("Device '%s' is not a raw dev\n"),
- raw_name);
- exit(2);
- }
-
- raw_minor = minor(statbuf.st_rdev);
-
if (do_query)
- return query(raw_minor, 0);
+ return query(raw_minor, raw_name, 0);
/*
* It's not a query, so we still have some parsing to do. Have
@@ -208,12 +191,35 @@ void open_raw_ctl(void)
}
}
-int query(int minor, int quiet)
+int query(int minor, const char *raw_name, int quiet)
{
struct raw_config_request rq;
static int has_worked = 0;
int err;
+ if (raw_name) {
+ struct stat statbuf;
+
+ err = stat(raw_name, &statbuf);
+ if (err) {
+ fprintf (stderr, _("Cannot locate raw device '%s' (%s)\n"),
+ raw_name, strerror(errno));
+ exit(2);
+ }
+
+ if (!S_ISCHR(statbuf.st_mode)) {
+ fprintf (stderr, _("Raw device '%s' is not a character dev\n"),
+ raw_name);
+ exit(2);
+ }
+ if (major(statbuf.st_rdev) != RAW_MAJOR) {
+ fprintf (stderr, _("Device '%s' is not a raw dev\n"),
+ raw_name);
+ exit(2);
+ }
+ minor = minor(statbuf.st_rdev);
+ }
+
rq.raw_minor = minor;
err = ioctl(master_fd, RAW_GETBIND, &rq);
if (err < 0) {
diff --git a/include/pathnames.h b/include/pathnames.h
index 0060a75..12170f9 100644
--- a/include/pathnames.h
+++ b/include/pathnames.h
@@ -19,7 +19,6 @@
#undef _PATH_DEFPATH_ROOT
#define _PATH_DEFPATH_ROOT "/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin"
-#define _PATH_TTY "/dev/tty"
#define _PATH_SECURETTY "/etc/securetty"
#define _PATH_WTMPLOCK "/etc/wtmplock"
@@ -94,6 +93,13 @@
#define _PATH_MOUNTED_LOCK _PATH_MOUNTED "~"
#define _PATH_MOUNTED_TMP _PATH_MOUNTED ".tmp"
+#ifndef _PATH_DEV
+# define _PATH_DEV "/dev"
+#endif
+
+#define _PATH_DEV_LOOP "/dev/loop"
+#define _PATH_DEV_TTY "/dev/tty"
+
/* udev paths */
#define _PATH_DEV_BYLABEL "/dev/disk/by-label"
#define _PATH_DEV_BYUUID "/dev/disk/by-uuid"
diff --git a/login-utils/login.c b/login-utils/login.c
index f315425..7328ede 100644
--- a/login-utils/login.c
+++ b/login-utils/login.c
@@ -378,7 +378,7 @@ main(int argc, char **argv)
int ask, fflag, hflag, pflag, cnt, errsv;
int quietlog, passwd_req;
char *domain, *ttyn;
- char tbuf[MAXPATHLEN + 2], tname[sizeof(_PATH_TTY) + 10];
+ char tbuf[MAXPATHLEN + 2], tname[sizeof(_PATH_DEV_TTY) + 10];
char *termenv;
char *childArgv[10];
char *buff;
@@ -499,7 +499,7 @@ main(int argc, char **argv)
if (ttyn == NULL || *ttyn == '\0') {
/* no snprintf required - see definition of tname */
- sprintf(tname, "%s??", _PATH_TTY);
+ snprintf(tname, sizeof(tname), "%s??", _PATH_DEV_TTY);
ttyn = tname;
}
diff --git a/misc-utils/script.c b/misc-utils/script.c
index 12ea43a..b877c31 100644
--- a/misc-utils/script.c
+++ b/misc-utils/script.c
@@ -371,7 +371,7 @@ doshell() {
#if 0
int t;
- t = open(_PATH_TTY, O_RDWR);
+ t = open(_PATH_DEV_TTY, O_RDWR);
if (t >= 0) {
(void) ioctl(t, TIOCNOTTY, (char *)0);
(void) close(t);
diff --git a/misc-utils/uuidd.8 b/misc-utils/uuidd.8
index ae033ea..67c6614 100644
--- a/misc-utils/uuidd.8
+++ b/misc-utils/uuidd.8
@@ -64,11 +64,11 @@ UUID's.
.TP
.BI \-p " pidfile"
Specify the pathname where the pid file should be written. By default,
-the pid file is written to /var/lib/libuuid/uuidd.pid.
+the pid file is written to /var/run/uuidd/uuidd.pid.
.TP
.BI \-s " socketpath"
Specify the pathname used for the unix-domain socket used by uuidd. By
-default, the pathname used is /var/lib/libuuid/request. This is primarily
+default, the pathname used is /var/run/uuidd/request. This is primarily
for debugging purposes, since the pathname is hard-coded in the libuuid
library.
.TP
diff --git a/mount/lomount.c b/mount/lomount.c
index 1b191ab..c6e0c92 100644
--- a/mount/lomount.c
+++ b/mount/lomount.c
@@ -60,8 +60,6 @@ loop_info64_to_old(const struct loop_info64 *info64, struct loop_info *info)
return 0;
}
-#define DEV_LOOP_PATH "/dev/loop"
-#define DEV_PATH "/dev"
#define LOOPMAJOR 7
#define NLOOPS_DEFAULT 8 /* /dev/loop[0-7] */
@@ -143,10 +141,10 @@ looplist_open(struct looplist *ll, int flag)
ll->flag = flag;
ll->ncur = -1;
- if (stat(DEV_PATH, &st) == -1 || (!S_ISDIR(st.st_mode)))
+ if (stat(_PATH_DEV, &st) == -1 || (!S_ISDIR(st.st_mode)))
return -1; /* /dev doesn't exist */
- if (stat(DEV_LOOP_PATH, &st) == 0 && S_ISDIR(st.st_mode))
+ if (stat(_PATH_DEV_LOOP, &st) == 0 && S_ISDIR(st.st_mode))
ll->flag |= LLFLG_SUBDIR; /* /dev/loop/ exists */
if ((ll->flag & LLFLG_USEDONLY) &&
@@ -179,8 +177,8 @@ looplist_open_dev(struct looplist *ll, int lnum)
/* create a full device path */
snprintf(ll->name, sizeof(ll->name),
ll->flag & LLFLG_SUBDIR ?
- DEV_LOOP_PATH "/%d" :
- DEV_PATH "/loop%d",
+ _PATH_DEV_LOOP "/%d" :
+ _PATH_DEV "/loop%d",
lnum);
fd = open(ll->name, O_RDONLY);
@@ -331,8 +329,8 @@ looplist_next(struct looplist *ll)
*/
if (!ll->minors) {
ll->nminors = (ll->flag & LLFLG_SUBDIR) ?
- loop_scandir(DEV_LOOP_PATH, &ll->minors, 0) :
- loop_scandir(DEV_PATH, &ll->minors, 1);
+ loop_scandir(_PATH_DEV_LOOP, &ll->minors, 0) :
+ loop_scandir(_PATH_DEV, &ll->minors, 1);
ll->ncur = -1;
}
for (++ll->ncur; ll->ncur < ll->nminors; ll->ncur++) {
@@ -500,8 +498,7 @@ show_associated_loop_devices(char *filename, unsigned long long offset, int isof
/* check if the loopfile is already associated with the same given
* parameters.
*
- * returns: -1 error
- * 0 unused
+ * returns: 0 unused / error
* 1 loop device already used
*/
static int
@@ -516,17 +513,15 @@ is_associated(int dev, struct stat *file, unsigned long long offset, int isoff)
file->st_ino == linfo64.lo_inode &&
(isoff == 0 || offset == linfo64.lo_offset))
ret = 1;
- return ret;
- }
- if (ioctl(dev, LOOP_GET_STATUS, &linfo) == 0) {
+
+ } else if (ioctl(dev, LOOP_GET_STATUS, &linfo) == 0) {
if (file->st_dev == linfo.lo_device &&
file->st_ino == linfo.lo_inode &&
(isoff == 0 || offset == linfo.lo_offset))
ret = 1;
- return ret;
}
- return errno == ENXIO ? 0 : -1;
+ return ret;
}
/* check if the loop file is already used with the same given
@@ -572,18 +567,14 @@ loopfile_used_with(char *devname, const char *filename, unsigned long long offse
if (!is_loop_device(devname))
return 0;
- if (stat(filename, &statbuf) == -1) {
- perror(filename);
- return -1;
- }
+ if (stat(filename, &statbuf) == -1)
+ return 0;
fd = open(devname, O_RDONLY);
- if (fd == -1) {
- perror(devname);
- return -1;
- }
- ret = is_associated(fd, &statbuf, offset, 1);
+ if (fd == -1)
+ return 0;
+ ret = is_associated(fd, &statbuf, offset, 1);
close(fd);
return ret;
}
diff --git a/mount/umount.c b/mount/umount.c
index 0468cb4..a695f0c 100644
--- a/mount/umount.c
+++ b/mount/umount.c
@@ -14,6 +14,7 @@
#include "mount_constants.h"
#include "sundries.h"
#include "getusername.h"
+#include "pathnames.h"
#include "lomount.h"
#include "loop.h"
#include "fstab.h"
@@ -406,7 +407,7 @@ static int
contains(const char *list, const char *s) {
int n = strlen(s);
- while (*list) {
+ while (list && *list) {
if (strncmp(list, s, n) == 0 &&
(list[n] == 0 || list[n] == ','))
return 1;
@@ -423,7 +424,7 @@ get_value(const char *list, const char *s) {
const char *t;
int n = strlen(s);
- while (*list) {
+ while (list && *list) {
if (strncmp(list, s, n) == 0) {
s = t = list+n;
while (*s && *s != ',')
@@ -432,6 +433,44 @@ get_value(const char *list, const char *s) {
}
while (*list && *list++ != ',') ;
}
+ return NULL;
+}
+
+/* check if @mc contains a loop device which is associated
+ * with the @file in fs
+ */
+static int
+is_valid_loop(struct mntentchn *mc, struct mntentchn *fs)
+{
+ unsigned long long offset = 0;
+ char *p;
+
+ /* check if it begins with /dev/loop */
+ if (strncmp(mc->m.mnt_fsname, _PATH_DEV_LOOP,
+ sizeof(_PATH_DEV_LOOP) - 1))
+ return 0;
+
+ /* check for loop option in fstab */
+ if (!contains(fs->m.mnt_opts, "loop"))
+ return 0;
+
+ /* check for offset option in fstab */
+ p = get_value(fs->m.mnt_opts, "offset=");
+ if (p)
+ offset = strtoull(p, NULL, 10);
+
+ /* check association */
+ if (loopfile_used_with((char *) mc->m.mnt_fsname,
+ fs->m.mnt_fsname, offset) == 1) {
+ if (verbose > 1)
+ printf(_("device %s is associated with %s\n"),
+ mc->m.mnt_fsname, fs->m.mnt_fsname);
+ return 1;
+ }
+
+ if (verbose > 1)
+ printf(_("device %s is not associated with %s\n"),
+ mc->m.mnt_fsname, fs->m.mnt_fsname);
return 0;
}
@@ -516,12 +555,15 @@ umount_file (char *arg) {
the pair (dev,file) in fstab. */
fs = getfs_by_devdir(mc->m.mnt_fsname, mc->m.mnt_dir);
if (!fs) {
- if (!getfs_by_spec (file) && !getfs_by_dir (file))
+ fs = getfs_by_dir(file);
+ if (!fs && !getfs_by_spec(file))
die (2,
_("umount: %s is not in the fstab "
"(and you are not root)"),
file);
- else
+
+ /* spec could be a file which is loop mounted */
+ if (fs && !is_valid_loop(mc, fs))
die (2, _("umount: %s mount disagrees with "
"the fstab"), file);
}
diff --git a/shlibs/uuid/src/uuidd.h b/shlibs/uuid/src/uuidd.h
index 528acdc..c807236 100644
--- a/shlibs/uuid/src/uuidd.h
+++ b/shlibs/uuid/src/uuidd.h
@@ -35,8 +35,8 @@
#ifndef _UUID_UUIDD_H
#define _UUID_UUIDD_H
-#define UUIDD_SOCKET_PATH "/var/lib/libuuid/request"
-#define UUIDD_PIDFILE_PATH "/var/lib/libuuid/uuidd.pid"
+#define UUIDD_SOCKET_PATH "/var/run/uuidd/request"
+#define UUIDD_PIDFILE_PATH "/var/run/uuidd/uuidd.pid"
#define UUIDD_PATH "/usr/sbin/uuidd"
#define UUIDD_OP_GETPID 0
diff --git a/sys-utils/ldattach.8 b/sys-utils/ldattach.8
index 4ee6229..7afe51d 100644
--- a/sys-utils/ldattach.8
+++ b/sys-utils/ldattach.8
@@ -35,7 +35,7 @@ With no arguments,
.B ldattach
prints usage information.
.SH LINE DISCIPLINES
-As of kernel release 2.6.21, the following line disciplines are supported:
+Depending on the kernel release, the following line disciplines are supported:
.TP
.BR TTY ( 0 )
The default line discipline,
@@ -80,6 +80,9 @@ Bluetooth HCI UART driver.
.TP
.BR GIGASET_M101 ( 16 )
Driver for Siemens Gigaset M101 serial DECT adapter.
+.TP
+.BR PPS ( 18 )
+Driver for serial line Pulse Per Second (PPS) source.
.SH OPTIONS
.TP
\fB-d\fP | \fB--debug\fP
diff --git a/sys-utils/ldattach.c b/sys-utils/ldattach.c
index 801dd1c..19f70fe 100644
--- a/sys-utils/ldattach.c
+++ b/sys-utils/ldattach.c
@@ -34,6 +34,10 @@
# define N_GIGASET_M101 16
#endif
+#ifndef N_PPS
+# define N_PPS 18
+#endif
+
#ifndef ARRAY_SIZE
# define ARRAY_SIZE(arr) (sizeof(arr) / sizeof((arr)[0]))
#endif
@@ -65,7 +69,8 @@ ld_table[] = {
{ "HCI", N_HCI },
{ "GIGASET_M101", N_GIGASET_M101 },
{ "GIGASET", N_GIGASET_M101 },
- { "M101", N_GIGASET_M101 }
+ { "M101", N_GIGASET_M101 },
+ { "PPS", N_PPS },
};
/* look up line discipline code */
diff --git a/tests/expected/paths/built-in b/tests/expected/paths/built-in
index 318f44e..51372de 100644
--- a/tests/expected/paths/built-in
+++ b/tests/expected/paths/built-in
@@ -1,6 +1,7 @@
_PATH_DEFPATH /usr/local/bin:/bin:/usr/bin
_PATH_DEFPATH_ROOT /usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
- _PATH_TTY /dev/tty
+ _PATH_DEV_TTY /dev/tty
+ _PATH_DEV_LOOP /dev/loop
_PATH_SECURETTY /etc/securetty
_PATH_WTMPLOCK /etc/wtmplock
_PATH_HUSHLOGIN .hushlogin
diff --git a/tests/helpers/test_pathnames.c b/tests/helpers/test_pathnames.c
index 1accede..5cc6efd 100644
--- a/tests/helpers/test_pathnames.c
+++ b/tests/helpers/test_pathnames.c
@@ -33,7 +33,8 @@ struct hlpPath paths[] =
{
DEF_HLPPATH(_PATH_DEFPATH),
DEF_HLPPATH(_PATH_DEFPATH_ROOT),
- DEF_HLPPATH(_PATH_TTY),
+ DEF_HLPPATH(_PATH_DEV_TTY),
+ DEF_HLPPATH(_PATH_DEV_LOOP),
DEF_HLPPATH(_PATH_SECURETTY),
DEF_HLPPATH(_PATH_WTMPLOCK),
DEF_HLPPATH(_PATH_HUSHLOGIN),

View File

@ -1,18 +0,0 @@
--- mount/lomount.c
+++ mount/lomount.c
@@ -109,7 +109,14 @@ static int
is_loop_used(int fd)
{
struct loop_info li;
- return ioctl (fd, LOOP_GET_STATUS, &li) == 0;
+ int ret;
+ ret = ioctl (fd, LOOP_GET_STATUS, &li);
+ if (ret == 0)
+ return 1;
+ if (ret < 0 && (errno == ENXIO))
+ return 0;
+ /* all other errors, e.g. ENOENT or ESTALE are an error. */
+ return -1;
}
int

View File

@ -1,33 +0,0 @@
Index: util-linux-ng-2.12r+2.13pre7/fdisk/fdisk.c
===================================================================
--- util-linux-ng-2.12r+2.13pre7.orig/fdisk/fdisk.c
+++ util-linux-ng-2.12r+2.13pre7/fdisk/fdisk.c
@@ -1918,6 +1918,16 @@ verify(void) {
total_number_of_sectors - total);
}
+static unsigned long long
+roundup_to_cylinder_boundary(unsigned long long offset) {
+ if (units_per_sector) {
+ unsigned long long extra_sectors = offset % units_per_sector;
+ if (extra_sectors != 0)
+ offset += (units_per_sector - extra_sectors) - 1;
+ }
+ return offset;
+}
+
static void
add_partition(int n, int sys) {
char mesg[256]; /* 48 does not suffice in Japanese */
@@ -1953,8 +1963,10 @@ add_partition(int n, int sys) {
limit = get_start_sect(q) + get_nr_sects(q) - 1;
}
if (display_in_cyl_units)
- for (i = 0; i < partitions; i++)
+ for (i = 0; i < partitions; i++) {
first[i] = (cround(first[i]) - 1) * units_per_sector;
+ last[i] = roundup_to_cylinder_boundary(last[i]);
+ }
snprintf(mesg, sizeof(mesg), _("First %s"), str_units(SINGULAR));
do {

View File

@ -1,118 +0,0 @@
From: Jeff Mahoney <jeffm@suse.com>
Subject: [PATCH] raw: Use the RAW_SETBIND ioctl without stat'ing the raw# file
References: bnc#450675
The in-kernel ioctl code creates a raw# device on-demand. udev will create
the /dev/raw/raw# file when the device is created automatically.
The current raw userspace code wants to stat the file before using it,
which is unnecessary for setting up the raw device.
This patch stats the file only when query() is called as a singleton, and
it's doubtful it's needed even there. I modified as little code as I could,
though.
Without this patch raw devices WILL NOT WORK on SLE11.
Signed-off-by: Jeff Mahoney <jeffm@suse.com>
---
disk-utils/raw.c | 54 ++++++++++++++++++++++++++++--------------------------
1 file changed, 28 insertions(+), 26 deletions(-)
--- a/disk-utils/raw.c
+++ b/disk-utils/raw.c
@@ -41,7 +41,7 @@ int master_fd;
int raw_minor;
void open_raw_ctl(void);
-int query(int minor, int quiet);
+int query(int minor, const char *raw_name, int quiet);
int bind (int minor, int block_major, int block_minor);
@@ -96,7 +96,7 @@ int main(int argc, char *argv[])
if (optind < argc)
usage(1);
for (i = 1; i < RAW_NR_MINORS; i++)
- query(i, 1);
+ query(i, NULL, 1);
exit(0);
}
@@ -122,28 +122,8 @@ int main(int argc, char *argv[])
exit(2);
}
- err = stat(raw_name, &statbuf);
- if (err) {
- fprintf (stderr, "Cannot locate raw device '%s' (%s)\n",
- raw_name, strerror(errno));
- exit(2);
- }
-
- if (!S_ISCHR(statbuf.st_mode)) {
- fprintf (stderr, "Raw device '%s' is not a character dev\n",
- raw_name);
- exit(2);
- }
- if (major(statbuf.st_rdev) != RAW_MAJOR) {
- fprintf (stderr, "Device '%s' is not a raw dev\n",
- raw_name);
- exit(2);
- }
-
- raw_minor = minor(statbuf.st_rdev);
-
if (do_query)
- return query(raw_minor, 0);
+ return query(raw_minor, raw_name, 0);
/*
* It's not a query, so we still have some parsing to do. Have
@@ -205,13 +185,35 @@ void open_raw_ctl(void)
}
}
-int query(int minor, int quiet)
+int query(int raw_minor, const char *raw_name, int quiet)
{
struct raw_config_request rq;
static int has_worked = 0;
int err;
+ struct stat statbuf;
+
+ if (raw_name) {
+ err = stat(raw_name, &statbuf);
+ if (err) {
+ fprintf (stderr, "Cannot locate raw device '%s' (%s)\n",
+ raw_name, strerror(errno));
+ exit(2);
+ }
+
+ if (!S_ISCHR(statbuf.st_mode)) {
+ fprintf (stderr, "Raw device '%s' is not a character dev\n",
+ raw_name);
+ exit(2);
+ }
+ if (major(statbuf.st_rdev) != RAW_MAJOR) {
+ fprintf (stderr, "Device '%s' is not a raw dev\n",
+ raw_name);
+ exit(2);
+ }
+ raw_minor = minor(statbuf.st_rdev);
+ }
- rq.raw_minor = minor;
+ rq.raw_minor = raw_minor;
err = ioctl(master_fd, RAW_GETBIND, &rq);
if (err < 0) {
if (quiet && errno == ENODEV)
@@ -230,7 +232,7 @@ int query(int minor, int quiet)
if (quiet && !rq.block_major && !rq.block_minor)
return 0;
printf (RAWDEVDIR "raw%d: bound to major %d, minor %d\n",
- minor, (int) rq.block_major, (int) rq.block_minor);
+ raw_minor, (int) rq.block_major, (int) rq.block_minor);
return 0;
}

View File

@ -1,170 +0,0 @@
From: Kurt Garloff <garloff@suse.de>
Subject: Allow to combine --adjust and --hctosys
Reference: bnc441106
Waiting for a clock tick twice when calling --adjust and --hctosys
is wasteful. Having to do it once is bad enough.
This patch allows combining the two options.
[Patch 1/5]
Index: util-linux-ng-2.14.1/hwclock/hwclock.c
===================================================================
--- util-linux-ng-2.14.1.orig/hwclock/hwclock.c
+++ util-linux-ng-2.14.1/hwclock/hwclock.c
@@ -490,13 +490,18 @@ set_hardware_clock(const time_t newtime,
}
+static int
+set_system_clock(const bool hclock_valid, const time_t newtime,
+ const bool testing, const int usec);
+
static void
set_hardware_clock_exact(const time_t sethwtime,
const struct timeval refsystime,
const bool universal,
- const bool testing) {
+ const bool testing,
+ const bool hctosys) {
/*----------------------------------------------------------------------------
Set the Hardware Clock to the time "sethwtime", in local time zone or UTC,
according to "universal".
@@ -539,8 +544,10 @@ set_hardware_clock_exact(const time_t se
if (tdiff < 0)
goto time_resync; /* probably time was reset */
} while (time_diff(nowsystime, refsystime) - 0.5 < newhwtime - sethwtime);
+ if (hctosys)
+ set_system_clock(TRUE, newhwtime, testing, 500000);
set_hardware_clock(newhwtime, universal, testing);
}
@@ -671,9 +678,9 @@ interpret_date_string(const char *date_o
static int
set_system_clock(const bool hclock_valid, const time_t newtime,
- const bool testing) {
+ const bool testing, const int usec) {
/*----------------------------------------------------------------------------
Set the System Clock to time 'newtime'.
Also set the kernel time zone value to the value indicated by the
@@ -699,9 +706,9 @@ set_system_clock(const bool hclock_valid
int minuteswest;
int rc;
tv.tv_sec = newtime;
- tv.tv_usec = 0;
+ tv.tv_usec = usec;
broken = localtime(&newtime);
#ifdef HAVE_TM_GMTOFF
minuteswest = -broken->tm_gmtoff/60; /* GNU extension */
@@ -935,9 +942,10 @@ save_adjtime(const struct adjtime adjtim
static void
do_adjustment(struct adjtime *adjtime_p,
const bool hclock_valid, const time_t hclocktime,
const struct timeval read_time,
- const bool universal, const bool testing) {
+ const bool universal, const bool testing,
+ const bool hctosys) {
/*---------------------------------------------------------------------------
Do the adjustment requested, by 1) setting the Hardware Clock (if
necessary), and 2) updating the last-adjusted time in the adjtime
structure.
@@ -990,9 +998,9 @@ do_adjustment(struct adjtime *adjtime_p,
&adjustment, &retro);
if (adjustment > 0 || adjustment < -1) {
set_hardware_clock_exact(hclocktime + adjustment,
time_inc(read_time, -retro),
- universal, testing);
+ universal, testing, hctosys);
adjtime_p->last_adj_time = hclocktime + adjustment;
adjtime_p->not_adjusted = 0;
adjtime_p->dirty = TRUE;
} else
@@ -1046,8 +1054,9 @@ manipulate_clock(const bool show, const
struct adjtime adjtime;
/* Contents of the adjtime file, or what they should be. */
int rc; /* local return code */
bool no_auth; /* User lacks necessary authorization to access the clock */
+ int usec = 0;
no_auth = ur->get_permissions();
if (no_auth)
return EX_NOPERM;
@@ -1097,15 +1106,15 @@ manipulate_clock(const bool show, const
display_time(hclock_valid, hclocktime,
time_diff(read_time, startup_time));
} else if (set) {
set_hardware_clock_exact(set_time, startup_time,
- universal, testing);
+ universal, testing, FALSE);
if (!noadjfile)
adjust_drift_factor(&adjtime, set_time, hclock_valid, hclocktime,
time_diff(read_time, startup_time));
} else if (adjust) {
do_adjustment(&adjtime, hclock_valid, hclocktime,
- read_time, universal, testing);
+ read_time, universal, testing, hctosys);
} else if (systohc) {
struct timeval nowtime, reftime;
/* We can only set_hardware_clock_exact to a whole seconds
time, so we set it with reference to the most recent
@@ -1115,14 +1124,14 @@ manipulate_clock(const bool show, const
reftime.tv_sec = nowtime.tv_sec;
reftime.tv_usec = 0;
set_hardware_clock_exact((time_t) reftime.tv_sec, reftime,
- universal, testing);
+ universal, testing, FALSE);
if (!noadjfile)
adjust_drift_factor(&adjtime, (time_t) reftime.tv_sec, hclock_valid,
hclocktime, (double) read_time.tv_usec / 1E6);
} else if (hctosys) {
- rc = set_system_clock(hclock_valid, hclocktime, testing);
+ rc = set_system_clock(hclock_valid, hclocktime, testing, usec);
if (rc) {
printf(_("Unable to set system clock.\n"));
return rc;
}
@@ -1442,9 +1451,16 @@ main(int argc, char **argv) {
"You supplied %d.\n"),
MYNAME, argc);
}
- if (show + set + systohc + hctosys + adjust + getepoch + setepoch > 1){
+ if (show + set + systohc + hctosys + getepoch + setepoch > 1){
+ fprintf(stderr, _("You have specified multiple functions.\n"
+ "You can only perform one function "
+ "at a time.\n"));
+ hwclock_exit(EX_USAGE);
+ }
+
+ if (show + set + systohc + adjust + getepoch + setepoch > 1){
fprintf(stderr, _("You have specified multiple functions.\n"
"You can only perform one function "
"at a time.\n"));
hwclock_exit(EX_USAGE);
Index: util-linux-ng-2.14.1/hwclock/hwclock.8
===================================================================
--- util-linux-ng-2.14.1.orig/hwclock/hwclock.8
+++ util-linux-ng-2.14.1/hwclock/hwclock.8
@@ -86,8 +86,12 @@ Set the Hardware Clock to the current Sy
.B \-\-adjust
Add or subtract time from the Hardware Clock to account for systematic
drift since the last time the clock was set or adjusted. See discussion
below.
+.B \-\-adjust
+can be used together with
+.B \-\-hctosys
+to speed up the boot process by 1s.
.TP
.B \-\-getepoch
Print the kernel's Hardware Clock epoch value to standard output.
This is the number of years into AD to which a zero year value in the

View File

@ -1,630 +0,0 @@
commit 5dd7507c18fa3d739266aeda4847be41e0613fad
Author: Cai Qian <qcai@redhat.com>
Date: Thu Jul 17 14:19:40 2008 +0200
lscpu: new command
Add a lscpu(1) utility program.
[kzak@redhat.com:
- indent by linux-2.6/scripts/Lindent
- add lscpu.{c,1} to sys-utils/Makefile.am
- add NLS suport
- complete code refactoring
]
Co-Author: Karel Zak <kzak@redhat.com>
Signed-off-by: Cai Qian <qcai@redhat.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
Index: util-linux-ng-2.14.2-rc2/README.licensing
===================================================================
--- util-linux-ng-2.14.2-rc2.orig/README.licensing 2009-01-22 12:32:48.000000000 +0100
+++ util-linux-ng-2.14.2-rc2/README.licensing 2009-02-05 15:27:37.000000000 +0100
@@ -2,6 +2,8 @@
The project utils-linux-ng doesn't use same license for all code. There are
code with:
+ * GPLv3+ (GNU General Public License version 3, or any later version)
+
* GPLv2+ (GNU General Public License version 2, or any later version)
* GPLv2 (GNU General Public License version 2)
Index: util-linux-ng-2.14.2-rc2/po/POTFILES.in
===================================================================
--- util-linux-ng-2.14.2-rc2.orig/po/POTFILES.in 2009-01-22 12:32:48.000000000 +0100
+++ util-linux-ng-2.14.2-rc2/po/POTFILES.in 2009-02-05 15:27:37.000000000 +0100
@@ -98,6 +98,7 @@ sys-utils/flock.c
sys-utils/ipcrm.c
sys-utils/ipcs.c
sys-utils/ldattach.c
+sys-utils/lscpu.c
sys-utils/rdev.c
sys-utils/readprofile.c
sys-utils/renice.c
Index: util-linux-ng-2.14.2-rc2/sys-utils/Makefile.am
===================================================================
--- util-linux-ng-2.14.2-rc2.orig/sys-utils/Makefile.am 2009-01-22 12:32:48.000000000 +0100
+++ util-linux-ng-2.14.2-rc2/sys-utils/Makefile.am 2009-02-05 15:28:58.000000000 +0100
@@ -11,11 +11,11 @@ dist_man_MANS = flock.1 ipcrm.1 ipcs.1 r
if LINUX
bin_PROGRAMS += dmesg
sbin_PROGRAMS += ctrlaltdel
-usrbinexec_PROGRAMS += cytune setarch
+usrbinexec_PROGRAMS += cytune setarch lscpu
usrsbinexec_PROGRAMS += ldattach tunelp rtcwake
dist_man_MANS += dmesg.1 ctrlaltdel.8 cytune.8 setarch.8 \
- tunelp.8 rtcwake.8 ldattach.8
+ tunelp.8 rtcwake.8 ldattach.8 lscpu.1
endif
cytune_SOURCES = cytune.c cyclades.h
Index: util-linux-ng-2.14.2-rc2/sys-utils/lscpu.1
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ util-linux-ng-2.14.2-rc2/sys-utils/lscpu.1 2009-02-05 15:27:37.000000000 +0100
@@ -0,0 +1,29 @@
+.\" Process this file with
+.\" groff -man -Tascii lscpu.1
+.\"
+.TH LSCPU 1 "JULY 2008" Linux "User Manuals"
+.SH NAME
+lscpu \- CPU architecture information helper
+.SH SYNOPSIS
+.B lscpu [-hp]
+.SH DESCRIPTION
+.B lscpu
+gathers CPU architecture information like number of CPUs, threads,
+cores, sockets, NUMA nodes, information about CPU caches, CPU family,
+model and stepping from sysfs and /proc/cpuinfo, and prints it in
+human-readable format. Alternatively, it can print out in parsable
+format including how different caches are shared by different CPUs,
+which can also be fed to other programs.
+.SH OPTIONS
+.IP -h, --help
+Print a help message.
+.IP -p, --parse
+Print out in parsable instead of printable format.
+.SH BUGS
+The program at the moment does not handle the system installed with
+different types of physical processors.
+.SH AUTHOR
+Cai Qian <qcai@redhat.com>
+.SH AVAILABILITY
+The setarch command is part of the util-linux-ng package and is available from
+ftp://ftp.kernel.org/pub/linux/utils/util-linux-ng/.
Index: util-linux-ng-2.14.2-rc2/sys-utils/lscpu.c
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ util-linux-ng-2.14.2-rc2/sys-utils/lscpu.c 2009-02-05 15:27:37.000000000 +0100
@@ -0,0 +1,529 @@
+/*
+ * lscpu - CPU architecture information helper
+ *
+ * Copyright (C) 2008 Cai Qian <qcai@redhat.com>
+ * Copyright (C) 2008 Karel Zak <kzak@redhat.com>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#include <ctype.h>
+#include <dirent.h>
+#include <err.h>
+#include <errno.h>
+#include <fcntl.h>
+#include <getopt.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <sys/utsname.h>
+#include <unistd.h>
+#include <stdarg.h>
+
+#include "nls.h"
+
+#define CACHE_MAX 100
+
+/* /sys paths */
+#define _PATH_SYS_SYSTEM "/sys/devices/system"
+#define _PATH_SYS_CPU0 _PATH_SYS_SYSTEM "/cpu/cpu0"
+#define _PATH_PROC_XENCAP "/proc/xen/capabilities"
+#define _PATH_PROC_CPUINFO "/proc/cpuinfo"
+
+int have_topology;
+int have_cache;
+int have_node;
+
+/* CPU(s) description */
+struct cpu_decs {
+ /* counters */
+ int ct_cpu;
+ int ct_thread;
+ int ct_core;
+ int ct_socket;
+ int ct_node;
+ int ct_cache;
+
+ /* who is who */
+ char *arch;
+ char *vendor;
+ char *family;
+ char *model;
+
+ /* caches */
+ char *caname[CACHE_MAX];
+ char *casize[CACHE_MAX];
+ int camap[CACHE_MAX];
+
+ /* misc */
+ char *mhz;
+ char *stepping;
+ char *flags;
+
+ /* NUMA */
+ int *nodecpu;
+};
+
+char pathbuf[PATH_MAX];
+
+static void path_scanstr(char *result, const char *path, ...)
+ __attribute__ ((__format__ (__printf__, 2, 3)));
+static int path_exist(const char *path, ...)
+ __attribute__ ((__format__ (__printf__, 1, 2)));
+static int path_sibling(const char *path, ...)
+ __attribute__ ((__format__ (__printf__, 1, 2)));
+
+static FILE *
+xfopen(const char *path, const char *mode)
+{
+ FILE *fd = fopen(path, mode);
+ if (!fd)
+ err(EXIT_FAILURE, _("error: %s"), path);
+ return fd;
+}
+
+static FILE *
+path_vfopen(const char *mode, const char *path, va_list ap)
+{
+ vsnprintf(pathbuf, sizeof(pathbuf), path, ap);
+ return xfopen(pathbuf, mode);
+}
+
+static void
+path_scanstr(char *result, const char *path, ...)
+{
+ FILE *fd;
+ va_list ap;
+
+ va_start(ap, path);
+ fd = path_vfopen("r", path, ap);
+ va_end(ap);
+
+ if (fscanf(fd, "%s", result) != 1) {
+ if (ferror(fd))
+ err(EXIT_FAILURE, _("error: %s"), pathbuf);
+ else
+ errx(EXIT_FAILURE, _("error parse: %s"), pathbuf);
+ }
+ fclose(fd);
+}
+
+static int
+path_exist(const char *path, ...)
+{
+ va_list ap;
+
+ va_start(ap, path);
+ vsnprintf(pathbuf, sizeof(pathbuf), path, ap);
+ va_end(ap);
+
+ return access(pathbuf, F_OK) == 0;
+}
+
+char *
+xstrdup(const char *str)
+{
+ char *s = strdup(str);
+ if (!s)
+ err(EXIT_FAILURE, _("error: strdup failed"));
+ return s;
+}
+
+/* count the set bit in a mapping file */
+static int
+path_sibling(const char *path, ...)
+{
+ int c, n;
+ int result = 0;
+ char s[2];
+ FILE *fp;
+ va_list ap;
+
+ va_start(ap, path);
+ fp = path_vfopen("r", path, ap);
+ va_end(ap);
+
+ while ((c = fgetc(fp)) != EOF) {
+ if (isxdigit(c)) {
+ s[0] = c;
+ s[1] = '\0';
+ for (n = strtol(s, NULL, 16); n > 0; n /= 2) {
+ if (n % 2)
+ result++;
+ }
+ }
+ }
+ fclose(fp);
+
+ return result;
+}
+
+/* Lookup a pattern and get the value from cpuinfo.
+ * Format is:
+ *
+ * "<pattern> : <key>"
+ */
+int lookup(char *line, char *pattern, char **value)
+{
+ char *p, *v;
+ int len = strlen(pattern);
+
+ if (!*line)
+ return 0;
+
+ /* pattern */
+ if (strncmp(line, pattern, len))
+ return 0;
+
+ /* white spaces */
+ for (p = line + len; isspace(*p); p++);
+
+ /* separator */
+ if (*p != ':')
+ return 0;
+
+ /* white spaces */
+ for (++p; isspace(*p); p++);
+
+ /* value */
+ if (!*p)
+ return 0;
+ v = p;
+
+ /* end of value */
+ len = strlen(line) - 1;
+ for (p = line + len; isspace(*(p-1)); p--);
+ *p = '\0';
+
+ *value = xstrdup(v);
+ return 1;
+}
+
+static void
+read_basicinfo(struct cpu_decs *cpu)
+{
+ FILE *fp = xfopen(_PATH_PROC_CPUINFO, "r");
+ char buf[BUFSIZ];
+ struct utsname utsbuf;
+
+ /* architecture */
+ if (uname(&utsbuf) == -1)
+ err(EXIT_FAILURE, _("error: uname failed"));
+ cpu->arch = xstrdup(utsbuf.machine);
+
+ /* count CPU(s) */
+ while(path_exist(_PATH_SYS_SYSTEM "/cpu/cpu%d", cpu->ct_cpu))
+ cpu->ct_cpu++;
+
+ /* details */
+ while (fgets(buf, sizeof(buf), fp) != NULL) {
+ /* IA64 */
+ if (lookup(buf, "vendor", &cpu->vendor)) ;
+ else if (lookup(buf, "vendor_id", &cpu->vendor)) ;
+ /* IA64 */
+ else if (lookup(buf, "family", &cpu->family)) ;
+ else if (lookup(buf, "cpu family", &cpu->family)) ;
+ else if (lookup(buf, "model", &cpu->model)) ;
+ else if (lookup(buf, "stepping", &cpu->stepping)) ;
+ else if (lookup(buf, "cpu MHz", &cpu->mhz)) ;
+ else if (lookup(buf, "flags", &cpu->flags)) ;
+ else
+ continue;
+ }
+ fclose(fp);
+}
+
+static void
+read_topology(struct cpu_decs *cpu)
+{
+ /* number of threads */
+ cpu->ct_thread = path_sibling(
+ _PATH_SYS_CPU0 "/topology/thread_siblings");
+
+ /* number of cores */
+ cpu->ct_core = path_sibling(
+ _PATH_SYS_CPU0 "/topology/core_siblings")
+ / cpu->ct_thread;
+
+ /* number of sockets */
+ cpu->ct_socket = cpu->ct_cpu / cpu->ct_core / cpu->ct_thread;
+}
+
+static void
+read_cache(struct cpu_decs *cpu)
+{
+ char buf[256];
+ DIR *dp;
+ struct dirent *dir;
+ int level, type;
+
+ dp = opendir(_PATH_SYS_CPU0 "/cache");
+ if (dp == NULL)
+ err(EXIT_FAILURE, _("error: %s"), _PATH_SYS_CPU0 "/cache");
+
+ while ((dir = readdir(dp)) != NULL) {
+ if (!strcmp(dir->d_name, ".")
+ || !strcmp(dir->d_name, ".."))
+ continue;
+
+ /* cache type */
+ path_scanstr(buf, _PATH_SYS_CPU0 "/cache/%s/type", dir->d_name);
+ if (!strcmp(buf, "Data"))
+ type = 'd';
+ else if (!strcmp(buf, "Instruction"))
+ type = 'i';
+ else
+ type = 0;
+
+ /* cache level */
+ path_scanstr(buf, _PATH_SYS_CPU0 "/cache/%s/level", dir->d_name);
+ level = atoi(buf);
+
+ if (type)
+ snprintf(buf, sizeof(buf), "L%d%c", level, type);
+ else
+ snprintf(buf, sizeof(buf), "L%d", level);
+
+ cpu->caname[cpu->ct_cache] = xstrdup(buf);
+
+ /* cache size */
+ path_scanstr(buf, _PATH_SYS_CPU0 "/cache/%s/size", dir->d_name);
+ cpu->casize[cpu->ct_cache] = xstrdup(buf);
+
+ /* information about how CPUs share different caches */
+ cpu->camap[cpu->ct_cache] = path_sibling(
+ _PATH_SYS_CPU0 "/cache/%s/shared_cpu_map",
+ dir->d_name);
+ cpu->ct_cache++;
+ }
+}
+
+static void
+read_nodes(struct cpu_decs *cpu)
+{
+ int i;
+
+ /* number of NUMA node */
+ while (path_exist(_PATH_SYS_SYSTEM "/node/node%d", cpu->ct_node))
+ cpu->ct_node++;
+
+ cpu->nodecpu = (int *) malloc(cpu->ct_node * sizeof(int));
+ if (!cpu->nodecpu)
+ err(EXIT_FAILURE, _("error: malloc failed"));
+
+ /* information about how nodes share different CPUs */
+ for (i = 0; i < cpu->ct_node; i++)
+ cpu->nodecpu[i] = path_sibling(
+ _PATH_SYS_SYSTEM "/node/node%d/cpumap",
+ i);
+}
+
+static void
+check_system(void)
+{
+ FILE *fd;
+ char buf[256];
+
+ /* Dom0 Kernel gives wrong information. */
+ fd = fopen(_PATH_PROC_XENCAP, "r");
+ if (fd) {
+ if (fscanf(fd, "%s", buf) == 1 && !strcmp(buf, "control_d"))
+ errx(EXIT_FAILURE,
+ _("error: Dom0 Kernel is unsupported."));
+ fclose(fd);
+ }
+
+ /* Read through sysfs. */
+ if (access(_PATH_SYS_SYSTEM, F_OK))
+ errx(1, _("error: /sys filesystem is not accessable."));
+
+ if (!access(_PATH_SYS_SYSTEM "/node", F_OK))
+ have_node = 1;
+
+ if (!access(_PATH_SYS_CPU0 "/topology/thread_siblings", F_OK))
+ have_topology = 1;
+
+ if (!access(_PATH_SYS_CPU0 "/cache", F_OK))
+ have_cache = 1;
+}
+
+static void
+print_parsable(struct cpu_decs *cpu)
+{
+ int i, j;
+
+ puts(
+ "# The following is the parsable format, which can be fed to other\n"
+ "# programs. Each different item in every column has a unique ID\n"
+ "# starting from zero.\n"
+ "# CPU,Core,Socket,Node");
+
+ if (have_cache) {
+ /* separator between CPU topology and cache information */
+ putchar(',');
+
+ for (i = cpu->ct_cache - 1; i >= 0; i--)
+ printf(",%s", cpu->caname[i]);
+ }
+ putchar('\n');
+
+ for (i = 0; i < cpu->ct_cpu; i++) {
+ printf("%d", i);
+
+ if (have_topology)
+ printf(",%d,%d",
+ i / cpu->ct_thread,
+ i / cpu->ct_core / cpu->ct_thread);
+ else
+ printf(",,");
+
+ if (have_node) {
+ int c = 0;
+
+ for (j = 0; j < cpu->ct_node; j++) {
+ c += cpu->nodecpu[j];
+ if (i < c) {
+ printf(",%d", j);
+ break;
+ }
+ }
+ } else
+ putchar(',');
+
+ if (have_cache) {
+ putchar(',');
+
+ for (j = cpu->ct_cache - 1; j >= 0; j--) {
+ /* If shared_cpu_map is 0, all CPUs share the same
+ cache. */
+ if (cpu->camap[j] == 0)
+ cpu->camap[j] = cpu->ct_core *
+ cpu->ct_thread;
+
+ printf(",%d", i / cpu->camap[j]);
+ }
+ }
+ putchar('\n');
+ }
+}
+
+
+/* output formats "<key> <value>"*/
+#define print_s(_key, _val) printf("%-23s%s\n", _key, _val)
+#define print_n(_key, _val) printf("%-23s%d\n", _key, _val)
+
+static void
+print_readable(struct cpu_decs *cpu)
+{
+ char buf[BUFSIZ];
+
+ print_s("Architecture:", cpu->arch);
+ print_n("CPU(s):", cpu->ct_cpu);
+
+ if (have_topology) {
+ print_n(_("Thread(s) per core:"), cpu->ct_thread);
+ print_n(_("Core(s) per socket:"), cpu->ct_core);
+ print_n(_("CPU socket(s):"), cpu->ct_socket);
+ }
+
+ if (have_node)
+ print_n(_("NUMA node(s):"), cpu->ct_node);
+ if (cpu->vendor)
+ print_s(_("Vendor ID:"), cpu->vendor);
+ if (cpu->family)
+ print_s(_("CPU family:"), cpu->family);
+ if (cpu->model)
+ print_s(_("Model:"), cpu->model);
+ if (cpu->stepping)
+ print_s(_("Stepping:"), cpu->stepping);
+ if (cpu->mhz)
+ print_s(_("CPU MHz:"), cpu->mhz);
+ if (cpu->flags) {
+ snprintf(buf, sizeof(buf), " %s ", cpu->flags);
+ if (strstr(buf, " svm "))
+ print_s(_("Virtualization:"), "AMD-V");
+ else if (strstr(buf, " vmx "))
+ print_s(_("Virtualization:"), "VT-x");
+ }
+
+ if (have_cache) {
+ int i;
+
+ for (i = cpu->ct_cache - 1; i >= 0; i--) {
+ snprintf(buf, sizeof(buf),
+ _("%s cache:"), cpu->caname[i]);
+ print_s(buf, cpu->casize[i]);
+ }
+ }
+}
+
+void usage(int rc)
+{
+ printf(_("Usage: %s [option]\n"),
+ program_invocation_short_name);
+
+ puts(_( "CPU architecture information helper\n\n"
+ " -h, --help usage information\n"
+ " -p, --parse print out in parsable instead of printable format.\n"));
+ exit(rc);
+}
+
+int main(int argc, char *argv[])
+{
+ struct cpu_decs _cpu, *cpu = &_cpu;
+ int parsable = 0, c;
+
+ struct option longopts[] = {
+ { "help", no_argument, 0, 'h' },
+ { "parse", no_argument, 0, 'p' },
+ { NULL, 0, 0, 0 }
+ };
+
+ setlocale(LC_MESSAGES, "");
+ bindtextdomain(PACKAGE, LOCALEDIR);
+ textdomain(PACKAGE);
+
+ while((c = getopt_long(argc, argv, "hp", longopts, NULL)) != -1) {
+ switch (c) {
+ case 'h':
+ usage(EXIT_SUCCESS);
+ case 'p':
+ parsable = 1;
+ break;
+ default:
+ usage(EXIT_FAILURE);
+ }
+ }
+
+ memset(cpu, 0, sizeof(*cpu));
+
+ check_system();
+
+ read_basicinfo(cpu);
+
+ if (have_topology)
+ read_topology(cpu);
+ if (have_cache)
+ read_cache(cpu);
+ if (have_node)
+ read_nodes(cpu);
+
+ /* Show time! */
+ if (parsable)
+ print_parsable(cpu);
+ else
+ print_readable(cpu);
+
+ return EXIT_FAILURE;
+}

View File

@ -1,284 +0,0 @@
commit c8b64f6d7770d62065bdc4fa5c4f80cc2326e203
Author: Karel Zak <kzak@redhat.com>
Date: Wed Oct 1 01:29:32 2008 +0200
lscpu: add Hypervisor detection
This patch adds two new fields:
* "Hypervisor vendor" -- based on CPUID and hypervisor specific
PCI devices. lscpu(1) supports KVM, XEN, Microsoft HV now.
* "Virtualization type"
- "none" = Xen dom0
- "full" = full virtualization (KVM, Xen, ...)
- "para" = Xen paravirtualization
Co-Author: Ky Srinivasan <ksrinivasan@novell.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
diff --git a/sys-utils/lscpu.1 b/sys-utils/lscpu.1
index 78da8a1..e0e9935 100644
--- a/sys-utils/lscpu.1
+++ b/sys-utils/lscpu.1
@@ -22,6 +22,8 @@ Print out in parsable instead of printable format.
.SH BUGS
The program at the moment does not handle the system installed with
different types of physical processors.
+
+Sometimes in Xen Dom0 kernel reports wrong data.
.SH AUTHOR
Cai Qian <qcai@redhat.com>
.SH AVAILABILITY
diff --git a/sys-utils/lscpu.c b/sys-utils/lscpu.c
index d6bb8b9..82972b3 100644
--- a/sys-utils/lscpu.c
+++ b/sys-utils/lscpu.c
@@ -38,8 +38,10 @@
/* /sys paths */
#define _PATH_SYS_SYSTEM "sys/devices/system"
#define _PATH_SYS_CPU0 _PATH_SYS_SYSTEM "/cpu/cpu0"
-#define _PATH_PROC_XENCAP "proc/xen/capabilities"
+#define _PATH_PROC_XEN "proc/xen"
+#define _PATH_PROC_XENCAP _PATH_PROC_XEN "/capabilities"
#define _PATH_PROC_CPUINFO "proc/cpuinfo"
+#define _PATH_PROC_PCIDEVS "proc/bus/pci/devices"
int have_topology;
int have_cache;
@@ -52,6 +54,33 @@ struct ca_desc {
int camap;
};
+/* virtualization types */
+enum {
+ VIRT_NONE = 0,
+ VIRT_PARA,
+ VIRT_FULL
+};
+const char *virt_types[] = {
+ [VIRT_NONE] = N_("none"),
+ [VIRT_PARA] = N_("para"),
+ [VIRT_FULL] = N_("full")
+};
+
+/* hypervisor vendors */
+enum {
+ HYPER_NONE = 0,
+ HYPER_XEN,
+ HYPER_KVM,
+ HYPER_MSHV
+};
+const char *hv_vendors[] = {
+ [HYPER_NONE] = NULL,
+ [HYPER_XEN] = "Xen",
+ [HYPER_KVM] = "KVM",
+ [HYPER_MSHV] = "Microsoft"
+};
+
+
/* CPU(s) description */
struct cpu_desc {
/* counters */
@@ -67,6 +96,9 @@ struct cpu_desc {
char *vendor;
char *family;
char *model;
+ char *virtflag; /* virtualization flag (vmx, svm) */
+ int hyper; /* hypervisor vendor ID */
+ int virtype; /* VIRT_PARA|FULL|NONE ? */
/* caches */
struct ca_desc cache[CACHE_MAX];
@@ -246,9 +278,130 @@ read_basicinfo(struct cpu_desc *cpu)
else
continue;
}
+
+ if (cpu->flags) {
+ snprintf(buf, sizeof(buf), " %s ", cpu->flags);
+ if (strstr(buf, " svm "))
+ cpu->virtflag = strdup("svm");
+ else if (strstr(buf, " vmx "))
+ cpu->virtflag = strdup("vmx");
+ }
+
fclose(fp);
}
+static int
+has_pci_device(int vendor, int device)
+{
+ FILE *f;
+ int num, fn, ven, dev;
+ int res = 1;
+
+ f = fopen(_PATH_PROC_PCIDEVS, "r");
+ if (!f)
+ return 0;
+
+ /* for more details about bus/pci/devices format see
+ * drivers/pci/proc.c in linux kernel
+ */
+ while(fscanf(f, "%02x%02x\t%04x%04x\t%*[^\n]",
+ &num, &fn, &ven, &dev) == 4) {
+
+ if (ven == vendor && dev == device)
+ goto found;
+ }
+
+ res = 0;
+found:
+ fclose(f);
+ return res;
+}
+
+#if defined(__x86_64__) || defined(__i386__)
+
+/*
+ * This CPUID leaf returns the information about the hypervisor.
+ * EAX : maximum input value for CPUID supported by the hypervisor.
+ * EBX, ECX, EDX : Hypervisor vendor ID signature. E.g. VMwareVMware.
+ */
+#define HYPERVISOR_INFO_LEAF 0x40000000
+
+static inline void
+cpuid(unsigned int op, unsigned int *eax, unsigned int *ebx,
+ unsigned int *ecx, unsigned int *edx)
+{
+ __asm__("cpuid"
+ : "=a" (*eax),
+ "=b" (*ebx),
+ "=c" (*ecx),
+ "=d" (*edx)
+ : "0" (op), "c"(0));
+}
+
+static void
+read_hypervisor_cpuid(struct cpu_desc *cpu)
+{
+ unsigned int eax = 0, ebx = 0, ecx = 0, edx = 0;
+ char hyper_vendor_id[13];
+
+ memset(hyper_vendor_id, 0, sizeof(hyper_vendor_id));
+
+ cpuid(HYPERVISOR_INFO_LEAF, &eax, &ebx, &ecx, &edx);
+ memcpy(hyper_vendor_id + 0, &ebx, 4);
+ memcpy(hyper_vendor_id + 4, &ecx, 4);
+ memcpy(hyper_vendor_id + 8, &edx, 4);
+ hyper_vendor_id[12] = '\0';
+
+ if (!hyper_vendor_id[0])
+ return;
+
+ if (!strncmp("XenVMMXenVMM", hyper_vendor_id, 12))
+ cpu->hyper = HYPER_XEN;
+ else if (!strncmp("KVMKVMKVM", hyper_vendor_id, 9))
+ cpu->hyper = HYPER_KVM;
+ else if (!strncmp("Microsoft Hv", hyper_vendor_id, 12))
+ cpu->hyper = HYPER_MSHV;
+}
+
+#else /* ! __x86_64__ */
+static void
+read_hypervisor_cpuid(struct cpu_desc *cpu)
+{
+}
+#endif
+
+static void
+read_hypervisor(struct cpu_desc *cpu)
+{
+ read_hypervisor_cpuid(cpu);
+
+ if (cpu->hyper)
+ /* hvm */
+ cpu->virtype = VIRT_FULL;
+
+ else if (!access(_PATH_PROC_XEN, F_OK)) {
+ /* Xen para-virt or dom0 */
+ FILE *fd = fopen(_PATH_PROC_XENCAP, "r");
+ int dom0 = 0;
+
+ if (fd) {
+ char buf[256];
+
+ if (fscanf(fd, "%s", buf) == 1 &&
+ !strcmp(buf, "control_d"))
+ dom0 = 1;
+ fclose(fd);
+ }
+ cpu->virtype = dom0 ? VIRT_NONE : VIRT_PARA;
+ cpu->hyper = HYPER_XEN;
+
+ } else if (has_pci_device(0x5853, 0x0001)) {
+ /* Xen full-virt on non-x86_64 */
+ cpu->hyper = HYPER_XEN;
+ cpu->virtype = VIRT_FULL;
+ }
+}
+
static void
read_topology(struct cpu_desc *cpu)
{
@@ -337,18 +490,6 @@ read_nodes(struct cpu_desc *cpu)
static void
check_system(void)
{
- FILE *fd;
- char buf[256];
-
- /* Dom0 Kernel gives wrong information. */
- fd = fopen(_PATH_PROC_XENCAP, "r");
- if (fd) {
- if (fscanf(fd, "%s", buf) == 1 && !strcmp(buf, "control_d"))
- errx(EXIT_FAILURE,
- _("error: Dom0 Kernel is unsupported."));
- fclose(fd);
- }
-
/* Read through sysfs. */
if (access(_PATH_SYS_SYSTEM, F_OK))
errx(EXIT_FAILURE,
@@ -432,8 +573,6 @@ print_parsable(struct cpu_desc *cpu)
static void
print_readable(struct cpu_desc *cpu)
{
- char buf[BUFSIZ];
-
print_s("Architecture:", cpu->arch);
print_n("CPU(s):", cpu->ct_cpu);
@@ -455,15 +594,18 @@ print_readable(struct cpu_desc *cpu)
print_s(_("Stepping:"), cpu->stepping);
if (cpu->mhz)
print_s(_("CPU MHz:"), cpu->mhz);
- if (cpu->flags) {
- snprintf(buf, sizeof(buf), " %s ", cpu->flags);
- if (strstr(buf, " svm "))
+ if (cpu->virtflag) {
+ if (!strcmp(cpu->virtflag, "svm"))
print_s(_("Virtualization:"), "AMD-V");
- else if (strstr(buf, " vmx "))
+ else if (!strcmp(cpu->virtflag, "vmx"))
print_s(_("Virtualization:"), "VT-x");
}
-
+ if (cpu->hyper) {
+ print_s(_("Hypervisor vendor:"), hv_vendors[cpu->hyper]);
+ print_s(_("Virtualization type:"), virt_types[cpu->virtype]);
+ }
if (have_cache) {
+ char buf[512];
int i;
for (i = cpu->ct_cache - 1; i >= 0; i--) {
@@ -545,6 +687,8 @@ int main(int argc, char *argv[])
if (have_node)
read_nodes(cpu);
+ read_hypervisor(cpu);
+
/* Show time! */
if (parsable)
print_parsable(cpu);

View File

@ -1,267 +0,0 @@
commit 47b6e8b684ad28228c9255fe4237b5a8a1c8c7d3
Author: Cai Qian <qcai@redhat.com>
Date: Sun Aug 10 15:33:51 2008 +0800
lscpu: --sysroot option and stable cache output
This patch added a --sysroot command-line option for testing purpose. It
also sorted cache names, and displayed cache information in a sorted
manner instead of randomly before. In addition, it had some other minor
fixes.
Signed-off-by: Cai Qian <qcai@redhat.com>
diff --git a/sys-utils/lscpu.c b/sys-utils/lscpu.c
index 275d4c7..d6bb8b9 100644
--- a/sys-utils/lscpu.c
+++ b/sys-utils/lscpu.c
@@ -36,17 +36,24 @@
#define CACHE_MAX 100
/* /sys paths */
-#define _PATH_SYS_SYSTEM "/sys/devices/system"
+#define _PATH_SYS_SYSTEM "sys/devices/system"
#define _PATH_SYS_CPU0 _PATH_SYS_SYSTEM "/cpu/cpu0"
-#define _PATH_PROC_XENCAP "/proc/xen/capabilities"
-#define _PATH_PROC_CPUINFO "/proc/cpuinfo"
+#define _PATH_PROC_XENCAP "proc/xen/capabilities"
+#define _PATH_PROC_CPUINFO "proc/cpuinfo"
int have_topology;
int have_cache;
int have_node;
+/* cache(s) description */
+struct ca_desc {
+ char *caname;
+ char *casize;
+ int camap;
+};
+
/* CPU(s) description */
-struct cpu_decs {
+struct cpu_desc {
/* counters */
int ct_cpu;
int ct_thread;
@@ -62,9 +69,7 @@ struct cpu_decs {
char *model;
/* caches */
- char *caname[CACHE_MAX];
- char *casize[CACHE_MAX];
- int camap[CACHE_MAX];
+ struct ca_desc cache[CACHE_MAX];
/* misc */
char *mhz;
@@ -75,7 +80,7 @@ struct cpu_decs {
int *nodecpu;
};
-char pathbuf[PATH_MAX];
+char pathbuf[PATH_MAX] = "/";
static void path_scanstr(char *result, const char *path, ...)
__attribute__ ((__format__ (__printf__, 2, 3)));
@@ -211,7 +216,7 @@ int lookup(char *line, char *pattern, char **value)
}
static void
-read_basicinfo(struct cpu_decs *cpu)
+read_basicinfo(struct cpu_desc *cpu)
{
FILE *fp = xfopen(_PATH_PROC_CPUINFO, "r");
char buf[BUFSIZ];
@@ -245,7 +250,7 @@ read_basicinfo(struct cpu_decs *cpu)
}
static void
-read_topology(struct cpu_decs *cpu)
+read_topology(struct cpu_desc *cpu)
{
/* number of threads */
cpu->ct_thread = path_sibling(
@@ -261,7 +266,7 @@ read_topology(struct cpu_decs *cpu)
}
static void
-read_cache(struct cpu_decs *cpu)
+read_cache(struct cpu_desc *cpu)
{
char buf[256];
DIR *dp;
@@ -295,14 +300,14 @@ read_cache(struct cpu_decs *cpu)
else
snprintf(buf, sizeof(buf), "L%d", level);
- cpu->caname[cpu->ct_cache] = xstrdup(buf);
+ cpu->cache[cpu->ct_cache].caname = xstrdup(buf);
/* cache size */
path_scanstr(buf, _PATH_SYS_CPU0 "/cache/%s/size", dir->d_name);
- cpu->casize[cpu->ct_cache] = xstrdup(buf);
+ cpu->cache[cpu->ct_cache].casize = xstrdup(buf);
/* information about how CPUs share different caches */
- cpu->camap[cpu->ct_cache] = path_sibling(
+ cpu->cache[cpu->ct_cache].camap = path_sibling(
_PATH_SYS_CPU0 "/cache/%s/shared_cpu_map",
dir->d_name);
cpu->ct_cache++;
@@ -310,7 +315,7 @@ read_cache(struct cpu_decs *cpu)
}
static void
-read_nodes(struct cpu_decs *cpu)
+read_nodes(struct cpu_desc *cpu)
{
int i;
@@ -346,7 +351,8 @@ check_system(void)
/* Read through sysfs. */
if (access(_PATH_SYS_SYSTEM, F_OK))
- errx(1, _("error: /sys filesystem is not accessable."));
+ errx(EXIT_FAILURE,
+ _("error: /sys filesystem is not accessable."));
if (!access(_PATH_SYS_SYSTEM "/node", F_OK))
have_node = 1;
@@ -359,22 +365,22 @@ check_system(void)
}
static void
-print_parsable(struct cpu_decs *cpu)
+print_parsable(struct cpu_desc *cpu)
{
int i, j;
- puts(
+ printf(_(
"# The following is the parsable format, which can be fed to other\n"
- "# programs. Each different item in every column has a unique ID\n"
+ "# programs. Each different item in every column has an unique ID\n"
"# starting from zero.\n"
- "# CPU,Core,Socket,Node");
+ "# CPU,Core,Socket,Node"));
if (have_cache) {
/* separator between CPU topology and cache information */
putchar(',');
for (i = cpu->ct_cache - 1; i >= 0; i--)
- printf(",%s", cpu->caname[i]);
+ printf(",%s", cpu->cache[i].caname);
}
putchar('\n');
@@ -407,11 +413,11 @@ print_parsable(struct cpu_decs *cpu)
for (j = cpu->ct_cache - 1; j >= 0; j--) {
/* If shared_cpu_map is 0, all CPUs share the same
cache. */
- if (cpu->camap[j] == 0)
- cpu->camap[j] = cpu->ct_core *
- cpu->ct_thread;
+ if (cpu->cache[j].camap == 0)
+ cpu->cache[j].camap = cpu->ct_core *
+ cpu->ct_thread;
- printf(",%d", i / cpu->camap[j]);
+ printf(",%d", i / cpu->cache[j].camap);
}
}
putchar('\n');
@@ -424,7 +430,7 @@ print_parsable(struct cpu_decs *cpu)
#define print_n(_key, _val) printf("%-23s%d\n", _key, _val)
static void
-print_readable(struct cpu_decs *cpu)
+print_readable(struct cpu_desc *cpu)
{
char buf[BUFSIZ];
@@ -462,8 +468,8 @@ print_readable(struct cpu_decs *cpu)
for (i = cpu->ct_cache - 1; i >= 0; i--) {
snprintf(buf, sizeof(buf),
- _("%s cache:"), cpu->caname[i]);
- print_s(buf, cpu->casize[i]);
+ _("%s cache:"), cpu->cache[i].caname);
+ print_s(buf, cpu->cache[i].casize);
}
}
}
@@ -475,18 +481,29 @@ void usage(int rc)
puts(_( "CPU architecture information helper\n\n"
" -h, --help usage information\n"
- " -p, --parse print out in parsable instead of printable format.\n"));
+ " -p, --parse print out in parsable instead of printable format.\n"
+ " -s, --sysroot use the directory as a new system root.\n"));
exit(rc);
}
+static int
+ca_compare(const void *a, const void *b)
+{
+ struct ca_desc *cache1 = (struct ca_desc *) a;
+ struct ca_desc *cache2 = (struct ca_desc *) b;
+
+ return strcmp(cache2->caname, cache1->caname);
+}
+
int main(int argc, char *argv[])
{
- struct cpu_decs _cpu, *cpu = &_cpu;
+ struct cpu_desc _cpu, *cpu = &_cpu;
int parsable = 0, c;
struct option longopts[] = {
- { "help", no_argument, 0, 'h' },
- { "parse", no_argument, 0, 'p' },
+ { "help", no_argument, 0, 'h' },
+ { "parse", no_argument, 0, 'p' },
+ { "sysroot", required_argument, 0, 's' },
{ NULL, 0, 0, 0 }
};
@@ -494,18 +511,25 @@ int main(int argc, char *argv[])
bindtextdomain(PACKAGE, LOCALEDIR);
textdomain(PACKAGE);
- while((c = getopt_long(argc, argv, "hp", longopts, NULL)) != -1) {
+ while((c = getopt_long(argc, argv, "hps:", longopts, NULL)) != -1) {
switch (c) {
case 'h':
usage(EXIT_SUCCESS);
case 'p':
parsable = 1;
break;
+ case 's':
+ strncpy(pathbuf, optarg, sizeof(pathbuf));
+ break;
default:
usage(EXIT_FAILURE);
}
}
+ if (chdir(pathbuf) == -1)
+ errx(EXIT_FAILURE,
+ _("error: change working directory to %s."), pathbuf);
+
memset(cpu, 0, sizeof(*cpu));
check_system();
@@ -514,8 +538,10 @@ int main(int argc, char *argv[])
if (have_topology)
read_topology(cpu);
- if (have_cache)
+ if (have_cache) {
read_cache(cpu);
+ qsort(cpu->cache, cpu->ct_cache, sizeof(struct ca_desc), ca_compare);
+ }
if (have_node)
read_nodes(cpu);

View File

@ -1,191 +0,0 @@
Index: util-linux-ng-2.14.1/mount/swapon.c
===================================================================
--- util-linux-ng-2.14.1.orig/mount/swapon.c 2008-09-10 11:02:43.000000000 +0200
+++ util-linux-ng-2.14.1/mount/swapon.c 2008-11-07 14:34:30.000000000 +0100
@@ -13,6 +13,8 @@
#include <sys/types.h>
#include <sys/wait.h>
#include <fcntl.h>
+#include <stdint.h>
+#include <byteswap.h>
#include "xmalloc.h"
#include "swap_constants.h"
#include "nls.h"
@@ -39,6 +41,33 @@
#define QUIET 1
#define CANONIC 1
+#define MAX_PAGESIZE (64 * 1024)
+static unsigned int page_size[] = { 4 * 1024,
+ 8 * 1024,
+ 16 * 1024,
+ 64 * 1024,
+ 0 };
+
+
+struct swap_info {
+ char bootbits[1024]; /* Space for disklabel etc. */
+ uint32_t version;
+ uint32_t last_page;
+ uint32_t nr_badpages;
+ unsigned char sws_uuid[16];
+ unsigned char sws_volume[16];
+ uint32_t padding[117];
+ uint32_t badpages[1];
+};
+
+enum {
+ SWAP_V0 = 1,
+ SWAP_V1,
+ SWAP_SUSPEND,
+ SWAP_ULSUSPEND,
+ SWAP_OOTSUSPEND
+};
+
int all = 0;
int priority = -1; /* non-prioritized swap by default */
@@ -238,11 +267,116 @@ swap_reinitialize(const char *device) {
return -1; /* error */
}
+int
+swap_detect_signature(const char *buf)
+{
+ if (memcmp(buf, "SWAP-SPACE", 10) == 0)
+ return SWAP_V0;
+ else if (memcmp(buf, "SWAPSPACE2", 10) == 0)
+ return SWAP_V1;
+ else if (memcmp(buf, "S1SUSPEND", 9) == 0)
+ return SWAP_SUSPEND;
+ else if (memcmp(buf, "ULSUSPEND", 9) == 0)
+ return SWAP_ULSUSPEND;
+ else if (memcmp(buf, "\xed\xc3\x02\xe9\x98\x56\xe5\x0c", 8) == 0)
+ return SWAP_OOTSUSPEND;
+
+ return 0;
+}
+
+/* return the pagesize the swap format has been built with
+ * as swap metadata depends on the pagesize, we have to
+ * reinitialize if it does not match with the current pagesize
+ * returns 0 if not a valid swap format
+ */
+unsigned int
+swap_get_pagesize(const char *dev)
+{
+ int fd;
+ char *buf;
+ unsigned int *page, last_page = 0;
+ unsigned int pagesize = 0;
+ off_t size, swap_size;
+ int swap_version = 0;
+ int flip = 0;
+ struct swap_info *s;
+
+ fd = open(dev, O_RDONLY);
+ if (fd == -1) {
+ perror("open");
+ return 0;
+ }
+
+ /* get size */
+ size = lseek(fd, 0, SEEK_END);
+ if (size == (off_t)-1) {
+ perror("lseek");
+ goto err;
+ }
+ /* rewind */
+ if (lseek(fd, 0, SEEK_SET)) {
+ perror("lseek");
+ goto err;
+ }
+
+ buf = malloc(MAX_PAGESIZE);
+ if (!buf) {
+ perror("malloc");
+ goto err;
+ }
+
+ if (read(fd, buf, MAX_PAGESIZE) == (ssize_t)-1) {
+ perror("read");
+ goto err1;
+ }
+
+ for (page = page_size; *page; ++page) {
+ char *off = buf + *page - 10;
+ if (swap_detect_signature(off)) {
+ pagesize = *page;
+ break;
+ }
+ }
+ if (pagesize) {
+ s = (struct swap_info *)buf;
+ if (s->version == 1) {
+ swap_version = 1;
+ last_page = s->last_page;
+ } else if (bswap_32(s->version) == 1) {
+ flip = 1;
+ swap_version = 1;
+ last_page = bswap_32(s->last_page);
+ }
+ if (verbose)
+ fprintf(stderr, _("found %sswap v%d signature string"
+ " for %d KiB PAGE_SIZE\n"),
+ flip ? "other-endian " : "", swap_version,
+ pagesize / 1024);
+ swap_size = (last_page + 1) * pagesize;
+ if (swap_size > size) {
+ if (verbose)
+ fprintf(stderr, _("last_page 0x%08llx is larger"
+ " than actual size of swapspace\n"),
+ (unsigned long long)swap_size);
+ pagesize = 0;
+ }
+ }
+
+err1:
+ free(buf);
+err:
+ close(fd);
+ return pagesize;
+}
+
static int
do_swapon(const char *orig_special, int prio, int canonic) {
int status;
+ int reinitialize = 0;
struct stat st;
const char *special = orig_special;
+ unsigned int pagesize = sysconf(_SC_PAGESIZE);
+ unsigned int swap_pagesize = 0;
if (verbose)
printf(_("%s on %s\n"), progname, orig_special);
@@ -260,6 +394,15 @@ do_swapon(const char *orig_special, int
return -1;
}
+ swap_pagesize = swap_get_pagesize(special);
+ if (swap_pagesize && (pagesize != swap_pagesize)) {
+ if (verbose)
+ fprintf(stderr, _("swap format pagesize does not match."
+ " Reinitializing the swap.\n"),
+ progname, special);
+ reinitialize = 1;
+ }
+
/* We have to reinitialize swap with old (=useless) software suspend
* data. The problem is that if we don't do it, then we get data
* corruption the next time an attempt at unsuspending is made.
@@ -268,6 +411,10 @@ do_swapon(const char *orig_special, int
fprintf(stdout, _("%s: %s: software suspend data detected. "
"Reinitializing the swap.\n"),
progname, special);
+ reinitialize = 1;
+ }
+
+ if (reinitialize) {
if (swap_reinitialize(special) < 0)
return -1;
}

View File

@ -1,11 +0,0 @@
Index: util-linux-ng-2.14.1/sys-utils/lscpu.c
===================================================================
--- util-linux-ng-2.14.1.orig/sys-utils/lscpu.c 2008-10-20 15:00:44.000000000 +0200
+++ util-linux-ng-2.14.1/sys-utils/lscpu.c 2008-10-21 18:27:01.000000000 +0200
@@ -647,5 +647,5 @@ int main(int argc, char *argv[])
else
print_readable(cpu);
- return EXIT_FAILURE;
+ return EXIT_SUCCESS;
}

View File

@ -1,68 +0,0 @@
Index: util-linux-ng-2.14.2/mount/umount.c
===================================================================
--- util-linux-ng-2.14.2.orig/mount/umount.c 2009-02-11 17:00:35.000000000 +0100
+++ util-linux-ng-2.14.2/mount/umount.c 2009-02-12 13:09:44.000000000 +0100
@@ -465,6 +465,42 @@ get_value(const char *list, const char *
return 0;
}
+#define LOOP_DEV_PATH "/dev/loop"
+/* check if mc contains a loop device which is associated
+ * with the file in fs
+ */
+static int
+valid_loop(struct mntentchn *mc, struct mntentchn *fs)
+{
+ unsigned long long offset=0;
+ char *p;
+
+ /* 1. check if it begins with /dev/loop */
+ if (strncmp(LOOP_DEV_PATH, mc->m.mnt_fsname, sizeof(LOOP_DEV_PATH)-1) != 0)
+ return 0;
+
+ /* 2. check for loop option in fstab */
+ if (!contains(fs->m.mnt_opts, "loop"))
+ return 0;
+
+ /* 3. check for offset option in fstab */
+ if (p=get_value(fs->m.mnt_opts, "offset="))
+ offset = strtoull(p, NULL, 10);
+
+ /* 4. check association */
+ if (loopfile_used_with(mc->m.mnt_fsname, fs->m.mnt_fsname, offset)) {
+ if (verbose > 1)
+ printf(_("device %s is associated with %s\n"),
+ mc->m.mnt_fsname, fs->m.mnt_fsname);
+ return 1;
+ } else {
+ if (verbose > 1)
+ printf(_("device %s is not associated with %s\n"),
+ mc->m.mnt_fsname, fs->m.mnt_fsname);
+ return 0;
+ }
+}
+
static int
umount_file (char *arg) {
struct mntentchn *mc, *fs;
@@ -530,14 +566,18 @@ umount_file (char *arg) {
the pair (spec,file) in fstab. */
fs = getfs_by_specdir(mc->m.mnt_fsname, mc->m.mnt_dir);
if (!fs) {
- if (!getfs_by_spec (file) && !getfs_by_dir (file))
+ fs = getfs_by_dir(file);
+ if (!getfs_by_spec (file) && !fs)
die (2,
_("umount: %s is not in the fstab "
"(and you are not root)"),
file);
- else
+
+ /* spec could be a file which is loop mounted */
+ if (fs && !valid_loop(mc, fs))
die (2, _("umount: %s mount disagrees with "
"the fstab"), file);
+
}
/*

View File

@ -1,35 +0,0 @@
Index: util-linux-ng-2.14.2-rc2/schedutils/ionice.1
===================================================================
--- util-linux-ng-2.14.2-rc2.orig/schedutils/ionice.1 2009-01-22 12:53:14.000000000 +0100
+++ util-linux-ng-2.14.2-rc2/schedutils/ionice.1 2009-02-05 18:08:51.000000000 +0100
@@ -76,7 +76,7 @@ Linux supports io scheduling priorities
io scheduler.
.SH AUTHORS
-Jens Axboe <axboe@suse.de>
+Jens Axboe <jens@axboe.dk>
.SH AVAILABILITY
The ionice command is part of the util-linux-ng package and is available from
Index: util-linux-ng-2.14.2-rc2/schedutils/ionice.c
===================================================================
--- util-linux-ng-2.14.2-rc2.orig/schedutils/ionice.c 2009-02-05 17:53:20.000000000 +0100
+++ util-linux-ng-2.14.2-rc2/schedutils/ionice.c 2009-02-05 18:09:46.000000000 +0100
@@ -1,7 +1,7 @@
/*
* ionice: set or get process io scheduling class and priority
*
- * Copyright (C) 2005 Jens Axboe <axboe@suse.de> SUSE Labs
+ * Copyright (C) 2005 Jens Axboe <jens@axboe.dk>
*
* Released under the terms of the GNU General Public License version 2
*
@@ -51,7 +51,7 @@ static void usage(void)
printf("\t\t\t1: realtime, 2: best-effort, 3: idle\n");
printf("\t-p\tProcess pid\n");
printf("\t-h\tThis help page\n");
- printf("\nJens Axboe <axboe@suse.de> (C) 2005\n");
+ printf("\nJens Axboe <jens@axboe.dk> (C) 2005\n");
}
int main(int argc, char *argv[])

View File

@ -1,19 +0,0 @@
Index: util-linux-ng-2.14.2-rc2/schedutils/ionice.c
===================================================================
--- util-linux-ng-2.14.2-rc2.orig/schedutils/ionice.c 2009-01-22 12:32:48.000000000 +0100
+++ util-linux-ng-2.14.2-rc2/schedutils/ionice.c 2009-02-05 17:53:20.000000000 +0100
@@ -115,8 +115,12 @@ int main(int argc, char *argv[])
}
} else {
if (ioprio_set(IOPRIO_WHO_PROCESS, pid, ioprio | ioprio_class << IOPRIO_CLASS_SHIFT) == -1) {
- perror("ioprio_set");
- exit(EXIT_FAILURE);
+ if (errno == ENOSYS)
+ fprintf(stderr, "Warning: omitting unsupported ioprio_set() call\n");
+ else {
+ perror("ioprio_set");
+ exit(EXIT_FAILURE);
+ }
}
if (argv[optind]) {

View File

@ -22,54 +22,41 @@ sha512.c is from loop-AES.
Signed-off-by: Ludwig Nussel <ludwig.nussel@suse.de>
---
mount/Makefile.am | 2 +
mount/lomount.c | 178 +++++++++++++++---
mount/lomount.h | 4 +-
mount/losetup.8 | 11 +
mount/mount.8 | 13 ++
mount/mount.c | 23 ++-
mount/my_dev_t.h | 5 +
mount/rmd160.c | 532 +++++++++++++++++++++++++++++++++++++++++++++++++++++
mount/rmd160.h | 11 +
mount/sha512.c | 432 +++++++++++++++++++++++++++++++++++++++++++
mount/sha512.h | 45 +++++
11 files changed, 1225 insertions(+), 31 deletions(-)
create mode 100644 mount/my_dev_t.h
create mode 100644 mount/rmd160.c
create mode 100644 mount/rmd160.h
create mode 100644 mount/sha512.c
create mode 100644 mount/sha512.h
Index: util-linux-ng-2.14.2-rc2/mount/Makefile.am
===================================================================
--- util-linux-ng-2.14.2-rc2.orig/mount/Makefile.am 2009-01-22 12:32:48.000000000 +0100
+++ util-linux-ng-2.14.2-rc2/mount/Makefile.am 2009-02-05 16:50:57.000000000 +0100
@@ -17,6 +17,7 @@ headers_common = fstab.h mount_mntent.h
getusername.h loop.h sundries.h
Makefile.am | 3
lomount.c | 174 +++++++++++++++++--
lomount.h | 5
losetup.8 | 11 +
mount.8 | 13 +
mount.c | 21 ++
rmd160.c | 532 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
rmd160.h | 11 +
sha512.c | 432 ++++++++++++++++++++++++++++++++++++++++++++++++
sha512.h | 45 +++++
10 files changed, 1219 insertions(+), 28 deletions(-)
diff --git a/mount/Makefile.am b/mount/Makefile.am
index b0e6374..5d5a682 100644
--- a/mount/Makefile.am
+++ b/mount/Makefile.am
@@ -7,7 +7,8 @@ sbin_PROGRAMS = losetup swapon
dist_man_MANS = fstab.5 mount.8 swapoff.8 swapon.8 umount.8 losetup.8
mount_common = fstab.c mount_mntent.c getusername.c lomount.c \
+ rmd160.c sha512.c \
$(utils_common) $(headers_common) ../lib/env.c ../lib/linux_version.c \
../lib/blkdev.c $(fallback)
# generic sources for all programs (mount, umount, losetup)
-srcs_common = sundries.c xmalloc.c ../lib/canonicalize.c sundries.h xmalloc.h
+srcs_common = sundries.c xmalloc.c ../lib/canonicalize.c sundries.h xmalloc.h \
+ rmd160.c sha512.c
@@ -32,7 +33,8 @@ umount_LDFLAGS = $(SUID_LDFLAGS) $(AM_LD
swapon_SOURCES = swapon.c swap_constants.h $(utils_common)
losetup_SOURCES = lomount.c sundries.c xmalloc.c realpath.c \
- loop.h lomount.h xmalloc.h sundries.h realpath.h $(fallback)
+ loop.h lomount.h xmalloc.h sundries.h realpath.h $(fallback) \
+ rmd160.c sha512.c
losetup_CPPFLAGS = -DMAIN $(AM_CPPFLAGS)
Index: util-linux-ng-2.14.2-rc2/mount/lomount.c
===================================================================
--- util-linux-ng-2.14.2-rc2.orig/mount/lomount.c 2009-02-05 16:50:51.000000000 +0100
+++ util-linux-ng-2.14.2-rc2/mount/lomount.c 2009-02-05 16:52:14.000000000 +0100
@@ -24,6 +24,12 @@
# generic header for mount and umount
hdrs_mount = fstab.h mount_mntent.h mount_constants.h \
diff --git a/mount/lomount.c b/mount/lomount.c
index 1b191ab..5c659cd 100644
--- a/mount/lomount.c
+++ b/mount/lomount.c
@@ -23,6 +23,12 @@
#include "sundries.h"
#include "xmalloc.h"
#include "realpath.h"
#include "pathnames.h"
+#include "rmd160.h"
+#include "sha512.h"
+
@ -77,9 +64,9 @@ Index: util-linux-ng-2.14.2-rc2/mount/lomount.c
+#define MIN(a,b) ((a<b)?(a):(b))
+#endif
#ifndef HAVE_VERSIONSORT
# include "strverscmp.h"
@@ -367,12 +373,22 @@ show_loop_fd(int fd, char *device) {
#define SIZE(a) (sizeof(a)/sizeof(a[0]))
@@ -394,12 +400,22 @@ show_loop_fd(int fd, char *device) {
if (loopinfo64.lo_encrypt_type ||
loopinfo64.lo_crypt_name[0]) {
@ -105,7 +92,7 @@ Index: util-linux-ng-2.14.2-rc2/mount/lomount.c
}
printf("\n");
return 0;
@@ -626,7 +642,7 @@ xgetpass(int pfd, const char *prompt) {
@@ -655,7 +671,7 @@ xgetpass(int pfd, const char *prompt) {
}
if (pass == NULL)
@ -114,7 +101,7 @@ Index: util-linux-ng-2.14.2-rc2/mount/lomount.c
pass[i] = 0;
return pass;
@@ -640,6 +656,24 @@ digits_only(const char *s) {
@@ -669,6 +685,24 @@ digits_only(const char *s) {
return 1;
}
@ -139,7 +126,7 @@ Index: util-linux-ng-2.14.2-rc2/mount/lomount.c
/*
* return codes:
* 0 - success
@@ -648,10 +682,11 @@ digits_only(const char *s) {
@@ -677,10 +711,11 @@ digits_only(const char *s) {
*/
int
set_loop(const char *device, const char *file, unsigned long long offset,
@ -153,7 +140,7 @@ Index: util-linux-ng-2.14.2-rc2/mount/lomount.c
char *filename;
if (verbose) {
@@ -689,13 +724,37 @@ set_loop(const char *device, const char
@@ -718,13 +753,37 @@ set_loop(const char *device, const char *file, unsigned long long offset,
filename = (char *) file;
xstrncpy((char *)loopinfo64.lo_file_name, filename, LO_NAME_SIZE);
@ -193,7 +180,7 @@ Index: util-linux-ng-2.14.2-rc2/mount/lomount.c
}
}
@@ -716,20 +775,70 @@ set_loop(const char *device, const char
@@ -745,20 +804,70 @@ set_loop(const char *device, const char *file, unsigned long long offset,
}
#endif
@ -276,7 +263,7 @@ Index: util-linux-ng-2.14.2-rc2/mount/lomount.c
}
if (ioctl(fd, LOOP_SET_FD, ffd) < 0) {
@@ -880,7 +989,13 @@ usage(void) {
@@ -906,7 +1015,13 @@ usage(void) {
fprintf(stderr, _("\nOptions:\n"
" -e | --encryption <type> enable data encryption with specified <name/num>\n"
@ -290,22 +277,22 @@ Index: util-linux-ng-2.14.2-rc2/mount/lomount.c
" -o | --offset <num> start at offset <num> into file\n"
" --sizelimit <num> loop limited to only <num> bytes of the file\n"
" -p | --pass-fd <num> read passphrase from file descriptor <num>\n"
@@ -893,11 +1008,14 @@ usage(void) {
@@ -919,11 +1034,14 @@ usage(void) {
int
main(int argc, char **argv) {
char *p, *offset, *sizelimit, *encryption, *passfd, *device, *file, *assoc;
+ char *keysize;
+ char *phash = NULL;
int delete, find, c, all;
+ char *keysize;
+ char *phash = NULL;
int delete, find, c, all, capacity;
int res = 0;
int showdev = 0;
int ro = 0;
int pfd = -1;
+ int keysz = 0;
+ int keysz = 0;
unsigned long long off, slimit;
struct option longopts[] = {
{ "all", 0, 0, 'a' },
@@ -905,6 +1023,8 @@ main(int argc, char **argv) {
@@ -932,6 +1050,8 @@ main(int argc, char **argv) {
{ "encryption", 1, 0, 'e' },
{ "find", 0, 0, 'f' },
{ "help", 0, 0, 'h' },
@ -314,7 +301,7 @@ Index: util-linux-ng-2.14.2-rc2/mount/lomount.c
{ "associated", 1, 0, 'j' },
{ "offset", 1, 0, 'o' },
{ "sizelimit", 1, 0, 128 },
@@ -923,12 +1043,13 @@ main(int argc, char **argv) {
@@ -950,12 +1070,13 @@ main(int argc, char **argv) {
off = 0;
slimit = 0;
assoc = offset = sizelimit = encryption = passfd = NULL;
@ -324,12 +311,12 @@ Index: util-linux-ng-2.14.2-rc2/mount/lomount.c
if ((p = strrchr(progname, '/')) != NULL)
progname = p+1;
- while ((c = getopt_long(argc, argv, "ade:E:fhj:o:p:rsv",
- while ((c = getopt_long(argc, argv, "acde:E:fhj:o:p:rsv",
+ while ((c = getopt_long(argc, argv, "ade:E:fhj:k:o:p:rsvH:",
longopts, NULL)) != -1) {
switch (c) {
case 'a':
@@ -950,6 +1071,12 @@ main(int argc, char **argv) {
@@ -980,6 +1101,12 @@ main(int argc, char **argv) {
case 'j':
assoc = optarg;
break;
@ -342,7 +329,7 @@ Index: util-linux-ng-2.14.2-rc2/mount/lomount.c
case 'o':
offset = optarg;
break;
@@ -1028,8 +1155,11 @@ main(int argc, char **argv) {
@@ -1065,8 +1192,11 @@ main(int argc, char **argv) {
else {
if (passfd && sscanf(passfd, "%d", &pfd) != 1)
usage();
@ -355,11 +342,24 @@ Index: util-linux-ng-2.14.2-rc2/mount/lomount.c
if (res == 2 && find) {
if (verbose)
printf(_("stolen loop=%s...trying again\n"),
Index: util-linux-ng-2.14.2-rc2/mount/losetup.8
===================================================================
--- util-linux-ng-2.14.2-rc2.orig/mount/losetup.8 2008-05-29 01:01:02.000000000 +0200
+++ util-linux-ng-2.14.2-rc2/mount/losetup.8 2009-02-05 16:50:57.000000000 +0100
@@ -80,9 +80,18 @@ find the first unused loop device. If a
diff --git a/mount/lomount.h b/mount/lomount.h
index 59108d4..07ab875 100644
--- a/mount/lomount.h
+++ b/mount/lomount.h
@@ -1,5 +1,6 @@
-extern int set_loop(const char *, const char *, unsigned long long, unsigned long long,
- const char *, int, int *);
+extern int set_loop(const char * device, const char * file, unsigned long long offset,
+ unsigned long long, const char *encryption, const char *phash,
+ int pfd, int *options, int keysz);
extern int del_loop(const char *);
extern int is_loop_device(const char *);
extern int is_loop_autoclear(const char *device);
diff --git a/mount/losetup.8 b/mount/losetup.8
index f5d3e17..226f4f3 100644
--- a/mount/losetup.8
+++ b/mount/losetup.8
@@ -94,9 +94,18 @@ find the first unused loop device. If a
argument is present, use this device. Otherwise, print its name
.IP "\fB\-h, \-\-help\fP"
print help
@ -378,7 +378,7 @@ Index: util-linux-ng-2.14.2-rc2/mount/losetup.8
.IP "\fB\-o, \-\-offset \fIoffset\fP"
the data start is moved \fIoffset\fP bytes into the specified file or
device
@@ -153,6 +162,8 @@ the command
@@ -167,6 +176,8 @@ the command
.fi
.SH RESTRICTION
DES encryption is painfully slow. On the other hand, XOR is terribly weak.
@ -387,11 +387,11 @@ Index: util-linux-ng-2.14.2-rc2/mount/losetup.8
Cryptoloop is deprecated in favor of dm-crypt. For more details see
.B cryptsetup(8).
Index: util-linux-ng-2.14.2-rc2/mount/mount.8
===================================================================
--- util-linux-ng-2.14.2-rc2.orig/mount/mount.8 2009-01-22 12:32:48.000000000 +0100
+++ util-linux-ng-2.14.2-rc2/mount/mount.8 2009-02-05 16:50:57.000000000 +0100
@@ -767,6 +767,15 @@ Every time the inode is modified, the i_
diff --git a/mount/mount.8 b/mount/mount.8
index 8e17549..ffe3cc5 100644
--- a/mount/mount.8
+++ b/mount/mount.8
@@ -782,6 +782,15 @@ Every time the inode is modified, the i_version field will be incremented.
.B noiversion
Do not increment the i_version inode field.
.TP
@ -407,7 +407,7 @@ Index: util-linux-ng-2.14.2-rc2/mount/mount.8
.B mand
Allow mandatory locks on this filesystem. See
.BR fcntl (2).
@@ -2222,6 +2231,10 @@ that are really options to
@@ -2390,6 +2399,10 @@ that are really options to
.BR \%losetup (8).
(These options can be used in addition to those specific
to the filesystem type.)
@ -418,13 +418,13 @@ Index: util-linux-ng-2.14.2-rc2/mount/mount.8
If no explicit loop device is mentioned
(but just an option `\fB\-o loop\fP' is given), then
Index: util-linux-ng-2.14.2-rc2/mount/mount.c
===================================================================
--- util-linux-ng-2.14.2-rc2.orig/mount/mount.c 2009-02-05 16:50:51.000000000 +0100
+++ util-linux-ng-2.14.2-rc2/mount/mount.c 2009-02-05 16:50:57.000000000 +0100
@@ -87,6 +87,9 @@ static int suid = 0;
/* Contains the fd to read the passphrase from, if any. */
static int pfd = -1;
diff --git a/mount/mount.c b/mount/mount.c
index c636e9d..2a69c38 100644
--- a/mount/mount.c
+++ b/mount/mount.c
@@ -95,6 +95,9 @@ struct mountargs {
void *data;
};
+/* Contains the preferred keysize in bits we want to use */
+static int keysz = 0;
@ -432,7 +432,7 @@ Index: util-linux-ng-2.14.2-rc2/mount/mount.c
/* Map from -o and fstab option strings to the flag argument to mount(2). */
struct opt_map {
const char *opt; /* option name */
@@ -188,6 +191,7 @@ static int opt_nofail = 0;
@@ -200,6 +203,7 @@ static int opt_nofail = 0;
static const char *opt_loopdev, *opt_vfstype, *opt_offset, *opt_sizelimit,
*opt_encryption, *opt_speed, *opt_comment, *opt_uhelper;
@ -440,7 +440,7 @@ Index: util-linux-ng-2.14.2-rc2/mount/mount.c
static int mounted (const char *spec0, const char *node0);
static int check_special_mountprog(const char *spec, const char *node,
@@ -203,6 +207,8 @@ static struct string_opt_map {
@@ -215,6 +219,8 @@ static struct string_opt_map {
{ "offset=", 0, &opt_offset },
{ "sizelimit=", 0, &opt_sizelimit },
{ "encryption=", 0, &opt_encryption },
@ -449,7 +449,7 @@ Index: util-linux-ng-2.14.2-rc2/mount/mount.c
{ "speed=", 0, &opt_speed },
{ "comment=", 1, &opt_comment },
{ "uhelper=", 0, &opt_uhelper },
@@ -910,7 +916,8 @@ loop_check(const char **spec, const char
@@ -1072,7 +1078,8 @@ loop_check(const char **spec, const char **type, int *flags,
*type = opt_vfstype;
}
@ -459,7 +459,7 @@ Index: util-linux-ng-2.14.2-rc2/mount/mount.c
*loopfile = *spec;
if (*loop) {
@@ -942,7 +949,7 @@ loop_check(const char **spec, const char
@@ -1104,7 +1111,7 @@ loop_check(const char **spec, const char **type, int *flags,
printf(_("mount: going to use the loop device %s\n"), *loopdev);
if ((res = set_loop(*loopdev, *loopfile, offset, sizelimit,
@ -468,15 +468,15 @@ Index: util-linux-ng-2.14.2-rc2/mount/mount.c
if (res == 2) {
/* loop dev has been grabbed by some other process,
try again, if not given explicitly */
@@ -1699,6 +1706,7 @@ static struct option longopts[] = {
@@ -1861,6 +1868,7 @@ static struct option longopts[] = {
{ "options", 1, 0, 'o' },
{ "test-opts", 1, 0, 'O' },
{ "pass-fd", 1, 0, 'p' },
+ { "keybits", 1, 0, 'k' },
{ "types", 1, 0, 't' },
{ "bind", 0, 0, 128 },
{ "move", 0, 0, 133 },
@@ -1860,6 +1868,7 @@ main(int argc, char *argv[]) {
{ "bind", 0, 0, 'B' },
{ "move", 0, 0, 'M' },
@@ -2022,6 +2030,7 @@ main(int argc, char *argv[]) {
char *options = NULL, *test_opts = NULL, *node;
const char *spec = NULL;
char *label = NULL;
@ -484,16 +484,16 @@ Index: util-linux-ng-2.14.2-rc2/mount/mount.c
char *uuid = NULL;
char *types = NULL;
char *p;
@@ -1890,7 +1899,7 @@ main(int argc, char *argv[]) {
@@ -2052,7 +2061,7 @@ main(int argc, char *argv[]) {
initproctitle(argc, argv);
#endif
- while ((c = getopt_long (argc, argv, "afFhilL:no:O:p:rsU:vVwt:",
+ while ((c = getopt_long (argc, argv, "afFhik:lL:no:O:p:rsU:vVwt:",
- while ((c = getopt_long (argc, argv, "aBfFhilL:Mno:O:p:rRsU:vVwt:",
+ while ((c = getopt_long (argc, argv, "aBfFhik:lL:Mno:O:p:rRsU:vVwt:",
longopts, NULL)) != -1) {
switch (c) {
case 'a': /* mount everything in fstab */
@@ -1908,6 +1917,9 @@ main(int argc, char *argv[]) {
@@ -2073,6 +2082,9 @@ main(int argc, char *argv[]) {
case 'i':
external_allowed = 0;
break;
@ -503,7 +503,7 @@ Index: util-linux-ng-2.14.2-rc2/mount/mount.c
case 'l':
list_with_volumelabel = 1;
break;
@@ -2038,6 +2050,9 @@ main(int argc, char *argv[]) {
@@ -2211,6 +2223,9 @@ main(int argc, char *argv[]) {
atexit(unlock_mtab);
@ -513,10 +513,11 @@ Index: util-linux-ng-2.14.2-rc2/mount/mount.c
switch (argc+specseen) {
case 0:
/* mount -a */
Index: util-linux-ng-2.14.2-rc2/mount/rmd160.c
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ util-linux-ng-2.14.2-rc2/mount/rmd160.c 2009-02-05 16:50:57.000000000 +0100
diff --git a/mount/rmd160.c b/mount/rmd160.c
new file mode 100644
index 0000000..3430954
--- /dev/null
+++ b/mount/rmd160.c
@@ -0,0 +1,532 @@
+/* rmd160.c - RIPE-MD160
+ * Copyright (C) 1998 Free Software Foundation, Inc.
@ -1050,10 +1051,11 @@ Index: util-linux-ng-2.14.2-rc2/mount/rmd160.c
+ rmd160_final( &hd );
+ memcpy( outbuf, hd.buf, 20 );
+}
Index: util-linux-ng-2.14.2-rc2/mount/rmd160.h
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ util-linux-ng-2.14.2-rc2/mount/rmd160.h 2009-02-05 16:50:57.000000000 +0100
diff --git a/mount/rmd160.h b/mount/rmd160.h
new file mode 100644
index 0000000..4b2c61d
--- /dev/null
+++ b/mount/rmd160.h
@@ -0,0 +1,11 @@
+#ifndef RMD160_H
+#define RMD160_H
@ -1066,10 +1068,11 @@ Index: util-linux-ng-2.14.2-rc2/mount/rmd160.h
+#endif /*RMD160_H*/
+
+
Index: util-linux-ng-2.14.2-rc2/mount/sha512.c
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ util-linux-ng-2.14.2-rc2/mount/sha512.c 2009-02-05 16:50:57.000000000 +0100
diff --git a/mount/sha512.c b/mount/sha512.c
new file mode 100644
index 0000000..f717c8b
--- /dev/null
+++ b/mount/sha512.c
@@ -0,0 +1,432 @@
+/*
+ * sha512.c
@ -1503,10 +1506,11 @@ Index: util-linux-ng-2.14.2-rc2/mount/sha512.c
+ memset(&ctx, 0, sizeof(ctx));
+}
+#endif
Index: util-linux-ng-2.14.2-rc2/mount/sha512.h
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ util-linux-ng-2.14.2-rc2/mount/sha512.h 2009-02-05 16:50:57.000000000 +0100
diff --git a/mount/sha512.h b/mount/sha512.h
new file mode 100644
index 0000000..4b57c01
--- /dev/null
+++ b/mount/sha512.h
@@ -0,0 +1,45 @@
+/*
+ * sha512.h
@ -1553,16 +1557,3 @@ Index: util-linux-ng-2.14.2-rc2/mount/sha512.h
+/* no sha384_write(), use sha512_write() */
+/* no sha384_final(), use sha512_final(), result in ctx->sha_out[0...47] */
+extern void sha384_hash_buffer(const unsigned char *, size_t, unsigned char *, size_t);
Index: util-linux-ng-2.14.2-rc2/mount/lomount.h
===================================================================
--- util-linux-ng-2.14.2-rc2.orig/mount/lomount.h 2008-07-02 15:08:50.000000000 +0200
+++ util-linux-ng-2.14.2-rc2/mount/lomount.h 2009-02-05 16:50:57.000000000 +0100
@@ -1,5 +1,6 @@
-extern int set_loop(const char *, const char *, unsigned long long, unsigned long long,
- const char *, int, int *);
+extern int set_loop(const char * device, const char * file, unsigned long long offset,
+ unsigned long long, const char *encryption, const char *phash,
+ int pfd, int *options, int keysz);
extern int del_loop(const char *);
extern int is_loop_device(const char *);
extern int is_loop_autoclear(const char *device);

View File

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:108e63e9a007f6a8c0eff841dd38e0fe3b635c98b35bfac2d89b4b1a1ce0630e
size 2956769

View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:7fd2c539888aeab25c22e99d784e9d537ba35fd3087c926efc40af4047dc418d
size 3455981

View File

@ -1,3 +1,24 @@
-------------------------------------------------------------------
Sun Jun 28 21:36:57 CEST 2009 - kay.sievers@novell.com
- update to version 2.16
- switch from libvolume_id to new libblkid
- provide fsck
- provide libblkid
- provide libuuid
- provide setarch
- provide separate uuidd package
- remove patches:
util-linux-2.14.1-lscpu.patch (upstream)
util-linux-2.14.1-lscpu_add_hypervisor_detection.patch (upstream)
util-linux-2.14.1-lscpu_sysroot_option.patch (upstream)
util-linux-2.14.1-sys-utils_lscpu_exit.patch (upstream)
util-linux-2.14.2-schedutils_fix_email.patch (upstream)
util-linux-2.12r-fdisk_cyl.patch (upstream)
util-linux-2.14.1-mount_swap_pagesize.patch (--fixpg option)
util-linux-2.14.2-schedutils_ionice_enosys.patch (-t option)
util-linux-2.14.1-hwclock_adjust_and_hctosys.patch (--systz)
-------------------------------------------------------------------
Thu Apr 16 14:55:22 CEST 2009 - werner@suse.de
@ -1506,12 +1527,12 @@ Tue Feb 4 12:40:00 CET 2003 - meissner@suse.de
Wed Jan 29 11:52:19 CET 2003 - mmj@suse.de
- Update to util-linux-2.11z including:
· Translation updates
· mount: fix LABEL= handling for user umount, don't abort on read
Translation updates
mount: fix LABEL= handling for user umount, don't abort on read
error with photocds and add dmask and fmask vfat mount options
· setterm: accept devfs name
· simpleinit: security: refuse initctl_fd if FD_CLOEXEC fails
· umount: allow user umount after mount by label or uuid
setterm: accept devfs name
simpleinit: security: refuse initctl_fd if FD_CLOEXEC fails
umount: allow user umount after mount by label or uuid
-------------------------------------------------------------------
Wed Jan 22 15:10:24 CET 2003 - sf@suse.de
@ -2339,7 +2360,7 @@ Thu Aug 26 15:05:03 CEST 1999 - uli@suse.de
-------------------------------------------------------------------
Wed Aug 25 18:04:35 MEST 1999 - kukuk@suse.de
- Don´t install tsort, its now in textutils 2.0
- Don?t install tsort, its now in textutils 2.0
-------------------------------------------------------------------
Tue Aug 24 10:11:06 MEST 1999 - kukuk@suse.de

File diff suppressed because it is too large Load Diff

77
uuidd.rc Normal file
View File

@ -0,0 +1,77 @@
#!/bin/sh
### BEGIN INIT INFO
# Provides: uuidd
# Required-Start: $time $local_fs $remote_fs
# Should-Start:
# Required-Stop: $time $local_fs $remote_fs
# Should-Stop:
# Default-Start: 2 3 5
# Default-Stop: 0 1 2 6
# Short-Description: UUID generating daemon
# Description: UUID generating daemon
### END INIT INFO
#
UUIDD_BIN=/usr/sbin/uuidd
UUIDD_PID_PATH=/var/run/uuidd
UUIDD_OPTIONS="-q -T 0"
test -x $UUIDD_BIN || { echo "$UUIDD_BIN not installed";
if [ "$1" = "stop" ]; then exit 0;
else exit 5; fi; }
. /etc/rc.status
# Reset status of this service
rc_reset
case "$1" in
start)
echo -n "Starting uuidd "
mkdir -p $UUIDD_PID_PATH
chown uuidd:uuidd $UUIDD_PID_PATH
/sbin/startproc $UUIDD_BIN $UUIDD_OPTIONS
rc_status -v
;;
stop)
echo -n "Shutting down uuidd "
/sbin/killproc -TERM $UUIDD_BIN
rc_status -v
;;
try-restart|condrestart|force-reload)
## Do a restart only if the service was active before.
## Note: try-restart is now part of LSB (as of 1.9).
## RH has a similar command named condrestart.
if test "$1" = "condrestart"; then
echo "${attn} Use try-restart ${done}(LSB)${attn} rather than condrestart ${warn}(RH)${norm}"
fi
$0 status
if test $? = 0; then
$0 restart
else
rc_reset # Not running is not a failure.
fi
# Remember status and be quiet
rc_status
;;
restart)
$0 stop
$0 start
rc_status
;;
reload)
rc_failed 3
rc_status -v
;;
status)
echo -n "Checking for service uuidd "
/sbin/checkproc $UUIDD_BIN
rc_status -v
;;
*)
echo "Usage: $0 {start|stop|status|try-restart|restart|force-reload|reload|probe}"
exit 1
;;
esac
rc_exit

View File

@ -1,418 +0,0 @@
Util-linux-ng 2.14 Release Notes (09-Jun-2008)
==============================================
Release highlights
------------------
mount(8) supports new "nofail" mount option.
mount(8) supports auto-destruction of loop devices.
losetup(8) supports new command line option "-j" to show status of all
loop devices associated with given file.
losetup(8) supports unlimited number of loop devices.
losetup(8) supports new command line option "--sizelimit" to set data end.
ldattach(8) command has been added to util-linux-ng. The ldattach
daemon opens the specified device file and attaches the line discipline
to it for processing of the sent and/or received data.
setterm(8) supports new command line option "-blank [force|poke]" for
TIOCL_{BLANKED,BLANK}SCREEN.
tailf(8) has been reimplemented to use inotify.
tailf(8) supports new command line option "-n" to specifying output lines.
mkswap(8) supports new command line option "-U" to set UUID explicitly.
fdisk(8) has been fixed to calculate partition size in 2^N.
cal(8) supports highlighting an arbitrary date.
agetty(8) makes username-in-uppercase feature optional (off by default).
Users who use uppercase-only terminals need to use the option "-U" now.
losetup(8), mount(8), umount(8), fdisk(8) and sfdisk(8) support static
linking when compiled with --enable-static-programs.
hwclock(8) supports new command line option "adjfile" to override
the default /etc/adjtime.
scriptreplay(1) command has been re-written from Perl to C.
Deprecated
----------
The losetup(8) '-s' option (introduced by util-linux-ng-2.13) is deprecated
now. This short form of the option '--show' could be in collision with
Loop-AES losetup implementation where the same option is used for the loop
sizelimit.
Fixed security issues
---------------------
CVE-2008-1926 - audit log injection via login
The problem was originally reported for OpenSSH few months
ago (CVE-2007-3102). The login(1) is affected by the same
bug when built with the option "--with-audit".
Stable maintenance releases between v2.13 and v2.14
---------------------------------------------------
util-linux-ng 2.13.1.1 [22-Apr-2008]
* ftp://ftp.kernel.org/pub/linux/utils/util-linux-ng/v2.13/v2.13.1.1-ReleaseNotes
ftp://ftp.kernel.org/pub/linux/utils/util-linux-ng/v2.13/v2.13.1.1-ChangeLog
util-linux-ng 2.13.1 [16-Jan-2008]
* ftp://ftp.kernel.org/pub/linux/utils/util-linux-ng/v2.13/v2.13.1-ReleaseNotes
ftp://ftp.kernel.org/pub/linux/utils/util-linux-ng/v2.13/v2.13.1-ChangeLog
ChangeLog between v2.13 and v2.14
---------------------------------
For more details see ChangeLog files at:
ftp://ftp.kernel.org/pub/linux/utils/util-linux-ng/v2.14/
agetty:
- cleanup MAXHOSTNAMELEN [Karel Zak]
- make username-in-uppercase feature optional (off by default.) [Hamish Coleman]
- non-linux support (use pathnames.h) [Karel Zak]
- replace termio with termios interface [Samuel Thibault]
- ungettextize several debugging messages. [Benno Schulenberg]
blockdev:
- add --getsz to blockdev.8 [Karel Zak]
- add missing description about option --report in manpage [Li Zefan]
- fix opened file leaving unclosed [lizf]
- use lib/blkdev.c, fix --report [Karel Zak]
build-sys:
- add --enable-static-programs [Stepan Kasal, Karel Zak]
- add AC_CANONICAL_HOST [Miklos Szeredi]
- add VARSUFFIX to UTIL_CHECK_LIB [Karel Zak]
- add err.h check [Karel Zak]
- add support ionice for Super-H architecture [Karel Zak]
- add v2.14 to NEWS [Karel Zak]
- autogen.sh reports versions of autotools now [Karel Zak]
- build arch(1) during distcheck [Stepan Kasal]
- cleanup "x$foo" usage [Karel Zak]
- cleanup disk-utils/Makefile.am (use $utils_common) [Karel Zak]
- cleanup usage of linux/major.h [Samuel Thibault]
- disable syscall fallbacks for non-linux systems [Karel Zak]
- do not add -luuid to BLKID_LIBS [Stepan Kasal]
- fix missing deps for swapon [Matthias Koenig]
- ignore a bunch of generated files, mostly binaries [James Youngman]
- nls/locale handling in util-linux-ng general [Mike Frysinger]
- non-linux support [Samuel Thibault]
- release++ [Karel Zak]
- remove errs.h [Karel Zak]
- remove files that are no longer delivered from git [LaMont Jones]
- remove hardcoded _GNU_SOURCE [Karel Zak]
- remove unnecessary check-local target from login-utils/ [Karel Zak]
- set AC_PREREQ to 2.60, increment version to 2.14 [Karel Zak]
- simplify code around RDEV_LINKS and SETARCH_LINKS [Stepan Kasal]
- unify method for checking system calls and fallback handling [Mike Frysinger, Stepan Kasal]
- update .gitignore files [Karel Zak]
- use dist_man_MANS instead of man_MANS [Stepan Kasal]
- use ncursesw (wide version) when possibe [Karel Zak, Mike Frysinger]
- use pkg-config to find the libs for static build [Stepan Kasal]
- use portable $(VAR =) instead of gmake-specific $(addsuffix) [Stepan Kasal]
cal:
- add description about option -V to manpage [Li Zefan]
- add support for highlighting an arbitrary date [Pádraig Brady]
- avoid -Wformat warnings [Jim Meyering]
- fix weekday alignment for certain locales [Pádraig Brady]
- replace errs.h with libc err.h [Karel Zak]
- use HAVE_LIB{NCURSES,NCURSESW} instead HAVE_NCURSES [Karel Zak]
cfdisk:
- define portable {DEFAULT,ALTERNATE}_DEVICE [Samuel Thibault]
- display cylinders beyond 1024 [Peter Breitenlohner]
- slightly increase the size of menu buttons [Benno Schulenberg]
- translate partition-type names when they are printed. [Benno Schulenberg]
chfn:
- add pam_end() call and cleanup PAM code [Karel Zak]
- fix compiler warnings in selinux stuff [Karel Zak]
chfn, chsh, login:
- collapsing three similar messages into a single one [Benno Schulenberg]
chsh:
- should use pam_end function to terminate the PAM transaction [Yu Zhiguo, Karel Zak]
column:
- replace errs.h with libc err.h [Karel Zak]
ddate:
- 11th, 12th and 13th of month [Volker Schatz]
docs:
- add a note about minix v3 to TODO file [Karel Zak]
- add info about .bugfix releases and branches [Karel Zak]
- add note about incorrect tag 2.13.1 [Karel Zak]
- add note about losetup --sizelimit to ReleaseNotes [Karel Zak]
- add note about static linking [Karel Zak]
- add v2.14 ReleaseNotes [Karel Zak]
- cleanup DEPRECATED file [Karel Zak]
- cleanup README.devel, add note about coding style and Signed-off-by [Karel Zak]
- fix ChangeLog URL [Pascal Terjan]
- fix stable branche name in README.devel [Karel Zak]
- mark vipw(1) is deprecated in favor of vipw from shadow-utils [Karel Zak]
- refresh TODO list [Karel Zak]
- remove date from ReleasNotes [Karel Zak]
- tweak a few messages for clarity [Benno Schulenberg]
- update AUTHORS file [Karel Zak]
- update TODO file [Karel Zak]
- update v2.14 ReleaseNotes [Karel Zak]
- we already rewrote the scriptreplay script; remove that TODO entry [James Youngman]
elvtune:
- use get_linux_version() [Karel Zak]
fdformat:
- install to /usr/sbin instead to /usr/bin [Karel Zak]
fdisk:
- better fallback for get_random_id() [H. Peter Anvin]
- calculate +size{K,M,G} in 2^N [Karel Zak]
- cleanup BLK* ioctls usage [Karel Zak]
- doesn't recognize the VMware ESX partitions [Karel Zak]
- doing useless ioctl when editing an image [Pascal Terjan]
- fix building for AVR32 and CRIS [Imre Kaloz]
- fix typo [Karel Zak]
- message tweak [Karel Zak]
- non-linux support (MAXPATHLEN) [Karel Zak]
- non-linux support (use standard uintxy_t instead __uxy) [Samuel Thibault]
- use more readable "GPT" name rather than "EFI GPT" [Robert Millan]
- use swab macros from bitops.h [Karel Zak]
flock:
- typo in man page [A. Costa]
fsck.cramfs:
- clean up gcc warnings [Randy Dunlap]
fsck.minix:
- correct the error message given when we can't open the device [James Youngman]
- reset the terminal state if we are killed by a fatal signal [James Youngman]
getopt:
- fix path to examples in getopt.1 [Karel Zak]
- install example scripts as SCRIPTS, not DATA [Peter Breitenlohner]
hwclock:
- add --adjfile=path option [Karel Zak]
- check for ENODEV [David Woodhouse]
- do not create a zero adjfile [Alain Guibert]
- fix --rtc option [Matthias Koenig, Karel Zak]
include:
- <stdint.h> provides everything [Samuel Thibault]
- add bitops.h with swab{16,32,64} macros [Karel Zak]
- add mount paths to pathnames.h [Karel Zak]
- cleanup pathnames.h [Karel Zak]
ionice:
- add a note about permissions to ionice.1 [Karel Zak]
- update man page to reflect IDLE class change in 2.6.25 [Karel Zak]
ipcs:
- add information about POSIX compatibility to ipcs.1 [Karel Zak]
kill:
- man page is missing a description of "kill -0" [Karel Zak]
ldattach:
- add NLS support [Karel Zak]
- new command [Tilman Schmidt]
- use glibc termios [Karel Zak]
lib:
- add blkdev.{c,h} [Stefan Krah, Karel Zak]
- add linux_version.{c,h} [Stefan Krah]
login:
- audit log injection attack via login [Steve Grubb]
- fix a small memory leak and remove unnecessary zeroing [Karel Zak]
- login segfaults on EOF (rh#298461) [Karel Zak]
- replace termio with termios interface [Samuel Thibault]
- rewrite is_local() to remove limits on line length [James Youngman]
login-utils:
- cleanup strlen() and fgets() usage [James Youngman]
losetup:
- add --associated option [Karel Zak]
- add --sizelimit option [Shachar Shemesh]
- canonicalize loopfile name [Karel Zak, Matthias Koenig]
- clean up gcc warnings [Randy Dunlap]
- fix errno usage [Karel Zak]
- fix typo in losetup.8 [Karel Zak]
- mark the option -s as deprecated [Karel Zak]
- remove duplicate xstrdup() and error() [Karel Zak]
- split help message into two smaller parts [Benno Schulenberg]
- support unlimited number of loops [Karel Zak]
- use standard uintxy_t types (struct loop_info64) [Samuel Thibault]
mesg:
- replace errs.h with libc err.h [Karel Zak]
mkfs.cramfs:
- clean up gcc warnings [Randy Dunlap, Karel Zak]
- remove unused header file [lizf]
- switch on localization. [Benno Schulenberg]
mkfs.minix:
- add sectorsize check [Matthias Koenig]
- clean up gcc warnings [Karel Zak]
- clean up gcc warnings [Randy Dunlap]
- device size cleanup [Matthias Koenig]
mkswap:
- BLKGETSIZE cleanup [Karel Zak]
- cleanup kB vs. KiB usage in error messages [Karel Zak]
- fix compiler warnings [Karel Zak]
- linux_version() code consolidation [Karel Zak]
- possible to crash with SELinux relabeling support [KaiGai Kohei]
- set UUID for swap space (add -U option) [Martin Schulze]
- set errno=0 in write_all() [Karel Zak]
- when writing the signature page, handle EINTR returns [Karel Zak]
more:
- cleanup gcc warnings [Randy Dunlap]
- non-linux support [Samuel Thibault]
- replace CBAUD with cfgetispeed() [Samuel Thibault]
- use HAVE_WIDECHAR instead ENABLE_WIDECHAR [Karel Zak]
mount:
- "can't create lock file" message sometimes means failure, sometimes not [Mark McLoughlin]
- "nofail" mount option [Matthias Koenig, Karel Zak]
- -L|-U segfault when label or uuid doesn't exist [Karel Zak]
- add more details to the --version output [Karel Zak]
- add support for sizelimit= mount option (for loop mounts) [Shachar Shemesh]
- allow auto-destruction of loop devices [Bernardo Innocenti]
- chain of symlinks to fstab causes use of pointer after free [Norbert Buchmuller]
- clean up gcc warnings (mount_mntent.c) [Randy Dunlap]
- clean up global variables [Karel Zak]
- cleanup "none" fstype usage [Karel Zak]
- cleanup KERNEL_VERSION, remove my_dev_t.h [Karel Zak]
- cleanup canonicalize() usage [Karel Zak]
- cleanup error() and die() [Karel Zak]
- cleanup usage of _PATH_* [Karel Zak]
- doesn't drop privileges properly when calling helpers [Ludwig Nussel]
- don't call canonicalize(SPEC) for cifs, smbfs and nfs [Karel Zak]
- don't canonicalize LABEL= or UUID= spec [Karel Zak]
- drop the part always true from a while condition [Pascal Terjan]
- fix a small typo in mount.8 [Christophe Blaess]
- fix fd leak [Matthias Koenig]
- fix typo in mount.8 [Karel Zak]
- hint about helper program if device doesn't exist [Karel Zak]
- improve chmod & chown usage and clean up gcc warnings (fstab.c) [Karel Zak]
- improve error message when helper program not present [LaMont Jones]
- prevent loop mounting the same file twice [Karel Zak, Matthias Koenig]
- remount doesn't care about loop= [Karel Zak]
- remove MS_{REPLACE,AFTER,BEFORE,OVER} [Karel Zak]
- remove built-in support for background mounts [Karel Zak]
- remove redundant fflush [Karel Zak]
- remove set_proc_name() [Karel Zak]
- remove useless if-before-my_free, define my_free as a macro [Karel Zak]
- use MNTTYPE_SWAP (from mntent.h) [Karel Zak]
- use atexit() rather than (*at_die)() [Karel Zak]
- use blkdev_get_size() [Karel Zak]
- use canonicalize in getfs_by_devname [Karel Zak]
namei:
- add to identify FIFO (named pipe) and update manpage [Li Zefan]
- cleanup tailing white-spaces [Karel Zak]
- non-linux support (get_current_dir_name() and PATH_MAX) [Karel Zak, Samuel Thibault]
partx:
- fix compiler warnings [Karel Zak]
- use swab macros from bitops.h [Karel Zak]
pg:
- fix segfault on search [Rajeev V. Pillai]
po:
- add eu.po (from translationproject.org) [Mikel Olasagasti]
- add pl.po (from translationproject.org) [Andrzej Krzysztofowicz]
- fix typo in de.po [Karel Zak]
- merge changes [Karel Zak]
- update POTFILES.in [Karel Zak]
- update ca.po (from translationproject.org) [Josep Puigdemont]
- update cs.po (from translationproject.org) [Petr Pisar]
- update da.po (from translationproject.org) [Claus Hindsgaul]
- update de.po (from translationproject.org) [Michael Piefel]
- update es.po (from translationproject.org) [Santiago Vila Doncel]
- update et.po (from translationproject.org) [Meelis Roos]
- update fi.po (from translationproject.org) [Lauri Nurmi]
- update fr.po (from translationproject.org) [Michel Robitaille]
- update hu.po (from translationproject.org) [Gabor Kelemen]
- update id.po (from translationproject.org) [Arif E. Nugroho]
- update it.po (from translationproject.org) [Marco Colombo]
- update ja.po (from translationproject.org) [Daisuke Yamashita]
- update nl.po (from translationproject.org) [Benno Schulenberg]
- update po files [Karel Zak]
- update pt_BR.po (from translationproject.org) [Rodrigo Stulzer Lopes]
- update ru.po (from translationproject.org) [Pavel Maryanov]
- update sl.po (from translationproject.org) [Simon Mihevc]
- update sv.po (from translationproject.org) [Daniel Nylander]
- update tr.po (from translationproject.org) [Nilgün Belma Bugüner]
- update uk.po (from translationproject.org) [Maxim V. Dziumanenko]
- update vi.po (from translationproject.org) [Clytie Siddall]
rename:
- add description about option -V to manpage [Li Zefan]
- remove useless variable [Li Zefan]
renice:
- detect errors in arguments, add -v, -h and long options [LaMont Jones, Karel Zak]
rev:
- use warn() in errs.h [Li Zefan]
rtcwake:
- fix UTC time usage [David Brownell]
- fix the default mode to "standby" [Paulius Zaleckas]
- fix typo [Karel Zak]
- fix typo SATE -> STATE [Mike Frysinger]
- fix verbose message [Karel Zak]
- include libgen.h for basename prototype [Mike Frysinger]
- misc cleanups [David Brownell]
script:
- cleanup gcc warnings [Randy Dunlap]
- cleanup includes [Samuel Thibault]
- dies on SIGWINCH [Karel Zak]
- read returns a size_t [James Youngman]
scriptreplay:
- gettextize a forgotten messages [Karel Zak]
- rewrite in C [Karel Zak, James Youngman]
setarch:
- add fallback for linux/personality [Karel Zak]
- add long options to setarch and update manpage [Karel Zak, Li Zefan]
- add missing alpha subarchs [Oliver Falk]
- adding groff symlinks to setarch manual page [Arkadiusz Miskiewicz]
- fix compiler warning [LaMont Jones]
- generate groff links in a better way [Karel Zak]
- provide backwards compatibility [Dmitry V. Levin]
- tweak the help text, and gettextize a forgotten message [Benno Schulenberg]
setterm:
- add -blan [force|poke] options for TIOCL_{BLANKED,BLANK}SCREEN [Samuel Thibault, Karel Zak]
- dump by TIOCLINUX is deprecated since linux 1.1.92. [Karel Zak]
- opened file leaving unclosed [Karel Zak, lizf]
- remove unnecessaty ifndef TCGETS [Samuel Thibault]
sfdisk:
- allow partitioning drives of over 2^31 sectors. [Kunihiko IMAI]
- cleanup 83 gcc warnings [Randy Dunlap]
- opened files leaving unclosed [Karel Zak, Li Zefan]
- remove unnecessary linux/unistd.h [Samuel Thibault]
- use get_linux_version() [Karel Zak]
shutdown:
- use _PATH_MOUNTED instead of _PATH_MTAB [Stepan Kasal]
swapon:
- Reinitialize software suspend areas to avoid future corruption. [Kees Cook, Karel Zak]
- add sundries.h [Karel Zak]
- clean up gcc warnings [Randy Dunlap]
- cleanup usage output [Karel Zak]
- cleanup usage() [Karel Zak]
- fix swsuspend detection [Karel Zak]
- fix typo in usage() [Karel Zak]
- readjust the usage summaries [Benno Schulenberg]
- remove unnecessary myrealpath() call [Karel Zak]
sys-utils:
- correct setarch.8 manpage link creation [Frédéric Bothamy]
tailf:
- add option -n to specifying output lines [Li Zefan]
- clean up gcc warnings & fix use of errno [Karel Zak]
- inotify based reimplementation [Karel Zak]
- non-linux support [Samuel Thibault]
- opened file leaving unclosed [lizf]
- replace errs.h with libc err.h [Karel Zak]
tests:
- add "sort" to cramfs test [Karel Zak]
- add test for include/pathnames.h [Karel Zak]
- add ts-mount-noncanonical [Karel Zak]
- exactly define a time format in ls -l output [Karel Zak]
- fix blkid cache usage [Karel Zak]
- move test_bkdev to lib/ [Karel Zak]
- redirect libblkid cache to BLKID_FILE [Karel Zak]
- rename test_sysinfo, remove tailing white-spaces [Karel Zak]
- use losetup -s [Karel Zak]
umount:
- add hint about lsof & fuser [Karel Zak]
- don't print duplicate error messages [Karel Zak]
- use atexit() rather than (*at_die)() [Karel Zak]
wall:
- cleanup MAXHOSTNAMELEN [Karel Zak]

View File

@ -1,49 +0,0 @@
Util-linux-ng 2.14.1 Release Notes (??-Aug-2008)
================================================
ChangeLog between v2.14 and v2.14.1
-----------------------------------
For more details see ChangeLog files at:
ftp://ftp.kernel.org/pub/linux/utils/util-linux-ng/v2.14/
build-sys:
- cleanup sys-utils/Makefile.am [Karel Zak]
- fix dmesg.1 installation [Karel Zak]
- release++ (v2.14.1-rc1) [Karel Zak]
- tgets is not in ncurses but in tinfo [Arkadiusz Miskiewicz]
docs:
- update AUTHORS file [Karel Zak]
- update v2.14.1 ReleaseNotes [Karel Zak]
fdisk:
- don't check for GPT when asked for disk size only [Karel Zak]
hwclock:
- omit warning about drift if --noadjfile given [Matthias Koenig]
- unshadow a diagnostic printf [Kalev Soikonen]
ipcs:
- ungettextize the spacing of the table headers [Benno Schulenberg]
losetup:
- remove unnecessary minor number check [Karel Zak]
mount:
- add docs about utf8=0 for vfat [Karel Zak]
- add fallback for versionsort() [Karel Zak]
- add info about tz=UTC option for FAT to mount.8 [Karel Zak]
- add norealtime to mount.8 [Karel Zak]
po:
- add zh_CN.po (from translationproject.org) [Ray Wang]
- merge changes [Karel Zak]
- update cs.po (from translationproject.org) [Petr Pisar]
- update nl.po (from translationproject.org) [Benno Schulenberg]
rtcwake:
- cleanup return codes [Karel Zak]
- prefer RTC_WKALM_SET over RTC_ALM_SET [Gabriel Burt]
scriptreplay:
- new implementation is out-of-sync [Karel Zak]
selinux:
- is_selinux_enabled() returns 0, 1 and -1 [Karel Zak]
sfdisk:
- print version should end with a newline [Denis ChengRq]
umount:
- improve "-d" option for autoclear loops [Karel Zak]
write:
- doesn't check for tty group [Karel Zak]

View File

@ -1,92 +0,0 @@
Util-linux-ng 2.14.2 Release Notes (??-Jan-2009)
================================================
ChangeLog between v2.14.1 and v2.14.2
-------------------------------------
For more details see ChangeLog files at:
ftp://ftp.kernel.org/pub/linux/utils/util-linux-ng/v2.14/
build-sys:
- add -luuid to BLKID_LIBS [Karel Zak]
- release++ (v2.14.2-rc1) [Karel Zak]
cfdisk:
- accept yes/no as fallback [Matthias Koenig]
chrt:
- support CFS SCHED_IDLE priority and document it [Martin Steigerwald]
docs:
- update AUTHORS file [Karel Zak]
- update v2.14.2 ReleaseNotes [Karel Zak]
fdisk:
- add some missing includes [Matthias Koenig]
- cannot create partition with starting beyond 1 TB [Karel Zak]
- fix man page typo [Karel Zak]
- remove obsolete information from man page [Karel Zak]
- remove unnecessary gettext call [Karel Zak]
- several strings without gettext calls [Pedro Ribeiro]
- support +cylinder notation [Karel Zak]
hwclock:
- remove "cli" and "sti" from i386 CMOS code [Karel Zak]
- remove x86_64-specific bogon [David Brownell]
include:
- use __BYTE_ORDER rather than AC specific WORDS_BIGENDIAN [Karel Zak]
ionice:
- Extend the man page to explain the "none" class and cpu-nice inheritance [Jakob Unterwurzacher]
- a little cleanup of "none" description [Karel Zak]
ldattach:
- don't compile for non-linux systems [Samuel Thibault]
lib:
- add __BYTE_ORDER to md5.c [Karel Zak]
logger:
- several strings without gettext calls [Pedro Ribeiro]
login:
- fix compiler warning (int32 time() arg) [Karel Zak]
- fix warning "dereferencing type-punned pointer will break strict-aliasing rules" [Karel Zak]
losetup:
- add warning about read-only mode [Karel Zak]
- missing EBUSY error hint message [Karel Zak]
- several strings without gettext strings [Pedro Ribeiro]
- try to set up loop readonly if EACCES [Matthias Koenig]
mkfs.cramfs:
- several strings without gettext calls [Pedro Ribeiro]
mkfs.minix:
- fix size detection [Matthias Koenig]
more:
- dont use a.out.h [Mike Frysinger]
- minor fixes to magic() [James Youngman]
mount:
- add i_version support [Karel Zak]
- add info about /proc/mounts to mount.1 [Karel Zak]
- add info about semantics of read-only mount to mount.8 [Karel Zak]
- add rootcontext= SELinux mount option [Karel Zak]
- clean up SPEC canonicalization [Karel Zak]
- cleans up mount(8) troff markup [Sam Varshavchik]
- create separate section for fs-independent options in mount.8 [Karel Zak]
- finalize support of quoted LABELs/UUIDs [Karel Zak]
- fix mount_static_LDADD [Karel Zak]
- fix typo [Guan Xin]
- fix typo [Karel Zak]
- make file_t SELinux warning optional and shorter [Karel Zak]
- mtab created multiple times with -a option [Karel Zak]
- remove link to namesys.com [Karel Zak]
- remove spurious newline from mount.8 [Mike Frysinger]
- reorder list of options in mount.8 [Karel Zak]
- retry on ENOMEDIUM [Matthias Koenig]
- suggest to use blockdev --setro rather than losetup [Karel Zak]
- sundries.h add klibc support [maximilian attems]
- sync FAT info in mount.8 with Documentation/filesystems/vfat.txt [Karel Zak]
- sync tmpfs info in mount.8 with Documentation/filesystems/tmpfs.txt [Karel Zak]
- use subsections in mount.8 DESCRIPTION [Karel Zak]
- warn on "file_t" selinux context [Karel Zak]
po:
- merge changes [Karel Zak]
- update cs.po (from translationproject.org) [Petr Pisar]
- update fr.po (from translationproject.org) [Nicolas Provost]
- update pt_BR.po (from translationproject.org) [Rodrigo Stulzer Lopes]
- update sv.po (from translationproject.org) [Daniel Nylander]
readprofile:
- several strings without gettext calls [Pedro Ribeiro]
setterm:
- fix -blank man page [Karel Zak]
- use getpagesize() [maximilian attems]