Smart: Difference between revisions

From Yocto Project
Jump to navigationJump to search
No edit summary
(Use --installed option for first query)
 
(5 intermediate revisions by 2 users not shown)
Line 1: Line 1:
http://labix.org/smart/
http://labix.org/smart/


Mark's smart contrib branch:
Smart is now used in conjunction with RPM in OE-Core / Poky as of 1.4 (dylan).


http://git.yoctoproject.org/cgit/cgit.cgi/poky-contrib/log/?h=mhatle/smart
You can use this on the target if you are using RPM packaging and have package-management in IMAGE_FEATURES.


(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 [https://bugzilla.yoctoproject.org/show_bug.cgi?id=3371 bug 3371] as well).
To interact with a root filesystem using Smart on the host:


To test this out querying a root filesystem on the host:
# Ensure you are using "package_rpm" in PACKAGE_CLASSES
 
# Have EXTRA_IMAGE_FEATURES += "package-management" in local.conf
# Ensure you are using "package_rpm" in PACKAGE_CLASSES
# <code>bitbake core-image-minimal</code>
# Comment out the line in core-image-minimal that removes the packaging data files
# <code>bitbake -c devshell core-image-minimal</code>
# <code>bitbake core-image-minimal</code>
# Then, within the devshell:
# <code>bitbake python-smartpm-native</code>
# <code>bitbake -c devshell core-image-minimal</code>
# Within the devshell:
  cd ../rootfs
  cd ../rootfs
export PYTHONPATH="/path/to/native/sysroot/usr/lib/python2.7/site-packages"
  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 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.
You should now be able to query the packages installed into the rootfs e.g.
  smart --data-dir=$PWD/var/lib/smart query
  smart --data-dir=$PWD/var/lib/smart query --installed


If you add an rpm-dir channel and run smart under pseudo you can install and uninstall packages:
If you add an rpm-dir channel and run smart under pseudo you can install and uninstall packages:
Line 29: Line 22:
  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 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
  smart --data-dir=$PWD/var/lib/smart query # verify that the new channel is recognized
  unset PSEUDO_DISABLED
  smart --data-dir=$PWD/var/lib/smart install zip # install 'zip' in the rootfs
unset PSEUDO_UNLOAD
pseudo smart --data-dir=$PWD/var/lib/smart install zip # install 'zip' in the rootfs

Latest revision as of 08:08, 24 July 2013

http://labix.org/smart/

Smart is now used in conjunction with RPM in OE-Core / Poky as of 1.4 (dylan).

You can use this on the target if you are using RPM packaging and have package-management in IMAGE_FEATURES.

To interact with a root filesystem using Smart on the host:

# Ensure you are using "package_rpm" in PACKAGE_CLASSES
# Have EXTRA_IMAGE_FEATURES += "package-management" in local.conf
# bitbake core-image-minimal
# bitbake -c devshell core-image-minimal
# Then, within the devshell:
cd ../rootfs
export RPM_ETCRPM=$PWD/etc/rpm

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

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

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
smart --data-dir=$PWD/var/lib/smart install zip # install 'zip' in the rootfs