Jump to content











Photo
- - - - -

Copying in different PING automated isolinux.cfg files via Grub4Dos


  • Please log in to reply
30 replies to this topic

#1 robertcollier4

robertcollier4

    Member

  • Members
  • 33 posts
  •  
    United States

Posted 23 December 2012 - 12:08 PM

Hi - I like to run PING (Partition Is Not Ghost) backup/restore in unattended mode via the isolinux.cfg file on the root of the file.

 

I have 5 different ISOs for PING currently on my flash drive. Each ISO is 33MB but they are all the same except for one file isolinux.cfg being different in each one. The rest of the files except for isolinux.cfg are all the same. Is there some way that I can keep 5 different versions of the file, load 1 common ISO of PING, and then copy the correct isolinux.cfg file into the in-memory loaded ISO image depending on the selection in Grub4DOS?

 

For example: I have: isolinux.cfg.computer1, isolinux.cfg.computer2, isolinux.cfg.computer3, isolinux.cfg.computer4, isolinux.cfg.computer5

 

Currently I have: 

title PING302-automated-computer3
map --mem (hd0,0)/iso/PING302-automated-computer3.iso (hd32)
map --hook
chainloader (hd32)
boot

 

 

I would like to do something like the following (note bolded line in red):
title PING302-automated-computer3

map --mem (hd0,0)/iso/PING302-commonfiles.iso (hd32)
cp /pingautomatedfiles/isolinux.cfg.computer3 (hd0,0)/isolinux.cfg
map --hook
chainloader (hd32)
boot
 

Is something like this possible so I don't have to keep 5 different versions of the entire ISO - and can just copy in the configuration files? Thanks.


Edited by robertcollier4, 23 December 2012 - 12:42 PM.


#2 steve6375

steve6375

    Platinum Member

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

Posted 23 December 2012 - 12:12 PM

I would try to avoid using isolinux.

Can you post one example of what is in the isolinux.cfg file please?  (i.e. label, kernel, append lines)

These can be translated into grub4dos commands.



#3 robertcollier4

robertcollier4

    Member

  • Members
  • 33 posts
  •  
    United States

Posted 23 December 2012 - 12:30 PM

Here is an example of one of my isolinux.cfg files for PING. PING instructions are to add variables to the end of the APPEND line for automated operation. All I need to change between menu items is the APPEND line.

 

DEFAULT default
PROMPT 0
TIMEOUT 26
DISPLAY boot.msg

LABEL default
KERNEL kernel
APPEND vga=normal devfs=nomount pxe ramdisk_size=60000 load_ramdisk=1 init=/linuxrc prompt_ramdisk=0 initrd=initrd.gz root=/dev/ram0 rw noapic nolapic lba combined_mode=libata ide0=noprobe nomce pci=nomsi irqpoll quiet AUTO=Y After_Completion=Reboot No_Shell=Y Replace_BIOS=N Compression_Type=gzip Tarball_Preferred=Y Store_MD5=N Minimize_Before_Storing=N Cmd_3="cp /tmp/x.log /mnt/dos/Automated/$(date +%F_%H%M).log" Parts_To_Backup=hda1 Server="/dev/sdc1" Directory=/ThinkpadT61Images Image_To_Restore=Create_New_Image New_Image_Name=Automated Already_Existing_Image=Rename

LABEL dummy
KERNEL kernel

 

The following is what I added to APPEND line on top of the default isolinux.cfg:

AUTO=Y After_Completion=Reboot No_Shell=Y Replace_BIOS=N Compression_Type=gzip Tarball_Preferred=Y Store_MD5=N Minimize_Before_Storing=N Cmd_3="cp /tmp/x.log /mnt/dos/Automated/$(date +%F_%H%M).log" Parts_To_Backup=hda1 Server="/dev/sdc1" Directory=/ThinkpadT61Images Image_To_Restore=Create_New_Image New_Image_Name=Automated Already_Existing_Image=Rename

 

http://ping.windowsd...2.01/annex.html

Every key=value setting contained in the ping.conf file can be passed directly to the kernel at boot time. To do this, simply edit your isolinux.cfg file (if CD/DVD, pxelinux.cfg\DEFAULT if PXE), and modify the APPEND line accordingly. For example, to have PING leave you to a shell after job completion, you'd add the string After_Completion=Shell to the APPEND line.
 
