Kel Modderman [Thu, 13 Aug 2009 11:51:57 +0000 (05:51 -0600)]
hwclockfirst.sh: initscript LSB header in conflict with update-rc.d options
hwclockfirst should start before checkroot, followed by hwclock as far as I
understand. This is not represented in the current dependency information,
hwlockfirst and hwclock both only require mountdevsubfs to have started, thus
they are started at same sequence in dependency based boot.
Addresses-Debian-Bug: 487196 Signed-off-by: LaMont Jones <lamont@debian.org>
Only check for ENOMEDIUM when ENOMEDIUM is defined.
ENOMEDIUM is Linux-only. On other systems, the open call on a CD-ROM
device without any medium may be successful and a subsequent read may
return EINVAL instead. Let's just break out of the loop if ENOMEDIUM
isn't defined.
Signed-off-by: Cyril Brulebois <kibi@debian.org> Signed-off-by: LaMont Jones <lamont@debian.org>
mount: when a remount to rw fails, quit and return an error
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>
Use the new --systz option in the udev rule for /dev/rtc0, stepping the
clock if the hardware clock wasn't in localtime and updating the kernel
timezone.
Since udev can directly import /etc/default/rcS to get the UTC and
BADYEAR settings, we don't need a wrapper shell script for this saving a
bit of time.
Daniel Drake [Tue, 14 Jul 2009 12:41:33 +0000 (14:41 +0200)]
switch_root: add subroot support
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>
Kay Sievers [Fri, 3 Jul 2009 21:18:36 +0000 (23:18 +0200)]
build-sys: reverse shlibs installation
[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>
libuuid: Don't run uuidd if it would fail due to permission problems
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.
libuuid, uuidd: Avoid infinite loop while reading from the socket fd
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.
uuidd: Avoid closing the server socket when calling create_daemon()
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).
Theodore Ts'o [Tue, 30 Jun 2009 01:19:28 +0000 (21:19 -0400)]
libuuid: Make sure fd's 0, 1, and 2 are valid before exec'ing uuidd
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.
Karel Zak [Tue, 30 Jun 2009 11:18:26 +0000 (13:18 +0200)]
libuuid: fix $libdir in uuid.pc
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).
Karel Zak [Tue, 30 Jun 2009 11:11:05 +0000 (13:11 +0200)]
libblkid: fix $libdir in blkid.pc
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).
Jeff Mahoney [Mon, 29 Jun 2009 21:05:36 +0000 (23:05 +0200)]
raw: Use the RAW_SETBIND ioctl without stat'ing the raw# file
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.
Tilman Schmidt [Sun, 10 May 2009 11:54:51 +0000 (13:54 +0200)]
ldattach: add N_PPS support
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.
Karel Zak [Tue, 9 Jun 2009 07:58:46 +0000 (09:58 +0200)]
switch_root: new command
Copied from Dracut project:
git://dracut.git.sourceforge.net/gitroot/dracut
switch_root history in dracut.git repository:
$ git shortlog switch_root.c
Harald Hoyer (5):
replace switch_root shell script with binary
add \n to switch_root
use switch_root code from http://pjones.fedorapeople.org/mkstart/usr/lib/mkstart/switchroot.c
mount move instead of umount and fix the search for fallback inits
setsid() and set controlling terminal for real /sbin/init
Victor Lowther (2):
Simplify switch_root.c a bit
Remove all files on the initramfs before switching root
Signed-off-by: Peter Jones <pjones@redhat.com> Signed-off-by: Karel Zak <kzak@redhat.com>