Jump to content











Photo
- - - - -

Edit file in mapped image

mapped image dft change edit

  • Please log in to reply
8 replies to this topic

#1 Obi-Wahn

Obi-Wahn

    Newbie

  • Members
  • 17 posts
  • Location:Vienna
  •  
    Austria

Posted 11 March 2012 - 02:50 PM

Hi!

On my multiboot usb drive, I'm using the Hitachi Drive Fitness Test Image.
I have edited the image in that way, that ATA images are default selected and boot-timeout is zero seconds.

As far as I see, it's a DOS-based floppy image, and the settings are located in the config.sys file.

The Question I have now is, if I have to use it on a SCSI Drive, I would have to edit the file again.
Also, I could make a copy of the image, and modify it for SCSI, but that would be waste of space.

I also do not want to get the image-menu displayed, therefore I edited the config.sys but now this setback.


Long story short:
Is there a way of modifying a specific file INSIDE a Image which is mapped?
I tried the cat command, but this results in a failure since theres no specific file defined.


FYI:
That's how I created the Image:
  • In Section "common" change Key "DEVICE" from "A:\DOS\HIMEM.SYS" to "A:\DOS\HIMEM.SYS /M:1"
  • In Section "MENU" change Key "MENUDEFAULT" from "SCSI_MENU, 20" to "ATA, 0"
Finally, dismount the Image and copy it to the USB Drive into Folder "images".
Add to menu.lst:

title Hitachi Drive Fitness Test

find --set-root /images/dft.img

map --mem /images/dft.img (fd0)

map --hook

chainloader (fd0)+1

rootnoverify (fd0)

map --floppies=1

THXIA
O-W


EDIT:
BTW: I'm creating images and saving changes into a XP PRO SP3 VM.

Edited by Obi-Wahn, 11 March 2012 - 02:55 PM.


#2 Wonko the Sane

Wonko the Sane

    The Finder

  • Advanced user
  • 15103 posts
  • Location:The Outside of the Asylum (gate is closed)
  •  
    Italy

Posted 11 March 2012 - 05:28 PM

You can use grub4dos newish FAT program to copy to the image one or the other versions of CONFIG.SYS directly from grub4dos while booting:
http://chenall.net/post/grub4dos_fat/


Latest should be :unsure::
http://code.google.c...27.zip&can=2&q=


Some related (and also unrelated) ideas are given here:
http://reboot.pro/16288/
(you could re-create the image on-the-fly)
Or you can use dd or write commands directly (as long as the file is "big enough", there should be no issues.

:cheers:
Wonko

#3 steve6375

steve6375

    Platinum Member

  • Developer
  • 7107 posts
  • Location:UK
  • Interests:computers, programming (masm,vb6,C,vbs), photography,TV,films,guitars, www.easy2boot.com
  •  
    United Kingdom

Posted 12 March 2012 - 09:23 AM

I tried the cat command, but this results in a failure since theres no specific file defined.

Not sure what you mean, the cat command will work on a specific file

e.g.
cat --locatei="HIMEM.SYS" --replace="HIMEM.SYS /M:1" (fd0)/config.sys
However, you must ensure there are lots of empty spaces at the end of each line you want to modify to allow for the extra characters.

So you must edit the files inside the image first to make sure the lines are long enough for any alteration you need to do when you map the image.

#4 Obi-Wahn

Obi-Wahn

    Newbie

  • Members
  • 17 posts
  • Location:Vienna
  •  
    Austria

Posted 12 March 2012 - 10:00 AM

Hi & TY 4 reply.

@Wonko: Thanks, I'll take a look. Unfortunately, my chinese isn't the best ^^

@steve: Since your suggestion seemed easier to recreate, I tried this first. It just doesn't work for me when I'm testing it with MobaLiveCD.
I tried several permutations of the cat command, but it doesn't work.
As you can see, g4d doesn't recognize the file: http://www.abload.de...i-fail22f97.png

If you wish, I can post all my (failed) attempts, but this was the last one:

title Hitachi Drive Fitness Test (SCSI for Adaptec)

find --set-root /images/dft.img

map --mem /images/dft.img (fd0)

map --hook

cat --locate="ATA, 0" --replace="SCSI, 0" (fd0)+1/config.sys

chainloader (fd0)+1

rootnoverify (fd0)

map --floppies=1

The only thing I'm not sure about is if you made a typo or it should be really "--locatei="?

#5 steve6375

steve6375

    Platinum Member

  • Developer
  • 7107 posts
  • Location:UK
  • Interests:computers, programming (masm,vb6,C,vbs), photography,TV,films,guitars, www.easy2boot.com
  •  
    United Kingdom

Posted 12 March 2012 - 10:22 AM

Use latest grub4dos version from chenall (Feb 2012)
The locate string must not be more than 16 chars (but the replace string can be longer)
locatei means 'case Insensitive'
use (fd0)/config.sys

#6 Wonko the Sane

Wonko the Sane

    The Finder

  • Advanced user
  • 15103 posts
  • Location:The Outside of the Asylum (gate is closed)
  •  
    Italy

Posted 12 March 2012 - 10:28 AM

Hi & TY 4 reply.

@Wonko: Thanks, I'll take a look. Unfortunately, my chinese isn't the best ^^

Well, google translate is not that bad:
http://translate.goo...&hl=it&ie=UTF-8
and actual screenshots (like the proggy is English allright), this is the part that may interest you:
Posted Image

:cheers:
Wonko

#7 Obi-Wahn

Obi-Wahn

    Newbie

  • Members
  • 17 posts
  • Location:Vienna
  •  
    Austria

Posted 12 March 2012 - 10:37 AM

@steve: Thanks. I was using the official release. I don't know that I had to use some other version. It works now.

@Wonko: yeah, I was reading the translation in German and I have to say, it was terrible ^^
Will read it in english soon.

THX :)

#8 Wonko the Sane

Wonko the Sane

    The Finder

  • Advanced user
  • 15103 posts
  • Location:The Outside of the Asylum (gate is closed)
  •  
    Italy

Posted 12 March 2012 - 10:48 AM

@Wonko: yeah, I was reading the translation in German and I have to say, it was terrible ^^

Seemingly Chinese lacks German "exact" composite words ;):
http://reboot.pro/16351/page__st__10

ONLY seemingly OT, since you can map --mem gzipped images, why don't you make two images and gzip them (the sum of the two will most probably be much smaller than the single .ima you have right now), maybe less elegant, but quite effective. :whistling:


:cheers:
Wonko

#9 Obi-Wahn

Obi-Wahn

    Newbie

  • Members
  • 17 posts
  • Location:Vienna
  •  
    Austria

Posted 12 March 2012 - 02:53 PM

ONLY seemingly OT, since you can map --mem gzipped images, why don't you make two images and gzip them (the sum of the two will most probably be much smaller than the single .ima you have right now), maybe less elegant, but quite effective. :whistling:


Well, it may sound crazy but I HATE double-files. I'd rather search for hours to find a way to avoid double (or at least mostly double) files instead of having 5 or 6 (in this case, because the SCSI Menu is a Sub-Menu) copies of a Image - even if it's just 1.4 MB in size and the Drive is 16 GB. ^^

I even remove copies of memtest in images since I'm using a current image seperately, well knowing that it doesn't reduce the Filesize. That's just a spleen of mine.





Also tagged with one or more of these keywords: mapped, image, dft, change, edit

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users