LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Boot image (https://www.linuxquestions.org/questions/linux-newbie-8/boot-image-917561/)

tr1ck 12-07-2011 07:47 AM

Boot image
 
Hey guys,

I'm trying to update a couple of files on a boot image that we use to run a low form of linux on some boards for testing. We basically install the image to create a bootable sdcard with this low form of linux.
Anyway I have a final.image.dd file that I usually create the sdcards from, but i need to edit the interfaces and replace a file from inside the .dd image.
Any pointers on how this could be done?

Thank you.

P.S. I'm using Ubuntu on the machine I'm doing all of this on.

rodrifra 12-07-2011 08:37 AM

Is there any problem mounting that image to a directory and modifying the contents?

tr1ck 12-07-2011 08:38 AM

I can mount the image on a sdcard and modify the content there, but how do i rip the card to create a new image? i have to do a lot of these cards and we have to give the image to a supplier so they can do this for us, so i need to make the image with the settings that we need.

coolsg5636 12-07-2011 09:22 AM

I think you can use dd command to achieve that goal.

Here is post which will help you learn how to use "dd" command.

http://www.linuxquestions.org/questi...ommand-362506/

rodrifra 12-07-2011 09:50 AM

I was talking about mounting "the image" not tranferring the image to a card and conecting that card.

If you have a whatever.img, which once was a fs in your card and you have created the image (using dd for instance) you should be able to mount your whatever.img in your /mnt directory. Any change you do there (if you mount your image with write permissions) will be kept in the image once you unmount it.

tr1ck 12-07-2011 10:31 AM

I'm trying to.. but i get this:

Code:

root@ubuntu:/home/alex/Desktop/Tech CIP# parted -Tech.final.image.dd unit B print
Model:  (file)
Disk /home/alex/Desktop/Tech CIP/-Tech.final.image.dd: 2090860544B
Sector size (logical/physical): 512B/512B
Partition Table: msdos

Number  Start    End        Size        Type    File system  Flags
 1      16384B    1572863B    1556480B    primary
 2      1572864B  2621439B    1048576B    primary  ext2
 3      4980736B  287047679B  282066944B  primary  ext3

root@ubuntu:/home/alex/Desktop/Tech CIP# sudo mount -o loop,offset=1572864B -Tech.final.image.dd /tmp/fti
mount: invalid offset '1572864B' specified
root@ubuntu:/home/alex/Desktop/Tech CIP#


TobiSGD 12-07-2011 11:15 AM

Try it without the B on the end of the offset, that should work.

tr1ck 12-07-2011 11:19 AM

That worked, how do I save the .dd file after I'm done editing it?

TobiSGD 12-07-2011 11:31 AM

Just unmount it. All edits are realtime, so be sure to have a backup of the image in case anything gets wrong.

tr1ck 12-07-2011 11:32 AM

Thanks a lot


All times are GMT -5. The time now is 06:30 AM.