Archive for March, 2009

Func Verification Method – Release 0.7

March 19, 2009

I am working in a method to verify the installed packages for the rpms module.

I checked python api and there isn’t any buildin method I could use, but I checked yum api and I found something interesting,

The output with the external command was:

S.?…..    /usr/sbin/groupmod
prelink: /usr/sbin/useradd: at least one of file’s dependencies has changed since prelinking
S.?…..    /usr/sbin/useradd
prelink: /usr/sbin/userdel: at least one of file’s dependencies has changed since prelinking
S.?…..    /usr/sbin/userdel
prelink: /usr/sbin/usermod: at least one of file’s dependencies has changed since prelinking
S.?…..    /usr/sbin/usermod

While the output with the yum api is:

/usr/sbin/userdel – checksum does not match
/usr/sbin/userdel – size does not match
/usr/sbin/groupdel – checksum does not match
/usr/sbin/groupdel – size does not match
/etc/login.defs – mtime does not match
/etc/login.defs – checksum does not match
/etc/login.defs – size does not match
/usr/bin/newgrp – checksum does not match

I intend to work now to allow the verification for only one package each time adding support for rpms.glob(). When its done the plan is to merge the yum module with the rpm module and create a new module called “packages”.

The current code  is:
http://func.pastebin.com/m523b93ac

def verify(self, flatten=True):
“””
Returns information of the verification of all installed packages.
“””
import yum
ts = rpm.TransactionSet()
mi = ts.dbMatch()
results = []
for hdr in mi:
name = hdr[‘name’]
if flatten:
yb = yum.YumBase()
pkgs = yb.rpmdb.searchNevra(name)
for pkg in pkgs:
errors = pkg.verify()
for fn in errors.keys():
for prob in errors[fn]:
results.append(‘%s %s %s’ % (name, fn, prob.message))
else:
results.append(“%s-%s-%s.%s” % (name, version, release, arch))
return results

Feel free to give me some ideas or comments, thanks.

func-logo-small1

VirtualBox – Cloning a Virtual Machine

March 17, 2009

The folder who store the DVI files is:

~/.VirtualBox/HardDisks

Just go there

$ cd ~/.VirtualBox/HardDisks

And type the following command to clone the virtual machine

$VBoxManage clonehd SOURCE.VDI DESTINATION.VDI -format VDI

Now enter at VirtualBox, -> new -> next -> type the name and kind of vm -> amount of memory ->

virtual harddisk – click on existing -> add -> and then select your new VDI file.

Have fun !

96px-virtualbox_logo

Sun VirtualBox – After a Kernel Update

March 11, 2009

Always after update the kernel of my Fedora 10 x64, VirtualBox stop working. The problem I found was that VirtualBox requires  a module to be compile for the new kernel.

To avoid all of the work to build the new module, I found a fast and effective solution:

After update to the new kernel, boot from it, open the shell the type:

# /etc/init.d/vboxdrv setup

This command will build a fresh new module for the current kernel.

96px-virtualbox_logo

Func Verification Method – Release 0.6

March 7, 2009

Release 0.6 is available in the wiki page of my project:

http://zenit.senecac.on.ca/wiki/index.php/Func/Rpms_Module_-_Function_Verify

func-logo-small1