diff options
author | Peter Seebach <peter.seebach@windriver.com> | 2012-08-27 13:32:30 -0500 |
---|---|---|
committer | Saul Wold <sgw@linux.intel.com> | 2012-08-28 08:03:41 -0700 |
commit | aa5d6bd006d3b4eede21d8987451876ed3385ab8 (patch) | |
tree | d2bf085eff2552d3cb305dcbc620e67781f183cb /scripts/runqemu-extract-sdk | |
parent | 812ec5434be01154c225b672a0ad4dcfb9d927ae (diff) | |
download | openembedded-core-aa5d6bd006d3b4eede21d8987451876ed3385ab8.tar.gz openembedded-core-aa5d6bd006d3b4eede21d8987451876ed3385ab8.tar.bz2 openembedded-core-aa5d6bd006d3b4eede21d8987451876ed3385ab8.zip |
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.
Signed-off-by: Peter Seebach <peter.seebach@windriver.com>
Diffstat (limited to 'scripts/runqemu-extract-sdk')
-rwxr-xr-x | scripts/runqemu-extract-sdk | 15 |
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 mkdir -p "$SDK_ROOTFS_DIR" fi -if [ -e "$SDK_ROOTFS_DIR/var/pseudo" ]; then - echo "Error: $SDK_ROOTFS_DIR/var/pseudo already exists!" - echo "Please delete the entire rootfs tree manually if this is really what you want" +pseudo_state_dir="$SDK_ROOTFS_DIR/../$(basename "$SDK_ROOTFS_DIR").pseudo_state" + +if [ -e "$pseudo_state_dir" ]; then + echo "Error: $pseudo_state_dir already exists!" + echo "Please delete the rootfs tree and pseudo directory manually" + echo "if this is really what you want." exit 1 fi -mkdir -p "$SDK_ROOTFS_DIR/var/pseudo" -touch "$SDK_ROOTFS_DIR/var/pseudo/pseudo.pid" -PSEUDO_LOCALSTATEDIR="$SDK_ROOTFS_DIR/var/pseudo" +mkdir -p "$pseudo_state_dir" +touch "$pseudo_state_dir/pseudo.pid" +PSEUDO_LOCALSTATEDIR="$pseudo_state_dir" export PSEUDO_LOCALSTATEDIR echo "Extracting rootfs tarball using pseudo..." |