Jump to content











Photo
- - - - -

Making the image files


  • Please log in to reply
10 replies to this topic

#1 TransformedBG

TransformedBG
  • Members
  • 4 posts
  •  
    United States

Posted 02 March 2022 - 10:05 PM

Howdy, I know this my first post here but I've been searching for an answer for some time. I'm building my own bootable USB Stick for Bios Update files on multiple machines (of different brands and varieties). Rather than carry around multiple sticks and getting them all mixed up I've been working on this project and managed to get a few of them working. However my stick is getting fairly large. 

 

SO my process has been:

1) Insert blank USB stick in to my PC

2) Use Rufus to format said USB stick as a freedos partition

3) copy the 6 files for the bios flash onto the USB (over riding the Autoexe.bat file)

4) Boot another thumbdrive to Gparted and shrink the USB drive I just made down to 346MB (even though the files together are only about 50MB total.

5) Use Win32 disk Imager and copy the allocated partition from usb file to a .img file.

 

Then i put it in a folder on my Grub4dos folder and add a line such as: 

title PC Core Type A - Bios Update ver. 05.05.01.0040
map --mem /Bios/Bios40.img || map /Bios/Bios40.ima (hd0)
map --hook
find --set-root /kernel.sys
chainloader ()/kernel.sys
 
this works perfectly fine. Loads the img into memory, and then flashes the bios without issue.
 
I do this for each image in order to make my drive. As you can see its about 250MB per file of waisted space. Ideally ide like to be able to free up that space and just make a 50MB image file. 
 
Recently I tried using WinImage and just importing the file into a non standard container and moving the files over manually, but when I save it as a .ima file or imz it will not read it even updating my previous command. even tried 
 
title PC Core Type A - Bios Update ver. 05.05.01.0040
kernel /memdisk raw
initrd /Bios/Bios40.ima
 
 the files i move to my image are:
autoexe.bat
command.com
config.sys
(FlashFile).exe
Flash.bat
FWUpdLcl.exe
ME91_5m.bin
 
so 7 files total. Typically these files would be ran by me booting to freedos then just running the autoexe.bat that kicks off the flash and loads the files.
 
Would anyone be able to suggest a tool, or some other way to create a img, iso, ima, imz file that would take up less space on a thumb drive. (yes i know i could just use a 32gb thumb drive, but i want to make this easier to send to someone remotely if possible) 
 


#2 steve6375

steve6375

    Platinum Member

  • Developer
  • 7566 posts
  • Location:UK
  • Interests:computers, programming (masm,vb6,C,vbs), photography,TV,films
  •  
    United Kingdom

Posted 02 March 2022 - 10:19 PM

Why make images?
Just copy the flash files to separate folders on an easy2boot usb drive
Boot to e2b
Boot to freedos which is already in e2b
Change to the correct folder
Run the .bat file.

The freedos in e2b can access the NTFS partition.

#3 steve6375

steve6375

    Platinum Member

  • Developer
  • 7566 posts
  • Location:UK
  • Interests:computers, programming (masm,vb6,C,vbs), photography,TV,films
  •  
    United Kingdom

Posted 02 March 2022 - 10:30 PM

P.s. grub4dos can read compressed files
First use winimage to remove deleted data - can't remember the option.
Then use 7zip and convert to .gzip which should reduce the size.
Map --mem will automatically decompress it when loaded into memory
  • TransformedBG likes this

#4 TransformedBG

TransformedBG
  • Members
  • 4 posts
  •  
    United States

Posted 02 March 2022 - 10:30 PM

Why make images?
Just copy the flash files to separate folders on an easy2boot usb drive
Boot to e2b
Boot to freedos which is already in e2b
Change to the correct folder
Run the .bat file.

The freedos in e2b can access the NTFS partition.

 

 

Just wanted it menu base to kick itself off automagically.  didnt want to boot into freedos and have to navigate across 50 different directories. 



#5 steve6375

steve6375

    Platinum Member

  • Developer
  • 7566 posts
  • Location:UK
  • Interests:computers, programming (masm,vb6,C,vbs), photography,TV,films
  •  
    United Kingdom

Posted 02 March 2022 - 10:55 PM

I think the winimage option was the defrag option.

#6 Wonko the Sane

Wonko the Sane

    The Finder

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

Posted 03 March 2022 - 09:49 AM

A few semi-random notes (feel free to ignore/discard them partially or totally):

 

Winimage was born to manage floppy (and floppy-like) images, the functions relative to partitioned media have been added, but there are some cases (just like it can happen with IMDISK) where they don't work as expected.

 

You have a typo here (hopefully only on the post and not in the menu):

map --mem /Bios/Bios40.img || map /Bios/Bios40.ima (hd0)

should be:

map --mem /Bios/Bios40.img (hd0) || map /Bios/Bios40.ima (hd0)

 

In the list of the freedos files the kernel.sys is missing?

 

