0

I am attempting to create a CRAMFS filesystem but am struggling with permissions. How to I set permissions so that when a host mounts the filesystem it will be root:root?

Once the CRAMFS is created it is a read-only FS so no changes can occur; therefore I need to set the changes prior to running mkcramfs.

At the moment I can sort of make things work by setting 777; but after mounting it on the device and checking the permissions I see that they are set as 1000:232 instead of root:root. Obviously I can't chown - read only. And I also can't unpack, chown and repack the CRAMFS on the device as there isn't enough disk-space.

I suspect it has to do with the UID/GID of the root user and group on the device and setting those correctly prior to packing the CRAMFS. BTW - The limited version of Linux on the device does not have the ID command.

Any help would be appreciated!

Ed Dantes
  • 53
  • 1
  • 2
  • 10

1 Answers1

0

To build the filesystem with root permissions, you will need to be root. Either really or virtually:

sudo mkcramfs root-dir cramfs.img

or

fakeroot mkcramfs root-dir cramfs.img

sudo really gives you root permissions, but is not really necessary for this operation. fakeroot does an LD_PRELOAD with a shim library to convince the running application that it really is root (even though it isn't). fakeroot is commonly used debian package maintainers to build the packages as 'root' without actually being root.

vmauery
  • 51
  • 2