Skip to contentSkip to conversation

runqemu: Ensure ROOTFS path is absolute

PATCH In review Saul Wold 5 participants 7 messages Feb 20, 2014 – Feb 25, 2014

lore
Share & tools
lore

Saul Wold

author
#0 lore raw

PATCH 1/1 runqemu: Ensure ROOTFS path is absolute

There is a problem if a relative path is passed to the kernel for NFS usage that it will not correctly find it, so ensure that the ROOTFS path is absolute.

[YOCTO #2807]

---
 scripts/runqemu | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
scripts/runqemu +3 -1
index 0db7ad6..57c5de4 100755
@@ -462,7 +462,9 @@ if [ -z "$ROOTFS" -a "x$FSTYPE" != "xvmdk" ]; then
         error "Unable to determine default rootfs for MACHINE [$MACHINE]"
     fi
 fi
-# ROOTFS is now set for all cases
+# ROOTFS is now set for all cases, now expand it to be an absolute path, it should exist at this point
+
+ROOTFS=`realpath $ROOTFS`
 
 echo ""
 echo "Continuing with the following parameters:"
Signature · 1 line
1.8.3.1
#1 lore raw
Quoted 18 lines · Saul Wold

There is a problem if a relative path is passed to the kernel for NFS usage that it will not correctly find it, so ensure that the ROOTFS path is absolute.

[YOCTO #2807]

---
scripts/runqemu | 4 +++-

1 file changed, 3 insertions(+), 1 deletion(-)
scripts/runqemu +0 -0
index 0db7ad6..57c5de4 100755
@@ -462,7 +462,9 @@ if [ -z "$ROOTFS" -a "x$FSTYPE" != "xvmdk" ]; then
        error "Unable to determine default rootfs for MACHINE [$MACHINE]"
    fi

fi

scripts/runqemu if [ -z "$ROOTFS" -a "x$FSTYPE" != "xvmdk" ]; then · line 467

Quoted 4 lines
scripts/runqemu +3 -1
-# ROOTFS is now set for all cases
+# ROOTFS is now set for all cases, now expand it to be an absolute path, it should exist at this point
+
+ROOTFS=`realpath $ROOTFS`

I think this change also means we need to add dependency on realpath package as prerequisite for build host.

#2 lore raw
Quoted 23 lines · On Friday 21 February 2014 21:57:37 Khem Raj wrote:
Quoted 22 lines · Saul Wold

There is a problem if a relative path is passed to the kernel for NFS usage
that it will not correctly find it, so ensure that the ROOTFS path is absolute.

[YOCTO #2807]

---
scripts/runqemu | 4 +++-

1 file changed, 3 insertions(+), 1 deletion(-)
scripts/runqemu +0 -0
index 0db7ad6..57c5de4 100755
@@ -462,7 +462,9 @@ if [ -z "$ROOTFS" -a "x$FSTYPE" != "xvmdk" ]; then
 
        error "Unable to determine default rootfs for MACHINE [$MACHINE]"
 
    fi
 
Quoted 8 lines
Quoted 5 lines

fi

scripts/runqemu +1 -1
-# ROOTFS is now set for all cases
+# ROOTFS is now set for all cases, now expand it to be an absolute path,

it should exist at this point +
+ROOTFS=realpath $ROOTFS

I think this change also means we need to add dependency on realpath package as prerequisite for build host.

realpath is part of coreutils. Another alternative would be readlink -f (but that also appears to be part of coreutils.)

Cheers,
Paul

Signature · 2 lines
Paul Eggleton
Intel Open Source Technology Centre
#3 lore raw
Quoted 33 lines · Paul Eggleton
Quoted 23 lines · On Friday 21 February 2014 21:57:37 Khem Raj wrote:
Quoted 22 lines · Saul Wold

There is a problem if a relative path is passed to the kernel for NFS usage
that it will not correctly find it, so ensure that the ROOTFS path is absolute.

[YOCTO #2807]

---
scripts/runqemu | 4 +++-

1 file changed, 3 insertions(+), 1 deletion(-)
scripts/runqemu +0 -0
index 0db7ad6..57c5de4 100755
@@ -462,7 +462,9 @@ if [ -z "$ROOTFS" -a "x$FSTYPE" != "xvmdk" ]; then
 
        error "Unable to determine default rootfs for MACHINE [$MACHINE]"
 
    fi
 
Quoted 8 lines
Quoted 5 lines

fi

scripts/runqemu +1 -1
-# ROOTFS is now set for all cases
+# ROOTFS is now set for all cases, now expand it to be an absolute path,

it should exist at this point +
+ROOTFS=realpath $ROOTFS

I think this change also means we need to add dependency on realpath package as prerequisite for build host.

Quoted 3 lines

realpath is part of coreutils. Another alternative would be readlink -f (but that also appears to be part of coreutils.)

Looks like busybox should provide realpath:
http://www.busybox.net/downloads/BusyBox.html#realpath

Thanks,

Signature · 4 lines
Paul Barker

Email: [email protected]
http://www.paulbarker.me.uk
#4 lore raw
In reply to Paul Eggleton
Quoted 33 lines · Paul Eggleton
Quoted 23 lines · On Friday 21 February 2014 21:57:37 Khem Raj wrote:
Quoted 22 lines · Saul Wold

There is a problem if a relative path is passed to the kernel for NFS usage
that it will not correctly find it, so ensure that the ROOTFS path is absolute.

[YOCTO #2807]

---
scripts/runqemu | 4 +++-

1 file changed, 3 insertions(+), 1 deletion(-)
scripts/runqemu +0 -0
index 0db7ad6..57c5de4 100755
@@ -462,7 +462,9 @@ if [ -z "$ROOTFS" -a "x$FSTYPE" != "xvmdk" ]; then
 
       error "Unable to determine default rootfs for MACHINE [$MACHINE]"
 
   fi
 
Quoted 8 lines
Quoted 5 lines

fi

scripts/runqemu +1 -1
-# ROOTFS is now set for all cases
+# ROOTFS is now set for all cases, now expand it to be an absolute path,

it should exist at this point +
+ROOTFS=realpath $ROOTFS

I think this change also means we need to add dependency on realpath package as prerequisite for build host.

Quoted 1 line

realpath is part of coreutils.

realpath is package of its own not coreutils, at least on ubuntu

Quoted 2 lines

Another alternative would be readlink -f (but
that also appears to be part of coreutils.)

this might be better options since coreutils is more or less given on any distro

Quoted 8 lines

Cheers,
Paul

Signature · 2 lines
Paul Eggleton
Intel Open Source Technology Centre
#5 lore raw
Quoted 36 lines · Khem Raj
Quoted 33 lines · Paul Eggleton
Quoted 31 lines · On Friday 21 February 2014 21:57:37 Khem Raj wrote:
Quoted 25 lines · Saul Wold

There is a problem if a relative path is passed to the kernel for NFS usage
that it will not correctly find it, so ensure that the ROOTFS path is absolute.

[YOCTO #2807]

---
scripts/runqemu | 4 +++-

1 file changed, 3 insertions(+), 1 deletion(-)
scripts/runqemu +0 -0
index 0db7ad6..57c5de4 100755
@@ -462,7 +462,9 @@ if [ -z "$ROOTFS" -a "x$FSTYPE" != "xvmdk" ]; then
 
        error "Unable to determine default rootfs for MACHINE [$MACHINE]"
 
    fi
 

fi

scripts/runqemu +1 -1
-# ROOTFS is now set for all cases
+# ROOTFS is now set for all cases, now expand it to be an absolute path,
Quoted 2 lines

it should exist at this point +
+ROOTFS=realpath $ROOTFS

I think this change also means we need to add dependency on realpath package as prerequisite for build host.

Quoted 3 lines
Quoted 1 line

realpath is part of coreutils.

realpath is package of its own not coreutils, at least on ubuntu

On CentOS 6.5 realpath is not part of coreutils and is not part of a default repo. I could find it only on RPMforge.

Quoted 24 lines
Quoted 3 lines

Another alternative would be readlink -f (but
that also appears to be part of coreutils.)

this might be better options since coreutils is more or less given on any distro

Quoted 8 lines

Cheers,
Paul

--

Paul Eggleton
Intel Open Source Technology Centre

_______________________________________________
Openembedded-core mailing list
[email protected]
http://lists.openembedded.org/mailman/listinfo/openembedded-core

Signature · 1 line
Alexandru Palalau
#6 lore raw
Quoted 41 lines · Alexandru Palalau
Quoted 40 lines · Khem Raj
Quoted 36 lines · Paul Eggleton
Quoted 34 lines · On Friday 21 February 2014 21:57:37 Khem Raj wrote:
Quoted 26 lines · Saul Wold

There is a problem if a relative path is passed to the kernel for NFS usage
that it will not correctly find it, so ensure that the ROOTFS path is absolute.

[YOCTO #2807]

---
scripts/runqemu | 4 +++-

1 file changed, 3 insertions(+), 1 deletion(-)
scripts/runqemu +0 -0
index 0db7ad6..57c5de4 100755
@@ -462,7 +462,9 @@ if [ -z "$ROOTFS" -a "x$FSTYPE" != "xvmdk" ]; then
 
        error "Unable to determine default rootfs for MACHINE

[$MACHINE]"

fi

fi

scripts/runqemu +1 -1
-# ROOTFS is now set for all cases
+# ROOTFS is now set for all cases, now expand it to be an absolute
Quoted 3 lines

path,
it should exist at this point +
+ROOTFS=realpath $ROOTFS

I think this change also means we need to add dependency on realpath package
as prerequisite for build host.

Quoted 6 lines
Quoted 3 lines
Quoted 1 line

realpath is part of coreutils.

realpath is package of its own not coreutils, at least on ubuntu

On CentOS 6.5 realpath is not part of coreutils and is not part of a default repo. I could find it only on RPMforge.

Added https://bugzilla.yoctoproject.org/show_bug.cgi?id=5879 on this matter.

Quoted 27 lines
Quoted 25 lines
Quoted 4 lines

Another alternative would be readlink -f (but
that also appears to be part of coreutils.)

this might be better options since coreutils is more or less given on any distro

Quoted 8 lines

Cheers,
Paul

--

Paul Eggleton
Intel Open Source Technology Centre

_______________________________________________
Openembedded-core mailing list
[email protected]
http://lists.openembedded.org/mailman/listinfo/openembedded-core

Signature · 1 line
Alexandru Palalau