Jump to content

Big Sur 11.3b4 multibooting chainloading tweaks brew migrating apps

1 post in this topic

Recommended Posts

tags: Big Sur 11.3b4 multibooting chainloading tweaks brew migrating apps
Some updated tips and observations concerning Big Sur 11.3 b4 installation to an available APFS HDD container/partition.  Assumes an existing working ESP bootloader.  System file modifications are made in recovery terminal with SIP disabled (csrutil disable and csrutil authenticated-root disable)  Any changes to the system files in recovery console require creating a new shapshot to be retained.


1. Go ahead and make your USB installer with OC 0.6.5 or later, but if you have an existing install of Catalina you can save time by starting the Big Sur installer directly from Catalina, choosing the target partition, and letting the installer copy over the install files rather than waiting on USB to boot and copy. You can then use the USB installer to reboot Big Sur as required to complete the installation.


2. If you are a linux multi-booter and using GRUB2 as your main bootloader, and if you have an existing Catalina install with a working chainloaded Open Core or Clover, suggest you don't disturb/break your existing bootloader by making tweaks for Big Sur.  You can make an additional small 200MB FAT32 partition on your HDD and put your Big Sur bootloader there.  Note that if you choose to use clover you can directly chainload from GRUB2 by adding this entry to your grub.cfg file (where xxxx-xxxx is your Big Sur bootloder partition from lsblk -f or sudo blkid terminal output in Linux):


