Created
September 17, 2008 23:26
-
-
Save felipec/11332 to your computer and use it in GitHub Desktop.
rootfs helper
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/bash | |
## contents of ubinize.cfg | |
# [ubifs] | |
# mode=ubi | |
# image=/tmp/ubifs.img | |
# vol_id=0 | |
# vol_size=128MiB | |
# vol_type=dynamic | |
# vol_name=rootfs | |
# vol_alignment=1 | |
# vol_flags=autoresize | |
version="beagle" | |
mkfs_jffs2="/usr/sbin/mkfs.jffs2" | |
# use_jffs2="yes" | |
use_ubifs="yes" | |
rootfs=$1 | |
if [ "$use_jffs2" ] | |
then | |
echo "building jffs2" | |
bin="/tmp/${USER}-${version}-jffs2.bin" | |
sudo ${mkfs_jffs2} -d ${rootfs} -e 128KiB -n -l -p -o ${bin} | |
fi | |
if [ "$use_ubifs" ] | |
then | |
echo "building ubi" | |
bin="/tmp/${USER}-${version}-ubi.bin" | |
sudo mkfs.ubifs -r ${rootfs} -m 2048 -e 129024 -c 2047 -o /tmp/ubifs.img | |
ubinize -o "${bin}" -m 2048 -p 128KiB -s 512 custom/ubinize.cfg | |
sudo rm /tmp/ubifs.img | |
fi | |
echo "rootfs: \"${rootfs}\"" | |
[ "$bin" ] && echo "bin: \"${bin}\"" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment