Update PartedMagic in UBCD511

If you have a tutorial or tip related to the UBCD, why not share it with other users here?

Moderators: Icecube, StopSpazzing

Post Reply
Message
Author
ady
Posts: 832
Joined: Sat May 08, 2010 5:26 am

Update PartedMagic in UBCD511

#1 Post by ady » Thu Feb 16, 2012 6:44 am

[EDIT]

2012JUL27:
I am correcting / updating / improving this tutorial so:
_ to reflect suggestions or corrections from the following posts;
_ to make it easier to read and follow.

A history of the changes made can be read at the end of this post.

[/EDIT]


This procedure will customize UBCD 5.1.1 with an updated version of PartedMagic (for versions of PartedMagic newer than v.6.7.).

This tutorial is simple to follow, and you should finish sooner than you think :).

Alternatively, you can use some multiboot tool to merge the original UBCD511*.ISO with a new updated PartedMagic version.

If you already remastered (edited) this same UBCD511*.ISO image using this same tutorial before, then some of the steps can be skipped now (ie. "One time steps").

In this procedure:
<ubcd511_extracted> : is the folder where UBCD511*.ISO is extracted;
<pmagic_extracted> : is the folder where PMAGIC*.ISO is extracted.

01_ Extract ubcd511*.iso.
02_ Extract pmagic*.iso.

03_ (One time step)
Delete the old folder (if exists)

Code: Select all

<ubcd511_extracted>\pmagic\pmagic\
which also includes the old "bzImage" file and the old "initramfs" (or "init*.*") file.

Note: The old path in the original UBCD 5.1.1 had a "double" "/pmagic" path. We are now deleting the second "/pmagic/" subfolder and its contents, but not the first "/pmagic/" (parent) folder.

04_ Delete the old "pmagic*.sqfs" (either lower case or upper case) file from

Code: Select all

<ubcd511_extracted>\pmagic\pmodules\
05_ Move (Merge) the content from

Code: Select all

<pmagic_extracted>\pmagic\
to

Code: Select all

<ubcd511_extracted>\pmagic\
Note1: To be clear, there is no "double" "/pmagic/" folders anymore. We are moving the content of the "/pmagic/" folder, not the parent folder itself.
Note2: Be sure that you have moved the entire content of the folder, including subfolders and their files (the complete path tree under the parent folder).
Note3: Some new file names of PartedMagic are different from the old ones. For example, the new SQFS file(s) (always) use upper case letters and their new file name "format" is as:

Code: Select all

PMAGIC_<yyyy_MM_dd>.SQFS
where <yyyy_MM_dd> means the release's year, month and date ( without "<" and ">" ), as for example:

Code: Select all

PMAGIC_2011_12_30.SQFS
Note4: The new location for the new "bzImage" file and the new "initrd.img" file in this new customization will be different from the old original location in UBCD 5.1.1.
Note5: Do not edit the new file names(for example, leave the SQFS file with upper case), or PartedMagic may not boot correctly.

06_ Move (Merge) the content from

Code: Select all

<pmagic_extracted>\boot\
to

Code: Select all

<ubcd511_extracted>\pmagic\boot\
Note: Be sure that you have moved the entire content of the folder, including subfolders and their files (the complete path tree under the parent folder).

07_ Open (when using Windows OS, preferably use Wordpad for this step)

Code: Select all

<ubcd511_extracted>\pmagic\boot\syslinux\syslinux.cfg
and replace ("REPLACE ALL") the text (path)

Code: Select all

boot/
with the new text (path)

Code: Select all

pmagic/boot/
and then save and close the file.

Note1: By using the "replace all" function, this entire step only takes a few seconds.

Note2: Be very careful with the above text replacement. If you happen to repeat the same replacement (or a similar one) in the same file, the text to be replaced could still be found (again), hence leaving you with incorrect paths.

08_ (Optional)
For completeness, you may want to move also the script file

Code: Select all

<pmagic_extracted>\mkgriso
to

Code: Select all

<ubcd511_extracted>\pmagic\mkgriso
but this is not strictly necessary.



