You are not logged in.

#1 2005-01-07 02:49:34

darose
Member
Registered: 2004-04-13
Posts: 158

[new package] mkinitrd

Package to make initrd's (initial ram disks) for loading kernel modules before booting.  (I use this to load USB modules so that I can boot off of an external USB drive.)

This package was adapted from slackware.  (And uses the slackware sources directly.)

ftp://ftp.archlinux.org/incoming/mkinit … 1-1.tar.gz

Comments/suggestions welcome.

DR

Offline

#2 2005-09-13 05:24:22

darose
Member
Registered: 2004-04-13
Posts: 158

Re: [new package] mkinitrd

Since incoming is now defunct, and since this package isn't really worthy for the AUR right now in my opinion, I'll post the package build files here.

PKGBUILD:

# mkinitrd utility for creating initial ram disks for kernel booting

# Adapted from the Slackware package for Arch.

# Contributor: David Rosenstrauch <darose@darose.net>

pkgname=mkinitrd
pkgver=1.0.1
busyboxpkgname=busybox
busyboxver=1.00
pkgrel=1
pkgdesc="utility for creating initial ram disks for kernel booting"
#url=""
license="custom"
#
# custom license
#
# Copyright 2004  Slackware Linux, Inc., Concord, CA, USA
# Copyright 2004  Patrick J. Volkerding, Concord, CA, USA
# All rights reserved.
#
# Redistribution and use of this script, with or without modification, is
# permitted provided that the following conditions are met:
#
# 1. Redistributions of this script must retain the above copyright
#    notice, this list of conditions and the following disclaimer.
#
#  THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
#  WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
#  MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO
#  EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
#  SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
#  PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
#  OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
#  WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
#  OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
#  ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#
#depends=()
makedepends=(gcc)
#conflicts=()
#replaces=()
#backup=()
#install=
slack_mkinitrd_loc=ftp://distro.ibiblio.org/pub/linux/distributions/slackware/slackware-10.0/source/a/mkinitrd
busybox_loc=http://www.busybox.net/downloads
source=(busybox-dot-config.diff 
        $slack_mkinitrd_loc/README.initrd       
        $slack_mkinitrd_loc/_initrd-tree.tar.gz 
        $slack_mkinitrd_loc/$busyboxpkgname-dot-config  
        $slack_mkinitrd_loc/mkinitrd    
        $slack_mkinitrd_loc/mkinitrd.8  
        $busybox_loc/$busyboxpkgname-$busyboxver.tar.gz)
#md5sums=()

build() {
        cd $startdir/src

        patch < busybox-dot-config.diff

        CWD=`pwd`
        PKG=$startdir/pkg

        VERSION=$pkgver
        BB=$busyboxver
#       ARCH=${ARCH:-i486}
#       BUILD=2

#       rm -rf $PKG
#       mkdir -p $PKG
#       cd /tmp
#       rm -rf busybox-$BB
#       tar xjvf $CWD/busybox-$BB.tar.bz2
        cd busybox-$BB
        chown -R root.root .
        cp $CWD/busybox-dot-config .config
        make oldconfig
        make || return 1
        mkdir -p $PKG/usr/share/mkinitrd
        mkdir -p $PKG/usr/share/mkinitrd/initrd-tree/bin
        cp busybox $PKG/usr/share/mkinitrd/initrd-tree/bin
        ( cd $PKG/usr/share/mkinitrd/initrd-tree
                tar xzf $CWD/_initrd-tree.tar.gz
                tar czf ../initrd-tree.tar.gz .
        )
        rm -rf $PKG/usr/share/mkinitrd/initrd-tree
#       # Add busybox docs:
#       mkdir -p $PKG/usr/doc/busybox-$BB
#       cp -a 
#               AUTHORS INSTALL LICENSE README 
#               $PKG/usr/doc/busybox-$BB
        mkdir -p $PKG/usr/sbin
        cat $CWD/mkinitrd > $PKG/usr/sbin/mkinitrd
        chmod 755 $PKG/usr/sbin/mkinitrd
#       chown -R root.bin $PKG/usr/sbin
        mkdir -p $PKG/usr/man/man8
#       cat $CWD/mkinitrd.8 | gzip -9c > $PKG/usr/man/man8/mkinitrd.8.gz
        cp $CWD/mkinitrd.8 $PKG/usr/man/man8/
#       mkdir $PKG/boot
#       mkdir -p $PKG/usr/doc/mkinitrd-$VERSION
#       cp -a $CWD/README.initrd $PKG/usr/doc/mkinitrd-$VERSION
#       chmod 644 $PKG/usr/doc/mkinitrd-$VERSION/*
#       chown root:root $PKG/usr/doc/mkinitrd-$VERSION/*
#       ( cd $PKG/boot
#               ln -sf /usr/doc/mkinitrd-$VERSION/README.initrd .
#       )
        #( cd $PKG/boot
        #  ln -sf /usr/sbin/mkinitrd .
        #)
        ( cd $PKG
                find . | xargs file | grep "executable" | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null
                find . | xargs file | grep "shared object" | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null
        )
#       mkdir -p $PKG/install
#       cat $CWD/slack-desc > $PKG/install/slack-desc

#       cd $PKG
#       makepkg -l y -c n ../mkinitrd-$VERSION-$ARCH-$BUILD.tgz

        return 0
}

busybox-dot-config.diff:

--- busybox-dot-config  2005-01-06 14:08:39.000000000 -0500
+++ busybox-dot-config.patched  2005-01-06 14:34:31.000000000 -0500
@@ -358,3 +358,5 @@
 # Debugging Options
 #
 # CONFIG_DEBUG is not set
+
+CONFIG_FEATURE_TEST_64=n

[/code]

Offline

Board footer

Powered by FluxBB