This is the contents of the pre-made ISO that PING Provides :
BOOT.CAT
BOOT.MSG
INITRD.GZ
ISOLINUX.BIN
ISOLINUX.CFG
KERNEL.
LOGO.16

 


Edited by robertcollier4, 23 December 2012 - 12:44 PM.


#4 Wonko the Sane

Wonko the Sane

    The Finder

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

Posted 23 December 2012 - 12:55 PM

I would try to avoid using isolinux.
 
Why exactly? :unsure:
 
OP has 5 isolinux.cfg.
The obvious solution is to have a single "main" isolinux.cfg and 5 other .cfg's, PC1.cfg, PC2.cfg, PC3.cfg, PC4.cfg, PC5.cfg.
 
Something *like*:
 
 
DEFAULT main

LABEL main
COM32 /boot/syslinux/menu.c32
APPEND /boot/menus/PC1.cfg
APPEND /boot/menus/PC2.cfg
APPEND /boot/menus/PC3.cfg
APPEND /boot/menus/PC4.cfg
APPEND /boot/menus/PC5.cfg

http://www.syslinux....omboot/menu.c32

:cheers:
Wonko

#5 robertcollier4

robertcollier4

    Member

  • Members
  • 33 posts
  •  
    United States

Posted 23 December 2012 - 01:01 PM

After looking at that link, it seems that isolinux.cfg is specifying its own menu system. Didn't realize that isolinux.cfg already had a menu system built into it (stupid me, doh!). So instead of having the 5 entries in the Grub4Dos menu, I could have one singular Grub4Dos entry load the isolinux boot menu which would then have my 5 entries from an ISOLinux menu. Will try it out.

 

I should just be able to modify my isolinux.cfg file as follows:
 

LABEL computer1
KERNEL kernel
APPEND (... settings for computer1 ...)

LABEL computer2
KERNEL kernel
APPEND (... settings for computer2 ...)

LABEL computer3
KERNEL kernel
APPEND (... settings for computer3 ...)

LABEL computer4
KERNEL kernel
APPEND (... settings for computer4 ...)

LABEL computer5
KERNEL kernel
APPEND (... settings for computer5 ...)

Edited by robertcollier4, 23 December 2012 - 01:08 PM.


#6 steve6375

steve6375

    Platinum Member

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

Posted 23 December 2012 - 01:02 PM

Try this

You need a 2012 version of grub4dos (as included with rmprepusb or download from chenall's site)

title test 
map --mem (hd0,0)/iso/PING302-automated-computer3.iso (0xff)
map --hook
root (0xff)
set STD=vga=normal devfs=nomount pxe ramdisk_size=60000 load_ramdisk=1 init=/linuxrc prompt_ramdisk=0  root=/dev/ram0 rw noapic nolapic lba combined_mode=libata ide0=noprobe nomce pci=nomsi irqpoll quiet 
set CFG=AUTO=Y After_Completion=Reboot No_Shell=Y Replace_BIOS=N Compression_Type=gzip Tarball_Preferred=Y Store_MD5=N Minimize_Before_Storing=N Cmd_3="cp /tmp/x.log /mnt/dos/Automated/$(date +%F_%H%M).log" Parts_To_Backup=hda1 Server="/dev/sdc1" Directory=/ThinkpadT61Images Image_To_Restore=Create_New_Image New_Image_Name=Automated Already_Existing_Image=Rename
echo About to run %STD% %CFG%
pause
kernel /kernel %STD% %CFG%
initrd /initrd.gz

just change the CFG line for each of your options.

The only thing I am worried about is that the line is rather long and I am not sure of the grub4dos line length limitation for the kernel command...

 

Also try without the --mem (it will be much quicker to test!)

 



#7 steve6375

steve6375

    Platinum Member

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

Posted 23 December 2012 - 01:20 PM

I quickly tested this with PING iso and it almost works!

As suspected the line length is just too long. If you can cut out the unneeded ones, then it does work - e.g.

 

the commented out STD line is too long.

The cut down STD line works - 

 

#set STD=vga=normal devfs=nomount pxe ramdisk_size=60000 load_ramdisk=1 init=/linuxrc prompt_ramdisk=0  root=/dev/ram0 rw noapic nolapic lba combined_mode=libata ide0=noprobe nomce pci=nomsi irqpoll quiet 
set CFG=AUTO=Y After_Completion=Reboot No_Shell=Y Replace_BIOS=N Compression_Type=gzip Tarball_Preferred=Y Store_MD5=N Minimize_Before_Storing=N Cmd_3="cp /tmp/x.log /mnt/dos/Automated/$(date +%F_%H%M).log" Parts_To_Backup=hda1 Server="/dev/sdc1" Directory=/ThinkpadT61Images Image_To_Restore=Create_New_Image New_Image_Name=Automated Already_Existing_Image=Rename
set STD=devfs=nomount pxe ramdisk_size=60000 load_ramdisk=1 init=/linuxrc prompt_ramdisk=0  root=/dev/ram0 rw

 

I suggest setting as many values  as possible in the /etc/ping.conf file - then you won't need to specify them in the grub4dos lines and you can make the lines shorter...


#8 robertcollier4

robertcollier4

    Member

  • Members
  • 33 posts
  •  
    United States

Posted 23 December 2012 - 01:49 PM

Thank you Steve. Yes with the long line it was initially giving "Error 28: Selected item cannot fit into memory". But with your cut down STD line version it is working. Hooray =)



