Chapter 8
Clover Files & Kexts
Now that you have the operating system and Clover on your flash drive, the next steps involve adding and modifying the Clover files so that it can boot properly for your machine. The main parts to focus on will be:
The editing process lets you modify the files before installing macOS. Not only is this done for compatibility testing, but allows for more control as the Clover bootloader provides limited ability to change parameters after the computer has been booted.
- config.plist - This is the primary file that gets loaded when you select the MacOS drive after booting, whether it's the one used to install MacOS or the one used to load the drive with MacOS after it's been installed.
- drivers folder - This folder holds the various drivers used after Clover gets loaded and after you select the MacOS. We won't be modifying and data in any driver, but simply moving driver files around in order to get it working.
- kexts - These are the individual pieces needed to run MacOS that are not part of the original operating system.
The editing process lets you modify the files before installing macOS. Not only is this done for compatibility testing, but allows for more control as the Clover bootloader provides limited ability to change parameters after the computer has been booted.
Downloading and Installing Kexts
The config.plist file and the drivers folder were generated automatically when you installed Clover. The kexts will be downloaded separately. These can be downloaded from the link here:
https://onedrive.live.com/?authkey=%21APjCyRpzoAKp4xs&id=FE4038DA929BFB23%21455036&cid=FE4038DA929BFB23.
Bookmark this page so you can refer to it if and when you need more kexts. Alternatively you can simply perform a Google search for the kext(s) you need and get the latest versions just in case they are not quite updated on the above link. Since we're on the subject of kexts, let's get these out of the way. From here on out, the process for kexts will be the same for both Windows and Mac users. Each kext will come zipped. Windows users will have to right-click the file and unzip it whereas Mac users just double-click the .zip file to unzip it.
The last essential piece for now is the one for networking, as the installation process requires a connection. In the chapter for Buying Advice in the section of Motherboards were listed some of the more popular networking sets used:
This is where the research part helps. No matter what computer or board you're using, go the manufacturer's product page to get the specs and see what type of networking set it uses. If it uses one of the types listed above, you're in luck! Else, you can purchase a USB-to-Ethernet adapter for $20 or less and it should work.
https://onedrive.live.com/?authkey=%21APjCyRpzoAKp4xs&id=FE4038DA929BFB23%21455036&cid=FE4038DA929BFB23.
Bookmark this page so you can refer to it if and when you need more kexts. Alternatively you can simply perform a Google search for the kext(s) you need and get the latest versions just in case they are not quite updated on the above link. Since we're on the subject of kexts, let's get these out of the way. From here on out, the process for kexts will be the same for both Windows and Mac users. Each kext will come zipped. Windows users will have to right-click the file and unzip it whereas Mac users just double-click the .zip file to unzip it.
- VirtualSMC.kext - This is the primary kext needed among all others. Without it, your system will not be able to load the MacOS. At All.
- Lilu.kext - This piece acts like a fix-all for a number of older compatibility issues.
- WhateverGreen.kext - The kext here replaces older graphics kexts for better compatibility including fixes for Intel, Nvidia, and AMD Graphics sets.
- AppleALC.kext - This kext is required for audio output and input for your system. Initially it won't work when you have your Hackintosh booting freely but will be used afterwards.
The last essential piece for now is the one for networking, as the installation process requires a connection. In the chapter for Buying Advice in the section of Motherboards were listed some of the more popular networking sets used:
- AppleIntelE1000 - Works with older Intel LAN chipsets, but be warned that it can crash using newer chipsets
- AtherosE2200Ethernet - this works for most Atheros or Killer networking chipsets
- IntelMausiEthernet - Works with most newer Intel LAN chipsets
- RealtekRTL8111 - Works with most gigabit Realtek LAN chipsets
- RealtekRTL8100 - for 10/100 Gbs Realtek LAN chipsets
This is where the research part helps. No matter what computer or board you're using, go the manufacturer's product page to get the specs and see what type of networking set it uses. If it uses one of the types listed above, you're in luck! Else, you can purchase a USB-to-Ethernet adapter for $20 or less and it should work.
ROADBLOCK! In the section of Buying Advice, I stated that I was able to test a USB-to-Ethernet adapter and get it working. I had testing this again on an Intel Hackintosh for a new installation. However it does not work at that point and only works after macOS has been installed. An alternative to this is to install the hard drive / SSD that macOS will be installed to in a different computer. You'll have to change the SMBIOS to match the specs of the source PC, then create another SMBIOS for the destination PC or the PC the hard drive / SSD will be put into.
PLATFORM NOTE - The flash drive used to boot and install macOS appears differently when created in Windows than it does when created in macOS. When done with Windows it will show as BOOT followed by the EFI folder, and that contains a BOOT folder and CLOVER folder. When done in macOS it will show as the name of the installer ("Install macOS Catalina", for example), the EFI folder, then the BOOT and CLOVER folders. In order to minimize confusion for either platform, the full path will be shown starting from the EFI folder. The folder that the EFI is contained in will vary depending on which platform it was created on.
When you have the basic set of kexts downloaded, go to the folder they are downloaded. For a new window make sure you're at the desktop and press Control + N in Windows or Command + N on Mac, then navigate to the kexts folder in boot drive. It should be EFI --> Clover --> kexts --> Other. In the kexts folder on the boot drive you will see other folders for older versions of macOS such as 10.14, 10.13, 10.12, etc. These can be ignored and deleted. all the kexts will be put into the folder labeled "Other".
Move the windows side by side to make it easier to copy the files from your hard drive to the boot drive. Copy the kexts that you downloaded to your hard drive and move them to This PC (or My Computer) --> BOOT --> EFI --> Clover --> kexts --> Other, similar to the example below.
Move the windows side by side to make it easier to copy the files from your hard drive to the boot drive. Copy the kexts that you downloaded to your hard drive and move them to This PC (or My Computer) --> BOOT --> EFI --> Clover --> kexts --> Other, similar to the example below.
If there are other kexts you want to test, you can go to BOOT --> EFI --> Clover --> kexts and make a separate folder called "unused", "Not used" or similar (the OS won't look for those types of filenames) and keep any extra kexts there to experiment. This way you can move kexts in and out later on.
HELPFUL HINT: When I was setting up the installer for my AMD machine, I ended up using different flsh drives to test because the Catalina full installer didn't work nor did the Catalina Recovery Installer, and I had to then try the versions for Mojave. To save time from having to copy each kext from each of the unzipped kext folders, I copied these to new a folder on my hard drive to make it easier for dragging and dropping the next time. To do the same, follow these steps:
HELPFUL HINT: When I was setting up the installer for my AMD machine, I ended up using different flsh drives to test because the Catalina full installer didn't work nor did the Catalina Recovery Installer, and I had to then try the versions for Mojave. To save time from having to copy each kext from each of the unzipped kext folders, I copied these to new a folder on my hard drive to make it easier for dragging and dropping the next time. To do the same, follow these steps:
- Designate a new folder for kexts and label it "My Kexts" (for example).
- Control + drag each kext from its unzipped folder to the My Kexts folder (or whatever you named it) in order to copy, not move, each kext.
The Drivers Folder
Drivers are essential for a Hackintosh, similar to kexts. They are located in EFI --> CLOVER --> drivers, and this has three subfolders:
- BIOS - for older motherboards
- off - for unused drivers
- UEFI - for newer boards and boards that use UEFI instead of BIOS:
Open up the UEFI folder and you should see a list of drivers. If you created the installer in macOS and selected "Drivers off" when installing Clover, you too should see a list similar to the following:
These are a list of minimal drivers needed to boot. All of these drivers and more are located in the folder EFI --> CLOVER--> drivers --> off. If any of the drivers in the BIOS or UEFI folders (from the drivers folder) are deleted, you can simply copy any missing drivers over from that "off" folder. By default, we need to make adjustments here, and this requires a bit of experimentation.
The files AptioMemoryFix,efi, OsxAptioFixDrv.efi, OsxAptioFix2Drv.efi, and OsxAptioFix3Drv.efi are different drivers that help handle memory differently. What I reccommend is start with the OsxAptioFix3Drv.efi driver. If you can't fully boot with that, remove it from the UEFI or BIOS folder (which ever one you're using based on your board), and copy the OsxAptioFix2Drv.efi file over to the UEFI or BIOS folder you're using. Repeat the process until you're left with AptioMemoryFix,efi file. If you can't boot with that, then a different issue is prevenrting you from fully booting. Two things to note here:
The files AptioMemoryFix,efi, OsxAptioFixDrv.efi, OsxAptioFix2Drv.efi, and OsxAptioFix3Drv.efi are different drivers that help handle memory differently. What I reccommend is start with the OsxAptioFix3Drv.efi driver. If you can't fully boot with that, remove it from the UEFI or BIOS folder (which ever one you're using based on your board), and copy the OsxAptioFix2Drv.efi file over to the UEFI or BIOS folder you're using. Repeat the process until you're left with AptioMemoryFix,efi file. If you can't boot with that, then a different issue is prevenrting you from fully booting. Two things to note here:
- When you boot to Clover, you'll want to go into Options and ensure that "-v" is one of the entries for the boot flags if it's not already set in the config.plist file. What the -v flag does it set the loader to verbose mode, which produces a similar output when booting in Windows Safe Mode. For a while you'll see DOS-like text on a black background. This will indicate what's being loaded and show any errors if they occur, but successful boots can still show errors and bring you to the desktop or installer.
For the rewrite of this book I created a new installer and tried booting with it. When booting in verbose mode, the screen would show what was loading and scroll through very quickly, which is normal behavior. The issue was that instead of freezing it would scroll for a few seconds then immediately reboot. I had tested the four different Memory Fix drivers until OsxAptioFix3Drv was the one that let me progress the rest of the way until I could get to the installation screen. In that instance I was going from the oldest to the newest of Memory Fix drivers, but at least I witnessed what would happen when using one of the older drivers. - When testing the drivers, only one of the four different Memory Fix drivers can be used at a time. So if you attempt to use OsxAptioFix2Drv and OsxAptioFix3Drv at the same time, it will not work. Each of the four different Memory fix drivers can be used with other drivers, just not with another Memory Fix driver.
Despite these directions, it never hurts to do a Google search on your computer or motherboard type to see if it has been attempted before. You may find a result showing that there may be other drivers from the "off" folder in order to get a successful boot. The same research can be applied in the next section regarding Config.plist files.
Config.plist and Editing
The kexts and drivers are individual files you can just move in order to activate or deactivate. The config.plist is a single file that you will later edit in order for the installer to boot correctly. You can use a text editor like Notepad (Windows) or TextEdit (Mac) or a specific program for these files. On the Mac the preferred program is Clover Configurator (https://mackie100projects.altervista.org/download-clover-configurator/), and on the PC and the Mac there's Cloud Clover Editor (cloudclovereditor.altervista.org/cce/index.php) with a similar look and feel of Clover Configurator only with the software running in the cloud.
The config.plist file can be loaded into either type of editor and can be changed using a graphical user interface (GUI) or by editing the file as a text. The Cloud Clover Editor and Clover Configurator let you use both where you can quickly switch back and forth between the graphical interface and text interface. It uses XML-style coding which is similar to HTML, so if you've ever edited a web page the coding will be familiar.
If you've never coded HTML, coding has a start tag and end tag, so anything like this:
<b>I want that specific item.</b>
...will appear as this:
I want that specific item.
The <b> tag stands for bold, so anything between the start tag of <b> and the end tag of </b> gets bolded. The coding there is not case-sensitive, so even <b> and </B> can be used.
The example below is a snippet of a config.plist file:
The config.plist file can be loaded into either type of editor and can be changed using a graphical user interface (GUI) or by editing the file as a text. The Cloud Clover Editor and Clover Configurator let you use both where you can quickly switch back and forth between the graphical interface and text interface. It uses XML-style coding which is similar to HTML, so if you've ever edited a web page the coding will be familiar.
If you've never coded HTML, coding has a start tag and end tag, so anything like this:
<b>I want that specific item.</b>
...will appear as this:
I want that specific item.
The <b> tag stands for bold, so anything between the start tag of <b> and the end tag of </b> gets bolded. The coding there is not case-sensitive, so even <b> and </B> can be used.
The example below is a snippet of a config.plist file:
<key>Boot</key>
<dict>
<key>Arguments</key>
<string>-v npci=0x2000 debug=0x100 keepsyms=1</string>
<key>DefaultLoader</key>
<string>boot.efi</string>
<key>DefaultVolume</key>
<string>LastBootedVolume</string>
<key>Legacy</key>
<string>PBR</string>
<key>NeverHibernate</key>
<true/>
<key>Timeout</key>
<integer>-1</integer>
</dict>
<dict>
<key>Arguments</key>
<string>-v npci=0x2000 debug=0x100 keepsyms=1</string>
<key>DefaultLoader</key>
<string>boot.efi</string>
<key>DefaultVolume</key>
<string>LastBootedVolume</string>
<key>Legacy</key>
<string>PBR</string>
<key>NeverHibernate</key>
<true/>
<key>Timeout</key>
<integer>-1</integer>
</dict>
Notice that the majority of the text have start tags and end tags with <key> and </key>, <string> and </string>, and <dict> and </dict>. The<key> represents the parameter, <string> represents the value, and <dict> represents the dictionary. In the example above, everything between the <dict> and </dict> tags is the dictionary for the <key>Boot</key>.
A similar example, made up for this demonstration, might be your car or truck:
A similar example, made up for this demonstration, might be your car or truck:
<key>Vehicle</key>
<dict>
<key>Color</key>
<string>red</string>
<key>Wheels</key>
<integer>4</integer>
<key>seats</key>
<integer>5</integer>
<key>Brand</key>
<string>Nissan</string>
<key>Model</key>
<string>Altima</string>
<key>IsRunning</key>
<true/>
</dict>
<dict>
<key>Color</key>
<string>red</string>
<key>Wheels</key>
<integer>4</integer>
<key>seats</key>
<integer>5</integer>
<key>Brand</key>
<string>Nissan</string>
<key>Model</key>
<string>Altima</string>
<key>IsRunning</key>
<true/>
</dict>
This is similar to the first example but with a few differences. If the value for the parameter is a number, it has an <integer> tag. There's also what's known as boolean data which is 1 or 0, true or false, yes or no. In XML the tags that follow the key are either <true/> or <false/>. Now if you had the tag <true/> after the parameter <key>Seats</key>, this would tell the program reading the data that the vehicle has seats, just not how many seats.
Cloud Clover Editor (Windows/Mac)
Clover Configurator has more fields and parameters in one window for Mac users whereas Cloud Clover Editor requires you to scroll up and down your browser window. It has a big edge over Clover Configurator in that there are pre-made templates you can download and edit for easier right-off-the-bat compatibility for your machine, if such a configuration exists.
Cloud Clover Editor can be accessed by going to cloudclovereditor.altervista.org/cce/index.php.
Cloud Clover Editor can be accessed by going to cloudclovereditor.altervista.org/cce/index.php.
The CLOVER folder from the EFI folder already has a pre-made config.plist that needs edited. But let's see if an existing plist file exists by clicking in the search field at the upper right hand field. If you are using a consumer laptop or desktop computer you can type the model in, but because of the variety of models out there a config.plist may not exist for your model. The files located in the list are user-contributed files by the users that uploaded them, and because of the work involved that's more in-depth than what the average consumer may know, a lot of the configuration files are for laptops and systems built from the ground up. Still it doesn't hurt to check.
The last laptop I owned was a Dell E5530. When I type it in to the search field in the window, no file appears. But if I limit it to just "Dell" I get a broad range of results:
The last laptop I owned was a Dell E5530. When I type it in to the search field in the window, no file appears. But if I limit it to just "Dell" I get a broad range of results:
When you move the mouse over the file icon or name, the name of the file will be displayed after a second or two.. This is especially helpful as the names in the list of results are truncated:
Try the same yourself using your computer model first (if applicable). If you get no results, type in the CPU model instead, such as i5-6500. If you managed to find an applicable config.plist file you're mostly set! Click on the icon to open it. In this example I clicked on a Dell Vostro file. To download the file to your computer, click on the download icon in the upper left corner:
This will prompt you for a name of the config file, which you can leave as-is for the time being. We'll alter the name later as the name is critical in Clover. If you attempted a search for your model, chip, or board but received no results; you can edit the existing config.plist file.
- To do this from the first page click on the red Open Configuration button, then "Browse...", then go to your flash drive and select EFI --> CLOVER --> config.plist.
- From the existing page similar to the one above, click the File icon to the left of the download button circled above, then "Browse...", then go to your flash drive and select EFI --> CLOVER --> config.plist.
The above example is a config file I already edited but yours may look similar. The left pane consists of links for specific sections in the file. Each section has a different layout from each other but all function the same way. At the upper right of this window you'll also notice four differently-colored tabs. The green tab with the plus symbol is to add an entry to the Patches list. The yellow tab with two file icons is to copy a highlighted entry to another config file. The blue tab with the globe icon is to retrieve one of the patches from a database of existing patches. The red tab with the trash icon is to delete a selected entry from the list.
Look closely on the right and you'll see that the scroll bar is all the way at the top, notifying that there is more information throughout the page. When you scroll down you should see something like the following:
Look closely on the right and you'll see that the scroll bar is all the way at the top, notifying that there is more information throughout the page. When you scroll down you should see something like the following:
While you're in the ACPI section, we can take a look at text mode so you can see how the code is arranged. In the upper left section next to the download button is a sprocket. Click the sprocket to open up the Settings menu:
Here you'll get a pop-up window showing the Settings menu. The third entry down is for the Text Editor Mode. Click "On" for Text Editor Mode and you will be switched from the graphical layout to the text layout:
This layout simply shows the graphical layout but arranged into a text layout so you can see the flow of the code from one section to the next. You can add, change, or remove entries and data from the list when applicable. Note that when you make any change and move to another section in either mode, a status at the upper right will appear showing that changes are saved; a nice touch so that you don't forget to save it. You'll still need to download the temporary file from the cloud and save it to your hard drive, then move it to your flash drive.
ROADBLOCK! If you performed a search for a pre-configured config.plist file in Cloud Clover Editor, more than likely the file did not start with "config" before the ".plist" extension. It is CRITICAL that you ensure all config files start with "config", and any other characters are entered between that and before the ".plist" extension. If the config file or files starts with anything other than "config" they will not be visible for selection or entry when you boot Clover.
The naming convention is important because you can have the initial config.plist file, but make copies with different changes and versions so that the flash drive installer can be used if you have other computers with different CPUs. So while a file downloaded from the Cloud Clover Editor may start with "Dell", you may end up modifying the code to suit your processor, save it as "dell-i7config.plist", then drag and drop it to the bootable flash drive. But when you boot with the flash drive, then go to Options --> Configs, the dell-i7config.plist file will not be visible, only the original config,plist file (if it is in the location it's supposed to reside in) and any other files that start with "config" and end with ".plist". Additionally, there's no way through Clover to access a path to the same folder to manually type in the filename of the config file you want to use.
The naming convention is important because you can have the initial config.plist file, but make copies with different changes and versions so that the flash drive installer can be used if you have other computers with different CPUs. So while a file downloaded from the Cloud Clover Editor may start with "Dell", you may end up modifying the code to suit your processor, save it as "dell-i7config.plist", then drag and drop it to the bootable flash drive. But when you boot with the flash drive, then go to Options --> Configs, the dell-i7config.plist file will not be visible, only the original config,plist file (if it is in the location it's supposed to reside in) and any other files that start with "config" and end with ".plist". Additionally, there's no way through Clover to access a path to the same folder to manually type in the filename of the config file you want to use.
My initial config file that was generated after building the flash drive had a number of comments that could be enabled or removed. Take a look at the screenshot below, a snippet of the default config.plist file from my other Hackintosh:
Code in these XML .plist files that have a # symbol before the name of the key entry denote that the code in that line is a comment and does not get processed. In this example there are entries of PatchAPIC, ResetAddress, ResetValue, SortedOrder, smartUPS, and DropOEM_DSM keys that have the pound sign (#) before them, so these do not get processed. If I were to remove the # symbols and save it; macOS would interpret those lines of code as commands and activate them, which may make or break the ability to get to the desktop. In some cases it may have no effect at all. The default config.plist file generated after installing Clover usually has a lot of these types of comments that can be removed, but not all of them.
Introduction to Editing
In Chapter 2, the first step was to get information about your CPU in regards to the generation and it's name: Haswell, Coffee Lake, Skylake, etc. This is critical for the next step which involves modifying the config.plist file to get it working properly.
A large part that comprises this eBook comes from the Hackintosh Vanilla Desktop Guide. The last part of that guide shows you which parts of the config.plist to edit based on your generation of Intel CPU. There are other guides that do the same regarding generations of compatible AMD CPUs which I will add at a later time. Click the link above to go to the Vanilla Guide, then click the link in the red area that your CPU falls into:
A large part that comprises this eBook comes from the Hackintosh Vanilla Desktop Guide. The last part of that guide shows you which parts of the config.plist to edit based on your generation of Intel CPU. There are other guides that do the same regarding generations of compatible AMD CPUs which I will add at a later time. Click the link above to go to the Vanilla Guide, then click the link in the red area that your CPU falls into:
This time I'm going to use the default config.plist generated when I built a USB installer on my Hackintosh and will display screenshots from that system. It is an i5-6500, which is designated as a Skylake processor. The Vanilla Desktop Guide breaks down the sections of each part of the config.plist code, starting with ACPI with links to each section on the right hand side:
Before editing the original config.plist, it's a good idea to make a copy and work on that. Select the config.plist file, copy it, then go to your Downloads or Documents folder and paste it there. Cloud Configurator Editor will not save any edited .plist file to the bootable flash drive. This is why it's beneficial to save locally to your hard drive, then copy the edited file back over to the flash drive when completed.
HELPFUL HINT: On the boot flash drive you can also rename it from config.plist to config-original.plist to note that it is the original file.
Scroll down and you'll see a graphical representation of what the code looks like when using Clover Configurator:
In the guide itself you can click any photo and it will become enlarged until you click it again. Here I can open up my copy of the config.plist file in one window and keep the Vanilla Guide open in a different window:
My copy of the default config.plist shows multiple entries in the fixes section (left). but the changes to be made for Skylake processors only shows six entries (right).
Config Text Editing - The Slow, Accurate Way
You can copy the needed text from the Vanilla Guide and paste in its appropriate slot, but human error is a factor when you can mistakenly delete or paste over the "<" or ">" characters in the tags. This saves time from having to omit the comments (described in the next section), so I recommend that you read both ways before proceeding.
It's a bit time-consuming to go through the list, delete unneeded entries, then ensure the entries that ARE there match the changes to be made on the right. That provides a great amount of accuracy though. A somewhat faster alternative would be to highlight the code between the <dict> and ></dict> tags for Fixes from the Vanilla Guide and copy it (Command + C / Control + C):
It's a bit time-consuming to go through the list, delete unneeded entries, then ensure the entries that ARE there match the changes to be made on the right. That provides a great amount of accuracy though. A somewhat faster alternative would be to highlight the code between the <dict> and ></dict> tags for Fixes from the Vanilla Guide and copy it (Command + C / Control + C):
...return to the config copy.plist file and highlight all the code between the same tags in the same section:
Then paste the copied data over the existing data:
The last step is to clean up the code for legibility (not required), by pressing the tab key to move the pasted data between the <dict> and </dict> tags. You can repeat this process for the changes instructed for your specific processor family until you get to the RtVariables and SMBIOS section, but some changes require only a checkbox to be checked or unchecked which are faster to accomplish by using the graphical user interface.
As previously mentioned the default .plist file has a lot of codes that are just comments. In the example below, everything between the <dict> and </dict> tags for the DropOEM_DSM key are ignored, as the key itself is commented by having the # symbol in front of the code:
As previously mentioned the default .plist file has a lot of codes that are just comments. In the example below, everything between the <dict> and </dict> tags for the DropOEM_DSM key are ignored, as the key itself is commented by having the # symbol in front of the code:
I can simply delete everything starting from <key>#DropOEM_DSM</key> all the way right before <key>Debug</key> because they are all comments, and the Vanilla Guide for Skylake processors doesn't indicate any code needed in that list for <DropOEM_DST, Rtc8Allowed,and SuspendOverride. Any code that's not mentioned in the Vanilla Guide for your processor can be deleted as well. It may be helpful to add line breaks (by pressing return) between the separate sections of the code (ACPI, Boot, GUI, Kernal and Kext Patches, etc).
Config Text Editing - The Quicker, Dangerous Way
It seems logical to simply copy the entire code between the <dict> tags for each section like APCI, Boot, System parameters, and more. It does make it much faster, but when pasted the alignment looks off. You can quickly find specific pieces of code using the find function, but the same key may exist in various sections and you may end up altering the wrong one. Additionally, I have done this before and saved the config.plist file when completed editing, but then when I went to edit it later in Clover Configurator, the text of the code showed next to nothing as a key was missing and screwed everything up. This is why it's crucial to make multiple versions when editing a config.plist file.
As long as you ensure you're copying the right data, ensuring that the code you're copying is highlighted in the right place, and the highlighted area to be deleted or pasted over is correct; you should be able to copy and paste freely without worry. Just be sure to save multiple versions with each paste so that if something gets screwed up; you can refer to an earlier version, dupe and rename that, then edit the new version and proceed.
As long as you ensure you're copying the right data, ensuring that the code you're copying is highlighted in the right place, and the highlighted area to be deleted or pasted over is correct; you should be able to copy and paste freely without worry. Just be sure to save multiple versions with each paste so that if something gets screwed up; you can refer to an earlier version, dupe and rename that, then edit the new version and proceed.