Jump to content
3205 posts in this topic

Recommended Posts

@sherlocks and other EmuVariable script testers:

 

Ok! I recoded the script once again and added a bit more status checking etc. Note: i finally had a failures similar to sherlocks - which helps in debugging.

And now I expect version will fix the failures to mount and find an ESP with Clover.

 

general aspects:

runs ok with Standard CloverDaemon or with LogoutHook

 

flow:

looks for all ESP partitions with CLOVER

it will re-use an existing already mounted ESP vs doing an unmount/mount

if the ESP is not mounted, first determine the fs type - versus using a trial and error approach to mount the ESP

finally if there are mounted ESPs with CLOVER, then remove any old /nvram.plist from the OS root.

and then write nvram.plist to all mounted ESP locations that have CLOVER

Note: attempts to gracefully unmount the ESP after use - but will not force an unmount.

 

attached is v1.10 80.save_nvram_plist.local.  please test and report.

 

 

nvram_v1.10.zip

  • Like 1

@sherlocks and other EmuVariable script testers:

 

Ok! I recoded the script once again and added a bit more status checking etc. Note: i finally had a failures similar to sherlocks - which helps in debugging.

And now I expect version will fix the failures to mount and find an ESP with Clover.

 

general aspects:

runs ok with Standard CloverDaemon or with LogoutHook

 

flow:

looks for all ESP partitions with CLOVER

it will re-use an existing already mounted ESP vs doing an unmount/mount

if the ESP is not mounted, first determine the fs type - versus using a trial and error approach to mount the ESP

finally if there are mounted ESPs with CLOVER, then remove any old /nvram.plist from the OS root.

and then write nvram.plist to all mounted ESP locations that have CLOVER

Note: attempts to gracefully unmount the ESP after use - but will not force an unmount.

 

attached is v1.10 80.save_nvram_plist.local. please test and report.

You did check failure case. Nice!!!. I will check your script and report.

 

Thank you so much

 

나의 LG-F410S 의 Tapatalk에서 보냄

@sherlocks and other EmuVariable script testers:

 

Ok! I recoded the script once again and added a bit more status checking etc. Note: i finally had a failures similar to sherlocks - which helps in debugging.

And now I expect version will fix the failures to mount and find an ESP with Clover.

 

general aspects:

runs ok with Standard CloverDaemon or with LogoutHook

 

flow:

looks for all ESP partitions with CLOVER

it will re-use an existing already mounted ESP vs doing an unmount/mount

if the ESP is not mounted, first determine the fs type - versus using a trial and error approach to mount the ESP

finally if there are mounted ESPs with CLOVER, then remove any old /nvram.plist from the OS root.

and then write nvram.plist to all mounted ESP locations that have CLOVER

Note: attempts to gracefully unmount the ESP after use - but will not force an unmount.

 

attached is v1.10 80.save_nvram_plist.local.  please test and report.

 

 

Last login: Mon Feb  6 01:56:15 on console

Supreme-MBP:~ supreme$ sudo cat /Library/Logs/CloverEFI/rc.shutdown.log

Password:

-------------------------------

DATE: 2017-02-06 TIME: 01:55:40

-------------------------------

>> Begin Script: /private/etc/rc.shutdown.d/80.save_nvram_plist.local

Found ESP on disk0s1 with directory /Volumes/ESP-01/EFI/CLOVER

Saved current values to /Volumes/ESP-01/nvram.plist

>> End Script: /private/etc/rc.shutdown.d/80.save_nvram_plist.local

 

umount(/Volumes/ESP-01): Resource busy -- try 'diskutil unmount'

Supreme-MBP:~ supreme$ sudo /etc/rc.shutdown.d/80.save_nvram_plist.local

Found ESP on disk0s1 with directory /Volumes/ESP-01/EFI/CLOVER

Saved current values to /Volumes/ESP-01/nvram.plist

Supreme-MBP:~ supreme$ umount(/Volumes/ESP-01): Resource busy -- try 'diskutil unmount'

Supreme-MBP:~ supreme$ sudo cat /Library/Logs/CloverEFI/rc.shutdown.log

-------------------------------

DATE: 2017-02-06 TIME: 01:55:40

-------------------------------

>> Begin Script: /private/etc/rc.shutdown.d/80.save_nvram_plist.local

Found ESP on disk0s1 with directory /Volumes/ESP-01/EFI/CLOVER

Saved current values to /Volumes/ESP-01/nvram.plist

