Skip to content

Instantly share code, notes, and snippets.

@pamaury
Created March 18, 2017 17:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pamaury/2ff60d80a36715c84b342be2122bcd4c to your computer and use it in GitHub Desktop.
Save pamaury/2ff60d80a36715c84b342be2122bcd4c to your computer and use it in GitHub Desktop.
# $UBIFS is ubifs image file
# make sure $IMAGE is a ubifs image file
blkid $(IMAGE)
$(IMAGE): ... TYPE="ubifs"
# size of created mtd is 256.0 MiB
modprobe nandsim first_id_byte=0x2c second_id_byte=0xda third_id_byte=0x90 fourth_id_byte=0x95
flash_erase /dev/mtd0 0 0
ubiformat /dev/mtd0 -s 2048 -O 2048
modprobe ubi
ubiattach -m 0 -d 0 -O 2048
# set $(SIZE) to value more than size of the ubifs filesystem
ubimkvol /dev/ubi0 -N volname -s $(SIZE)
ubiupdatevol /dev/ubi0_0 $(UBIFS)
mount /dev/ubi0_0 /mnt
# (taken from: http://lists.infradead.org/pipermail/linux-mtd/2013-October/049229.html )
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment