* [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
* [PATCH v2] 95rootfs-block: fix missing root when label contains slash
[not found] ` <1288963916-3609-1-git-send-email-arvidjaar-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
@ 2010-11-06 21:46 ` Andrey Borzenkov
[not found] ` <1289080013-3525-1-git-send-email-arvidjaar-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
0 siblings, 1 reply; 4+ messages in thread
From: Andrey Borzenkov @ 2010-11-06 21:46 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.
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"
--
tg: (1c29003..) upstream/rootdev (depends on: master)
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH v2] 95rootfs-block: fix missing root when label contains slash
[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
1 sibling, 0 replies; 4+ messages in thread
From: Harald Hoyer @ 2010-11-10 14:48 UTC (permalink / raw)
To: Andrey Borzenkov; +Cc: initramfs-u79uwXL29TY76Z2rM5mHXA
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 / ??
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH v2] 95rootfs-block: fix missing root when label contains slash
[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
1 sibling, 0 replies; 4+ messages in thread
From: Harald Hoyer @ 2010-11-10 15:03 UTC (permalink / raw)
To: Andrey Borzenkov; +Cc: initramfs-u79uwXL29TY76Z2rM5mHXA
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"
pushed
^ permalink raw reply [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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox