Hopefully, this post could potentially become some kind of tutorial.
The current Syslinux boot entry in UBCD52b2 for PMagic is:
Code: Select all
CONFIG /pmagic/boot/syslinux/syslinux.cfg /pmagic/boot/syslinux/
I am suggesting here several (but simple) changes, so to make the (current and future) update of pmagic in UBCD easier and consistent.
Note: I hope Victor will accept these suggestions. If that turns out to be the case, the following "one-time-only" steps would be already done in the next release and they could be skipped from the following procedure.
Before I get into it, I want to make an important point. The following procedure is expressed in a generic way, so to try to cover (some) potential developments or changes that are not currently present in PMagic. That means that the following steps could be expressed in a _seemingly_ simpler way, by referencing specific words or codes as they are _currently_ expressed in PMagic. Instead, I decided to generalize the following steps, so not to be restrictive to what PMagic presents in current versions and thus covering at least part of potential future versions / variations / changes / developments in PMagic.
0_ For the purpose of this procedure, the structure of UBCD will be located at "
ubcd_extracted
". Download a new updated version of PMagic and extract it to some directory; let's call it "
pmagic_extracted
".
1_ (One-time-only step) In
ubcd_extracted/ubcd/menus/syslinux/main.cfg
change the aforementioned boot entry from: "
CONFIG /pmagic/boot/syslinux/syslinux.cfg /pmagic/boot/syslinux/
" to:
Code: Select all
CONFIG /pmagic/boot/syslinux/syslinux.cfg /pmagic/
2_ If present, delete the following unnecessary (and/or duplicated, and/or older, and/or incompatible) files from UBCD:
Code: Select all
ubcd_extracted/pmagic/boot/syslinux/*.c32
ubcd_extracted/pmagic/boot/syslinux/*.bin
ubcd_extracted/pmagic/boot/syslinux/iso*.*
ubcd_extracted/pmagic/boot/syslinux/iso*
ubcd_extracted/pmagic/boot/syslinux/memdisk
ubcd_extracted/pmagic/pmodules/PMAGIC*.SQFS
3_
Copy (or directly move, if you are confident about what you are doing) and
overwrite files from "
pmagic_extracted
" into "
ubcd_extracted/pmagic/
" as follows:
3.1_ The
content of "
pmagic_extracted/pmagic/
" (including subdirectories) into "
ubcd_extracted/pmagic/
".
3.2_
Almost all the content of "
pmagic_extracted/boot/
" (including subdirectories) into "
ubcd_extracted/pmagic/boot/
"; with the
exception of the following files:
Code: Select all
pmagic_extracted/boot/syslinux/*.c32
pmagic_extracted/boot/syslinux/*.bin
pmagic_extracted/boot/syslinux/iso*.*
pmagic_extracted/boot/syslinux/iso*
pmagic_extracted/boot/syslinux/memdisk
In some cases, it might be easier to first copy all the content of "
pmagic_extracted/boot/
" (including subdirectories) into "
ubcd_extracted/pmagic/boot/
" at once, and then delete the unnecessary files (the above exceptions) from "
ubcd_extracted/pmagic/boot/syslinux/
".
In some cases, it might be easier to _first_ delete the unnecessary files (the aforementioned exceptions) from "
pmagic_extracted/pmagic/boot/syslinux/
", and then copy all the remaining content of "
pmagic_extracted/boot/
" (including subdirectories) into "
ubcd_extracted/pmagic/boot/
" at once. I personally find this 3rd alternative method to be easier.
4_ Open the new "
ubcd_extracted/pmagic/boot/*.cfg
" file(s) in some simple text editor (Notepad could be used, but other text editors are better suited to deal with Unix-like newlines).
5_ In each of the new "
ubcd_extracted/pmagic/boot/*.cfg
" file(s), we need to apply the "Replace all" function several times, as follows (in this precise order; and the specific order is indeed important):
5.1_
Optionally, from
Code: Select all
" initrd=/pmagic/initrd.img " (without the quotation marks)
to
Code: Select all
" iso_filename=/path/to/ubcdNN.iso initrd=/pmagic/initrd.img " (without the quotation marks)
where "
iso_filename=/path/to/ubcdNN.iso
" in the official UBCD 5.2 release would be "
iso_filename=ubcd52.iso
"; and for user's customization the "
iso_filename=/path/to/ubcdNN.iso
" path and file name shall be adapted to the user's needs.
Please note that the initial and ending space characters in both codes MUST be used in that last code replacement.
5.2_ From "
/boot/
" (without the quotation marks) to "
boot/
" (without the quotation marks). This step effectively deletes the first slash "/" character. Note that this "Replace all" might
temporarily mess up some code that was already adequate for our needs. The unwanted result will be corrected in next steps. The reason to use such a generic replacement code is to support potential future changes in pmagic.
5.3_ From
Code: Select all
" boot/syslinux/memdisk" (without the quotation marks)
to
Code: Select all
" /boot/syslinux/memdisk" (without the quotation marks)
Note the
initial (but no ending) space character in both codes.
5.4_ This code replacement involves several c32 Syslinux modules, and there are several alternative ways to achieve it (by using "Regular Expressions", for example).
Replace all
from "
boot/syslinux/*.c32
" to
"
/boot/syslinux/*.c32
" (adds the first slash "/" character).
Note the initial (but no ending) space character in both codes.
Examples:
change from
Code: Select all
" boot/syslinux/menu.c32" (without the quotation marks)
to
Code: Select all
" /boot/syslinux/menu.c32" (without the quotation marks)
and from
Code: Select all
" boot/syslinux/reboot.c32" (without the quotation marks)
to
Code: Select all
" /boot/syslinux/reboot.c32" (without the quotation marks)
Note that there might be other c32 Syslinux modules mentioned in pmagic's *.cfg file(s) (like "linux.c32" for example), that may be using different paths (or no path at all) than the one used in that code replacement, so they are not (and shall not be) included in this specific step, as expected.
5.5_ From
Code: Select all
"COM32 linux.c32" (without the quotation marks)
to
Code: Select all
"COM32 /boot/syslinux/linux.c32" (without the quotation marks)
If necessary, this step could be coded in a more generic way, so to match some additional potential c32 Syslinux modules. For example, the ones mentioned in the previous step would be
"COM32 menu.c32"
and
"COM32 reboot.c32"
.
5.6_ From "
/pmagic/
" (without the quotation marks) to "
" (without the quotation marks). The new replacement (or second) code is empty, with no character at all, so the first code is deleted from the cfg file(s). Note that there shall NOT exist any space character in these codes, at all. Also note that the initial and ending slash "/" characters are required in the (first) code to be replaced (or, in this case, in the code to be deleted).
6_ Now save the opened *.cfg files. The new "
ubcd_extracted
" structure can be used either on a USB drive or to build a new UBCD ISO image. The "
pmagic_extracted
" directory is not required anymore.
The above steps of this procedure are "generic enough" to be used with future versions of PMagic. If someone can "translate" the above manual procedure into scripts (using the same techniques and auxiliary tools as the current UBCD scripts), it could be useful too.