#!/bin/sh CWD=`pwd` PKG=/tmp/package-mkinitrd VERSION=1.0.1 BB=1.00 ARCH=${ARCH:-x86_64} BUILD=1 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 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 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