>> End Script: /private/etc/rc.shutdown.d/80.save_nvram_plist.local

 

umount(/Volumes/ESP-01): Resource busy -- try 'diskutil unmount'

Supreme-MBP:~ supreme$ 

 

my ESP always shown "Resource busy -- try 'diskutil unmount" now

 

 

     #

      # dump NVRAM to target path now
      #
      _dmpNVRAM "${gESPList}"
      umount    "${gESPList}" 2>&1 > /dev/null &

 

if comment umount, i don't see "Resource busy -- try 'diskutil unmount". 

i wonder that we always have to unmount?

 

add.

if manual terminal command, 

 

Supreme-MBP:~ supreme$ sudo /etc/rc.shutdown.d/80.save_nvram_plist.local

Found ESP on disk0s1 with directory /Volumes/ESP-01/EFI/CLOVER

Saved current values to /Volumes/ESP-01/nvram.plist

Supreme-MBP:~ supreme$ umount(/Volumes/ESP-01): Resource busy -- try 'diskutil unmount'

 

 

 

stop line above. please check

Before report, my laptop smbios is no problem about model idefication.

 

thank you for hard work.

 

here is report

if DellSMBIOSPatch is no

attachicon.gif스크린샷 2017-02-05 오후 9.45.38.png

 

if DellSMBIOSPatch is yes

attachicon.gif스크린샷 2017-02-05 오후 9.47.13.png

 

Maybe all clover users use DellSMBIOSPatch yes if clover include this patch.

 

After test, now, returned clover r3998 with my fix.

 

Thank you

Hey @Sherlock, you are good, man!

 

Thanks for this important feedback that makes me realize I have to improve/fix some bugs in my code, here's the new source code

Clover 2.zip

 

Here's the compiled version

CLOVERX64.efi.zip

 

In new CLOVERX64.efi:

On your computer: no matter you check Dell SMBIOS Patch or uncheck Dell SMBIOS Patch, your Model Identifier should always be: MacBookPro13,3

 

The only difference is: Boot.log: Remap smbios table type 1 vs. Use origin smbios table type 1.

 

There's at least 6 possible cases I've tested on my XPS 13 9350(Iris 540):

  • No DellSMBIOSPatch key in config.plist, unchecked Dell SMBIOS Patch in binaries patching: truncate Model Identifier (as expected)
  • No DellSMBIOSPatch key in config.plist, checked Dell SMBIOS Patch in binaries patching: correct Model Identifier (as expected)
  • DellSMBIOSPatch = Trueunchecked Dell SMBIOS Patch in binaries patching: truncate Model Identifier (as expected)
  • DellSMBIOSPatch = Truechecked Dell SMBIOS Patch in binaries patching: correct Model Identifier (as expected)
  • DellSMBIOSPatch = False,  unchecked Dell SMBIOS Patch in binaries patching: truncate Model Identifier (as expected)
  • DellSMBIOSPatch = Falsechecked Dell SMBIOS Patch in binaries patching: correct Model Identifier (as expected)

 

No more corrupt selection now. 

 

Cheers,

syscl

i think i understand what is happening. if you have an ESP mounted as a login user, when you shutdown, the logout process will start to unmount these filesystems. i will re-examine this some more!!!

 

You did check failure case. Nice!!!. I will check your script and report.

 

Thank you so much

 

나의 LG-F410S 의 Tapatalk에서 보냄

 

 

my ESP always shown "Resource busy -- try 'diskutil unmount" now

 

 

if comment umount, i don't see "Resource busy -- try 'diskutil unmount". 

i wonder that we always have to unmount?

 

add.

if manual terminal command, 

 

stop line above. please check

@Sherlock, I have a question: why your EFI is always Resource busy? You mount your EFI when laptop startup? Normal case: this resource busy should not happen unless you operate on it.

 

Try to see which process read/write on your EFI.

 

syscl

  • Like 1

Hey @Sherlock, you are good, man!

 

Thanks for this important feedback that makes me realize I have to improve/fix some bugs in my code, here's the new source code

attachicon.gifClover 2.zip

 

Here's the compiled version

attachicon.gifCLOVERX64.efi.zip

 

In new CLOVERX64.efi:

On your computer: no matter you check Dell SMBIOS Patch or uncheck Dell SMBIOS Patch, your Model Identifier should always be: MacBookPro13,3

 

The only difference is: Boot.log: Remap smbios table type 1 vs. Use origin smbios table type 1.

 

