From: Harald Hoyer <harald-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
To: Andrey Borzenkov <arvidjaar-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
Cc: initramfs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: Re: [PATCH v2] 95rootfs-block: fix missing root when label contains slash
Date: Wed, 10 Nov 2010 15:48:58 +0100 [thread overview]
Message-ID: <4CDAB0DA.909@redhat.com> (raw)
In-Reply-To: <1289080013-3525-1-git-send-email-arvidjaar-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
On 11/06/2010 10:46 PM, Andrey Borzenkov wrote:
> 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.
>
> v2:
> - fix sed expression
> - use printf instead of echo because echo eats '\' as well
>
> 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..9065bed 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 's,\\,\\\\,g')
> + printf "%s $NEWROOT $rootfs ${rflags},${rootopts} 1 1\n" "$esc_root"> /etc/fstab
>
> if [ -z "$fastboot" -a "$READONLY" != "yes" ]; then
> info "Checking filesystems"
maybe we should just turn \x2f back into / ??
next prev parent reply other threads:[~2010-11-10 14:48 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
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 [this message]
2010-11-10 15:03 ` Harald Hoyer
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4CDAB0DA.909@redhat.com \
--to=harald-h+wxahxf7alqt0dzr+alfa@public.gmane.org \
--cc=arvidjaar-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
--cc=initramfs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.