#9 steve6375

steve6375

    Platinum Member

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

Posted 23 December 2012 - 02:23 PM

Another alternative (if using grub4dos directly is proving troublesome due to line length issues) would be to extract all the files from the ISO and put them on your USB drive.

Then from a grub4dos menu, chain to isolinux.

You can then edit your isolinux.cfg file and add any entries you wanted.


title PING
chainloader /isolinux.bin

See Tutorial #62 on my site for some ideas.



#10 robertcollier4

robertcollier4

    Member

  • Members
  • 33 posts
  •  
    United States

Posted 23 December 2012 - 05:36 PM

Another alternative (if using grub4dos directly is proving troublesome due to line length issues) would be to extract all the files from the ISO and put them on your USB drive.

Then from a grub4dos menu, chain to isolinux.

You can then edit your isolinux.cfg file and add any entries you wanted.

title PING
chainloader /isolinux.bin

See Tutorial #62 on my site for some ideas.

 

Tried the above and got the error:

 

 

Cannot chainload ISOLINUX from a non-CDROM device
chainloader /isolinux.bin
Error 13: Invalid or unsupported executable format

 

This would be preferable to have the files directly on the USB stick and not packaged into an ISO. Is there a way to bypass the "non-CDROM device" problem? Or must I have the isolinux files packaged within an ISO?



#11 steve6375

steve6375

    Platinum Member

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

Posted 23 December 2012 - 05:44 PM

See Tutorial 62 - Method 2 - the syslinux.bin that you make must be made using the same UFD that you have PING flat files on.



#12 robertcollier4

robertcollier4

    Member

  • Members
  • 33 posts
  •  
    United States

Posted 23 December 2012 - 06:32 PM

See Tutorial 62 - Method 2 - the syslinux.bin that you make must be made using the same UFD that you have PING flat files on.

Ahh, I see! Okay, thank you. Got it working with "syslinux.exe -f X: X:\syslinux.bin"



#13 robertcollier4

robertcollier4

    Member

  • Members
  • 33 posts
  •  
    United States

Posted 23 December 2012 - 07:37 PM

I didn't like that it wasn't portable loading from a flat file since syslinux.bin requires custom building per partition ID. So I finalized on this solution which I will post the instructions for posterity sake.

 

To have PING Unattended options in an ISOLinux Menu that is chainloaded from Grub4Dos

title PING302-ISOLINUX406Menu.iso
map (hd0,0)/iso/PING302-ISOLINUX406Menu.iso (hd32)
map --hook
chainloader (hd32)/isolinux.bin

 

To make PING302-ISOLINUX406Menu.iso:

1. Create a new blank ISO file with the name of PING302-ISOLINUX406Menu.iso in a program such as UltraISO

1. From syslinux-4.06.zip, find and put these files into the root directory of PING302-ISOLINUX406Menu.iso: isolinux.bin, menu.c32

