Jump to content

Clover General discussion


ErmaC
29,866 posts in this topic

Recommended Posts

7 hours ago, arsradu said:

I was also wondering how to order the drivers alphabetically in the installer.

 

34 minutes ago, Matgen84 said:

As on High Sierra, the drivers list includes the mandatory and then the additional drivers. These two groups are affected by the problem indicated on 10.14

 

2 hours ago, fusion71au said:

This happens if you compile Clover on an apfs volume.  Alphabetical order is maintained if compiled on an HFS+ volume (but mandatory drivers show first, then optional drivers in "drivers-Off", in alphabetical order) eg

Guys try r4636:)

  • Like 4
Link to comment
Share on other sites

@Slice,

 

As I reported in the Clover problems thread, and as some others have noticed after trying to install recent Clover revisions in legacy mode, there was a regression introduced in r4541 which causes boot0 to fail to install in the MBR of the target disk.  You won't notice an issue unless you haven't installed boot0 on the disk before with older Clover revisions eg you are installing on a new disk or the disk has Windows MBR.

 

Noticed some typos and found that while dd for macOS fails to write to the disk unless it is unmounted, fdisk is OK.

 

if="${DEST_VOL}/usr/standalone/i386/${diskloader}" of=newMBR bs=1 count=440 conv=notrunc should be

if="${DEST_VOL}/usr/standalone/i386/${diskloader}" of=newMBR bs=440 count=1 conv=notrunc

 

"Writting" should be spelt as "Writing".  Modified code below fixes the problem and I have attached the edited postinstall script...

 

Spoiler

### Stage 0 ###
echo "Stage 0 - Writing ${diskloader} to ${bootdisk}" >> "$install_log"
#echo "$fdisk440 -u -f ${DEST_VOL}/usr/standalone/i386/${diskloader} -y ${bootdisk}" >> "$install_log"
#"$fdisk440" -u -f "${DEST_VOL}/usr/standalone/i386/${diskloader}" -y ${bootdisk}
echo dd if=${bootdisk} count=1 bs=512 of=/tmp/origMBR >> "$install_log"
dd if=${bootdisk} count=1 bs=512 of=/tmp/origMBR
echo cp /tmp/origMBR /tmp/newMBR >> "$install_log"
cp /tmp/origMBR /tmp/newMBR
echo dd if="${DEST_VOL}/usr/standalone/i386/${diskloader}" of=/tmp/newMBR bs=440 count=1 conv=notrunc >> "$install_log"
dd if="${DEST_VOL}/usr/standalone/i386/${diskloader}" of=/tmp/newMBR bs=440 count=1 conv=notrunc
echo fdisk -f /tmp/newMBR -u -y ${bootdisk} >> "$install_log"
fdisk -f /tmp/newMBR -u -y ${bootdisk}
echo "" >> "$install_log"

 

 

postinstall.zip

Clover_v2.4k_r4637_fixedMBR.pkg.zip

Edited by fusion71au
Fixed code to use macOS fdisk to write MBR
  • Like 1
  • Thanks 1
Link to comment
Share on other sites

3 hours ago, fusion71au said:

Script may fail due to timing issues with un-mount, mounting drive

With both dd and fdisk440 you will get "Resource Busy"  and this is what cause the failure.

 

I can propose to use dd only for boot1f32:

/bin/dd if=/dev/rawdisk count=1 bs=512 of=/path/to/origbootsectors
/bin/dd if=/private/tmp/origbootsectors of=/path/to/boot1f32_copy skip=3 seek=3 bs=1 count=87 conv=notrunc
/bin/dd if=/path/to/boot1f32_copy  of=/dev/rawdisk count=1 bs=512

in other all other cases just use boot1-install:

/path/to/boot1-install -y -u -f /path/to/boot1xx /dev/rawdisk

 

where the -u option given used only if the target volume is not "/", otherwise -M. And additional task is to remount the Volume if that doesn't happen.

boot1-install is well aware of what to do and automatically..

 

But for boot0, isn't fdisk (not fdisk440) just enough since we have to write 512 bytes and not 440?

I mean, we can just save to a file from byte at index 440 to byte at index 511 and merge all with our first 440 bytes????. Just an idea so the stock fdisk will be just fine..

