ncmprhnsbl wrote: ↑02 Apr 2024, 07:03
original installer.com:
Oh, wow!
So fanthom's original work actually had none of these issues --
nor even issue #1 from the Original Thread Post.
He's actually using
df similar to how I suggested (in fact, his tail was a good idea, but my
-P is what
guarantees POSIX output format):
Code: Select all
PRT=`df -h . | tail -n1 | cut -d" " -f1`
Someone changed that to the broken cut-slash method that caused the bug:
Code: Select all
PRT=/dev/`echo $PWD | cut -d/ -f3`
Also the "$PRT" tests were originally "$PRTN" by him, which makes much more sense. (Someone changed them and broke it.) He also didn't have the meaningless $DEV test there.
However, someone (maybe same person) upgraded to using
lsblk..pkname, which was a great
improvement over his sed'ing to get DEV.
So I guess these versions should be merged, if only a little.
ncmprhnsbl wrote: ↑02 Apr 2024, 07:03
GPT-BIOS support sounds like something others might find useful and ...
OK, I'll aim to make a post eventually, when I'm comfortable with it.
For Linux it's straightforward. sfdisk, instead of setting the Active flag, must set the Legacy BIOS Bootable attribute that the syslinux gptmbr.bin (instead of mbr.bin) scans for, and that's basically it (besides testing the table type).
For Windows, I don't have a Win32 devel environment, so I had to hex-patch syslinux.exe swapping its embedded mbr.bin with gptmbr.bin and re-checksum. (Explained
here.)
Then remove the -a (set Active) flag from inside Porteus-installer-for-Windows-GPT.exe.
But it seemed unwise to try to script diskpart in Batch to set the Legacy BIOS Bootable attribute, esp. since the WMIC command-line utility to get disk#/part# is
deprecated as of Windows 10, Microsoft pushing everyone to PowerShell to access WMI.
So the user would have to set the attribute manually (in diskpart), which Microsoft
pretends doesn't exist, but it does work if you add 15 zeros:
So not very user-friendly.
[edit: snipped.. some incorrect info]