There's at least 6 possible cases I've tested on my XPS 13 9350(Iris 540):

  • No DellSMBIOSPatch key in config.plist, unchecked Dell SMBIOS Patch in binaries patching: truncate Model Identifier (as expected)
  • No DellSMBIOSPatch key in config.plist, checked Dell SMBIOS Patch in binaries patching: correct Model Identifier (as expected)
  • DellSMBIOSPatch = Trueunchecked Dell SMBIOS Patch in binaries patching: truncate Model Identifier (as expected)
  • DellSMBIOSPatch = Truechecked Dell SMBIOS Patch in binaries patching: correct Model Identifier (as expected)
  • DellSMBIOSPatch = False,  unchecked Dell SMBIOS Patch in binaries patching: truncate Model Identifier (as expected)
  • DellSMBIOSPatch = Falsechecked Dell SMBIOS Patch in binaries patching: correct Model Identifier (as expected)

 

No more corrupt selection now. 

 

Cheers,

syscl

 

@Sherlock, I have a question: why your EFI is always Resource busy? You mount your EFI when laptop startup? Normal case: this resource busy should not happen unless you operate on it.

 

Try to see which process read/write on your EFI.

 

syscl

 

i will test and report.

 

Q.why your EFI is always Resource busy? You mount your EFI when laptop startup? Normal case: this resource busy should not happen unless you operate on it.

A.I am an ordinary user. i don't touch anything features. just boot, use itune, internet, etc. just to test clover bootloader, mount and put file in EFI. 

if you have not turned off indexing for the ESP, meaning there is a .Spotlight-V100, then after writing nvram.plist, mdutil will lock it up for a short time. 

 

look like i need to recoding to deal with logout doing unmounting of ESPs - the logout will unmount filesystems

So then it may be unmounted after we see it with a CLOVER before BUT before we write nvram.plist.

if you have not turned off indexing for the ESP, meaning there is a .Spotlight-V100, then after writing nvram.plist, mdutil will lock it up for a short time. 

 

look like i need to recoding to deal with logout doing unmounting of ESPs - the logout will unmount filesystems

So then it may be unmounted after we see it with a CLOVER before BUT before we write nvram.plist.

 

i will test and report.

 

Q.why your EFI is always Resource busy? You mount your EFI when laptop startup? Normal case: this resource busy should not happen unless you operate on it.

A.I am an ordinary user. i don't touch anything features. just boot, use itune, internet, etc. just to test clover bootloader, mount and put file in EFI. 

Thanks for clarification, but why Spotlight indexing on ESP? I don't see there's .Spotlight-V100 in my ESP partition. 

 

There's another improvement can be considered to add:

 

If we mount ESP failed with information like: disk damage, then we can try to fsck the 'corrupted' ESP, then remount it. If we still fail to mount after fsck, then we dump NVRAM to root(/).

 

Wish this could help,

syscl

  • Like 1

Thanks for clarification, but why Spotlight indexing on ESP? I don't see there's .Spotlight-V100 in my ESP partition. 

 

There's another improvement can be considered to add:

 

If we mount ESP failed with information like: disk damage, then we can try to fsck the 'corrupted' ESP, then remount it. If we still fail to mount after fsck, then we dump NVRAM to root(/).

 

Wish this could help,

syscl

 

Fixed SMBIOS Model Identifier  :)

 

DellSMBIOSPatch no

post-980913-0-69308500-1486316294_thumb.png

 

Model Identifier : no problem

 

DellSMBIOSPatch yes

post-980913-0-87026400-1486316345_thumb.png

 

Model Identifier : no problem

 

nice! thank you for hard work.

  • Like 2

you can check spotlight status with mdutil -s /Volumes/EFI when EFI is mounted if it's not mounted it will return invalid path. to stop indexing it you can use mdutil -i off /Volumes/EFI when it is mounted. indexing EFI has corrupted EFI in the past for me on older OS's

  • Like 1

@Sherlock

 

What's your result after executing mdutil -s /Volumes/EFI?

 

syscl

 

here

 

Supreme-MBP:~ supreme$ mdutil -s /Volumes/EFI

/Volumes/EFI:

Indexing enabled. 

Supreme-MBP:~ supreme$ 

 

i have a question. 

Should we manually turn off indexing, but when we switch to a new storage device?

Earlier rc scripts did not include this manual process.

Of course, there are a couple of things to consider when creating an nvram file with an ESP partition

Weird

syscls-MacBook:~ syscl$ ls /Volumes/EFI/
EFI		nvram.plist
syscls-MacBook:~ syscl$ mdutil -s /Volumes/EFI
/Volumes/EFI:
	Indexing enabled. 
