• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

Editing a compiled image

Devilfish

DW Regular
Joined
Oct 22, 2005
Messages
14,269
Likes
194
#1
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!
 

ellie1998

DW Member ++
Joined
May 7, 2005
Messages
5,744
Likes
67
#2
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 :)
 

Devilfish

DW Regular
Joined
Oct 22, 2005
Messages
14,269
Likes
194
#3
Fook me! Thanks Ellie!

EDIT: Used this today m8, worked a treat! Thanks again!
 
Last edited:

witchy

Banned for good!
Joined
Jul 20, 2005
Messages
18,282
Likes
293
#4
I've ftp'ed the root.tar to my desktop, but when i enter tar -xf root.tar I get teh following error.

[email protected]:~# 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...

[email protected]:~# cd desktop
-bash: cd: desktop: No such file or directory
[email protected]:~#

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:

fergy

Member +
Joined
Jan 11, 2007
Messages
170
Likes
3
#5
You don't need winrar. Use Ark, File roller or whatever packer/unpacker You usually use on Your system.