2. From PING-3.02.iso, find and put these files into the root directory of PING302-ISOLINUX406Menu.iso: kernel, initrd.gz. 

3. Create and put a file named isolinux.cfg with your configuration options into the root directory of PING302-ISOLINUX406Menu.iso as follows:

default menu.c32
prompt 0

MENU TITLE PING302 Automated Options

LABEL PING302 (Attended)
KERNEL /PING302/kernel
APPEND vga=normal devfs=nomount pxe ramdisk_size=60000 load_ramdisk=1 init=/linuxrc prompt_ramdisk=0 initrd=initrd.gz root=/dev/ram0 rw noapic nolapic lba combined_mode=libata ide0=noprobe nomce pci=nomsi irqpoll quiet

LABEL PING302 Backup hda1 to ASK/Automated
KERNEL kernel
APPEND vga=normal devfs=nomount pxe ramdisk_size=60000 load_ramdisk=1 init=/linuxrc prompt_ramdisk=0 initrd=initrd.gz root=/dev/ram0 rw noapic nolapic lba combined_mode=libata ide0=noprobe nomce pci=nomsi irqpoll quiet AUTO=Y After_Completion=Reboot No_Shell=Y Replace_BIOS=N Compression_Type=gzip Tarball_Preferred=Y Store_MD5=N Minimize_Before_Storing=N Cmd_3="cp /tmp/x.log /mnt/dos/Automated/$(date +%F_%H%M).log" Parts_To_Backup=hda1 Directory=/ Image_To_Restore=Create_New_Image New_Image_Name=Automated Already_Existing_Image=Rename

LABEL PING302 Backup hda1 to sda1/Automated
KERNEL kernel
APPEND vga=normal devfs=nomount pxe ramdisk_size=60000 load_ramdisk=1 init=/linuxrc prompt_ramdisk=0 initrd=initrd.gz root=/dev/ram0 rw noapic nolapic lba combined_mode=libata ide0=noprobe nomce pci=nomsi irqpoll quiet AUTO=Y After_Completion=Reboot No_Shell=Y Replace_BIOS=N Compression_Type=gzip Tarball_Preferred=Y Store_MD5=N Minimize_Before_Storing=N Cmd_3="cp /tmp/x.log /mnt/dos/Automated/$(date +%F_%H%M).log" Parts_To_Backup=hda1 Server="/dev/sda1" Directory=/ Image_To_Restore=Create_New_Image New_Image_Name=Automated Already_Existing_Image=Rename

LABEL PING302 Backup hda1 to sda1/DellImages/Dell503
KERNEL kernel
APPEND vga=normal devfs=nomount pxe ramdisk_size=60000 load_ramdisk=1 init=/linuxrc prompt_ramdisk=0 initrd=initrd.gz root=/dev/ram0 rw noapic nolapic lba combined_mode=libata ide0=noprobe nomce pci=nomsi irqpoll quiet AUTO=Y After_Completion=Reboot No_Shell=Y Replace_BIOS=N Compression_Type=gzip Tarball_Preferred=Y Store_MD5=N Minimize_Before_Storing=N Cmd_3="cp /tmp/x.log /mnt/dos/DellImages/Dell503/$(date +%F_%H%M).log" Parts_To_Backup=hda1 Server="/dev/sda1" Directory=/DellImages Image_To_Restore=Create_New_Image New_Image_Name=Dell503 Already_Existing_Image=Rename

4. Save the ISO file and make sure it is contiguous via Contig.exe: "Contig.exe PING302-ISOLINUX406Menu.iso" (or you can add --mem to allow Grub4Dos to load a non-contiguous ISO file).


Edited by robertcollier4, 23 December 2012 - 08:00 PM.


#14 cdob

cdob

    Gold Member

  • Expert
  • 1469 posts

Posted 24 December 2012 - 09:36 AM

Is there some way that I can keep 5 different versions of the file, load 1 common ISO of PING, and then copy the correct isolinux.cfg file into the in-memory loaded ISO image depending on the selection in Grub4DOS?
 
Grub4dos dosn't copy files to a ISO image, it's not a ISO image editor: read file size is fixed

Contrary you may dd a file to a ISO image.
Given isolinux.cfg is small and can't hold a bigger file. Fix file size in addition.
A CD sector contains 2048 bytes, set isolinux.cfg file size to 2048.
And create isolinux.cfg less or equal 2048 bytes.
 
title PING 3.02 (Attended)
map (hd0,0)/PING-3.02.iso (0xff) ||  map --mem (hd0,0)/PING-3.02.iso (0xff)
map --hook
chainloader (0xff)/isolinux.bin

title PING 3.02 Backup hda1 to ASK/Automated
map --mem (hd0,0)/PING-3.02.iso (0xff)
map --hook
#isolinux.cfg: set file size 2048 bytes according ISO9660 
write --offset=0xC2F6 (0xff) \x00\x08
write --offset=0xC2FC (0xff) \x08\x00
#write options to isolinux.cfg
write --offset=0x0127 (0xff)/isolinux.cfg quiet AUTO=Y After_Completion=Reboot No_Shell=Y Replace_BIOS=N Compression_Type=gzip Tarball_Preferred=Y Store_MD5=N Minimize_Before_Storing=N Cmd_3="cp /tmp/x.log /mnt/dos/Automated/$(date +%F_%H%M).log" Parts_To_Backup=hda1 Directory=/ Image_To_Restore=Create_New_Image New_Image_Name=Automated Already_Existing_Image=Rename\n
cat (0xff)/isolinux.cfg
pause pause
chainloader (0xff)/isolinux.bin

title PING 3.02 /pingautomatedfiles/isolinux.cfg.computer3
map --mem (hd0,0)/PING-3.02.iso (0xff)
map --hook
#isolinux.cfg: set file size 2048 bytes according ISO9660 
write --offset=0xC2F6 (0xff) \x00\x08
write --offset=0xC2FC (0xff) \x08\x00
#write options to isolinux.cfg
dd if=(hd0,0)/pingautomatedfiles/isolinux.cfg.computer3 of=(0xff)/isolinux.cfg
cat (0xff)/isolinux.cfg
pause pause
chainloader (0xff)/isolinux.bin


#15 ady

ady

    Frequent Member

  • Advanced user
  • 165 posts

Posted 24 December 2012 - 05:39 PM

@robertcollier4,

I know this topic was started in the grub4dos subforum, but after reading the topic, I don't understand why you are using grub4dos for this particular case. Even if you want (or "have") to boot with grub4dos for whichever reason not mentioned in this topic, having:

1_ flat files (instead of iso images); and,
2_ one or a few syslinux cfg files (with or without syslinux menus); and,
3_ chain-loading from grub4dos to syslinux;

is so simple (in relation to other alternatives presented here) that I wonder what exactly is that I am missing.

Of course, since this is a grub4dos topic, and you already know grub4dos but not syslinux' configurations, and you seem to have solved your main concern, whether there is a simpler solution or not may not be worth additional time and attention.

Regards,
Ady

#16 steve6375

steve6375

    Platinum Member

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

Posted 24 December 2012 - 06:44 PM

maybe

  1. You don't need to modify the iso
  2. Extracting the flat files may overwrite or interfere with other extracted flat-file OS's already on the boot device
  3. If a newer version of PING is released, you can just replace the old iso with the new one

The above is actually a numbered list, but it doesn't seem to display like that!



#17 ady

ady

    Frequent Member

  • Advanced user
  • 165 posts

Posted 24 December 2012 - 07:28 PM

@Steve, I don't think those are real problems for this case. It is simple to use one directory for the current version of PING, which is using the same files (except the cfg file) for every case presented here. There is no need to extract all the files again and again, as the only file that changes is isolinux.cfg, and the UFD should use syslinux.cfg (either one of several cfg files). In fact, the only thing that is required each new time is the minimal append changes for each case (each computer).

 

If the goal of the topic was to reduce the duplication of files, then copying the files directly in the UFD (most of them, just once and "forget" about them) in one directory and chainloading grub4dos to the syslinux is simple. There is no need for new long grub4dos entries just for a grub4dos menu (when syslinux can show the same menu and the cfg files are already there). Grub4dos boots, chains to syslinux and the user chooses the entry.

 

