From patchwork Mon May 30 14:54:19 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [13/17] initramfs-module-block: use ROOT_DEVICE mountpoint if available Date: Mon, 30 May 2011 14:54:19 -0000 From: Otavio Salvador X-Patchwork-Id: 5065 Message-Id: <1306767263-29895-14-git-send-email-otavio@ossystems.com.br> To: openembedded-devel@lists.openembedded.org Cc: Otavio Salvador Signed-off-by: Otavio Salvador --- recipes/initrdscripts/files/85-blockboot.sh | 9 +++++++-- .../initrdscripts/initramfs-module-block_1.0.bb | 2 +- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/recipes/initrdscripts/files/85-blockboot.sh b/recipes/initrdscripts/files/85-blockboot.sh index 7841ac6..07c1c35 100644 --- a/recipes/initrdscripts/files/85-blockboot.sh +++ b/recipes/initrdscripts/files/85-blockboot.sh @@ -7,6 +7,11 @@ if [ -e "$ROOT_DEVICE" ]; then if [ -n "$ROOT_FSTYPE" ]; then type="-t $ROOT_FSTYPE" fi - mount $type "$ROOT_DEVICE" /mnt || fatal "Unable to mount rootfs device" - BOOT_ROOT=/mnt + + if ! mount | grep -q "$ROOT_DEVICE"; then + mount $type "$ROOT_DEVICE" /mnt || fatal "Unable to mount rootfs device" + BOOT_ROOT=/mnt + else + BOOT_ROOT=`expr "$(mount | grep $ROOT_DEVICE)" : '.* on \([^ ]*\)'` + fi fi diff --git a/recipes/initrdscripts/initramfs-module-block_1.0.bb b/recipes/initrdscripts/initramfs-module-block_1.0.bb index f7834f0..a21a681 100644 --- a/recipes/initrdscripts/initramfs-module-block_1.0.bb +++ b/recipes/initrdscripts/initramfs-module-block_1.0.bb @@ -1,5 +1,5 @@ SRC_URI = "file://85-blockboot.sh" -PR = "r5" +PR = "r6" RDEPENDS_${PN} = "initramfs-uniboot" DESCRIPTION = "An initramfs module for booting off normal block devices."