Editing a compiled image

Devilfish

DW Regular
Joined
Oct 22, 2005
Messages
14,269
Reaction score
198
Location
Dream world
I was wondering if this is possible...

If I have an .img, can I still edit files in the read-only folders on the image, i.e. /bin, /share, etc.

I know I can't replace/edit any files when they're on the dreambox but is there a way to take an .img file and edit it in your linux environment? I'm guessing the image would need to be compiled again after making any changes.

Thanks!
 
never tried a maxvar image but a standard layout image
telnet to the box
root
dreambox
mkdir /var/tmp/root
mount -t squashfs -o ro /dev/mtdblock/5 /var/tmp/root
cd /var/tmp
tar -cf root.tar root
ftp the root.tar to your linux desktop
open terminal
cd Desktop
tar -xf root.tar
leave the terminal window open.

treat the root folder on the desktop as the box itself but don't bother trying to add or do anything to /var or /var_init
when you have finished go back to the terminal window and
./mksquashfs root mtd5.img -be
then ftp the mtd5.img back to the box
telnet into the box and
root
dreambox
cd /tmp && eraseall /dev/mtd/5 && cp mtd5.img /dev/mtd/5 && reboot

all this info was taken from pt-1's dbox helpfile
to check what mtd#
more /proc/mtd
but most squashfs are mtd5
You will need a copy of mksquashfs on the desktop so anybody with my ubuntu now knows why it is there :)
 
Fook me! Thanks Ellie!

EDIT: Used this today m8, worked a treat! Thanks again!
 
Last edited:
I've ftp'ed the root.tar to my desktop, but when i enter tar -xf root.tar I get teh following error.

root@slax:~# tar -xf root.tar
tar: root.tar: Cannot open: No such file or directory
tar: Error is not recoverable: exiting now

UPDATE:

Just noticed that I'm not actually in the desktop, I'm in root, but when i enter cd desktop I get...

root@slax:~# cd desktop
-bash: cd: desktop: No such file or directory
root@slax:~#

As u can see, I'm new to Linux :)

Sorry.

ANOTHER UPDATE!

Fook me, I'm a dick.
I forgot that Linus was case sensitive :)

Got it working now, many thanks.

Now I just need to find out how to get Winrar running :)
I tried runnig it via Wine but it failed :(
 
Last edited:
You don't need winrar. Use Ark, File roller or whatever packer/unpacker You usually use on Your system.
 
Back
Top