All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] 95rootfs-block: fix missing root when label contains slash
@ 2010-11-05 13:31 Andrey Borzenkov
       [not found] ` <1288963916-3609-1-git-send-email-arvidjaar-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
  0 siblings, 1 reply; 4+ messages in thread
From: Andrey Borzenkov @ 2010-11-05 13:31 UTC (permalink / raw)
  To: initramfs-u79uwXL29TY76Z2rM5mHXA,
	initramfs-u79uwXL29TY76Z2rM5mHXA

It is not clearly documented, but apparently fsck
(or, probably, getmntent) is using backslash as
escape character.

Label containing slash is converted to \x2f but '\'
is eaten by fsck later. Escape '\' before writing
into fstab.

Signed-off-by: Andrey Borzenkov <arvidjaar-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>

---
 modules.d/95rootfs-block/mount-root.sh |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/modules.d/95rootfs-block/mount-root.sh b/modules.d/95rootfs-block/mount-root.sh
index ff64209..493b54b 100755
--- a/modules.d/95rootfs-block/mount-root.sh
+++ b/modules.d/95rootfs-block/mount-root.sh
@@ -106,7 +106,9 @@ if [ -n "$root" -a -z "${root%%block:*}" ]; then
             done
     fi
 
-    echo ${root#block:} "$NEWROOT" "$rootfs" ${rflags},${rootopts} 1 1 > /etc/fstab
+    # backslashes are treated as escape character in fstab
+    esc_root=$(echo ${root#block:} | sed ',\\,\\\\,g')
+    echo "$esc_root" "$NEWROOT" "$rootfs" ${rflags},${rootopts} 1 1 > /etc/fstab
 
     if [ -z "$fastboot" -a "$READONLY" != "yes" ]; then
         info "Checking filesystems"
-- 
tg: (921f4b5..) upstream/rootdev (depends on: master)

^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2010-11-10 15:03 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-11-05 13:31 [PATCH] 95rootfs-block: fix missing root when label contains slash Andrey Borzenkov
     [not found] ` <1288963916-3609-1-git-send-email-arvidjaar-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2010-11-06 21:46   ` [PATCH v2] " Andrey Borzenkov
     [not found]     ` <1289080013-3525-1-git-send-email-arvidjaar-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2010-11-10 14:48       ` Harald Hoyer
2010-11-10 15:03       ` Harald Hoyer

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.