[Lunar-commits] r14553 - lunar-iso/branches/lunar-iso-2.6/scripts
Jaime Buffery
nestu at lunar-linux.org
Sun May 1 11:50:41 UTC 2005
Author: nestu
Date: 2005-05-01 11:50:39 +0000 (Sun, 01 May 2005)
New Revision: 14553
Modified:
lunar-iso/branches/lunar-iso-2.6/scripts/initrd
Log:
Use get_bins_dynamic_lib_links to get the lib list
and copy those libs to the initrd image too.
Modified: lunar-iso/branches/lunar-iso-2.6/scripts/initrd
===================================================================
--- lunar-iso/branches/lunar-iso-2.6/scripts/initrd 2005-05-01 11:30:02 UTC (rev 14552)
+++ lunar-iso/branches/lunar-iso-2.6/scripts/initrd 2005-05-01 11:50:39 UTC (rev 14553)
@@ -15,18 +15,46 @@
cp -a --no-dereference template BUILD
find BUILD -type d -name CVS -exec rm -rf {} \;
mkdir -p BUILD/{mnt,proc,var/lib/discover/crash}
+if [ "${ISO_KSUFFIX}" = "2.6" ]; then
+ mkdir -p BUILD/sys/
+fi
+# Get the list of binaries from the initrd.lists,
+# so we can use get_bins_dynamic_lib_links to get to know
+# the list of libs those bins are linked to, as they as well
+# have to copied to the initrd
+(
+ cat initrd.list initrd.list-$ISO_KSUFFIX | while read ITEM DIR; do
+ case $ITEM in
+ *bin/* ) echo $ITEM
+ esac
+ done
+) > ${ISO_TARGET}/.initrd.bin.list
+
+# copy the script over to find the libs linked to
+cp get_bins_dynamic_lib_links ${ISO_TARGET}
+
+# get the list of libs linked to and strip off the trailing / off their path
+( chroot ${ISO_TARGET} ./get_bins_dynamic_lib_links /.initrd.bin.list ) | sed -e 's:^/::g' > .initrd.lib.list
+
+# remove the script, as it is in the way ;)
+rm ${ISO_TARGET}/get_bins_dynamic_lib_links
+
echo "+ copying binaries and required files"
# next up are the required stuff from the BUILD
-cat initrd.list initrd.list-$ISO_KSUFFIX | while read ITEM DIR; do
- if [ -n "$DIR" ]; then
- mkdir -p BUILD/$DIR
- cp -a --no-dereference "$ISO_TARGET/$ITEM" "BUILD/$DIR"
- else
- mkdir -p "BUILD/$(dirname $ITEM)"
- cp -a --no-dereference "$ISO_TARGET/$ITEM" "BUILD/$(dirname $ITEM)"
- fi
+# Don't forget to copy the libs too!
+cat initrd.list initrd.list-$ISO_KSUFFIX .initrd.lib.list | while read ITEM DIR; do
+ if [ -n "$DIR" ]; then
+ mkdir -p BUILD/$DIR
+ cp -a --no-dereference "$ISO_TARGET/$ITEM" "BUILD/$DIR"
+ else
+ mkdir -p "BUILD/$(dirname $ITEM)"
+ cp -a --no-dereference "$ISO_TARGET/$ITEM" "BUILD/$(dirname $ITEM)"
+ fi
done
+
+rm .initrd.lib.list
+
echo "+ filling /dev"
# bare minimum of device nodes
@@ -111,6 +139,7 @@
echo "+ estimated $SIZE"
(( SIZE = SIZE + 1 ))
echo "+ used size $SIZE"
+echo $(( SIZE + 10 )) > .initrd_size
dd if=/dev/zero of=initrd.raw bs=1024 count=$SIZE
losetup /dev/loop/0 initrd.raw
mkfs.ext2 -b 1024 -m 0 -i 1024 -N 1024 /dev/loop/0
More information about the Lunar-commits
mailing list