syscls-MacBook:~ syscl$ 

But, I don't have resource busy and .Spotlight-V100.

 

syscl

 

i don't use other apps for ESP. my system is very clean. That is why I reported this situation when I failed.

when just use terminal for check script with no mount ESP, it's happen

 

Supreme-MBP:~ supreme$ sudo /etc/rc.shutdown.d/80.save_nvram_plist.local

Password:

Found ESP on disk0s1 with directory /Volumes/EFI/EFI/CLOVER

Saved current values to /Volumes/EFI/nvram.plist

Supreme-MBP:~ supreme$ umount(/Volumes/EFI): Resource busy -- try 'diskutil unmount'

I use diskutil mount to mount my ESP.

 

I've written a script call mnt to mount ESP everytime I want. I don't use any other tools to mount my ESP.

 

mnt_and_umnt.zip

 

I just place it in /usr/sbin, then in terminal I can type mnt, then choose EFI to mount

post-950366-0-81754100-1486317650_thumb.png

 

syscl

 

so are you using clover NVRAM option to mount?

 

i didn't touch any clover option. i like default. just install clover pkg.

post-980913-0-06845600-1486317785_thumb.png

 

add. syscl's mount script

 

Supreme-MBP:~ supreme$ mnt

/dev/disk0 (internal, physical):

   #:                       TYPE NAME                    SIZE       IDENTIFIER

   0:      GUID_partition_scheme                        *256.1 GB   disk0

   1:                        EFI EFI                     209.7 MB   disk0s1

   2:       Microsoft Basic Data Windows 7               110.0 GB   disk0s2

   3:       Microsoft Basic Data Win Data                60.1 GB    disk0s3

   4:                  Apple_HFS Macintosh SSD           69.1 GB    disk0s4

   5:                 Apple_Boot Recovery HD             650.0 MB   disk0s5

   6:                  Apple_HFS Mac Data                16.0 GB    disk0s6

 

Enter EFI's IDENTIFIER, e.g. disk0s1: disk0s1

Volume EFI on disk0s1 mounted

Supreme-MBP:~ supreme$ ls /Volumes/EFI/

EFI nvram.plist

Supreme-MBP:~ supreme$ mdutil -s /Volumes/EFI

/Volumes/EFI:

Indexing enabled. 

Supreme-MBP:~ supreme$ ls /Volumes/EFI/

EFI nvram.plist

Supreme-MBP:~ supreme$ 

i didn't touch any clover option. i like default. just install clover pkg.

attachicon.gifScreen Shot 2017-02-06 at 3.09.59 AM.png

 

add. syscl's mount script

We have same result.

 

After mounting disk0s1, how about now try to type in:

unmount /Volumes/EFI

What result you get?

 

syscl

We have same result.

 

After mounting disk0s1, how about now try to type in:

unmount /Volumes/EFI

What result you get?

 

syscl

 

 

Supreme-MBP:~ supreme$ mnt

/dev/disk0 (internal, physical):

   #:                       TYPE NAME                    SIZE       IDENTIFIER

   0:      GUID_partition_scheme                        *256.1 GB   disk0

   1:                        EFI EFI                     209.7 MB   disk0s1

   2:       Microsoft Basic Data Windows 7               110.0 GB   disk0s2

   3:       Microsoft Basic Data Win Data                60.1 GB    disk0s3

   4:                  Apple_HFS Macintosh SSD           69.1 GB    disk0s4

   5:                 Apple_Boot Recovery HD             650.0 MB   disk0s5

   6:                  Apple_HFS Mac Data                16.0 GB    disk0s6

 

Enter EFI's IDENTIFIER, e.g. disk0s1: disk0s1

Volume EFI on disk0s1 mounted

Supreme-MBP:~ supreme$ ls /Volumes/EFI/

EFI nvram.plist

Supreme-MBP:~ supreme$ mdutil -s /Volumes/EFI

/Volumes/EFI:

Indexing enabled. 

Supreme-MBP:~ supreme$ ls /Volumes/EFI/

EFI nvram.plist

Supreme-MBP:~ supreme$ unmount /Volumes/EFI

-bash: unmount: command not found

Supreme-MBP:~ supreme$ unmnt

-bash: unmnt: command not found

Supreme-MBP:~ supreme$ umnt

