Permalink
Fetching contributors…
Cannot retrieve contributors at this time
executable file 41 lines (32 sloc) 854 Bytes
#!/bin/sh
. config/options
INITRD=$ROOT/$BUILD/initrd/initrd
rm -rf $ROOT/$BUILD/initrd
mkdir -p $ROOT/$BUILD/initrd
# Create a CPIO InitRamfs archive
cd $ROOTFS
find . | egrep -v '^./boot.*$' | cpio -o -H newc > $INITRD
cd -
GZIP="`which pigz`" || GZIP="`which gzip`"
if [ $TARGET_ARCH = i386 ]; then
if [ "$COMPRESSION_METHOD" = lzma ]; then
lzma -9 $INITRD -S .gz
elif [ "$COMPRESSION_METHOD" = gzip ]; then
$GZIP -9 $INITRD
else
mv $INITRD $INITRD.gz
fi
elif [ $TARGET_ARCH = arm ]; then
$GZIP -9 $INITRD
mkimage -A arm -O linux -T ramdisk -C gzip -n "$DISTRONAME Ramdisk" -d $INITRD.gz $BUILD/initrd/uinitrd.gz
else
$GZIP -9 $INITRD
fi
if [ $TARGET_ARCH = arm ]; then
mkdir -p $INSTALL/boot
cp $BUILD/initrd/uinitrd.gz $INSTALL/boot
else
mkdir -p $INSTALL/isolinux
cp $INITRD.gz $INSTALL/isolinux
fi
exit 0