#!/bin/sh
#
# /usr/share/initrd-tools/scripts/e2fsprogs
#
cp /usr/share/e2fsprogs/initrd.ext3-add-journal \
    $INITRDDIR/scripts/ext3-add-journal.sh
cp /sbin/tune2fs $INITRDDIR/sbin
cp /usr/lib/e2initrd_helper $INITRDDIR/bin/e2initrd_helper

case "$VERSION" in
    2.4.*)
    	LD_ASSUME_KERNEL=2.4
	export LD_ASSUME_KERNEL
	;;
esac

PROGS="/sbin/tune2fs /usr/lib/e2initrd_helper"
LIBS=`ldd $PROGS | grep -v linux-gate.so | sort -u | \
    awk '{print $3}'` 
for i in $LIBS
do
	mkdir -p `dirname $INITRDDIR/$i`
	cp $i $INITRDDIR/$i
done