Il try that..

 

Edited by vector sigma
from byte at index 440 ;-)
  • Like 1
  • Thanks 1
Link to comment
Share on other sites

20 hours ago, vector sigma said:

But for boot0, isn't fdisk (not fdisk440) just enough since we have to write 512 bytes and not 440?

I mean, we can just save to a file from byte at index 440 to byte at index 511 and merge all with our first 440 bytes????. Just an idea so the stock fdisk will be just fine..

Il try that..

 

Yep, standard fdisk works while target disk still mounted, as long as we pre-process the new MBR as a file - also saw @blackosxpost #10 in old Chameleon thread :)

 

Modified Clover package from my post above now works (tested by replacing MBR on USB disk with Windows MBR, then running Clover installer  ---> boot0af restored to MBR and legacy Clover boots again).

  • Like 1
Link to comment
Share on other sites

@fusion71au, I made really tens and tens of tests installing boot sectors, and I have to admit that using dd is a pain. It worked once but mostly I get 'Resource Busy' even on un-monted devices, also using Terminal. I've rolled back fdisk440 in my working copy but this time is 64 bit only and is linked to 10.6 as minimum.

Please try and let my know, here work like a sharm:

 

Clover_r4637_fdisk440-64bit.pkg

 

P.S. during my tests I've understood also why many peoples claim that the pkg didn't records choices previously selected: the Distribution is set to not allowing external scripts and so java functions cannot be used to read the com.projectosx.clover.installer.plist. The attached pkg is able again.

 

@Slice, are you opposed to using fdisk440 again? Let me know because I'm ready for a commit..

  • Like 1
  • Thanks 1
Link to comment
Share on other sites

I want to exclude fdisk440 because it will not compiled in 10.14 with Xcode10.

Is there any other possibility?

On 8/7/2018 at 1:22 PM, fusion71au said:

 

 

if="${DEST_VOL}/usr/standalone/i386/${diskloader}" of=newMBR bs=1 count=440 conv=notrunc should be

if="${DEST_VOL}/usr/standalone/i386/${diskloader}" of=newMBR bs=440 count=1 conv=notrunc

 

Is this change make the installer working?

1 hour ago, Badruzeus said:

I know. No need to reming me obvious things.

  • Like 1
Link to comment
Share on other sites

42 minutes ago, Slice said:

I want to exclude fdisk440 because it will not compiled in 10.14 with Xcode10.

Compile fine here with all the Xcode I have, Xcode 10 included in 10.14. Just exluded the 32 bit part from the make file:


PROGRAM = fdisk440

SRCROOT := $(abspath $(CURDIR)/..)
SYMROOT := $(abspath $(CURDIR)/../../sym)
OBJROOT := $(SYMROOT)/build/$(PROGRAM)

INSTALL_DIR_NAME := utils
UTILSDIR := $(SYMROOT)/$(INSTALL_DIR_NAME)

DIRS_NEEDED := $(OBJROOT)

include ${SRCROOT}/Make.rules

LDFLAGS := $(LDFALGS) -mmacosx-version-min=10.6

SRCS := $(wildcard *.c)

OBJS =  $(SRCS:.c=.o64)
OBJS := $(addprefix $(OBJROOT)/, $(OBJS))

PROGRAM := $(addprefix $(UTILSDIR)/, $(PROGRAM))

all: $(PROGRAM)

$(PROGRAM): $(DIRS_NEEDED) $(OBJS)
	@mkdir -p $(UTILSDIR)
	@echo "\t[LD64] $(@F)_64"
	@$(CC) $(CFLAGS) $(LDFLAGS) $(DEFINES) -arch x86_64 -o $@_64 $(filter %.o64,$^)
	@echo "\t[LIPO] $@"
	@lipo -create -arch x86_64 $@_64 -output $@
	@strip $@
	@rm $@_64

install-local: $(PROGRAM)
	@sudo install -d -g 0 -o 0 /usr/local/bin /usr/local/man/man8
	@sudo install -psv -g 0 -o 0 $(PROGRAM) /usr/local/bin
	@sudo install -pv  -g 0 -o 0 fdisk440.8 /usr/local/man/man8

