Note: I received this from ady via PM and thinks it is suitable for discussion on the forum for future reference.

Quote:

I think I found a potential problem with ubcd2usb.cmd. I usually don't use it, but lately I have seen a couple of reports about booting UBCD, so I took a look at the script.

The script should install the SYSLINUX bootloader in

/boot/syslinux/ldlinux.sys

, but when the directory doesn’t yet exist, then the result depends on the version of SYSLINUX (the behavior has changed over the time / releases, and it is inconsistent between installers under different OS).

Additionally, the script copies the files only after the installation of the SYSLINUX bootloader, and only if that installation succeeds. And here we have 2 potential issues:1_ when the bootloader is installed to the root (because the

/boot/syslinux/

directory doesn't yet exist), the procedure is considered successful anyway, not a failure; and,2_ a file is then copied to

/boot/syslinux/ldlinux.sys

as part of the procedure that copies files to the USB drive.

So, depending on the initial state of the drive, and depending on the Syslinux version, the resulting USB drive *might* fail to boot UBCD.

Currently, one reason to execute the installation of the bootloader before copying the rest of the files is that the former is faster than the latter; so if it fails then the user doesn't have to wait for all the files to be copied just to find out that something has failed.

So to cover these cases, one possible solution could be to perform the installation of the bootloader twice, one before the copy of the files, and one after it.

The alternative is to swap the order, copy the files first, and if that succeeds, only then install the bootloader.

I thought about that possibility before, but it doesn't solve the second potential problem I mentioned: a file is then copied to

/boot/syslinux/ldlinux.sys

during the "xcopy" procedure. This *could* be a problem.

The UBCD ISO images include this

/boot/syslinux/ldlinux.sys

file, and it is copied during the "copying files" phase of the script.

Although this file is not strictly necessary in the ISO image, it can be helpful in some cases, so I am not recommending removing it from the UBCD ISO images. Moreover, the ubcd2usb script can be executed from a different media such as a removable drive (not just from extracting the original content of the ISO image or from an optical media). This means that the script should still consider the possibility that

<ubcd_extracted>/boot/syslinux/ldlinux.sys

would be copied over to the USB media, even if official UBCD ISO images wouldn't include it (and, to be clear, I am still in favor of including this file in the ISO image).

Now, executing the SYSLINUX installer before copying the rest of the files also improves the chances for the ldlinux.sys file to be located in a relatively low LBA, which potentially helps when booting buggy BIOS. So this is the second reason to execute the SYSLINUX installer before copying the rest of the files.

If the SYSLINUX installer is executed *again* after the files are copied (which is one of my proposals posted above), I am unsure whether this file would still occupy a low LBA (or as low as when the first time it was installed).

OTOH, if the SYSLINUX installer is only executed once, after the files are copied, we miss (lose) the two aforementioned advantages that we currently have.

So, a more-complete solution would be to:1_ As you suggested, add a step for the creation of the directory before executing the SYSLINUX installer; then,2_ Add code to the "xcopy" command so to copy all files *except*

<ubcd_extracted/boot/syslinux/ldlinux.sys>

.

I currently don't remember if there are such xcopy arguments available without over-complicating the current script. If such xcopy argument exists (I'll have to take a look), and if adding it doesn't imply making a “mess” of the xcopy section of the script, I think this would be the best solution.

BTW, some time ago someone posted in this UBCD forum a suggested new alternative ubcd2usb.cmd script. The potential problems I am describing here are also relevant to that other script too.

I can understand the addition of "[BOOT]" to exclude.lst (artifact from 7za extraction), but how about "boot.images"?

"[BOOT]" is to "7zip", what "boot.images" is to "IZArc".

If you take a look at the ubcd2iso scripts, you added (years ago) "boot.images" (to the tasks performed on "[BOOT]") so to support performing the extraction by means of IZArc (as alternative to 7zip).

I am just suggesting the same equivalent support for both, 7zip and IZArc, in the new ubcd2usb's exclude.lst too.

The background reason to support alternatives to 7zip is because there are certain cases where 7zip is "too strict" with certain "non-standard" archives (or images), so it fails to complete the extraction. Alternatives such as IZArc can help in those situations (among others).

On another matter (still regarding ubcd2iso), is there any interest (as in *real* need) on adding a Linux-based ubcd2usb.sh script too?

Who is online

Users browsing this forum: No registered users and 2 guests

You cannot post new topics in this forumYou cannot reply to topics in this forumYou cannot edit your posts in this forumYou cannot delete your posts in this forumYou cannot post attachments in this forum