Partial resume: all the original PMAGIC*.ISO content was just been moved (merged) into the "/pmagic/" subfolder of UBCD. You can now delete the old folder "<pmagic_extracted>" where you extracted the original PMAGIC*.ISO.



09_ (One time step)
In the following files:

Code: Select all

<ubcd511_extracted>\ubcd\menus\syslinux\main.cfg
<ubcd511_extracted>\ubcd\menus\syslinux\hdd\cloning.cfg
<ubcd511_extracted>\ubcd\menus\syslinux\hdd\devmgmt.cfg
<ubcd511_extracted>\ubcd\menus\syslinux\hdd\partmgmt.cfg
<ubcd511_extracted>\ubcd\menus\syslinux\hdd\recovery.cfg
replace the original menu entries for (software included in) PartedMagic :

Code: Select all

CONFIG /pmagic/boot/syslinux/syslinux.cfg
with the new entry

Code: Select all

CONFIG /pmagic/boot/syslinux/syslinux.cfg /pmagic/boot/syslinux/
Note: Yes, the same path as before, but now it is there twice in the same "CONFIG" entry line, and the second time the cfg file is NOT part of the path (ie. folder path, no cfg file).

10_ (Optional)
You can edit the help text entries for (software included in) PartedMagic at

Code: Select all

<ubcd511_extracted>\ubcd\menus\syslinux\main.cfg
<ubcd511_extracted>\ubcd\menus\syslinux\hdd\cloning.cfg
<ubcd511_extracted>\ubcd\menus\syslinux\hdd\devmgmt.cfg
<ubcd511_extracted>\ubcd\menus\syslinux\hdd\partmgmt.cfg
<ubcd511_extracted>\ubcd\menus\syslinux\hdd\recovery.cfg
so to match the new versions you are updating to, either of PartedMagic itself or of the software included in it.

11_ If either step #09 and/or #10 were performed, then SAVE and CLOSE the respective *.cfg file(s).

12_ (One time step)
In the file:

Code: Select all

<ubcd511_extracted>\ubcd\menus\syslinux\cpu.cfg
replace the text ("REPLACE ALL")

Code: Select all

pmagic/pmagic
with a (one only)

Code: Select all

pmagic
instead.


Additional comments:

The syslinux (isolinux) menu was changed in this tutorial. I have not checked whether the alternative grub4dos menu (or anything related to grub4dos in UBCD) needs changes too, as UBCD 5.1.1. no longer supports booting PartedMagic using grub4dos.

Since the path for the "/pmodules/" folder has NOT changed, the scripts to update the antivirus databases should work as usual in regards to such path.

Now you can run the "ubcd2iso" (or "ubcd2usb") script and you should have a customized UBCD with a new updated PartedMagic version (newer than v6.7.).

Please note that the method described here in this tutorial is not the only way to accomplish the update of PartedMagic in your customized UBCD. This tutorial preserves all "pmagic" related files inside one unique folder (as the original UBCD511.ISO does), while simplifies (just by a little bit) the original folder structure (making it just a little bit "more compatible" with some auxiliary multiboot tools).

Since the PartedMagic project is independent and more frequently updated than UBCD, there might be additional corrections, changes and/or improvements in the future.

Please report any problems you find in this tutorial.