ONLY as a side note, there is also the possibility of "truncated" images, see these:

http://reboot.pro/in...showtopic=18312

http://reboot.pro/to...n-many-ramdisk/

 

About making a new image, personally I would use a VM like Qemu or Virtualbox (for this latter using a RAW image wiith the .vmdk descriptor), basically because this way you have the possibility to directly test it (short of actually flashing the BIOS), boot the VM from freedos and from it partition/format the image, this is advised because when we are talking about small images there could be geometry issues.

 

Otherwise you can use IMDISK (which "save image with MBR" should be working just fine for your simple needs), or use (the updated version of) my good ol' mbrbatch/mkimg batch (intended for XP, but updated for Vista and later) that should work on newer systems, but you would anyway post process it to installl the grub4dos to the MBR (if you are using it that way).

 

Or use a driver like the Arsenal one (same Author of IMDISK) or the Microsoft one (though I have no idea if it still exists in a version compatible with newer MS OS's. :unsure:

 

You can even do it all manually, the small calculations needed for a simple primary partition are not that difficult.

 

Or you could get rid of the idea of a partitioned image and see if a floppy (actually a super-floppy) works, the "canonical" sizes are 1.44 and 2.88, but larger sizes are well possible.

 

Loosely in your case could be *something like* this old idea:

http://reboot.pro/to...-to-g4d-images/

but maybe it is overcomplicated for your uses.

 

Another idea could be - following the suggestion by Steve6375, automating it - to have a "generic" FreeDOS (floppy sized) image (that you can surely map to memory) and in the grub4dos menu.lst add a command to write on-the-fly, before chainloading the kernel.sys, an autoexec.bat pointing to the specific directory where the .bin/.exe/etc. are (in the stick). ;dubbio:

 

In any case, with your current approach, you have some 50 entries in the menu.lst to choose from, if I get it right, adding to each of them a dd or echo command wouldn't be an issue, but it remains (I believe) prone to error to have to choose among so many entries, maybe you need a multi-level menu, similar to the ones in (say) the supergrubdisk. :unsure:

 

:duff:

Wonko


  • TransformedBG likes this

#7 TransformedBG

TransformedBG
  • Members
  • 4 posts
  •  
    United States

Posted 03 March 2022 - 05:43 PM

Otherwise you can use IMDISK (which "save image with MBR" should be working just fine for your simple needs), or use (the updated version of) my good ol' mbrbatch/mkimg batch (intended for XP, but updated for Vista and later) that should work on newer systems, but you would anyway post process it to installl the grub4dos to the MBR (if you are using it that way).

 

....

 

Loosely in your case could be *something like* this old idea:

http://reboot.pro/to...-to-g4d-images/

but maybe it is overcomplicated for your uses.

 

:duff:

Wonko

Actually that Worked.. I installed IMDisk and just mounted the freedos as a 40MB partition mounted my files in it, and copied the kerenal.sys and command.com into the partition, Fixed my typo you pointed out and was able to make a 40MB img file that boots and flashes. 



#8 steve6375

steve6375

    Platinum Member

  • Developer
  • 7566 posts
  • Location:UK
  • Interests:computers, programming (masm,vb6,C,vbs), photography,TV,films
  •  
    United Kingdom

Posted 04 March 2022 - 08:48 AM

You should be able to compress the 40MB files too.



#9 TransformedBG

TransformedBG
  • Members
  • 4 posts
  •  
    United States

Posted 10 March 2022 - 07:16 PM

You should be able to compress the 40MB files too.

yeah i was... im down to 300MB with about 20 bios files... so Im not complain 

 

side note, you have any idea how to just print a page of text in my menus? IE if i made an Information.LST file for what the differences were in the bios files, and capabilities, would there be a simple way just to make it print some text on the screen, and do a page up / down as needed enter to return kind of thing? 

 

i mean i know i could use /hotkeys ...

 

title

 

input text here (echo doenst work i know that)

 

title ^0x1C0D Press Enter to return to main menu
configfile /menu.lst kind of thing.. 



#10 steve6375

steve6375

    Platinum Member

  • Developer
  • 7566 posts
  • Location:UK
  • Interests:computers, programming (masm,vb6,C,vbs), photography,TV,films
  •  
    United Kingdom

Posted 10 March 2022 - 07:38 PM

You can use a configfile which contains echo commands
https://easy2boot.xy...xtra-help-menu/
Or

https://easy2boot.xy...ay-a-text-file/
To see the code used to display .help files download e2b and look at the .help batch file label in the /_iso/e2b/grub/qrun g4b file.

#11 steve6375

steve6375

    Platinum Member

  • Developer
  • 7566 posts
  • Location:UK
  • Interests:computers, programming (masm,vb6,C,vbs), photography,TV,films
  •  
    United Kingdom

Posted 10 March 2022 - 07:44 PM

P.S. My ebook on grub4dos may be of use and easy2boot contains lots of useful code which you can borrow




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users