Permalink
Find file
Fetching contributors…
Cannot retrieve contributors at this time
executable file 53 lines (41 sloc) 984 Bytes
#!/bin/sh
. config/options
do_gzip () {
GZIP="`which pigz`" || GZIP="`which gzip`"
$GZIP -9 $INITRAMFS
mv $INITRAMFS.gz $INITRAMFS
}
do_xz () {
$SCRIPTS/installdev xz
xz -9 --check=crc32 $INITRAMFS
mv $INITRAMFS.xz $INITRAMFS
}
if [ "$1" = image ]; then
$SCRIPTS/installdev busybox-init
INITRAMFS_ROOT=$ROOT/$TOOLCHAIN/share/initramfs
INITRAMFS_NAME=$INSTALL/initrd
else
INITRAMFS_ROOT=$ROOTFS
fi
INITRAMFS=$ROOT/$BUILD/initramfs/initrd
rm -rf $ROOT/$BUILD/initramfs
mkdir -p $ROOT/$BUILD/initramfs
# Create a CPIO InitRamfs archive
cd $INITRAMFS_ROOT
find . | cpio -o -H newc > $INITRAMFS
cd -
case $TARGET_ARCH in
i386|x86_64)
[ "$COMPRESSION_METHOD" = xz ] && do_xz || do_gzip
cp -P $INITRAMFS $INITRAMFS_NAME
;;
arm)
do_gzip
mkimage -A arm -O linux -T ramdisk -C gzip -n "$DISTRONAME Ramdisk" \
-d $INITRAMFS $BUILD/initramfs/uinitrd.gz
cp $BUILD/initramfs/uinitrd.gz $INITRAMFS_NAME
;;
*)
;;
esac
exit 0