My guess is that between post #11 and #12 some kind of info was lost (or not followed). That's fine. What is simpler for me may not be simpler for someone already knowing grub4dos but not knowing syslinux (the learning curve issue). My point is that extracting the ISO content once and using each respective cfg file (with almost no changes) sounds to me easier than having to play with long new entries from grub4dos.

 

Anyway, this was just a general comment, as the topic seems to be solved.



#18 robertcollier4

robertcollier4

    Member

  • Members
  • 33 posts
  •  
    United States

Posted 24 December 2012 - 07:35 PM

The goal was to have different PING unattended configurations on my grub4dos multiboot menu. Steve's solution in post #6 and #7 would have had been the perfect solution if not for the problem of grub4dos having problems passing long kernel parameter strings.

 

The second (almost perfect) solution was to chainload to isolinux/syslinux - and use a menu system from there as outlined in post #13. This post started because I did not know before that isolinux could present a GUI menu system - because PING did not include the menu.c32 file. I figured out from Wonko's post #4 that I could download and add menu.c32 from kernel.org to produce the desired behavior of having a GUI menu in isolinux.cfg with different APPEND options.

 

Yes - this is solved =) What a great forum operated and run in the spirit of collaboration and oneness. Hopefully anyone else looking to automate PING will probably find these posts helpful to them in the future when searching for related keywords.



#19 robertcollier4

robertcollier4

    Member

  • Members
  • 33 posts
  •  
    United States

Posted 24 December 2012 - 07:44 PM

1_ flat files (instead of iso images); and,

is so simple (in relation to other alternatives presented here) that I wonder what exactly is that I am missing.

 

Flat files was not possible for chainloading from grub4dos to syslinux because I needed portability (need to be able to copy the files between USB drives without having to re-build syslinux.bin). It seems Syslinux.bin requires a particular UFD Partition ID coded into it if not booted from within an ISO.

 

 

My guess is that between post #11 and #12 some kind of info was lost (or not followed).

 

If there is a way to be able to chainload grub4dos to syslinux flat files - and have the flat files be portable between USB Flash Drives, I would still be interested. But otherwise I have reverted to having to keep the isolinux.cfg file(s) within an ISO so I can copy between multiple USB flash drives without having to re-create syslinux.bin via having access to syslinux.exe each time. If I am mistaken and there is a way to chainload grub4dos to syslinux flat files (and maintain portability) please let me know.


Edited by robertcollier4, 24 December 2012 - 07:58 PM.


#20 ady

ady

    Frequent Member

  • Advanced user
  • 165 posts

Posted 24 December 2012 - 08:01 PM

Flat files was not possible for chainloading from grub4dos to syslinux because I needed portability (need to be able to copy the files between USB drives without having to re-build syslinux.bin). It seems Syslinux.bin requires a particular UFD Partition ID coded into it if not booted from within an ISO.

That's the info that I was assuming you somehow got wrong. You can chainload grub4dos to syslinux.bin (or even to syslinux.bss). You don't have to (re)install ldlinux.sys to do this (at least, that's not my experience, but probably Steve could add something about it). And you are using syslinux, not isolinux. My guess is that the installation of syslinux (ldlinux.sys) instead of the chainload from grub4dos to syslinux.bin might be somehow confusing.

Since this is a grub4dos topic and you already have your solution, my intention was only to reduce the impression that it can't be done with syslinux or that it is more difficult; for me, it isn't. The difficulty in this case seems to be the previous knowledge about grub4dos and not about syslinux. And that's a very valid reason.

#21 robertcollier4

robertcollier4

    Member

  • Members
  • 33 posts
  •  
    United States

Posted 24 December 2012 - 08:34 PM

You don't have to (re)install ldlinux.sys to do this (at least, that's not my experience, but probably Steve could add something about it).

 

It seems this is incorrect. The syslinux.bin and ldlinux.sys are both different between USB flash drives as created by syslinux.exe. And reusing them between flash drives gives an error. Steps to reproduce:

 

USB Flash Drive #1 (UFD1)

1. Format as FAT32 - install grub4dos MBR and grldr via RMPrepUSB

2. Copy menu.lst onto UFD1 with following entry:

title PING302-syslinuxchainload
chainloader /syslinux.bin

 

3. Create syslinux.bin and ldlinux.sys on UFD1 with "syslinux.exe -f E: E:\syslinux.bin" (syslinux.exe from RMPrepUSB\Syslinux_4.04 folder)

