View Single Post
Old 08-04-2013, 08:38 PM   #1037
GreenPants
Senior Member
 
Join Date: Jul 2013
Drives: Burnt Orange GT86
Location: Christchurch, New Zealand
Posts: 114
Thanks: 12
Thanked 74 Times in 50 Posts
Mentioned: 36 Post(s)
Yep, that's pretty much what I was going to say in a PM...
  • mkdir ~/system_img
  • sudo mount -t ext4 -o loop system.img system_img/
  • cd ~/system_img
  • <tweak the files as you see fit>
  • sudo umount ~/system_img
  • <copy/use modified system.img>

I prefer the use of sudo over su as it only raises you to root for the duration of the command, rather than for the duration of the shell.

You need to be root when you modify files (e.g. sudo cp ...), not just to have the right permissions, but also to make sure that the root user becomes the owner of the files. Not all files have this requirement, so there are some that you may need to chown. You also need to make sure that the attributes are set correctly for the type of file (chmod/chattr)

If you're only interested in examining the system.img file system, then you can use
ext2read on Windows.

If you want to modify the root file system (uramdisk.img), then I have found bootutil.exe to be an easy tool to use on Windows.
GreenPants is offline   Reply With Quote