Editing the read-only parts of an image
Register
Page 1 of 4 1234 LastLast
Results 1 to 15 of 60
  1. #1
    Administrator
    Devilfish's Avatar
    Join Date
    Feb 2008
    Location
    /cdk
    Posts
    7,844
    Thanks Thanks Given 
    71
    Thanks Thanks Received 
    2,546
    Thanked in
    203 Posts

    Default Editing the read-only parts of an image

    Enigma images are created in such a way that there is a read-only section of the image and read/write section. The /var folder and /tmp folder is the old folders in an image that you can edit. If, for any reason, you want to edit the read-only folders, i.e. /bin, /etc, /lib, /share, etc. this is what you'll need to do.

    First of all, you'll need a linux platform to make your changes. This could be a PC with a linux OS, i.e. Ubuntu, or you could have a program called VMWare which is a virtual machine that allows you to run a different OS from within an existing OS. It's up to you which one you choose and I will not go into setting it up in this thread.

    Telnet to the dreambox...
    username: root
    password: dreambox

    Follow these commands...

    Code:
     mkdir /var/tmp/root
    Code:
     mount -t squashfs -o ro /dev/mtdblock/5 /var/tmp/root
    Code:
     cd /var/tmp
    Code:
     tar -cf root.tar root
    FTP the root.tar to your linux desktop and open a terminal.
    Code:
    cd Desktop
    Code:
     tar -xf root.tar
    Leave the terminal window open.

    Treat the root folder on the desktop as the box itself but don't add or change anything in /var because that is a different location.

    When you have finished go back to the terminal window and...

    Code:
     ./mksquashfs root mtd5.img -be
    Then ftp the mtd5.img back to the box. You will need a copy of mksquashfs on the Desktop to be able to perform this command.

    Telnet back to the box and...

    Code:
     cd /tmp && eraseall /dev/mtd/5 && cp mtd5.img /dev/mtd/5 && reboot
    Done.

    To check what mtd# ...
    Code:
    more /proc/mtd
    ...but most squashfs are mtd5.

    Njoy!
    Last edited by Devilfish; 27th December, 2008 at 05:02 AM.
    Get Digital Kaos on your Apple or Android device with Tapatalk

  2. #2
    Newbie
    Join Date
    Aug 2008
    Posts
    4
    Thanks Thanks Given 
    0
    Thanks Thanks Received 
    0
    Thanked in
    0 Posts

    Default

    is there anyway to do this from a Pc running on windows

  3. #3
    Junior Member
    Join Date
    Jul 2008
    Posts
    27
    Thanks Thanks Given 
    0
    Thanks Thanks Received 
    0
    Thanked in
    0 Posts

    Default

    is there anyway to do this from a Pc running on windows
    No, but you can install a virtual linux machine, using e.g. vmware, and do it from there. It's fairly easy to set up, and there's plenty of guides on the interweb.

  4. #4
    Member
    Join Date
    May 2008
    Posts
    74
    Thanks Thanks Given 
    0
    Thanks Thanks Received 
    0
    Thanked in
    0 Posts

    Default

    can anyone please tell me if this method works? I have tested so many times but not working. I have done and follow devilfish's instruction. I am able to produce mtd5.img but when I flash back to the box, the box dont work at all. Can someone please advise me?

    Thanks

  5. #5
    Top Poster
    Join Date
    May 2008
    Posts
    117
    Thanks Thanks Given 
    0
    Thanks Thanks Received 
    0
    Thanked in
    0 Posts

    Default

    will this method work for neutrino on the dbox as well?

  6. #6
    V.I.P. Member
    Join Date
    Jul 2008
    Posts
    109
    Thanks Thanks Given 
    9
    Thanks Thanks Received 
    10
    Thanked in
    3 Posts

    Default

    Quote Originally Posted by ronlkh View Post
    can anyone please tell me if this method works? I have tested so many times but not working. I have done and follow devilfish's instruction. I am able to produce mtd5.img but when I flash back to the box, the box dont work at all. Can someone please advise me?

    Thanks
    Yes of course it works - This is the exact method I used to make the moddified jade image I posted in here.

  7. #7
    Member
    Join Date
    May 2008
    Posts
    74
    Thanks Thanks Given 
    0
    Thanks Thanks Received 
    0
    Thanked in
    0 Posts

    Default

    must I umount the root and delete the root.tar before I flash the new mtd5.img?

    Thanks

  8. #8
    Member
    Join Date
    May 2008
    Posts
    74
    Thanks Thanks Given 
    0
    Thanks Thanks Received 
    0
    Thanked in
    0 Posts

    Default

    What I am running is vmware + ubuntu 8.04.

    First I telnet to the dm500 from ubuntu terminal
    then I make directory
    root@dm500 ~ #mkdir /var/tmp/root
    root@dm500 ~ #mount -t squashfs -o ro /dev/mtdblock/5 /var/tmp/root
    root@dm500 ~#cd /var/tmp
    root@dm500 /tmp #tar -cf root.tar root
    root@dm500 /tmp #
    then I open another terminal to ftp to dm500
    root@ubuntu8041:/home/user/Desktop# ftp 192.168.0.112
    Connected to 192.168.0.112.
    220 Welcome to the PLi dreambox FTP server
    Name (192.168.0.112:user): root
    331 Please specify the password.
    Password:
    230 Login successful.
    Remote system type is UNIX.
    Using binary mode to transfer files.
    ftp> cd /tmp
    250 Directory successfully changed.
    ftp> get root.tar
    ftp>bye
    root@ubuntu8041:/home/user/Desktop# tar -xf root.tar
    root@ubuntu8041:/home/user/Desktop# ./mksquashfs root mtd5.img
    I mksquashfs back the original root and a new mtd5.img is created.
    then I ftp back to dm500
    root@ubuntu8041:/home/user/Desktop# ftp 192.168.0.112
    Connected to 192.168.0.112.
    220 Welcome to the PLi dreambox FTP server
    Name (192.168.0.112:user): root
    331 Please specify the password.
    Password:
    230 Login successful.
    Remote system type is UNIX.
    Using binary mode to transfer files.
    ftp> cd /tmp
    250 Directory successfully changed.
    ftp> put mtd5.img
    ftp>bye
    exit back to Desktop and telnet back to the box
    i change the directory to /tmp
    root@ubuntu8041:/home/user/Desktop# telnet 192.168.0.112
    Trying 192.168.0.112...
    Connected to 192.168.0.112.
    Escape character is '^]'.

    PLi dm500 Jade 20080718 (based on 1.09)
    welcome on your dreambox! - Kernel 2.6.9 (13:08:41).
    dm500 login: root
    Password:


    BusyBox v1.01 (2008.07.11-10:44+0000) Built-in shell (ash)
    Enter 'help' for a list of built-in commands.

    root@dm500 ~ # cd /tmp && eraseall /dev/mtd/5 && cp mtd5.img /dev/mtd/5 && reboot

    after image flashed dm500 reboot but dm500 is dead

    I did not umount the root directory in the /var/tmp nor I have deleted the root.tar

    Have I done anything wrong?

  9. #9
    Administrator
    Devilfish's Avatar
    Join Date
    Feb 2008
    Location
    /cdk
    Posts
    7,844
    Thanks Thanks Given 
    71
    Thanks Thanks Received 
    2,546
    Thanked in
    203 Posts

    Default

    On a working image, do a 'more /proc/mtd' in telnet and see what it says.
    Get Digital Kaos on your Apple or Android device with Tapatalk

  10. #10
    Member
    Join Date
    May 2008
    Posts
    74
    Thanks Thanks Given 
    0
    Thanks Thanks Received 
    0
    Thanked in
    0 Posts

    Default

    Hi Devilfish,
    What I got is :-

    root@dm500 ~ # more /proc/mtd
    dev: size erasesize name
    mtd0: 00600000 00020000 "DreamBOX cramfs+squashfs"
    mtd1: 001c0000 00020000 "DreamBOX jffs2"
    mtd2: 00040000 00020000 "DreamBOX OpenBIOS"
    mtd3: 007c0000 00020000 "DreamBOX (w/o bootloader)"
    mtd4: 00800000 00020000 "DreamBOX (w/ bootloader)"
    mtd5: 004e0000 00020000 "DreamBOX SquashedFS"
    mtd6: 00120000 00020000 "DreamBOX Cramfs"

    thanks

  11. #11
    Administrator
    Devilfish's Avatar
    Join Date
    Feb 2008
    Location
    /cdk
    Posts
    7,844
    Thanks Thanks Given 
    71
    Thanks Thanks Received 
    2,546
    Thanked in
    203 Posts

    Default

    That looks right, was just checking that the squashfs part was indeed mtd5. Not sure what else to suggest. Maybe try a totally different image.
    Get Digital Kaos on your Apple or Android device with Tapatalk

  12. #12
    Newbie
    Join Date
    Sep 2008
    Posts
    1
    Thanks Thanks Given 
    0
    Thanks Thanks Received 
    0
    Thanked in
    0 Posts

    Default

    Hello there! I've just found this forum and have to say that i'm impress with it

    Continuing with the thread, I'm having the same problem as ronlkh here. I followed the steps explained by Devilfish except from the part of using a mksquashfs binnary copied on the Desktop. I used the mksquashfs binnary from ubuntu instead. Then, after rebooting, the dreambox does not respond and i get a black screen...

    I've read that squashfs-lzm is used for building most of the dreambox images, shouldn't will be using that program? Thanks in advance!

  13. #13
    Newbie
    Join Date
    Jan 2009
    Posts
    12
    Thanks Thanks Given 
    0
    Thanks Thanks Received 
    0
    Thanked in
    0 Posts

    Default

    hi,
    this is gr8 topic tested with gemini4.6 not work (Black screen after reboot)
    I do exactly same steps said Devilfish

    BR

  14. #14
    Administrator
    Devilfish's Avatar
    Join Date
    Feb 2008
    Location
    /cdk
    Posts
    7,844
    Thanks Thanks Given 
    71
    Thanks Thanks Received 
    2,546
    Thanked in
    203 Posts

    Default

    I followed these steps about a month ago to edit /var_init on an image so that certain files stayed there after a factory reset and it worked 100%.

    Maybe the SquashedFS partition is not mtd5 on a Gemini image, I'm not sure, but I imagine it would be the same.
    Get Digital Kaos on your Apple or Android device with Tapatalk

  15. #15
    Newbie
    Join Date
    Jan 2009
    Posts
    12
    Thanks Thanks Given 
    0
    Thanks Thanks Received 
    0
    Thanked in
    0 Posts

    Default

    hi I get this
    root@dreambox:~> more /proc/mtd
    dev: size erasesize name
    mtd0: 00500000 00020000 "DreamBOX cramfs+squashfs"
    mtd1: 002c0000 00020000 "DreamBOX jffs2"
    mtd2: 00040000 00020000 "DreamBOX OpenBIOS"
    mtd3: 007c0000 00020000 "DreamBOX (w/o bootloader)"
    mtd4: 00800000 00020000 "DreamBOX (w/ bootloader)"
    mtd5: 003e0000 00020000 "DreamBOX SquashedFS"
    mtd6: 00120000 00020000 "DreamBOX Cramfs"

    I tried only to change a font in /share !!!

    thanks

 

 
Page 1 of 4 1234 LastLast

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
This website uses cookies
We use cookies to store session information to facilitate remembering your login information, to allow you to save website preferences, to personalise content and ads, to provide social media features and to analyse our traffic. We also share information about your use of our site with our social media, advertising and analytics partners.