diff options
author | Dirk von Suchodoletz | 2007-05-13 19:19:45 +0200 |
---|---|---|
committer | Dirk von Suchodoletz | 2007-05-13 19:19:45 +0200 |
commit | d01b5fd8ff99978cd298bbf01e4beaffc3c7fa51 (patch) | |
tree | fabdd4fab85aec3d2483a9384a9d2fa310c6a00c | |
parent | * added implementation for smart metapackager (diff) | |
download | core-d01b5fd8ff99978cd298bbf01e4beaffc3c7fa51.tar.gz core-d01b5fd8ff99978cd298bbf01e4beaffc3c7fa51.tar.xz core-d01b5fd8ff99978cd298bbf01e4beaffc3c7fa51.zip |
Make mkdxsinitrd able to follow symlinks in kernel module directory
(needed for weak-update mechanism). Now one level of symlinking is
allowed ...
git-svn-id: http://svn.openslx.org/svn/openslx/trunk@1068 95ad53e4-c205-0410-b2fa-d234c58c8868
-rwxr-xr-x | initramfs/mkdxsinitrd | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/initramfs/mkdxsinitrd b/initramfs/mkdxsinitrd index e722a378..7e836af0 100755 --- a/initramfs/mkdxsinitrd +++ b/initramfs/mkdxsinitrd @@ -213,7 +213,18 @@ copy_distro_stuff() { find ${INSTDIR}/etc/sysconfig/files \ -regex ".*/\..*" -exec rm -rf {} 2>/dev/null \; } - +# copy kernel modules even if links (first parameter is source, second +# destination and third source prefix) +modcp () { +local tmpval +if [ -L $1 ] ; then + tmpval=$(ls -la $1) + tmpval=${tmpval#*-> } + cp $3/$tmpval $2 +else + cp $1 $2 +fi +} # This function makes the directory of this script to the present working # directory # Does also work when called by symbolic links (even for nested links). @@ -550,7 +561,8 @@ for module in af_packet unix ${NWMODULES} ${FSMODULES} ${MISCMODULES} \ if [ -n "$mod" ] ; then mpath=${INSTDIR}/${mod%/*} mkdir -p ${mpath} - cp ${ROOTDIR}/$mod ${mpath} + # specific function which can follow a link + modcp ${ROOTDIR}/$mod ${mpath} ${ROOTDIR} # fixmee!! selection of dependent modules could be handled a little bit # more clever rdirprefix="${ROOTDIR}/lib/modules/${KERNVER}/kernel" @@ -569,7 +581,8 @@ for module in af_packet unix ${NWMODULES} ${FSMODULES} ${MISCMODULES} \ mod=$(cd /${ROOTDIR}; find "lib/modules/${KERNVER}" \ -name ${module}.ko 2>/dev/null) mkdir -p ${INSTDIR}/${mod%/*} - cp ${ROOTDIR}/$mod ${INSTDIR}/${mod%/*} + # specific function which can follow a link + modcp ${ROOTDIR}/$mod ${INSTDIR}/${mod%/*} ${ROOTDIR} done ;; nfs) |