mount: add support for sizelimit= mount option (for loop mounts)
[kzak@redhat.com: split the original patch to small patches] Signed-off-by: Shachar Shemesh <shachar@lingnu.com> Signed-off-by: Karel Zak <kzak@redhat.com>
[kzak@redhat.com: split the original patch to small patches] Signed-off-by: Shachar Shemesh <shachar@debian.org> Signed-off-by: Karel Zak <kzak@redhat.com>
James Youngman [Sun, 6 Apr 2008 10:45:57 +0000 (11:45 +0100)]
fsck.minix: correct the error message given when we can't open the device
Don't actually print %s in the error message, print the device name,
as was obviously intended. Also, print the error message
corresponding to the errno value.
[kzak@redhat.com: add __attribute__, coding style cleanups] Signed-off-by: James Youngman <jay@gnu.org> Signed-off-by: Karel Zak <kzak@redhat.com>
Karel Zak [Wed, 2 Apr 2008 11:46:26 +0000 (13:46 +0200)]
mount: remove built-in support for background mounts
EX_BG is archaism from old integrated NFS code. The built-in NFS code
has been removed in the previous version and all "bg" stuff is handled
by /sbin/mount.nfs. It seems we can remove all "bg" stuff from
mount(8).
Karel Zak [Thu, 20 Mar 2008 13:54:06 +0000 (14:54 +0100)]
mkswap: fix compiler warnings
mkswap.c:529: warning: pointer targets in assignment differ in signedness
mkswap.c:531: warning: pointer targets in assignment differ in signedness
mkswap.c:550: warning: pointer targets in passing argument 1 of `uuid_parse' differ in signedness
Kees Cook [Thu, 20 Mar 2008 08:24:03 +0000 (01:24 -0700)]
swapon: Reinitialize software suspend areas to avoid future corruption.
This is based on the earlier swsuspend re-init patch carried by
RedHat, SuSE, and Ubuntu. It has been updated to include passing
the known UUID to mkswap, and fixing the fstype name.
Co-Author: Karel Zak <kzak@redhat.com> Signed-off-by: Kees Cook <kees.cook@canonical.com> Signed-off-by: Karel Zak <kzak@redhat.com>
Karel Zak [Tue, 4 Mar 2008 23:53:24 +0000 (00:53 +0100)]
build-sys: use ncursesw (wide version) when possibe
Detect ncursesw and use it in place of ncurses when possible
(default). Allow people to use classic (non-wide) version by
--with-ncurses or disable all ncurses/ncursesw support by
--without-ncurses.
Co-Author: Mike Frysinger <vapier@gentoo.org> Signed-off-by: Karel Zak <kzak@redhat.com>
Karel Zak [Tue, 4 Mar 2008 23:34:49 +0000 (00:34 +0100)]
build-sys: add VARSUFFIX to UTIL_CHECK_LIB
The UTIL_CHECK_LIB macro follows the default autoconf behaviour and
generates have_<libname> and HAVE_LIB<LIBNAME> variables.
Some libraries are substitutional (e.g. ncurses and ncursesw). It would be
nice to generate for that libraries the same HAVE_ variables independently
on a library name.
This patch adds optional VARSUFFIX option to UTIL_CHECK_LIB, so the final
variables are have_<varsuffix> and HAVE_LIB<VARSUFFIX>.
For example:
UTIL_CHECK_LIB(yyy, func) generates have_yyy and HAVE_LIBYYY
UTIL_CHECK_LIB(yyy, func, xxx) generates have_xxx and HAVE_LIBXXX
Jim Meyering [Wed, 12 Mar 2008 10:42:16 +0000 (11:42 +0100)]
remove useless if-before-free tests.
E.g., in this example, the "if (p)" test is useless.
if (p)
free (p);
I've been removing such tests systematically.
Here's where I proposed it to the git folks, along with justification
for why it's ok to perform this transformation, these days (no one
uses SunOS4 anymore):
Hamish Coleman [Mon, 3 Mar 2008 16:52:59 +0000 (09:52 -0700)]
agetty: make username-in-uppercase feature optional (off by default.)
The following patch makes the username-in-upper-case feature optional.
I have chosen to make it default to off since this feature was designed
to cater for serial terminals that were last sold almost 30 years ago,
thus the likelyhood that anyone will need this feature turned on is
vanishingly small.
Addresses-Debian-Bug: 156242 Signed-off-by: Hamish Coleman <hamish@zot.org> Signed-off-by: LaMont Jones <lamont@debian.org> Signed-off-by: Karel Zak <kzak@redhat.com>
Robert Millan [Thu, 14 Feb 2008 23:13:26 +0000 (00:13 +0100)]
fdisk: use more readable "GPT" name rather than "EFI GPT"
Although GPT is defined in EFI spec, it is widely used without EFI, as it
reserves space for the MBR and works fine on PC/BIOS systems provided the
bootloader supports it.
This is in fact the way everyone seems to be following to overcome the 2 TiB
limitation with MSDOS partition table.
Martin Schulze [Sun, 27 Jan 2008 06:31:06 +0000 (23:31 -0700)]
mkswap: set UUID for swap space (add -U option)
A friend of mine is looking into the possibility of cloning Debian
(and other) systems automatically and stomped over swap partitions
getting assigned new UUIDs every time the new harddisk is partitioned
and swap is created.
It's essential when partitions are to be recognised by their uuid and
not by their old device path anymore.
Addresses-Ubuntu-Bug: #66637 Signed-off-by: LaMont Jones <lamont@debian.org> Signed-off-by: Karel Zak <kzak@redhat.com>
Mark McLoughlin [Mon, 28 Jan 2008 13:30:29 +0000 (14:30 +0100)]
mount: "can't create lock file" message sometimes means failure, sometimes not
What the patch does is goes from the situation where:
1) If /etc/mtab doesn't exist and /etc is read-only, you get the
"can't create lock file" message and the mount fails
2) If /etc/mtab does exist and /etc is read-only,you get the same
message but the mount succeeds
Clearly, the failure to update /etc/mtab should either cause the mount
to fail or not ... sometimes causing it to fail, and sometimes not
(each with the same message) is not useful.
This patch sets the same behaviour for create and update mtab. In both
cases it prints error message and the mount succeeds.
Signed-off-by: Mark McLoughlin <markmc@redhat.com> Signed-off-by: Karel Zak <kzak@redhat.com>
Samuel Thibault [Tue, 27 Nov 2007 22:54:35 +0000 (22:54 +0000)]
setterm: add -blan [force|poke] options for TIOCL_{BLANKED,BLANK}SCREEN
Linux has some interface to force an immediate blank
(TIOCL_BLANK/UNBLANKSCREEN) or get the blank status
(TIOCL_BLANKEDSCREEN), which is useful e.g. for blind people.
Co-Author: Karel Zak <kzak@redhat.com> Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org> Signed-off-by: Karel Zak <kzak@redhat.com>
David Brownell [Sun, 3 Feb 2008 23:34:35 +0000 (15:34 -0800)]
rtcwake: fix UTC time usage
Timezone handling is broken in this version since it's always
passing UTC time into the kernel, even on systems where the
RTC uses the local timezone.
I think that bug must come from bugs in how the system used to
to originally develop this code handled the RTC timezone. Both
RTCs should have been kept in UTC ... but only one of them was.
Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Karel Zak [Fri, 23 Nov 2007 14:13:22 +0000 (15:13 +0100)]
losetup: support unlimited number of loops
Old implementation:
- supports 256 loop devices only
- doesn't support gaps in list of loop devices
(e.g. loop0, loop1, loop3 -- loop3 is invisible)
Kernel 2.6.21 removes artificial maximum 256 loop device. Now the maximum
of loop devices could be really huge (depends on limit of MINOR
numbers). It means we need a better way how work with loop devices
than blindly call stat(2) for all 0-1048575 devices.
This patch uses three methods:
a) scan /sys/block/loopN (used for losetup -a only). This method is
probably the fastest way how found used loop device on machine with
huge number of devices in /dev.
b) classic way, stat(2) for all loop[0-7] devices (default number of
loop devices). This cheap method is sufficient for 99% of all machines.
LaMont Jones [Sun, 13 Jan 2008 05:35:50 +0000 (22:35 -0700)]
renice: detect errors in arguments, add -v, -h and long options
* renice was using atoi(), which does no error detection, meaning
that: "renice +20 blah" was accepted as valid.
* add -h | --help
* add -v | --version
* add long options for -p, -u and -g
* cleanup coding style
Addresses-Debian-Bug: #385245
Co-Author: Karel Zak <kzak@redhat.com> Signed-off-by: LaMont Jones <lamont@debian.org> Signed-off-by: Karel Zak <kzak@redhat.com>
H. Peter Anvin [Wed, 16 Jan 2008 18:53:56 +0000 (13:53 -0500)]
fdisk: better fallback for get_random_id()
When /dev/urandom is not available, we have to use some kind of a hack
to generate a random MBR identifier. Use a better fallback that
incorporates the clock down to microsecond granularity.
Karel Zak [Mon, 28 Jan 2008 13:02:35 +0000 (14:02 +0100)]
login: fix a small memory leak and remove unnecessary zeroing
This patch fix a small memory leak (rh#251539) and also remove
unnecessary pam_set_item(). We needn't to zeroing PAM_USER when the
value is already NULL, it doesn't make sense.
Addresses-Red-Hat-Bugzilla: #251539 Signed-off-by: Karel Zak <kzak@redhat.com>
Karel Zak [Mon, 28 Jan 2008 12:13:25 +0000 (13:13 +0100)]
umount: don't print duplicate error messages
umount(8) is trying to umount a device two times to prevent some
obscure scenarios. It's maybe a nice feature, but it also produces
duplicate error messages.
# umount /home
umount: /home: device is busy
umount: /home: device is busy