4. Copy menu.c32 from RMPrepUSB\Syslinux_4.04 folder

5. Create syslinux.cfg with some entries

 

TEST UFD1 - WORKS FINE

 

USB Flash Drive 2 (UFD2):

1. Same as above

2. Same as above

3. Copy syslinux.bin and ldlinux.sys from UFD1

4. Same as above

5. Same as above

 

TEST UFD2 - "Boot error" once I select the entry from grub4dos.

 

Now - if I delete syslinux.bin and ldlinux.sys on UFD2 - and recreate them on UFD2 via "syslinux.exe -f F: F:\syslinux.bin

TEST UFD2 - works now.

 

So it seems that syslinux.bin and ldlinux.sys are USB Flash Drive Specific and cannot be copied between drives. I did a diff between syslinux.bin and ldlinux.sys between UFD1 and UFD2 as created by syslinux.exe - and they are both different. If I try to copy these files between drives - it gives "Boot error".

 

Update: I can actually delete ldinux.sys and it works without the ldinux.sys being there at all. It is syslinux.bin that is being specific and that cannot be mixed and matched between drives. Here is syslinux.bin.UFD1 and syslinux.bin.UFD2. They are different and are specifically coded to each flash drive. If I put them on their correct drives which they were created on - it works. But If I mix and match them - it gives "Boot error".


Edited by robertcollier4, 24 December 2012 - 08:48 PM.


#22 steve6375

steve6375

    Platinum Member

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

Posted 24 December 2012 - 08:42 PM

The syslinux.bin file created by the command

syslinux -f  f: f:\syslinux.bin

is a 512 byte file which contains the Partition Boot Record of the drive specified on the command line plus some syslinux code which loads and runs ldlinux.sys..

So if you have a FAT32 UFD, the syslinux.bin will have those same parameters in the BPB of the bin file.

The syslinux command also puts ldlinux.sys on the target drive and, as far as I am aware, the position of the start of the ldlinux.sys file is hard coded into the syslinux.bin file when it is created.

In my experience, this means if the UFD is re-made, and ldlinux.sys is not in the exact same position as it was before, it won't boot. The string 'ldlinux.sys' is not in the syslinux.bin and as far as I am aware, it does not have any code to search a FAT12/FAT16/FAT32 filesystem for the ldlinux.sys file (not enough space in 512 bytes to do that?)

So in my experience, the syslinux.bin file is not very portable.

I am not very familiar with syslinux and maybe someone will be able to clarify this...

 

P.S. Maybe grub4dos could find the position of ldlinux.sys using the blocklist command, calculate it's position and then write the correct values into syslinux.bin before chainloading it? Then we would have a 'portable' solution?



#23 cdob

cdob

    Gold Member

  • Expert
  • 1469 posts

Posted 25 December 2012 - 09:24 AM

Use default PING ISO file and different isolinux.cfg

New isolinux.cfg location is searched within ISO image:
 
title PING 3.02 /pingautomatedfiles/isolinux.cfg.computer3\ndd config file
set PingISO=/PING-3.02.iso
cat --length=0 %PingISO% > nul || find --set-root --devices=hf %PingISO%
map --mem %PingISO% (0xff)
map --hook
#search ISO9660 Level 1 file name isolinux.cfg within first 64 CD sectors
cat --locate="ISOLINUX.CFG;1" --number=1 (0xff)0+63 > nul
set FileName=%?%
set /a FileSize=%FileName% - 34 + 11 > nul
#isolinux.cfg: set file size 2048 bytes according ISO9660
write --offset=%FileSize% (0xff) \x00\x08\x00\x00\x00\x00\x08\x00
#write options to isolinux.cfg
dd if=()/pingautomatedfiles/isolinux.cfg.computer3 of=(0xff)/isolinux.cfg
#cat (0xff)/isolinux.cfg
#pause pause
chainloader (0xff)/isolinux.bin

title PING 3.02 Backup hda1 to ASK/Automated\nwrite append data to isolinux.cfg
set PingISO=/PING-3.02.iso
cat --length=0 %PingISO% > nul || find --set-root --devices=hf %PingISO%
map --mem %PingISO% (0xff)
map --hook
#map (hd0,0)/PING-3.02.iso (0xff)
map --hook
#isolinux.cfg: set file size 2048 bytes according ISO9660 
#search ISO9660 Level 1 file name isolinux.cfg within first 64 CD sectors
cat --locate="ISOLINUX.CFG;1" --number=1 (0xff)0+63 > nul
set FileName=%?%
set /a FileSize=%FileName% - 34 + 11 > nul
#echo FileName %FileName%  FileSize %FileSize%
#isolinux.cfg: set file size 2048 bytes according ISO9660
write --offset=%FileSize% (0xff) \x00\x08\x00\x00\x00\x00\x08\x00
#write options to isolinux.cfg
write --offset=0x0127 (0xff)/isolinux.cfg quiet AUTO=Y After_Completion=Reboot No_Shell=Y Replace_BIOS=N Compression_Type=gzip Tarball_Preferred=Y Store_MD5=N Minimize_Before_Storing=N Cmd_3="cp /tmp/x.log /mnt/dos/Automated/$(date +%F_%H%M).log" Parts_To_Backup=hda1 Directory=/ Image_To_Restore=Create_New_Image New_Image_Name=Automated Already_Existing_Image=Rename\n
#cat (0xff)/ISOLINUX.CFG
#pause pause
chainloader (0xff)/ISOLINUX.BIN

In adddition:
the config file limitation 2048 bytes can be extended
First 16 CD sectors can be used too, that's 32768 bytes
Aks if need be.
  • steve6375 and robertcollier4 like this

#24 ady

ady

    Frequent Member

  • Advanced user
  • 165 posts

Posted 25 December 2012 - 06:04 PM

I didn't like that it wasn't portable loading from a flat file since syslinux.bin requires custom building per partition ID

The following comments are not specific to PING. I just thought that maybe it could be useful for you in the future, giving that portability need. I apologize in advance, since the main issue is already solved and this is a grub4dos topic.

The syslinux.bin is specific to the drive because it takes specific values. You would be chainloading to syslinux (so to use all its features) with the information specific to that bootsector of that partition on that UFD.

So, if we extend your *portability* need to *flexibility*, here are a couple of ideas. You run the syslinux command once for each UFD (probably without the "-f" parameter in this case, since you don't really want to change the boot sector of the UFDs but only generate syslinux.bin). Once you have each respective syslinux.bin (from a specific syslinux version), you could chainload from your grub4dos menu to syslinux.bin and boot "anything related to syslinux or isolinux", not just PING, whether it is inside an isolinux ISO image(s) or flat files using syslinux.cfg.

So, next time you have another situation like this one with PING (or any syslinux/isolinux config file), you don't have to install anything. Just chainload to the same syslinux.bin and add a new entry to syslinux.cfg corresponding to the new addition (but if you need or want syslinux c32 modules, they should preferably use the same version of syslinux that you used to initially generate syslinux.bin.)

Now, if you would consider the above to be useful for the general usage you give to those UFDs, then I would also consider doing it the other way around. You could actually install the syslinux bootloader to your UFDs so to boot first to syslinux.cfg (before your grub4dos menu.lst). An entry in syslinux.cfg would chainload to grldr so to use the already available grub4dos menu, and you can add an entry in that menu so to go back to syslinux.cfg or to any other syslinux config file. The result would be that you would have even more flexibility.

All this is off-topic here, and it takes some time to set up. Considering that you have already solved the specific case for PING, it may not be worth for you now.

#25 Sha0

Sha0

    WinVBlock Dev

  • Developer
  • 1682 posts
  • Location:reboot.pro Forums
  • Interests:Booting
  •  
    Canada

Posted 29 December 2012 - 04:52 PM

Off-topic: Syslinux variants SYSLINUX and EXTLINUX require installation to a particular disk because they build and use a sector map.  It is not generally possible to simply copy [SYS|EXT]LINUX files from one disk to another and expect them to work.  This is why these kinds of Syslinux have installers.  It's probably possible to build a GRUB4DOS batch file that does some of what a Syslinux installer does, but it'd be a pretty complicated batch file!  I'd only suggest it as an exercise for someone willing to invest a good amount of time, with the possibility of not achieving success. :)






0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users