menuentry "Clover"{
    insmod part_gpt
    search --no-floppy --set=root --fs-uuid xxxx-xxxx
    chainloader /EFI/CLOVER/CLOVERX64.efi  # or whatever path you use


With Open Core version 0.6.4 and earlier chainloading from GRUB2 was relatively simple with grub.cfg menu entry:


menuentry "Open_Core"{
    insmod part_gpt
    search --no-floppy --set=root --fs-uuid xxxx-xxxx
    chainloader /EFI/OC/OpenCore.efi  # or whatever path you use


It now appears that Open Core 0.6.5 and newer have undergone code change that prevents directly chainloading OpenCore.efi from GRUB2.
However, if you want to continue to use GRUB2 as your main ESP bootloader, you can work around this issue by installing Refind 0.13.2 to the same ESP with GRUB2 and chainload to Refind in grub.cfg with the following menu entry (where xxxx:xxxx is your ESP UUID}:


menuentry "refind"{
   insmod part_gpt
   search --no-floppy --set=root --fs-uuid xxxx-xxxx
   chainloader /EFI/refind/refind_x64.efi


You can launch Open Core from the Refind GUI.  Here is a sample refind.conf that will chainload Open Core 0.6.7 (where xxxx is the volume name or UUID name of your Open Core partition):


menuentry "OpenCore" {
    icon /EFI/refind/icons/os_mac.png
    volume xxxx
    loader /EFI/OC/OpenCore.efi
    options "-v"   


You may have to change the Vault configuration in Open Core config.plist from Secure to Optional.


This chainloading is an extra step but it preserves GRUB2 as the main bootloader and facilitates use of newer Open Core versions.


Note that you can install GRUB2, Refind and Open Core all on the ESP or you can install Open Core to a separate partition in order to edit/tweak your Big Sur bootloader settings without breaking an existing working ESP bootloader.  
When editing config.plist files, if you are not comfortable using an XML editor, and you have Catalina installed, you can download ProperTree from github and launch it from Catalina.  For Linux multibooters, you can modify your linux /etc/grub.d/40_custom to include any custom bootloader menu entries you want to keep, and then run update-grub from within Linux.
3. When your install is finished and you are finally at the working desktop, you may want to make a backup. With Catalina this was easily done by using Disk Utility from a bootable USB installer to restore to an APFS formatted backup media.  The Big Sur Disk Utility ASR has repeatedly failed to replicate (bootable) Big Sur and it appears Disk Utility from Catalina 10.15.7 can not perform this task with Big Sur APFS containers. You can, however, use third party freeware other than dd to make a sector by sector clone of the entire Big Sur container onto removable media.  Alternatively, depending on the size of your AFPS container/partition and transfer rate, using dd can take quite a long time to do the backup.


If you clone to USB media and then boot the clone to test the backup on the same computer from which it was made, both the Big Sur USB clone and the Big Sur HDD container installation show up within disk utility, in the USB media area.  The clone will have the same UUIDs.


4. If your Open Core keyboard language is not properly configured the recovery console language may default to Chinese or some other language.  To avoid this make sure your keyboard language is specified in Open Core NVRAM section of the config.plist.
Recovery terminal is available for system file changes.


The mount command within recovery terminal will show volumes.  You can then run: diskutil mountDisk diskXsY (where x is the number of your Big Sur disk and y is the read-only slice from the mount command output).


You can then run: mount -uw /Volumes/thenameofyourBigSurvolume (not Data volume) to make the normally read-only volume writable.


Make any desired system file changes from the console and reseal (where X is your Big Sur volume name shown with mount command):


bless --folder /Volumes/X/System/Library/CoreServices --bootefi --create-snapshot


5.  If you have an existing Catalina installation with brew and numerous brew installed programs such as ntfs-3g, you can directly copy the brew files/programs (usr/local) to the corresponding file system locations within Big Sur and if necessary, manually create the soft links to enable programs.  If you need to write to the system file tree you can do this from the recovery console as previously referenced.


NTFS volumes will normally mount read-only but read-write can be enabled if the installed /sbin/mount_ntfs supports read/write:


From terminal make a mount point of your choice for each ntfs volume.  Example: sudo mkdir ~/ntfs
Unmount the target read-only ntfs volume where x is disk number and y is slice: sudo umount /dev/diskxsy
Mount ntfs volume as read-write: sudo mount -t ntfs -o rw,auto,nobrowse /dev/diskxsy ~/ntfs
Link to desktop: sudo ln -s ~/ntfs ~/Desktop/whatever_name_you_choose
Make sure finder is configured to show mounted volumes on the desktop.


Keep in mind that if you use ntfs-3g with osxfuse to automount ntfs volumes, install version 4.0.5 or later of osxfuse.  You may have to copy the ntfs-3g mount_ntfs binary directly to /sbin using recovery console.  Note that brew's ntfs-3g 2017.3.23_3 has previously failed to mount NTFS volumes with all files and folders visible.  You can use a prior Catalina Version, although it may be necessary to copy mount_ntfs directory to sbin. 


Any changes made in recovery console should be followed by creating a new shapshot: 


bless --folder /Volumes/x/System/Library/CoreServices --bootefi --create-snapshot (where X is your Big Sur volume name shown with mount command.


Here are some post-install terminal tweaks/info for zsh.  If you do not know what they do, don't use them:


defaults write NSGlobalDomain NSDocumentSaveNewDocumentsToCloud -bool false
defaults write com.apple.finder AppleShowAllFiles TRUE
defaults write com.apple.TextEdit RichText -int 0  
defaults write com.apple.finder _FXShowPosixPathInTitle -bool YES
sudo defaults write /.Spotlight-V100/VolumeConfiguration Exclusions -array "/Volumes"
sudo launchctl unload -w /System/Library/LaunchDaemons/com.apple.metadata.mds.plist
defaults write com.apple.desktopservices DSDontWriteUSBStores -bool true
defaults write com.apple.desktopservices DSDontWriteNetworkStores -bool true
sudo mdutil -i off -d /Volumes/whatevervolumename  (Disable Indexing AND Searching of specified Volume)
sudo mdutil -a -i off
top -o CMPRS
top -o MEM


6. If you have an existing Catalina installation with third party programs they may work without modification by copying them directly from Catalina Applications folder to the Big Sur Applications folder AND copying the corresponding entries for those programs from Catalina ~/Library/Application Support to Big Sur ~/Library/Application Support.  Note that ~/Library/Application Support refers to Users/yourusername/Library/Application Support.


7. A suitable Open Core NVRAM csr-active-config value to receive software updates with a supported hardware profile is 67080000.


8. Automator utility can create an apple script or shell script app for Big Sur but it may fail with error message when run from the desktop if absolute paths are not specified within the script.  Test by opening the app in automator and click the step button and see if the app executes with the desired result.  Test by running the command line directly within the zsh terminal.


9.  The attached EFI with OC was modified for Skylake/520/Sunrise Point but you may find that it works for a range of models with similar Intel hardware.  Supply your own Platforminfo.  If you multi-boot with linux you can run lspci -k from terminal in linux to show your pci hardware configuration.  This may be omitted from the post due to upload limitations.


10.  If you desire an Open Core GUI, change the config.plist PickerMode specification from BuiltIn to External and make sure you have the required Resources installed for your version of Open Core.  Set the applicable resolution for Open Core or all icons may not be completely visible.  Change HideAuxiliary to true if you do not want to see recovery.


11.  Removing old/unwanted snapshots.
Boot into recovery mode and disable SIP: csrutil disable/csrutil authenticated-root disable.


Reboot into recovery mode if necessary.


Run the mount command to see your Big Sur partition name and disk/slice.

In terminal type:


diskutil mount /dev/diskXsY  and hit enter (where X and Y are your Big Sur disk and slice)


then type: mount -uw /Volumes/X and hit enter (where X is your Big Sur volume name)


Your Big Sur volume should now be read-write.


Run: bless --folder /Volumes/x/System/Library/CoreServices --bootefi --create-snapshot (and hit enter to generate a new snapshot)


Now you can remove old/unwanted snapshots.


diskutil apfs listSnapshots diskXsY  for a list of snapshots/uuids


delete unwanted snapshots one at a time:


diskutil apfs deleteSnapshot diskXsY -uuid (the snapshot uuid you want to delete)


12.  Change the Big Sur login background.  
Boot into recovery mode with SIP/authenticated-root disabled.  


From prompt run: cd /


cd into the desktop pictures folder (where X represents the name of your Big Sur install volume)


cd /Volumes/X/System/Library/Desktop\ Pictures


The default Big Sur login background in Desktop Pictures is Big Sur Graphic.heic.  You can optionally save this graphic by typing:


mv /Volumes/X/System/Library/Desktop\ Pictures/Big\ Sur\ Graphic.heic  /Volumes/X/System/Library/Desktop\ Pictures/Big\ Sur\ Graphic.heic.orig


Create a symlink to the desired login graphic....using Big Sur.heic as an example:


ln -s /Volumes/X/System/Library/Desktop\ Pictures/Big\ Sur.heic    /Volumes/X/System/Library/Desktop\ Pictures/Big\ Sur\ Graphic.heic


Run: bless --folder /Volumes/x/System/Library/CoreServices --bootefi --create-snapshot



13. Memory and Swap.
Note if you disable swap without enough memory your machine may freeze or slow to a crawl.  The risk/performance tradeoff is up to you.


turn off swap:
sudo launchctl unload -wF /System/Library/LaunchDaemons/com.apple.dynamic_pager.plist


re-enable swap:
sudo launchctl load -wF /System/Library/LaunchDaemons/com.apple.dynamic_pager.plist


delete swap:
sudo rm /private/var/vm/swapfile*


for those who have nvram.plist:

search for swap enabled:
nvram.plist vm_compressor=4


or swap disabled:
nvram.plist vm_compressor=2


view swap status:
sysctl -a vm.compressor_mode


nvram config to enable swap:
sudo nvram boot-args="vm_compressor=4"


disable swap:
sudo nvram boot-args="vm_compressor=2"


14.  Disabling Sleep/Hibernation
check state:
sudo pmset -g | grep hibernatemode


sudo pmset -a hibernatemode 0


remove file to reclaim space:
sudo rm /private/var/vm/sleepimage
in /private/var/vm/ make a dummy:
sudo touch /private/var/vm/sleepimage


prevent write access to it:
sudo chmod 000 /private/var/vm/sleepimage
sudo chflags schg /private/var/vm/sleepimage


15. Manually install kexts to System/Library/Extensions.   
You need to enter recovery mode, open terminal, type at prompt  csrutil status
hit enter

verify response is "disabled"

if not, run at prompt: csrutil disable


type at prompt csrutil authenticated-root status
hit enter

verify response is "disabled"

if not run at prompt: csrutil authenticated-root disable


reboot into recovery mode if required


open terminal, at prompt run: mount
hit enter

verify volumes, disk numbers, slices.


confirm with: diskutil list


at prompt type:
diskutil mountDisk diskXsY  where X is the Big Sur disk number and Y is the Big Sur slice.
hit enter


at prompt type:
mount -uw /Volumes/your Big Sur volume name
hit enter


at prompt type: mount
hit enter

Your Big Sur volume should no longer indicate read-only


at prompt:  cp -r where/ever/your/kext/is/whatever.kext /Volumes/your Big Sur volume name/System/Library/Extensions

hit enter


for each kext:

at prompt: chown -R 0:0 /Volumes/your Big Sur volume name/System/Library/Extensions/target.kext && chmod -R 755  /Volumes/your Big Sur volume name/System/Library/Extensions/target.kext

hit enter


then type at prompt:  touch /Volumes/your Big Sur volume name/System/Library/Extensions/whatever.kext(s)

hit enter


then type at prompt: kmutil install --volume-root /Volumes/your Big Sur volume name  --update-all --force

hit enter, wait for finish


then type at prompt: /Volumes/your Big Sur volume name/usr/sbin/kcditto

hit enter, wait for finish


then type at prompt:

bless --folder /Volumes/your Big Sur volume name/System/Library/CoreServices --bootefi --create-snapshot

hit enter, wait for finish



16. some intel wifi info
Lilu.kext should load first and -lilubetaall in boot arguments in config.plist.


Use either Itlwm.kext with Heliport.app  OR AirportItlwm.kext.  Don't load both Itlwm.kext and AirportItlwm.kext.


Experience has shown that Itlwm.kext version 1.2.0 works well with Catalina and Big Sur when using the Heliport.app.


If you have both Catalina and Big Sur installed and prefer to use AirportItlwm.kext, you can rename one of them (example: Catalina version renamed to AirportItlwm2.kext) and inject them with Open Core by specifying MinKernel and MaxKernel versions in the config.plist to load the appropriate kext based on whether Catalina or Big Sur is booting.




constructive comments and amplifications welcome




Edited by HenryV
improve readability

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...