/dev/disk0 (internal, physical):

   #:                       TYPE NAME                    SIZE       IDENTIFIER

   0:      GUID_partition_scheme                        *256.1 GB   disk0

   1:                        EFI EFI                     209.7 MB   disk0s1

   2:       Microsoft Basic Data Windows 7               110.0 GB   disk0s2

   3:       Microsoft Basic Data Win Data                60.1 GB    disk0s3

   4:                  Apple_HFS Macintosh SSD           69.1 GB    disk0s4

   5:                 Apple_Boot Recovery HD             650.0 MB   disk0s5

   6:                  Apple_HFS Mac Data                16.0 GB    disk0s6

 

Enter EFI's IDENTIFIER to unmount, e.g. disk0s1: disk0s1

 

Volume EFI on disk0s1 unmounted

Supreme-MBP:~ supreme$ 

Supreme-MBP:~ supreme$ 

syscls-MacBook:freqv syscl$ umount /Volumes/EFI
umount: /Volumes/EFI: not currently mounted
syscls-MacBook:freqv syscl$ mnt
/dev/disk0 (internal):
   #:                       TYPE NAME                    SIZE       IDENTIFIER
   0:      GUID_partition_scheme                         1.0 TB     disk0
   1:                        EFI EFI                     209.7 MB   disk0s1
   2:         Microsoft Reserved                         134.2 MB   disk0s2
   3:       Microsoft Basic Data OS                      276.6 GB   disk0s3
   4:                  Apple_HFS Macintosh HD            746.6 GB   disk0s4
   5:                 Apple_Boot Recovery HD             650.0 MB   disk0s5

Enter EFI's IDENTIFIER, e.g. disk0s1: disk0s1
Volume EFI on disk0s1 mounted
syscls-MacBook:freqv syscl$ umount /Volumes/EFI
umount: unmount(/Volumes/EFI): Operation not permitted
syscls-MacBook:freqv syscl$ sudo umount /Volumes/EFI
Password:
umount(/Volumes/EFI): Resource busy -- try 'diskutil unmount'
syscls-MacBook:freqv syscl$ 

Oh, I got resource busy now as well...

 

syscl

do yo have show hidden files on? i can see hidden .spotlight folder on mine but in terminal i get only

 

Elites-MBP:~ elite$ mdutil -s /Volumes/EFI

/Volumes/EFI:

Indexing disabled.

Elites-MBP:~ elite$ ls /volumes/EFI

 

EFI EFIx nvram.plist

Thank you, indeed there's .Spotlight-V100

syscls-MacBook:freqv syscl$ ls -a /Volumes/EFI/
.		.Spotlight-V100	.Trashes	EFI
..		.TemporaryItems	.fseventsd	nvram.plist

@Sherlock, please use ls -a instead to list all file including hidden files.

 

syscl

do yo have show hidden files on? i can see hidden .spotlight folder on mine but in terminal i get only

 

Elites-MBP:~ elite$ mdutil -s /Volumes/EFI

/Volumes/EFI:

Indexing disabled.

Elites-MBP:~ elite$ ls /volumes/EFI

 

EFI EFIx nvram.plist

 

 

Thank you, indeed there's .Spotlight-V100

syscls-MacBook:freqv syscl$ ls -a /Volumes/EFI/
.		.Spotlight-V100	.Trashes	EFI
..		.TemporaryItems	.fseventsd	nvram.plist

@Sherlock, please use ls -a instead to list all file including hidden files.

 

syscl

 

here

 

Supreme-MBP:~ supreme$ mnt

/dev/disk0 (internal, physical):

   #:                       TYPE NAME                    SIZE       IDENTIFIER

   0:      GUID_partition_scheme                        *256.1 GB   disk0

   1:                        EFI EFI                     209.7 MB   disk0s1

   2:       Microsoft Basic Data Windows 7               110.0 GB   disk0s2

   3:       Microsoft Basic Data Win Data                60.1 GB    disk0s3

   4:                  Apple_HFS Macintosh SSD           69.1 GB    disk0s4

   5:                 Apple_Boot Recovery HD             650.0 MB   disk0s5

   6:                  Apple_HFS Mac Data                16.0 GB    disk0s6

 

Enter EFI's IDENTIFIER, e.g. disk0s1: disk0s1

Volume EFI on disk0s1 mounted

Supreme-MBP:~ supreme$ ls -a /Volumes/EFI/

. .Spotlight-V100 .Trashes EFI

.. .TemporaryItems .fseventsd nvram.plist

Supreme-MBP:~ supreme$ 

×
×
  • Create New...