From b0b61b17a030b97528aa6dad7666d20d80de4586 Mon Sep 17 00:00:00 2001 From: Martin Gracik Date: Tue, 8 Sep 2009 10:11:06 +0200 Subject: [PATCH] Corrected the automatic getting of dynamic libraries --- etc/templates/includes/initrd/initrd.common | 27 ++++++++++++--------- src/pylorax/actions/base.py | 2 +- src/pylorax/images.py | 9 ++++--- src/pylorax/utils/fileutils.py | 6 ++--- 4 files changed, 25 insertions(+), 19 deletions(-) diff --git a/etc/templates/includes/initrd/initrd.common b/etc/templates/includes/initrd/initrd.common index ecd72fd8..c0a74a38 100644 --- a/etc/templates/includes/initrd/initrd.common +++ b/etc/templates/includes/initrd/initrd.common @@ -1,10 +1,11 @@ # initrd template # create required directories -makedir @initrd@/lib/modules -makedir @initrd@/lib/firmware -link @initrd@/modules to lib/modules -link @initrd@/firmware to lib/firmware +makedir @initrd@/lib +makedir @initrd@/modules +makedir @initrd@/firmware +link @initrd@/lib/modules to ../modules +link @initrd@/lib/firmware to ../firmware makedir @initrd@/sbin makedir @initrd@/dev makedir @initrd@/etc @@ -72,15 +73,15 @@ copy @instroot@ sbin/umount.* to @initrd@ sbin # copy udev copy @instroot@ sbin/udevd to @initrd@ sbin copy @instroot@ sbin/udevadm to @initrd@ sbin -copy @instroot@ sbin/udevinfo to @initrd@ sbin -copy @instroot@ sbin/udevsettle to @initrd@ sbin +link @initrd@/sbin/udevinfo to udevadm +link @initrd@/sbin/udevsettle to udevadm # udev rules copy @instroot@ etc/udev/udev.conf to @initrd@ etc/udev chmod @initrd@/etc/udev/udev.conf mode 0644 copy @instroot@ lib/udev/* to @initrd@ lib/udev -chmod @initrd@/lib/udev/* mode 0644 +#chmod @initrd@/lib/udev/* mode 0644 remove @initrd@/lib/udev/rules.d/*persistent* remove @initrd@/lib/udev/rules.d/*generator* @@ -206,12 +207,16 @@ copy @instroot@ usr/lib/anaconda-runtime/loader/loader.tr to @initrd@ etc chmod @initrd/etc/loader.tr mode 0644 # indirect dependencies -copy @instroot@ @libdir@/libfreebl3.so to @initrd@ @libdir@ -copy @instroot@ @libdir@/libsoftokn3.so to @initrd@ @libdir@ -copy @instroot@ usr/@libdir@/libsqlite3.so.0 to @initrd@ usr/@libdir@ +copy @instroot@ @libdir@/ld-linux.so.2 to @initrd@ @libdir@ +#copy @instroot@ @libdir@/libcom_err.so.2 to @initrd@ @libdir@ +#copy @instroot@ @libdir@/libdbus-glib-1.so.2 to @initrd@ @libdir@ +#copy @instroot@ @libdir@/libfreebl3.so to @initrd@ @libdir@ +copy @instroot@ @libdir@/libgcc_s.so.1 to @initrd@ @libdir@ copy @instroot@ @libdir@/libnss_dns.so.2 to @initrd@ @libdir@ copy @instroot@ @libdir@/libnss_files.so.2 to @initrd@ @libdir@ -copy @instroot@ @libdir@/libgcc_s.so.1 to @initrd@ @libdir@ +copy @instroot@ @libdir@/libsoftokn3.so to @initrd@ @libdir@ + +copy @instroot@ usr/@libdir@/libsqlite3.so.0 to @initrd@ usr/@libdir@ # langtable copy @instroot@ usr/lib/anaconda/lang-table to @initrd@ etc diff --git a/src/pylorax/actions/base.py b/src/pylorax/actions/base.py index ac5f5448..7862afb9 100644 --- a/src/pylorax/actions/base.py +++ b/src/pylorax/actions/base.py @@ -167,7 +167,7 @@ class Copy(LoraxAction): @property def getDeps(self): - return self._attrs['src'] + return self.src @property def nolinks(self): diff --git a/src/pylorax/images.py b/src/pylorax/images.py index f89d5ef6..41a23af0 100644 --- a/src/pylorax/images.py +++ b/src/pylorax/images.py @@ -101,10 +101,11 @@ class InitRD(object): # add dependencies to actions for dep in ldd.deps: kwargs = {} - kwargs['src_tree'] = self.conf.treedir - kwargs['src_path'] = dep.replace(self.conf.treedir, '') - kwargs['dst_tree'] = self.conf.initrddir - kwargs['dst_path'] = dep.replace(self.conf.treedir, '') + kwargs['src_root'] = self.conf.treedir + kwargs['src_path'] = dep.replace(self.conf.treedir + os.sep, '', 1) + kwargs['dst_root'] = self.conf.initrddir + kwargs['dst_path'] = dep.replace(self.conf.treedir + os.sep, '', 1) + kwargs['dst_path'] = os.path.dirname(kwargs['dst_path']) new_action = actions.base.Copy(**kwargs) self._actions.append(new_action) diff --git a/src/pylorax/utils/fileutils.py b/src/pylorax/utils/fileutils.py index 3b841bdd..842864b4 100644 --- a/src/pylorax/utils/fileutils.py +++ b/src/pylorax/utils/fileutils.py @@ -64,7 +64,7 @@ def touch(filename, verbose=False): return True -def cp(src_path, dst_path, src_root='/', dst_root='/', nolinks=False, ignore_errors=False, verbose=True): +def cp(src_path, dst_path, src_root='/', dst_root='/', nolinks=False, ignore_errors=False, verbose=False): filecopy = Copy(ignore_errors, verbose) src = os.path.join(src_root, src_path) @@ -78,7 +78,7 @@ def cp(src_path, dst_path, src_root='/', dst_root='/', nolinks=False, ignore_err return filecopy.errors -def mv(src_path, dst_path, src_root='/', dst_root='/', nolinks=False, ignore_errors=False, verbose=True): +def mv(src_path, dst_path, src_root='/', dst_root='/', nolinks=False, ignore_errors=False, verbose=False): errors = cp(src_path, dst_path, src_root, dst_root, ignore_errors, verbose) # if everything was copied, remove the source @@ -136,7 +136,7 @@ class CopyError(Exception): pass class Copy(object): - def __init__(self, ignore_errors=False, verbose=True): + def __init__(self, ignore_errors=False, verbose=False): self.Error = CopyError self.ignore_errors = ignore_errors