summaryrefslogtreecommitdiffstats
path: root/scripts/runqemu-extract-sdk
diff options
context:
space:
mode:
authorPeter Seebach <peter.seebach@windriver.com>2012-08-27 13:32:30 -0500
committerRichard Purdie <richard.purdie@linuxfoundation.org>2012-08-29 16:02:10 -0700
commit92e40ec8599d567f3907837c616b83e089c2b544 (patch)
tree4e0173fa06524583fd17ca26aa042ce6a1bc0c9b /scripts/runqemu-extract-sdk
parentc0aa58f4611d0a9e3cc41c09770f536b3ed6eb66 (diff)
downloadpoky-92e40ec8599d567f3907837c616b83e089c2b544.tar.gz
runqemu-export-rootfs and friends: don't put pseudo db in target fs
In a few places, we have scripts which use <rootfs>/var/pseudo for the pseudo state directory controlling a given filesystem. This seems possibly risky because it means that stuff running under qemu or whatnot could wipe out the data being used to handle that rootfs. Move this to: <rootfs>/../$(basename_rootfs).pseudo_state to avoid problems. This also solves at least one case (not directly hit by yocto's tree) wherein you could end up trying to remove a rootfs while pseudo was using a database inside that rootfs, and thus the remove would fail. (From OE-Core rev: aa5d6bd006d3b4eede21d8987451876ed3385ab8) Signed-off-by: Peter Seebach <peter.seebach@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'scripts/runqemu-extract-sdk')
-rwxr-xr-xscripts/runqemu-extract-sdk15
1 files changed, 9 insertions, 6 deletions
diff --git a/scripts/runqemu-extract-sdk b/scripts/runqemu-extract-sdk
index 4b5247597f..509af66216 100755
--- a/scripts/runqemu-extract-sdk
+++ b/scripts/runqemu-extract-sdk
@@ -73,15 +73,18 @@ if [ ! -d "$SDK_ROOTFS_DIR" ]; then
73 mkdir -p "$SDK_ROOTFS_DIR" 73 mkdir -p "$SDK_ROOTFS_DIR"
74fi 74fi
75 75
76if [ -e "$SDK_ROOTFS_DIR/var/pseudo" ]; then 76pseudo_state_dir="$SDK_ROOTFS_DIR/../$(basename "$SDK_ROOTFS_DIR").pseudo_state"
77 echo "Error: $SDK_ROOTFS_DIR/var/pseudo already exists!" 77
78 echo "Please delete the entire rootfs tree manually if this is really what you want" 78if [ -e "$pseudo_state_dir" ]; then
79 echo "Error: $pseudo_state_dir already exists!"
80 echo "Please delete the rootfs tree and pseudo directory manually"
81 echo "if this is really what you want."
79 exit 1 82 exit 1
80fi 83fi
81 84
82mkdir -p "$SDK_ROOTFS_DIR/var/pseudo" 85mkdir -p "$pseudo_state_dir"
83touch "$SDK_ROOTFS_DIR/var/pseudo/pseudo.pid" 86touch "$pseudo_state_dir/pseudo.pid"
84PSEUDO_LOCALSTATEDIR="$SDK_ROOTFS_DIR/var/pseudo" 87PSEUDO_LOCALSTATEDIR="$pseudo_state_dir"
85export PSEUDO_LOCALSTATEDIR 88export PSEUDO_LOCALSTATEDIR
86 89
87echo "Extracting rootfs tarball using pseudo..." 90echo "Extracting rootfs tarball using pseudo..."