Smart: Difference between revisions

From Yocto Project
Jump to navigationJump to search
No edit summary
No edit summary
Line 12: Line 12:
# Comment out the line in core-image-minimal that removes the packaging data files
# Comment out the line in core-image-minimal that removes the packaging data files
# <code>bitbake core-image-minimal</code>
# <code>bitbake core-image-minimal</code>
# <code>bitbake python-smartpm-native</code>
# <code>bitbake python-smartpm-native</code>  
# <code>bitbake -c devshell core-image-minimal</code>
# <code>bitbake -c devshell core-image-minimal</code>
# Within the devshell:
# Within the devshell:
  cd ../rootfs
  cd ../rootfs
  export PYTHONPATH="/path/to/native/sysroot/usr/lib/python2.7/site-packages"
  export PATH=/path/to/native/sysroot/usr/bin/python-native:$PATH
  export RPM_ETCRPM=$PWD/etc/rpm
  export RPM_ETCRPM=$PWD/etc/rpm
  smart --data-dir=$PWD/var/lib/smart channel --add rpmsys type=rpm-sys name="rpmsys"
  smart --data-dir=$PWD/var/lib/smart channel --add rpmsys type=rpm-sys name="rpmsys"
Line 31: Line 31:
  unset PSEUDO_DISABLED
  unset PSEUDO_DISABLED
  unset PSEUDO_UNLOAD
  unset PSEUDO_UNLOAD
export PSEUDO_LOCALSTATEDIR=$PWD/../pseudo
  pseudo smart --data-dir=$PWD/var/lib/smart install zip # install 'zip' in the rootfs
  pseudo smart --data-dir=$PWD/var/lib/smart install zip # install 'zip' in the rootfs

Revision as of 19:28, 31 October 2012

http://labix.org/smart/

Mark's smart contrib branch:

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

(This is on top of OE-Core - cherry pick the patches on top of something else if you prefer - you'll probably need to revert the patch mentioned in bug 3371 as well).

To test this out querying a root filesystem on the host:

  1. Ensure you are using "package_rpm" in PACKAGE_CLASSES
  2. Comment out the line in core-image-minimal that removes the packaging data files
  3. bitbake core-image-minimal
  4. bitbake python-smartpm-native
  5. bitbake -c devshell core-image-minimal
  6. Within the devshell:
cd ../rootfs
export PATH=/path/to/native/sysroot/usr/bin/python-native:$PATH
export RPM_ETCRPM=$PWD/etc/rpm
smart --data-dir=$PWD/var/lib/smart channel --add rpmsys type=rpm-sys name="rpmsys"
smart --data-dir=$PWD/var/lib/smart config --set rpm-root=$PWD
smart --data-dir=$PWD/var/lib/smart config --set rpm-dbpath=/var/lib/rpm

You should now be able to query the packages installed into the rootfs e.g.

smart --data-dir=$PWD/var/lib/smart query

If you add an rpm-dir channel and run smart under pseudo you can install and uninstall packages:

smart --data-dir=$PWD/var/lib/smart channel --add test type=rpm-dir path=/path/to/tmp/deploy/rpm/i586
smart --data-dir=$PWD/var/lib/smart query # verify that the new channel is recognized
unset PSEUDO_DISABLED
unset PSEUDO_UNLOAD
export PSEUDO_LOCALSTATEDIR=$PWD/../pseudo
pseudo smart --data-dir=$PWD/var/lib/smart install zip # install 'zip' in the rootfs