clean-local:
	@rm -f $(PROGRAM)
	@rm -rf $(OBJROOT) *~

 

fdisk440.zip

Edited by vector sigma
Link to comment
Share on other sites

1 hour ago, Slice said:

I want to exclude fdisk440 because it will not compiled in 10.14 with Xcode10.

Is there any other possibility?

Is this change make the installer working?

 

The code below works for me and uses the built in macOS fdisk to write boot0 to MBR (no need to compile fdisk440).  Attached postinstall_fixed script...

 

### Stage 0 ###
echo "Stage 0 - Writing ${diskloader} to ${bootdisk}" >> "$install_log"
echo dd if=${bootdisk} count=1 bs=512 of=/tmp/origMBR >> "$install_log"
dd if=${bootdisk} count=1 bs=512 of=/tmp/origMBR
echo cp /tmp/origMBR /tmp/newMBR >> "$install_log"
cp /tmp/origMBR /tmp/newMBR
echo dd if="${DEST_VOL}/usr/standalone/i386/${diskloader}" of=/tmp/newMBR bs=440 count=1 conv=notrunc >> "$install_log"
dd if="${DEST_VOL}/usr/standalone/i386/${diskloader}" of=/tmp/newMBR bs=440 count=1 conv=notrunc
echo fdisk -f /tmp/newMBR -u -y ${bootdisk} >> "$install_log"
fdisk -f /tmp/newMBR -u -y ${bootdisk}
echo "" >> "$install_log"

 

2 hours ago, vector sigma said:

@fusion71au, I made really tens and tens of tests installing boot sectors, and I have to admit that using dd is a pain. It worked once but mostly I get 'Resource Busy' even on un-monted devices, also using Terminal. I've rolled back fdisk440 in my working copy but this time is 64 bit only and is linked to 10.6 as minimum.

Please try and let my know, here work like a sharm:

 

Clover_r4637_fdisk440-64bit.pkg

 

I agree - can't make dd work unless target disk/volume is unmounted, and this also causes timing problems for other parts of the Clover pkg installer.  Both fdisk440 or standard macOS fdisk allows installation to MBR while disk still mounted so I would be happy with either solution :).

postinstall_fixed.zip

  • Like 1
Link to comment
Share on other sites

@fusion71au

Nice to use combination of dd and system fdisk. I think it will be best solution.

 

11 minutes ago, nms said:

Fdisk440 or not fdisk440?

 

There is the bug in "dd" case. All boot blocks must be written to /dev/rdisk*.

Someone can correct this? We use

dd if=${bootdisk}

so there will be calculation before to define {rbootdisk}.

  • Like 2
  • Thanks 1
Link to comment
Share on other sites

@fusion71au can you try then this way?

### Stage 0 ###
echo "Stage 0 - Writing ${diskloader} to ${bootrdisk}" >> "$install_log"
echo dd if=${bootrdisk} count=1 bs=512 of=/tmp/origMBR >> "$install_log"
dd if=${bootrdisk} count=1 bs=512 of=/tmp/origMBR
echo cp /tmp/origMBR /tmp/newMBR >> "$install_log"
cp /tmp/origMBR /tmp/newMBR
echo dd if="${DEST_VOL}/usr/standalone/i386/${diskloader}" of=/tmp/newMBR bs=440 count=1 conv=notrunc >> "$install_log"
dd if="${DEST_VOL}/usr/standalone/i386/${diskloader}" of=/tmp/newMBR bs=440 count=1 conv=notrunc
echo fdisk -f /tmp/newMBR -u -y ${bootrdisk} >> "$install_log"
fdisk -f /tmp/newMBR -u -y ${bootrdisk}
echo "" >> "$install_log"

just to ensure all is good.

 

EDIT
tested my self, working

Edited by vector sigma
  • Thanks 1
Link to comment
Share on other sites

Hi

 

Wonderful embedded theme with commit r4639 :thumbsup_anim: 

 

Can we have a usb icon on vol_clover and vol_external. Please. it would be convenient for the macOS Installer pen drive for example.

 

 

Sorry for my bad english

 

Edited by Matgen84
  • Like 1
Link to comment
Share on other sites

22 minutes ago, Matgen84 said:

Hi

 

