Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
mkinitrd and initrd?
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo
View previous topic :: View next topic  
Author Message
burzmali
Apprentice
Apprentice


Joined: 18 Apr 2002
Posts: 238
Location: ca

PostPosted: Tue Jul 09, 2002 1:29 am    Post subject: mkinitrd and initrd? Reply with quote

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
View user's profile Send private message
rommel
Veteran
Veteran


Joined: 19 Apr 2002
Posts: 1145
Location: Williamsburg Virginia

PostPosted: Tue Jul 09, 2002 4:14 am    Post subject: Reply with quote

try looking here

these are rpms but you could convert to tar.gz and build
Back to top
View user's profile Send private message
delta407
Bodhisattva
Bodhisattva


Joined: 23 Apr 2002
Posts: 2876
Location: Chicago, IL

PostPosted: Tue Jul 09, 2002 4:18 am    Post subject: Reply with quote

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
View user's profile Send private message
tebers
Tux's lil' helper
Tux's lil' helper


Joined: 24 Apr 2002
Posts: 115
Location: Germany, Kirchheim near Munich

PostPosted: Tue Aug 06, 2002 1:07 pm    Post subject: Reply with quote

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
View user's profile Send private message
tebers
Tux's lil' helper
Tux's lil' helper


Joined: 24 Apr 2002
Posts: 115
Location: Germany, Kirchheim near Munich

PostPosted: Tue Aug 06, 2002 1:46 pm    Post subject: Reply with quote

found a link :-)

ftp://ftp.redhat.com/pub/redhat/linux/7.3/en/os/i386/SRPMS/mkinitrd-3.3.10-1.src.rpm

Thorsten
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum