A nice feature of mount is that when you attempt to mount a file
system read-write, and that fails because it can only be mounted
read-only, it goes ahead and retries the mount with the "ro" option
and returns success if that succeeds. However, this code path is also
followed when you are doing a remount for the sole purpose of changing
the mount from read-only to read-write - the change fails, but mount
returns success. Instead, check if we are attempting to remount and
fail out immediately, instead of retrying with the old "ro" option and
whee, happily "succeeding."
Signed-off-by: Valerie Aurora (Henson) <vaurora@redhat.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
The current switch_root can only switch to a new root that is the root
of a mount point.
This patch adds support for "subroots", where the new root is
somewhere below a mount point. It does this by adding in a few extra
steps to chroot into the subroot after the enclosing partition has
been moved and entered.
This will be used by OLPC, who sort-of have 2 copies of Fedora stored
on a single partition under different directory trees, where the
initramfs decides which one to boot into
[kzak@redhat.com:
- port to the current u-l-ng switch_root code
- don't use static buffer for "dir" in get_parent_mount()]
CC: Peter Jones <pjones@redhat.com>
Signed-off-by: Daniel Drake <dsd@laptop.org>
Signed-off-by: Karel Zak <kzak@redhat.com>
It's more safe to create symlinks in the target directory and use
$(LN_S) rather than directly call "ln -sf".
Reported-by: Peter Breitenlohner <peb@mppmu.mpg.de>
Signed-off-by: Karel Zak <kzak@redhat.com>
[kzak@redhat.com:
Unfortunately, libtool does not provide a way how to install real
libraries to /lib and devel libs (symlinks) to /usr/lib. We have
to use install hooks to move these files.
Currently we install to /lib and move devel files to /usr/lib. This
concept is wrong, because the libdir= in .la libtool files must to
match with the place where we install the devel .so libs. It means we
have to install everything to /usr/lib and then move (by install hook)
the real .so libs to /lib.
This change is necessary to fix "make install", otherwise the install
process will not work in clean change root. ]
Signed-off-by: Kay Sievers <kay.sievers@vrfy.org>
Signed-off-by: Karel Zak <kzak@redhat.com>
The others utilities are in one of the top-level directories. That's
confusing to have blkid(8) and findfs(8) in shlibs/ tree.
Signed-off-by: Karel Zak <kzak@redhat.com>
from Linux kernel:
commit abd4aa5a97ebc0efb9a7fbc98ef0bcf39266fadf
Author: Dave Jones <davej@redhat.com>
Date: Sun Jul 15 23:40:49 2007 -0700
undeprecate raw driver
:-(
Signed-off-by: Karel Zak <kzak@redhat.com>
Some distributions don't like installing uuidd setuid or setgid. So
if the setuid or setigid bit is not set with uuidd, and the current
process does not have write access to the UUIDD work directory, don't
try running uuidd, since it won't work properly.
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
If for some reason the uuidd daemon or the process calling uuidd
exited unexpectely, the read_all() function would end up looping
forever, either in uuidd or in libuuid. Fix this terminating the loop
if no data can be read after five tries to read from the file
descriptor.
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
In the event that file descriptors 0-2 are closed when uuidd is
started, the server socket could be created as a file descriptor that
will get closed when create_daemon() tries detaching the uuidd daemon
from its controlling tty. Avoid this case by using dup(2).
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
When closing all of the file descriptors before starting uuidd, make
sure file descriptors 0, 1, and 2 are reserved by opening /dev/null.
This prevents strange bugs caused by assumptions regarding file
descriptors <= 2 as being special.
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
The -L<dir> gcc option is for directories to be searched for .so/.a
files. It means the directory with development stuff. We have devel
libs in /usr/lib[64].
The side effect is that pkg-config does not return -L with standard
system directories (so make(1) output is more readable and shorter).
Signed-off-by: Karel Zak <kzak@redhat.com>
The -L<dir> gcc option is for directories to be searched for .so/.a
files. It means the directory with development stuff. We have devel
libs in /usr/lib[64].
The side effect is that pkg-config does not return -L with standard
system directories (so make(1) output is more readable and shorter).
Signed-off-by: Karel Zak <kzak@redhat.com>
We need to use $usr{bin,sbin,lib}execdir variables in *.pc.in files
and these files are generated by ./configure script.
Signed-off-by: Karel Zak <kzak@redhat.com>
Unfortunately, libtool installs all files to $libdir (/lib), but
we need devel files in $usrlibexecdir (/usr/lib).
Signed-off-by: Karel Zak <kzak@redhat.com>
Unfortunately, libtool installs all files to $libdir (/lib), but we need
devel files in $usrlibexecdir (/usr/lib).
Signed-off-by: Karel Zak <kzak@redhat.com>
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.
[kzak@redhat.com: - check properly fscanf() return code
- add NLS stuff]
Signed-off-by: Jeff Mahoney <jeffm@suse.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
Add support for a line discipline name "PPS" selecting the
Pulse Per Second line discipline N_PPS (18). The number has been
reserved since kernel release 2.6.28, and the implementation is
finally going to be submitted for kernel release 2.6.31.
Signed-off-by: Tilman Schmidt <tilman@imap.cc>