Created
March 19, 2014 01:59
-
-
Save jannson/9634148 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
RAMSIZE=32768 | |
STRIP_DIR=rootfs-cpio | |
TEMP_DIR=ramfs_tempdir | |
dd if=/dev/zero of=initrd.img bs=1k count=$RAMSIZE | |
#/sbin/mke2fs -F -m0 initrd.img | |
/sbin/mkfs.ext2 -F -v -m0 initrd.img | |
mkdir $TEMP_DIR | |
mount -o loop,exec initrd.img $TEMP_DIR | |
cp -rf $STRIP_DIR/* $TEMP_DIR/. | |
umount $TEMP_DIR | |
gzip -9 initrd.img | |
mkimage -A arm -O linux -T ramdisk -C gzip -d initrd.img.gz initrd.img | |
rm -rf initrd.img.gz $TEMP_DIR | |
#copy from http://shyuanliang.blogspot.com/2010/01/jffs2-root-file-system_20.html |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment