O'Reilly logo

Linux: Embedded Development by Chris Simmonds, Alex González, Alexandru Vaduva

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Creating filesystem images with device tables

The kernel has a utility, gen_init_cpio, that creates a cpio file based on format instructions set out in a text file, called a device table, which allows a non-root user to create device nodes and to allocate arbitrary UID and GID values to any file or directory.

The same concept has been applied to tools that create other filesystem image formats:

  • jffs2: mkfs.jffs2
  • ubifs: mkfs.ubifs
  • ext2: genext2fs

We will look at jffs2 and ubifs in Chapter 7, Creating a Storage Strategy, when we look at filesystems for flash memory. The third, ext2, is a fairly old format for hard drives.

They each take a device table file with the format <name> <type> <mode> <uid> <gid> <major> <minor> <start> <inc> <count> in which ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required