Skip to contentSkip to conversation

v3: Move pseudo localstatedir outside of rootfs.

PATCH Applied Peter Seebach 2 participants 3 messages Aug 27, 2012 – Aug 29, 2012

lore
Share & tools
lore
#0 lore raw

cover v3: Move pseudo localstatedir outside of rootfs.

On reflection, I like "rootfs.pseudo_state" better than "pseudo_state_rootfs". Also found a typo in which *one* reference had pseudo_state/rootfs rather than pseudo_state_rootfs. (My keyboard layout hates me.)

This version has been actually tested complete with running the associated bitbake targets.

The following changes since commit 4ef8960c8d2876914bb78cbdce5fae3c5297e942:
Khem Raj (1):
gcc-cross-intermediate, gcc-crosssdk-intermediate: Remove

are available in the git repository at:

git://git.yoctoproject.org/poky-contrib seebs/varpseudo
http://git.yoctoproject.org/cgit.cgi/poky-contrib/log/?h=seebs/varpseudo

Peter Seebach (1):
runqemu-export-rootfs and friends: don't put pseudo db in target fs

 .../installer/adt-installer/scripts/extract_rootfs |    8 ++++----
 scripts/runqemu-export-rootfs                      |    2 +-
 scripts/runqemu-extract-sdk                        |   15 +++++++++------
 3 files changed, 14 insertions(+), 11 deletions(-)
#1 lore raw

PATCH 1/1 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.

---
 .../installer/adt-installer/scripts/extract_rootfs |    8 ++++----
 scripts/runqemu-export-rootfs                      |    2 +-
 scripts/runqemu-extract-sdk                        |   15 +++++++++------
 3 files changed, 14 insertions(+), 11 deletions(-)
meta/recipes-devtools/installer/adt-installer/scripts/extract_rootfs +4 -4
index 62dc170..d1a595b 100755
@@ -28,7 +28,6 @@ extract_rootfs()
   native_sysroot=$3
   target_sysroot=$2
   PSEUDO_COMMAND="$native_sysroot/usr/bin/pseudo"
-  PSEUDO_OPTS="-P $natvie_sysroot/usr"
   TAR_OPTS="-xjf"
   PSEUDO_OPTS="-P $native_sysroot/usr"
 
@@ -46,9 +45,10 @@ extract_rootfs()
     mkdir -p "$target_sysroot"
   fi
 
-  mkdir -p "$target_sysroot/var/pseudo"
-  touch "$target_sysroot/var/pseudo/pseudo.pid"
-  PSEUDO_LOCALSTATEDIR="$target_sysroot/var/pseudo"
+  pseudo_state_dir="$target_sysroot/../$(basename "$target_sysroot").pseudo_state"
+  mkdir -p "$pseudo_state_dir"
+  touch "$pseudo_state_dir/pseudo.pid"
+  PSEUDO_LOCALSTATEDIR="$pseudo_state_dir"
   export PSEUDO_LOCALSTATEDIR
 
   echo_info "Extracting rootfs: $1, using pseudo..."
scripts/runqemu-export-rootfs +1 -1
index f8213ba..3c77dd7 100755
@@ -68,7 +68,7 @@ NFSPID=~/.runqemu-sdk/nfs$NFS_INSTANCE.pid
 MOUNTPID=~/.runqemu-sdk/mount$NFS_INSTANCE.pid
 
 PSEUDO_OPTS="-P $OECORE_NATIVE_SYSROOT/usr"
-PSEUDO_LOCALSTATEDIR="$NFS_EXPORT_DIR/var/pseudo"
+PSEUDO_LOCALSTATEDIR="$NFS_EXPORT_DIR/../$(basename $NFS_EXPORT_DIR).pseudo_state"
 export PSEUDO_LOCALSTATEDIR
 
 if [ ! -d "$PSEUDO_LOCALSTATEDIR" ]; then
scripts/runqemu-extract-sdk +9 -6
index 4b52475..509af66 100755
@@ -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..."
Signature · 1 line
1.7.0.4
Applied
#2 lore raw
In reply to Peter Seebach
Quoted 17 lines · Peter Seebach

On reflection, I like "rootfs.pseudo_state" better than "pseudo_state_rootfs". Also found a typo in which *one* reference had pseudo_state/rootfs rather than pseudo_state_rootfs. (My keyboard layout hates me.)

This version has been actually tested complete with running the associated bitbake targets.

The following changes since commit 4ef8960c8d2876914bb78cbdce5fae3c5297e942:
Khem Raj (1):
gcc-cross-intermediate, gcc-crosssdk-intermediate: Remove

are available in the git repository at:

git://git.yoctoproject.org/poky-contrib seebs/varpseudo
http://git.yoctoproject.org/cgit.cgi/poky-contrib/log/?h=seebs/varpseudo

Quoted 8 lines

Peter Seebach (1):
runqemu-export-rootfs and friends: don't put pseudo db in target fs

  .../installer/adt-installer/scripts/extract_rootfs |    8 ++++----
  scripts/runqemu-export-rootfs                      |    2 +-
  scripts/runqemu-extract-sdk                        |   15 +++++++++------
  3 files changed, 14 insertions(+), 11 deletions(-)

Merged into OE-Core

Thanks
Sau!

Quoted 7 lines

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