On Wed, Apr 27, 2011 at 05:20:13PM +0100, Roger Leigh wrote: > On Sat, Apr 23, 2011 at 10:07:28AM +1000, Kel Modderman wrote: > > On Sat, 23 Apr 2011 04:27:00 AM Roger Leigh wrote: > > > Hi Kel and other sysvinit developers, > > > > > > I've attached a further update for your consideration, which fixes a > > > few issues. If it's OK with you, this could be uploaded to > > > experimental (with your changes folded into the same version in the > > > changelog) as 2.88dsf-13.5. Unless you'd prefer to do a maintainer > > > upload. > > > > > > The logic used for mounting filesystems is duplicated entirely between > > > the various scripts doing mounting, and the mtab script used to > > > generate the initial mtab. This includes the domtab() function, which > > > is almost entirely identical to domount() with the use of -f with mount. > > > This patch removes the duplication, and uses the same codepaths for > > > both mounting and mtab generation, which will make the scripts much > > > more robust when making any changes. > > > > Great improvement. > > [...] > > > In my opnion: do not hesitate to upload this to experimental and continue > > the > > improvement of the transition to /run. > > I've uploaded sysvinit_2.88dsf-13.5 to experimental. The patch against > SVN is attached. This only differs from the previous patch by one > character (s/50%/20%/ for a size limit check).
I've attached a diff against current svn for sysvinit_2.88dsf-13.6. This is quite a small patch - reverts relative symlinks back to absolute to comply with debian policy - fixes a typo and placement of return in mount-functions.sh - remounts filesystems only after mtab becomes writable If it's OK with you, I would like to upload this to unstable now that initramfs-tools_0.99 went in today, which was a prequisite for full udev support. If you would prefer to do this as a proper maintainer upload, that's also fine. Many thanks, Roger -- .''`. Roger Leigh : :' : Debian GNU/Linux http://people.debian.org/~rleigh/ `. `' Printing on GNU/Linux? http://gutenprint.sourceforge.net/ `- GPG Public Key: 0x25BFB848 Please GPG sign your mail.
Index: debian/src/initscripts/lib/init/mount-functions.sh
===================================================================
--- debian/src/initscripts/lib/init/mount-functions.sh (revision 1961)
+++ debian/src/initscripts/lib/init/mount-functions.sh (working copy)
@@ -87,11 +87,9 @@
found=1
if [ -f /etc/fstab ]; then
-
exec 9<&0 </etc/fstab
-
- while read MNT_FSNAME MNT_DIR MNT_TYPE MNT_OPTS MNT_FREQ MAN_PASS MAN_JUNK
+ while read MNT_FSNAME MNT_DIR MNT_TYPE MNT_OPTS MNT_FREQ MNT_PASS MNT_JUNK
do
case "$MNT_FSNAME" in
""|\#*)
@@ -109,9 +107,9 @@
done
exec 0<&9 9<&-
-
- return $found
fi
+
+ return $found
}
# Mount kernel and device file systems.
@@ -210,8 +208,8 @@
if mountpoint -q "$MTPT"; then
# Already mounted, probably moved from the
# initramfs, so remount with the
- # user-specified mount options.
- mount $MOUNTFLAGS -oremount $CALLER_OPTS $FSTAB_OPTS $MTPT
+ # user-specified mount options later on.
+ :
else
if [ "$VERBOSE" != "no" ]; then
is_empty_dir "$MTPT" >/dev/null 2>&1 || log_warning_msg "Files under mount point '$MTPT' will be hidden."
@@ -279,7 +277,6 @@
{
OLD=$1
RUN=$2
- RUNLINK=$3
KERNEL="$(uname -s)"
OPTS=""
@@ -290,11 +287,13 @@
*) FSTYPE=none ;;
esac
- # Create relative symlink if not already present. This is to
- # upgrade from older versions which created absolute links.
- if [ -L "$OLD" ] && [ "$(readlink "$OLD")" = "$RUN" ]; then
+ # Create absolute symlink if not already present. This is to
+ # upgrade from older versions which created relative links,
+ # which are not permitted in policy between top-level
+ # directories.
+ if [ -L "$OLD" ] && [ "$(readlink "$OLD")" != "$RUN" ]; then
rm -f "$OLD"
- ln -fs "$RUNLINK" "$OLD"
+ ln -fs "$RUN" "$OLD"
fi
# If both directories are the same, we don't need to do
@@ -323,11 +322,11 @@
mount -t $FSTYPE "$RUN" "$OLD" $OPTS
else
# Create symlink if not already present.
- if [ -L "$OLD" ] && [ "$(readlink "$OLD")" = "$RUNLINK" ]; then
+ if [ -L "$OLD" ] && [ "$(readlink "$OLD")" != "$RUN" ]; then
:
else
rm -f "$OLD"
- ln -fs "$RUNLINK" "$OLD"
+ ln -fs "$RUN" "$OLD"
fi
fi
@@ -351,7 +350,7 @@
# filesystems are mounted, we replace the directory with a
# symlink where possible.
- run_migrate /var/run /run ../run
- run_migrate /var/lock /run/lock ../run/lock
- run_migrate /dev/shm /run/shm ../run/shm
+ run_migrate /var/run /run
+ run_migrate /var/lock /run/lock
+ run_migrate /dev/shm /run/shm
}
Index: debian/src/initscripts/etc/init.d/mtab.sh
===================================================================
--- debian/src/initscripts/etc/init.d/mtab.sh (revision 1961)
+++ debian/src/initscripts/etc/init.d/mtab.sh (working copy)
@@ -77,10 +77,12 @@
# Add entries for mounts created in early boot
# S01mountkernfs.sh
/etc/init.d/mountkernfs.sh mtab
+ /etc/init.d/mountkernfs.sh reload
# S03udev
domount mtab tmpfs "" /dev "udev" "-omode=0755"
# S03mountdevsubfs.sh
/etc/init.d/mountdevsubfs.sh mtab
+ /etc/init.d/mountdevsubfs.sh reload
# Add everything else in /proc/mounts into /etc/mtab, with
# special exceptions.
Index: debian/initscripts.postinst
===================================================================
--- debian/initscripts.postinst (revision 1961)
+++ debian/initscripts.postinst (working copy)
@@ -244,14 +244,14 @@
if guest_environment; then
# Symlink /var/run from /run
# Note var/run is relative
- if compat_link var/run /run; then
+ if compat_link /var/run /run; then
# Symlink /var/lock from /run/lock
# Note that it's really /var/run/lock
- compat_link ../../var/lock /run/lock
+ compat_link /var/lock /run/lock
# Symlink /dev/shm from /run/shm
# Note that it's really /var/run/shm
- compat_link ../../dev/shm /run/shm
+ compat_link /dev/shm /run/shm
fi
# Host system, not a chroot.
else
Index: debian/changelog
===================================================================
--- debian/changelog (revision 1961)
+++ debian/changelog (working copy)
@@ -1,3 +1,15 @@
+sysvinit (2.88dsf-13.6) unstable; urgency=low
+
+ [ Roger Leigh ]
+ * Non-maintainer upload.
+ * Don't remount filesystems mounted in the initramfs until mtab
+ exists. Use the existing reload functionality of mountkernfs
+ and mountdevsubfs to allow mtab.sh to trigger the remounts.
+ * Revert to using absolute paths in compatibility symlinks in order
+ to comply with Policy ยง10.5 symlink rules.
+
+ -- Roger Leigh <[email protected]> Fri, 13 May 2011 17:03:22 +0100
+
sysvinit (2.88dsf-13.5) experimental; urgency=low
[ Roger Leigh ]
signature.asc
Description: Digital signature
_______________________________________________ Pkg-sysvinit-devel mailing list [email protected] http://lists.alioth.debian.org/mailman/listinfo/pkg-sysvinit-devel

