Author Topic: Csm2Uefi migration tool (updated)  (Read 6023 times)

Rich Walsh

  • Sr. Member
  • ****
  • Posts: 339
  • Karma: +23/-0
  • ONU! (OS/2 is NOT Unix!)
    • View Profile
Csm2Uefi migration tool (updated)
« on: September 05, 2023, 02:05:04 am »
Several users have found they can migrate from 5.0.8 CSM to 5.1.0 UEFI simply by booting the installer/upgrader in UEFI mode. While this works, it isn't really supported and fails to copy in several files (e.g. the new boot logo). Similarly, switching an existing 5.1.x CSM install to UEFI isn't supported either. To fix this, I wrote csm2uefi.exe (attached).

To use it, you start with an existing 5.1.x installation (CSM or UEFI), mount the 5.1.x ISO (doubleclick on the file) or your 5.1.x DVD, then run:
  csm2uefi <isoDrive:> <5.1bootDrive:>  [e.g. csm2uefi F: C:]

It will copy in any missing files, then update 2 video-related ines in 'config.sys' to make it ready to boot in UEFI mode (the original is saved as 'config.csm' if you need to revert). If you're doing a 5.0.x to 5.1.0 upgrade, I'd suggest doing it in CSM mode so you can confirm the upgrade went as planned. Once you're confident everything works, then do the CSM->UEFI migration.

Important
* this does not create or setup an EFI System Partition - use the options on MiniLVM's 'System' menu when booted under UEFI to do so.
* the ISO and the installed system must be the exact same version of AOS - this method can't be used to boot other versions of OS/2 under UEFI (there's a different method available but that's another post...)

Update
* v2 - fixed a bug in v1 that caused a failure when calling 'CUBE'; v2 supports both 'cube.cmd' and 'cube.exe'
« Last Edit: September 05, 2023, 08:51:51 pm by Rich Walsh »

Jochen Schäfer

  • Sr. Member
  • ****
  • Posts: 344
  • Karma: +29/-0
    • View Profile
Re: Csm2Uefi migration tool
« Reply #1 on: September 05, 2023, 10:34:10 am »
Thanks Rich.

I have put the exe on the installer usb stick, and installed 5.1 as CSM boot.
If I try your tool, I always get "Can't determine the source version", although the referenced iso is exactly the iso from the installer stick.

Rich Walsh

  • Sr. Member
  • ****
  • Posts: 339
  • Karma: +23/-0
  • ONU! (OS/2 is NOT Unix!)
    • View Profile
Re: Csm2Uefi migration tool
« Reply #2 on: September 05, 2023, 11:55:18 am »
I have put the exe on the installer usb stick, and installed 5.1 as CSM boot.
If I try your tool, I always get "Can't determine the source version", although the referenced iso is exactly the iso from the installer stick.

The source is not the ISO file, it's the drive created when you mount the ISO. When booted from the installed system, doubleclick on the ISO, select a drive letter, then use that drive letter as the source. If booted from the installer, the ISO is already mounted, usually as drive R:, so that's the letter you'd use. (If I've misunderstood the problem, please correct me so we can get this going for you.)

Jochen Schäfer

  • Sr. Member
  • ****
  • Posts: 344
  • Karma: +29/-0
    • View Profile
Re: Csm2Uefi migration tool
« Reply #3 on: September 05, 2023, 02:17:40 pm »
Yeah, my bad, Should have had a closer look :-(
Now, it copied some files, and then I got an error message (cf. attachment).

Rich Walsh

  • Sr. Member
  • ****
  • Posts: 339
  • Karma: +23/-0
  • ONU! (OS/2 is NOT Unix!)
    • View Profile
Re: Csm2Uefi migration tool
« Reply #4 on: September 05, 2023, 08:50:53 pm »
Now, it copied some files, and then I got an error message (cf. attachment).

My apologies. There are 2 versions of 'cube', an EXE and a CMD. 'csm2uefi-v1' only supported the CMD version (which few people have). v2 supports the more common EXE version as well; it also fixes the missing '\' when copying 'config.sys'. Run the new version to finish the job (you can run it any number of times).

Jochen Schäfer

  • Sr. Member
  • ****
  • Posts: 344
  • Karma: +29/-0
    • View Profile
Re: Csm2Uefi migration tool (updated)
« Reply #5 on: September 06, 2023, 01:20:47 pm »

Rich Walsh

  • Sr. Member
  • ****
  • Posts: 339
  • Karma: +23/-0
  • ONU! (OS/2 is NOT Unix!)
    • View Profile
Re: Csm2Uefi migration tool (updated)
« Reply #6 on: September 06, 2023, 10:45:39 pm »
Pardon my ignorance: Is Cube this file https://hobbes.nmsu.edu/?detail=%2Fpub%2Fos2%2Futil%2Fstartup%2FCUBE_3-30.zip?

Yes and no... CUBE is a REXX script for modifying text files like config.sys. It has been updated many times, most recently by me. It is used extensively by the AOS installer, and apparently by RPM scripts because BWW has converted it to an .exe and put a copy in \usr\bin. I'd consider this exe and the cube.cmd it's based on to be the "official" release. It's version is 3.0.

The package on hobbes appears to be a fork based on an outdated version. The package's author has updated it in various ways and greatly expanded its scope. Until you mentioned it, I wasn't aware it existed so I can't comment on its reliability. Until that's established, I wouldn't put that version on the PATH before the "official" versions.

For your reference, I've attached the "official" version containing 'cube.cmd' and its documentation.

Jochen Schäfer

  • Sr. Member
  • ****
  • Posts: 344
  • Karma: +29/-0
    • View Profile
Re: Csm2Uefi migration tool (updated)
« Reply #7 on: September 07, 2023, 09:21:15 am »
Hi Rich.

I really don't much with Rexx, so I didn't know it comes with ArcaOS.
I tried the new version again, and it finished the job.
Good Job.


Bye Jochen
« Last Edit: October 15, 2023, 06:34:03 am by Jochen Schäfer »

Martin Iturbide

  • OS2World NewsMaster
  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4757
  • Karma: +41/-1
  • Your Friend Wil Declares...
    • View Profile
    • Martin's Personal Blog
Re: Csm2Uefi migration tool (updated)
« Reply #8 on: October 13, 2023, 12:52:01 am »
Hi Rich.

Can I upload your tool to Hobbes? I created this little readme for it based in your post.

Regards
« Last Edit: October 15, 2023, 01:19:23 am by Martin Iturbide »
Martin Iturbide
OS2World NewsMaster
... just share the dream.