View previous topic :: View next topic |
Author |
Message |
burzmali Apprentice
Joined: 18 Apr 2002 Posts: 238 Location: ca
|
Posted: Tue Jul 09, 2002 1:29 am Post subject: mkinitrd and initrd? |
|
|
hello
where can what package contains mkinitrd? i need to make an initrd for a project i am working on and cannot find out how anywhere except to use mkinitrd (which is not in my path, or root's) any help is appreciated. thanks _________________ burzmali
www.burzmali.net |
|
Back to top |
|
|
rommel Veteran
Joined: 19 Apr 2002 Posts: 1145 Location: Williamsburg Virginia
|
Posted: Tue Jul 09, 2002 4:14 am Post subject: |
|
|
try looking here
these are rpms but you could convert to tar.gz and build |
|
Back to top |
|
|
delta407 Bodhisattva
Joined: 23 Apr 2002 Posts: 2876 Location: Chicago, IL
|
Posted: Tue Jul 09, 2002 4:18 am Post subject: |
|
|
Google keeps pointing me to a shell script that looks like:
Code: | #!/bin/sh
PATH=/sbin:$PATH
export PATH
BASEDIR=initrd
SIZE=2000
while [ -n "$1" ] ; do
case "$1" in
"local")
IMAGES="$IMAGES local"
EXCLUDELOADER=loader-pcmcia
shift
;;
"network")
IMAGES="$IMAGES network"
EXCLUDELOADER=loader-pcmcia
shift;
;;
"pcmcia")
IMAGES="$IMAGES pcmcia"
EXCLUDELOADER="loader\$"
shift;
;;
-f)
FORCE=-f
shift;
;;
*)
echo "Useage:" >&2
echo "$0 [-f] [network] [local] [pcmcia]" >&2
exit
;;
esac
done
if [ -z "$IMAGES" ]; then
IMAGES="local network pcmcia"
fi
MNTPOINT=/tmp/mkimage.mnt-$$
for TARGET in $IMAGES; do
IMAGE=initrd-$TARGET.img
if [ "$FORCE" != "-f" ]; then
if [ -f $IMAGE ]; then
echo "$IMAGE already exists." >&2
continue;
fi
fi
rm -f /tmp/$IMAGE
dd if=/dev/zero of=/tmp/$IMAGE bs=1k count=$SIZE
mke2fs -i 8096 -q /tmp/$IMAGE $SIZE <<EOF
y
EOF
mkdir -p $MNTPOINT
mount -o loop -t ext2 /tmp/$IMAGE $MNTPOINT
(cd $BASEDIR; find . | grep -v $EXCLUDELOADER | cpio -vp $MNTPOINT)
(cd $TARGET; find . | cpio -vpud $MNTPOINT)
(cd $MNTPOINT/sbin; [ loader* != "loader" ] && mv loader* loader)
df $MNTPOINT
umount $MNTPOINT
mv -f /tmp/$IMAGE .
echo -n "gzipping image..."
mv $IMAGE $IMAGE.nogz
gzip -9 < $IMAGE.nogz > $IMAGE
echo " done."
rm -rf $MNTPOINT
size=`cat $IMAGE | wc -c`
filler=`expr 1474560 - $size`
if [ $TARGET = "local" ]; then
cp $IMAGE ../../../dosutils/autoboot/initrd.img
fi
done |
Just make sure you have Loopback support enabled (under Block devices in your kernel config). _________________ I don't believe in witty sigs. |
|
Back to top |
|
|
tebers Tux's lil' helper
Joined: 24 Apr 2002 Posts: 115 Location: Germany, Kirchheim near Munich
|
Posted: Tue Aug 06, 2002 1:07 pm Post subject: |
|
|
rommel wrote: | try looking here
these are rpms but you could convert to tar.gz and build |
well actually these links do not exist on this site
found no other mkinitrd sources |
|
Back to top |
|
|
tebers Tux's lil' helper
Joined: 24 Apr 2002 Posts: 115 Location: Germany, Kirchheim near Munich
|
|
Back to top |
|
|
|