Wonderful embedded theme with commit r4639 :thumbsup_anim: 

 

Can we have a usb icon on vol_clover and vol_external. Please. it would be convenient for the macOS Installer pen drive for example.

 

 

Sorry for my bad english

 

Yes I have USB Installer Mojave

screenshot7.thumb.png.a51149aae46fa7a59874f12592a07fb4.png

Link to comment
Share on other sites

38 minutes ago, chris1111 said:

Yes I have USB Installer Mojave

screenshot7.thumb.png.a51149aae46fa7a59874f12592a07fb4.png

 

I don't talk about that. I have vol_external too for USB Installer but without logo on it. Like USB logo for example

vol_external.png

Link to comment
Share on other sites

Hi Clover team   :)

 

As you can see, this topic has became expansive enough (more than 700 pages, 25 posts per page) and to continue posting further would be more counterproductive, IMO.

 

Without dwelling on that (I think you've all understood that no one is so crazy about reading the 700 pages to be up to date, right?), I suggest you to open another topic (v2.0  :P ) and continue to discuss.

  • Like 4
Link to comment
Share on other sites

12 hours ago, vector sigma said:

@fusion71au can you try then this way?

just to ensure all is good.

 

Thanks to @vector sigma and @Slice for recent commits.  Boot0 is now correctly installed in MBR for legacy Clover installation :thumbsup_anim:.

 

Yes, all is good but spelling mistake in log for stage 1 "Writting" should be "Writing" :P.  Install log for r4643...
 

Spoiler

 


Installer version: v2.4k r4643 EFI bootloader
======================================================
/dev/disk0 (internal, physical):
   #:                       TYPE NAME                    SIZE       IDENTIFIER
   0:      GUID_partition_scheme                        *500.1 GB   disk0
   1:                        EFI EFI                     209.7 MB   disk0s1
   2:                  Apple_HFS Macintosh HD            121.0 GB   disk0s2
   3:                 Apple_Boot Recovery HD             650.0 MB   disk0s3
   4:       Microsoft Basic Data WIN10                   334.7 GB   disk0s4
   5:           Windows Recovery                         472.9 MB   disk0s5
   6:           Linux Filesystem                         38.7 GB    disk0s6
   7:                 Linux Swap                         4.3 GB     disk0s7
/dev/disk1 (external, physical):
   #:                       TYPE NAME                    SIZE       IDENTIFIER
   0:      GUID_partition_scheme                        *15.9 GB    disk1
   1:                        EFI EFI                     209.7 MB   disk1s1
   2:                  Apple_HFS Mojave_Installer        15.5 GB    disk1s2
======================================================
Backing up EFI files

Backing up stage2 file /Volumes/Mojave_Installer/EFIROOTDIR/boot  to /Volumes/Mojave_Installer/EFI-Backups/r4630/2018-08-10-09h17/boot
Backing up /Volumes/Mojave_Installer/EFIROOTDIR/EFI folder to /Volumes/Mojave_Installer/EFI-Backups/r4630/2018-08-10-09h17/EFI
No Active Partition

Stage 0 - Writing boot0af to /dev/rdisk1
dd if=/dev/rdisk1 count=1 bs=512 of=/tmp/origMBR
cp /tmp/origMBR /tmp/newMBR
dd if=/Volumes/Mojave_Installer/usr/standalone/i386/boot0af of=/tmp/newMBR bs=440 count=1 conv=notrunc
fdisk -f /tmp/newMBR -u -y /dev/rdisk1

Stage 1 - Writting boot1f32 to /dev/rdisk1s1
dd if=/dev/rdisk1s1 count=1 bs=512 of=/tmp/origbs
boot volume format is FAT32
cp /tmp/boot1f32 /tmp/newbs
dd if=/tmp/origbs of=/tmp/newbs skip=3 seek=3 bs=1 count=87 conv=notrunc
dd if=/tmp/newbs of=/dev/rdisk1s1

Stage 2 - Written boot6 (x64) to /Volumes/ESP/boot

======================================================
=========== Clover EFI Installation Finish ===========
======================================================

 

 

 

 

Clover_v2.4k_r4643.pkg.zip

Edited by fusion71au
  • Like 2
Link to comment
Share on other sites

×
×
  • Create New...