_________________________________
[EDIT][TUTORIAL'S CHANGES HISTORY]

2012JUL27:
1_ Step 07_ : Change the "text to be replaced" and the "new text to replace the previous one" so to include other menu entries of PartedMagic (in its "Extras" submenu, for example).
2_ Step 08_ (Optional) : Minor text improvement.
3_ Step 09_ (One time step) : Add additional files on which to perform the same text replacement.
4_ Step 10_ (Optional) : Add additional files on which to perform the same type of changes.
5_ Step 11_ : Re-word in accordance to other changes.
6_ Step 12_ (One time step) : Delete unnecessary file path; and re-word for easier reading.
7_ In the Additional comments: section : Minor text improvements.

[/EDIT][/TUTORIAL'S CHANGES HISTORY]
Last edited by ady on Fri Jul 27, 2012 10:42 am, edited 1 time in total.

Explorer09
Posts: 178
Joined: Fri Jun 17, 2011 11:23 pm

Re: Update PartedMagic in UBCD511

#2 Post by Explorer09 » Thu Jul 26, 2012 5:59 pm

I found a few issues in your tutorial.
1. In "<ubcd511_extracted>\ubcd\menus\syslinux\hdd\cloning.cfg" I cannot find any keyword "pmagic/pmagic".

2. You didn't change the pmagic path in "<ubcd511_extracted>\ubcd\menus\grub4dos\cpu.lst" so some entries there won't work. (File not found error.)

3. There are paths in "<ubcd511_extracted>\pmagic\boot\syslinux\syslinux.cfg" that you didn't replace:

Code: Select all

/boot/plpbt/plpbt.bin (Plop Boot Manager)
/boot/chntpw/vmlinuz /boot/chntpw/initrd.cgz /boot/chntpw/scsi.cgz (Chntpw)
/boot/ipxe/ipxe.krn (IPXE Network boot)
/boot/sgd/sgd.gz (Super Grub Disk)
/boot/sgd/sgd2.gz (Super Grub2 Disk)
/boot/mhdd/mhdd.gz (MHDD)
So the corresponding entries in Parted Magic's "Extras Menu" don't work. File not found error, too.

4. This line:

Code: Select all

CONFIG /pmagic/boot/syslinux/syslinux.cfg
is also found in these files:
<ubcd511_extracted>\ubcd\menus\syslinux\hdd\cloning.cfg(line 61)
<ubcd511_extracted>\ubcd\menus\syslinux\hdd\devmgmt.cfg(line 99)
<ubcd511_extracted>\ubcd\menus\syslinux\hdd\partmgmt.cfg(line 60)
<ubcd511_extracted>\ubcd\menus\syslinux\hdd\recovery.cfg(line 28)
<ubcd511_extracted>\ubcd\menus\syslinux\hdd\recovery.cfg(line 37)
I'm not sure whether they should be replaced or not.

ady
Posts: 832
Joined: Sat May 08, 2010 5:26 am

Re: Update PartedMagic in UBCD511

#3 Post by ady » Fri Jul 27, 2012 11:36 am

Thank you for your feedback.
Explorer09 wrote:1. In "<ubcd511_extracted>\ubcd\menus\syslinux\hdd\cloning.cfg" I cannot find any keyword "pmagic/pmagic".
You are correct; there is none. When I originally wrote the tutorial, I confused the type of edition I actually performed on that file (cloning.cfg, among other files too), which is related to your suggestion #4. I did it correctly in my system, but wrote it incorrectly in the tutorial :oops: (keep reading).
2. You didn't change the pmagic path in "<ubcd511_extracted>\ubcd\menus\grub4dos\cpu.lst" so some entries there won't work. (File not found error.)
As I said in the "Additional comments" section in the original post, I have not included in this tutorial ANY changes to ANYTHING related to grub4dos.

If anyone wants to add clear steps in relation to grub4dos that will "mirror" the tutorial, that's welcome.
3. There are paths in "<ubcd511_extracted>\pmagic\boot\syslinux\syslinux.cfg" that you didn't replace:

Code: Select all

/boot/plpbt/plpbt.bin (Plop Boot Manager)
/boot/chntpw/vmlinuz /boot/chntpw/initrd.cgz /boot/chntpw/scsi.cgz (Chntpw)
/boot/ipxe/ipxe.krn (IPXE Network boot)
/boot/sgd/sgd.gz (Super Grub Disk)
/boot/sgd/sgd2.gz (Super Grub2 Disk)
/boot/mhdd/mhdd.gz (MHDD)
So the corresponding entries in Parted Magic's "Extras Menu" don't work. File not found error, too.
The "Extras" menu in PartedMagic is not _that_ much needed when combined with UBCD, but that doesn't mean it is not useful anyway :wink: . The original type of text replacement I wrote in the tutorial was (just a very little tiny bit) "safer", less vulnerable to inadequate "replace all" functions, but indeed left out the "Extras" menu. I have now changed the tutorial so to include the "Extras" menu entries of PartedMagic (as I should had done already from the beginning).
4. This line:

Code: Select all

CONFIG /pmagic/boot/syslinux/syslinux.cfg
is also found in these files:
<ubcd511_extracted>\ubcd\menus\syslinux\hdd\cloning.cfg(line 61)
<ubcd511_extracted>\ubcd\menus\syslinux\hdd\devmgmt.cfg(line 99)
<ubcd511_extracted>\ubcd\menus\syslinux\hdd\partmgmt.cfg(line 60)
<ubcd511_extracted>\ubcd\menus\syslinux\hdd\recovery.cfg(line 28)
<ubcd511_extracted>\ubcd\menus\syslinux\hdd\recovery.cfg(line 37)
I'm not sure whether they should be replaced or not.
This is part of my unintended confusion I mentioned before. When I wrote the tutorial, these files should had been added, with the intended text edition. But I mistakenly wrote "cloning.cfg" in the wrong step in the tutorial :oops: , and then I couldn't find the rest of the files where I did "the same type of edition". Duh! :mrgreen: (to myself), since it was not that the actual edition I made to "cloning.cfg" nor to the rest of the files :!: .

I have now performed once again the intended and correct actions, as I in fact did them before, and I reviewed the original post / tutorial as I wrote it, clearly seeing the mistake. My apologies and thank you for bringing this to my attention.

I have now corrected the tutorial, and I would have left the old steps with “strike-through” format, but that could potentially add confusion to new readers trying to follow the instructions. Instead, I replaced the relevant text, and added some general "changelog".

If there are more suggestions, corrections, comments, improvements..., they are very welcome.

Explorer09
Posts: 178
Joined: Fri Jun 17, 2011 11:23 pm

Re: Update PartedMagic in UBCD511

#4 Post by Explorer09 » Fri Jul 27, 2012 5:04 pm

ady wrote: The "Extras" menu in PartedMagic is not _that_ much needed when combined with UBCD, but that doesn't mean it is not useful anyway :wink: . The original type of text replacement I wrote in the tutorial was (just a very little tiny bit) "safer", less vulnerable to inadequate "replace all" functions, but indeed left out the "Extras" menu. I have now changed the tutorial so to include the "Extras" menu entries of PartedMagic (as I should had done already from the beginning).
I think it is much safer to replace the text in this way:
  • " /boot" (note the space before the slash) with " /pmagic/boot"
  • "=/boot" (equal before the slash) with "=/pmagic/boot"
  • ",/boot" (comma before the slash) with ",/pmagic/boot"
So that users won't have to worry about getting wrong paths after (second) replacement.

Code: Select all

# Equivalent sed function (ERE)
s#([ =,])/boot#\1/pmagic/boot#g
One more thing. Why you are removing the "double /pmagic" path in this tutorial? As far as I tried, putting "bzImage" and "initrd.img" inside that path works for me.

ady
Posts: 832
Joined: Sat May 08, 2010 5:26 am

Re: Update PartedMagic in UBCD511

#5 Post by ady » Fri Jul 27, 2012 8:33 pm

Thank you for your post. It is appreciated.
Explorer09 wrote:I think it is much safer to replace the text in this way:
  • " /boot" (note the space before the slash) with " /pmagic/boot"
  • "=/boot" (equal before the slash) with "=/pmagic/boot"
  • ",/boot" (comma before the slash) with ",/pmagic/boot"
So that users won't have to worry about getting wrong paths after (second) replacement.
For most of the steps, there are alternatives available. Let me explain the reasons for the particular step you are mentioning here.

Originally, before the changes I made to the tutorial on 2012JUL27, the text to be searched was "boot/syslinux" and it was to be replaced by "pmagic/boot/syslinux". This previous form of change ("replace all") reduced the possibility of mistakenly changing every appearance of the word "boot" into "pmagic/boot", which is not the desired result; but it also left out all the other folder paths inside the "pmagic/boot/" folder except for "pmagic/boot/syslinux/" and therefore making the "Extras" boot menu fail.

Since the paths to be changed are very similar and they include parts of the same folders (only including an upper level parent folder after the change), then almost every text used in the "replace all" function in this tutorial have the same problem: if the same "replace all" function is applied more than once, the path text won't match the real required path tree.

So for most (but not all) possible texts, it doesn't matter which form of text I use, the potential "risk" is the same. The only difference would be in the difficulty for the user to identify such wrong path in case the "replace all" action were to be mistakenly applied more than once. This risk is a known one, but I added the additional comment just in case the resulting cfg fails (specially for newbies), so the user would have at least one tip as to where the problem might reside.

So, since almost any text to be replaced has the same potential risk, I chose the simpler form of text that will cover all the necessary changes. Although your 3 suggested texts here are technically valid, the user would need to apply the "replace all" function 3 times instead of only 1. Moreover, such 3 specific texts contain characters that are more prone to "typos", whereas the text I used in the tutorial is simpler to type without typing errors.

Such potential "typo-like" errors are the same that make your 3 suggested texts less risky to the case I mentioned: applying the "replace all" function more than once. So we would be replacing one potential risk with another. Which one is worse? The "typo" risk; or the "replace all" risk? Does the "typo" risk overcome the need to perform 3 "replace all" functions instead of only 1?

My decision when writing and/or editing the tutorial was that the simplicity of the searched text is more important than the potential risk of applying "replace all" more than once.

Code: Select all

# Equivalent sed function (ERE)
s#([ =,])/boot#\1/pmagic/boot#g
Using Notepad or Wordpad and the "replace all" function (or some equivalent editor, whether under Windows or under Linux) is "simpler" for newbies. If the complete procedure were to be performed many times and with complicated steps, then a full-feature script would be nice and useful.
One more thing. Why you are removing the "double /pmagic" path in this tutorial? As far as I tried, putting "bzImage" and "initrd.img" inside that path works for me.
Having the longer path, "pmagic/pmagic", is not completely wrong. Its pro: less manual changes to the original cfg file (from PartedMagic) when updating it in the customized UBCD.

But having a shorter path, as in only one "pmagic/" directory level (as used in the tutorial) has pros too. The first (yet less critical) advantage is that using shorter paths makes it "more compatible" with ISO9660. I could expand this point of my arguments with more details, if it's really necessary.

The second (and more important) consideration is that using only one "pmagic/" instead of "pmagic/pmagic/" makes it easier to combine UBCD (including the "pmagic" section) into multiboot (either optical or USB) media. With "easier", I mean either manually or by using some additional tool.

For example, building the original UBCD511.ISO into a multiboot USB media by using YUMI should work. Indeed the resulting media boots UBCD. Unfortunately, when going from the UBCD boot menu into its included PartedMagic menu, PartedMagic fails to boot. This is not a fail or a bug caused by UBCD or by PartedMagic, but by YUMI. By using only one "pmagic/", the chained PartedMagic boot menu correctly works in such YUMI-made multiboot USB media.

Having my own manually-made customized UBCD (with many more changes that are not relevant to the goal of this particular tutorial), I also "feel" it "easier" with only one "pmagic/" directory level. The disadvantage is that the original cfg file (from PartedMagic) needs some extra tweaks when updating it in the customized UBCD.

As mentioned before, there are other ways to accomplish the same general goal of updating PartedMagic in a customized UBCD. For example, instead of changing the paths for the "Extra" menu of PartedMagic, the actual folders could had been moved to "/boot/" instead of "/pmagic/boot/". So instead of changing the cfg files, you could move the actual folders into the paths already specified in the respective cfg file(s).

In this tutorial, I decided to respect the criteria of leaving all related files from PartedMagic inside its own directory, as the original UBCD511.ISO does, but I changed the "pmagic/pmagic" path into one "pmagic/", because I see it as an improvement. Other users might disagree with these decisions, and the same final goal can be achieved by several means.

As usual, if there are more suggestions, corrections, comments, improvements..., they are very welcome.

Post Reply