* [PATCH 1/3] Fix 'root=LABEL=/'
@ 2009-01-10 19:59 Bill Nottingham
[not found] ` <1231617553-4206-1-git-send-email-notting-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
0 siblings, 1 reply; 8+ messages in thread
From: Bill Nottingham @ 2009-01-10 19:59 UTC (permalink / raw)
To: initramfs-u79uwXL29TY76Z2rM5mHXA; +Cc: Bill Nottingham
As you can't have /dev/disk/by-label//, we need to escape the '/'
character in the same way that udev does.
---
init | 5 ++++-
1 files changed, 4 insertions(+), 1 deletions(-)
diff --git a/init b/init
index 5b94e3d..12144d2 100755
--- a/init
+++ b/init
@@ -64,7 +64,10 @@ if [ -z "$root" ]; then
echo "Warning: no root specified"
root="/dev/sda1"
elif [ "${root#LABEL=}" != $root ]; then
- root="/dev/disk/by-label/${root#LABEL=}"
+ # FIXME: may need to do more escaping here
+ l=${root#LABEL=}
+ label=${l//\//\\x2f}
+ root="/dev/disk/by-label/${label}"
elif [ "${root#UUID=}" != $root ]; then
root="/dev/disk/by-uuid/${root#UUID=}"
fi
--
1.6.1
--
To unsubscribe from this list: send the line "unsubscribe initramfs" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [PATCH 2/3] Fix tense.
[not found] ` <1231617553-4206-1-git-send-email-notting-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
@ 2009-01-10 19:59 ` Bill Nottingham
[not found] ` <1231617553-4206-2-git-send-email-notting-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2009-01-12 16:35 ` [PATCH 1/3] Fix 'root=LABEL=/' Jeremy Katz
1 sibling, 1 reply; 8+ messages in thread
From: Bill Nottingham @ 2009-01-10 19:59 UTC (permalink / raw)
To: initramfs-u79uwXL29TY76Z2rM5mHXA; +Cc: Bill Nottingham
---
init | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/init b/init
index 12144d2..9b7cfe9 100755
--- a/init
+++ b/init
@@ -81,7 +81,7 @@ while [ ! -e $root ]; do
emergency_shell
fi
done
-echo -e "\n\nMounted rootfs after $tries seconds"
+echo -e "\n\nMounting rootfs after $tries seconds"
ln -s "$root" /dev/root
mount -o ro /dev/root $NEWROOT
--
1.6.1
--
To unsubscribe from this list: send the line "unsubscribe initramfs" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [PATCH 3/3] Go to an emergency shell if mounting the root filesystem fails.
[not found] ` <1231617553-4206-2-git-send-email-notting-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
@ 2009-01-10 19:59 ` Bill Nottingham
[not found] ` <1231617553-4206-3-git-send-email-notting-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2009-01-12 16:36 ` [PATCH 2/3] Fix tense Jeremy Katz
1 sibling, 1 reply; 8+ messages in thread
From: Bill Nottingham @ 2009-01-10 19:59 UTC (permalink / raw)
To: initramfs-u79uwXL29TY76Z2rM5mHXA; +Cc: Bill Nottingham
---
init | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/init b/init
index 9b7cfe9..ce6359b 100755
--- a/init
+++ b/init
@@ -83,7 +83,7 @@ while [ ! -e $root ]; do
done
echo -e "\n\nMounting rootfs after $tries seconds"
ln -s "$root" /dev/root
-mount -o ro /dev/root $NEWROOT
+mount -o ro /dev/root $NEWROOT || emergency_shell
# now we need to prepare to switchroot
mount --bind /dev $NEWROOT/dev
--
1.6.1
--
To unsubscribe from this list: send the line "unsubscribe initramfs" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply related [flat|nested] 8+ messages in thread
* Re: [PATCH 1/3] Fix 'root=LABEL=/'
[not found] ` <1231617553-4206-1-git-send-email-notting-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2009-01-10 19:59 ` [PATCH 2/3] Fix tense Bill Nottingham
@ 2009-01-12 16:35 ` Jeremy Katz
[not found] ` <B9A9EF7B-50A6-4E37-8485-F9486F96C5FA-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
1 sibling, 1 reply; 8+ messages in thread
From: Jeremy Katz @ 2009-01-12 16:35 UTC (permalink / raw)
To: Bill Nottingham; +Cc: initramfs-u79uwXL29TY76Z2rM5mHXA
On Jan 10, 2009, at 2:59 PM, Bill Nottingham wrote:
> As you can't have /dev/disk/by-label//, we need to escape the '/'
> character in the same way that udev does.
Applied, thanks. Though I still want to get to where we use a udev
rule to create the /dev/root symlink so that we can not have to do
this sort of escaping.
Jeremy
--
To unsubscribe from this list: send the line "unsubscribe initramfs" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH 2/3] Fix tense.
[not found] ` <1231617553-4206-2-git-send-email-notting-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2009-01-10 19:59 ` [PATCH 3/3] Go to an emergency shell if mounting the root filesystem fails Bill Nottingham
@ 2009-01-12 16:36 ` Jeremy Katz
1 sibling, 0 replies; 8+ messages in thread
From: Jeremy Katz @ 2009-01-12 16:36 UTC (permalink / raw)
To: Bill Nottingham; +Cc: initramfs-u79uwXL29TY76Z2rM5mHXA
On Jan 10, 2009, at 2:59 PM, Bill Nottingham wrote:
> -echo -e "\n\nMounted rootfs after $tries seconds"
> +echo -e "\n\nMounting rootfs after $tries seconds"
Picky, picky... applied :)
Jeremy
--
To unsubscribe from this list: send the line "unsubscribe initramfs" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH 3/3] Go to an emergency shell if mounting the root filesystem fails.
[not found] ` <1231617553-4206-3-git-send-email-notting-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
@ 2009-01-12 16:36 ` Jeremy Katz
0 siblings, 0 replies; 8+ messages in thread
From: Jeremy Katz @ 2009-01-12 16:36 UTC (permalink / raw)
To: Bill Nottingham; +Cc: initramfs-u79uwXL29TY76Z2rM5mHXA
On Jan 10, 2009, at 2:59 PM, Bill Nottingham wrote:
> -mount -o ro /dev/root $NEWROOT
> +mount -o ro /dev/root $NEWROOT || emergency_shell
And also applied. Although it raises the question of if it makes
sense to use 'set -e' so that any command failing drops you to the
prompt
Jeremy
--
To unsubscribe from this list: send the line "unsubscribe initramfs" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH 1/3] Fix 'root=LABEL=/'
[not found] ` <B9A9EF7B-50A6-4E37-8485-F9486F96C5FA-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
@ 2009-01-13 7:46 ` Seewer Philippe
[not found] ` <496C46E4.8000301-omB+W0Dpw2o@public.gmane.org>
0 siblings, 1 reply; 8+ messages in thread
From: Seewer Philippe @ 2009-01-13 7:46 UTC (permalink / raw)
To: Jeremy Katz; +Cc: Bill Nottingham, initramfs-u79uwXL29TY76Z2rM5mHXA
Jeremy Katz wrote:
> On Jan 10, 2009, at 2:59 PM, Bill Nottingham wrote:
>> As you can't have /dev/disk/by-label//, we need to escape the '/'
>> character in the same way that udev does.
>
> Applied, thanks. Though I still want to get to where we use a udev rule
> to create the /dev/root symlink so that we can not have to do this sort
> of escaping.
Just out of curiosity. Any idea how to do a udev rule like that?
Cheers,
Philippe
--
To unsubscribe from this list: send the line "unsubscribe initramfs" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH 1/3] Fix 'root=LABEL=/'
[not found] ` <496C46E4.8000301-omB+W0Dpw2o@public.gmane.org>
@ 2009-01-13 15:56 ` Bill Nottingham
0 siblings, 0 replies; 8+ messages in thread
From: Bill Nottingham @ 2009-01-13 15:56 UTC (permalink / raw)
To: Seewer Philippe; +Cc: Jeremy Katz, initramfs-u79uwXL29TY76Z2rM5mHXA
Seewer Philippe (philippe.seewer-omB+W0Dpw2o@public.gmane.org) said:
>> Applied, thanks. Though I still want to get to where we use a udev
>> rule to create the /dev/root symlink so that we can not have to do this
>> sort of escaping.
>
> Just out of curiosity. Any idea how to do a udev rule like that?
Before you start udev, in the initramfs init script, you'd do something
like:
if [ "${root#LABEL=}" != "$root" ]; then
l=${root#LABEL=}
cat > /etc/udev/rules.d/99-rootfs.rules << EOF
ENV{ID_FS_USAGE}=="filesystem|other", ENV{ID_FS_LABEL_ENC}=="$l", SYMLINK+="root"
EOF
fi
Then, you'd just wait for /dev/root to show up, rather than a particular
device.
Bill
--
To unsubscribe from this list: send the line "unsubscribe initramfs" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2009-01-13 15:56 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-01-10 19:59 [PATCH 1/3] Fix 'root=LABEL=/' Bill Nottingham
[not found] ` <1231617553-4206-1-git-send-email-notting-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2009-01-10 19:59 ` [PATCH 2/3] Fix tense Bill Nottingham
[not found] ` <1231617553-4206-2-git-send-email-notting-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2009-01-10 19:59 ` [PATCH 3/3] Go to an emergency shell if mounting the root filesystem fails Bill Nottingham
[not found] ` <1231617553-4206-3-git-send-email-notting-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2009-01-12 16:36 ` Jeremy Katz
2009-01-12 16:36 ` [PATCH 2/3] Fix tense Jeremy Katz
2009-01-12 16:35 ` [PATCH 1/3] Fix 'root=LABEL=/' Jeremy Katz
[not found] ` <B9A9EF7B-50A6-4E37-8485-F9486F96C5FA-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2009-01-13 7:46 ` Seewer Philippe
[not found] ` <496C46E4.8000301-omB+W0Dpw2o@public.gmane.org>
2009-01-13 15:56 ` Bill Nottingham
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.