|
|
(3 intermediate revisions by the same user not shown) |
Line 1: |
Line 1: |
− | '''PRE BUILD ENVIRONMENT IS ASSUMED ALREADY INSTALLED ON THE SYSTEM YOU'RE BUILDING'''
| + | Moved to the official docs, see here: https://docs.fogproject.org/en/latest/reference/compile_fos_kernel.html |
− | NOTE: It is assumed you have root access to the system you're building this on. It also assumes you know your CWD (Current Working Directory).
| |
− | = Build TomElliott Kernel for FOG 0.32 and earlier=
| |
− | The below instructions are to build the TomElliott kernel. There is an extra step involved compared to the normal kernel build as there are firmware's built directly into the kernels now.
| |
− | == Download the Kernel ==
| |
− | As of the time of this writing kernel 3.13 is the latest. You can use previous, or future kernels as well though.
| |
− | <pre>wget https://www.kernel.org/pub/linux/kernel/v3.x/linux-3.13.tar.xz</pre>
| |
− | | |
− | == Uncompress the kernel ==
| |
− | <pre>tar -xf linux-3.13.tar.xz</pre>
| |
− | | |
− | == Go into uncompressed linux kernel directory ==
| |
− | <pre>cd linux-3.13</pre>
| |
− | | |
− | == Get the config file ==
| |
− | <pre>wget https://svn.code.sf.net/p/freeghost/code/trunk/kernel/TomElliott.config.32 -O .config</pre>
| |
− | | |
− | == Download the prerequisite package '''(THE EXTRA STEP IS HERE)''' ==
| |
− | <pre>git clone git://git.kernel.org/pub/scm/linux/kernel/git/firmware/linux-firmware.git</pre>
| |
− | | |
− | == Prepare the build ==
| |
− | <pre>make ARCH=i386 menuconfig</pre>
| |
− | Add any choices, or don't but when you exit, it will ask you to save the config, '''NEEDED'''.
| |
− | | |
− | After you've saved the config.
| |
− | | |
− | == Build the bzImage ==
| |
− | <pre>make ARCH=i386 bzImage</pre>
| |
− | | |
− | This will take a while. Once successful, it will say bzImage created.
| |
− | | |
− | == Copy the built kernel to your FOG Server's kernel directory. ==
| |
− | NOTE: In my example, the FOG Server is the same as my build system.
| |
− | NOTE: Recommend to make a backup of the original /tftpboot/fog/kernel/bzImage before continuing just in case.
| |
− | <pre>cp arch/x86/boot/bzImage /tftpboot/fog/kernel/bzImage</pre>
| |
− | = Build TomElliott Kernel for FOG 0.33b and newer=
| |
− | The below instructions are to build the TomElliott kernel. There is an extra step involved compared to the normal kernel build as there are firmware's built directly into the kernels now.
| |
− | == Download the Kernel ==
| |
− | As of the time of this writing kernel 4.17 is the latest. You can use previous, or future kernels as well though.
| |
− | <pre>wget https://www.kernel.org/pub/linux/kernel/v4.x/linux-4.17.tar.xz</pre>
| |
− | | |
− | == Uncompress the kernel ==
| |
− | <pre>tar -xf linux-4.17.tar.xz</pre>
| |
− | | |
− | == Go into uncompressed linux kernel directory ==
| |
− | <pre>cd linux-4.17</pre>
| |
− | | |
− | == Get the config file ==
| |
− | ===To Build 32 bit Kernel===
| |
− | <pre>wget -O .config https://github.com/FOGProject/fos/raw/master/configs/kernelx86.config</pre>
| |
− | ===To Build 64 bit Kernel===
| |
− | <pre>wget -O .config https://github.com/FOGProject/fos/raw/master/configs/kernelx64.config</pre>
| |
− | == Download the prerequisite package '''(THE EXTRA STEP IS HERE)''' ==
| |
− | <pre>git clone git://git.kernel.org/pub/scm/linux/kernel/git/firmware/linux-firmware.git</pre>
| |
− | | |
− | == Prepare the build ==
| |
− | ===To Build 32 bit Kernel===
| |
− | <pre>make ARCH=i386 oldconfig</pre>
| |
− | ===To Build 64 bit Kernel===
| |
− | '''NOTE: MUST BE ON A 64 BIT OS'''
| |
− | <pre>make oldconfig</pre>
| |
− | | |
− | In case you want to make changes to the config run:
| |
− | <pre>make ARCH=i386 menuconfig</pre>
| |
− | or
| |
− | <pre>make oldconfig</pre>
| |
− | | |
− | Make sure to save when exiting the menuconfig.
| |
− | | |
− | == Build the bzImage ==
| |
− | ===To Build 32 bit Kernel===
| |
− | <pre>make ARCH=i386 bzImage</pre>
| |
− | ===To Build 64 bit Kernel===
| |
− | <pre>make bzImage</pre>
| |
− | | |
− | This will take a while. Once successful, it will say bzImage created.
| |
− | | |
− | == Copy the built kernel to your FOG Server's kernel directory. ==
| |
− | NOTE: In my example, the FOG Server is the same as my build system.
| |
− | NOTE: Recommend to make a backup of the original /var/www/html/fog/service/ipxe/bzImage before continuing just in case.
| |
− | <pre>cp arch/x86/boot/bzImage /var/www/html/fog/service/ipxe/bzImage</pre>
| |
− | or
| |
− | <pre>cp arch/x86/boot/bzImage /var/www/html/fog/service/ipxe/bzImage32</pre>
| |
− | | |
− | = Additional Patches =
| |
− | Edit the files within the linux decompressed folder:
| |
− | == drivers/net/usb/r8152.c ==
| |
− | https://forums.fogproject.org/topic/12465/microsoft-surface-go-usb-c-to-ethernet-adapter-compatibility
| |
− | Search for <pre>REALTEK_USB_DEVICE(VENDOR_ID_REALTEK</pre> and add this line:
| |
− | <pre>
| |
− | {REALTEK_USB_DEVICE(VENDOR_ID_MICROSOFT, 0x0927)}
| |
− | </pre>
| |
− | | |
− | == drivers/scsi/storvsc_drv.c ==
| |
− | This is an important patch to help prevent from major performance issues in HyperV: https://forums.fogproject.org/topic/6695/performance-decrease-using-hyper-v-win10-clients
| |
− | | |
− | Search for <pre>blk_queue_virt_boundary</pre>
| |
− | | |
− | Delete the line and add:
| |
− | <pre>
| |
− | if (PAGE_SIZE - 1 < 4096) {
| |
− | blk_queue_virt_boundary(sdevice->request_queue, 4096);
| |
− | } else {
| |
− | blk_queue_virt_boundary(sdevice->request_queue, PAGE_SIZE - 1);
| |
− | }
| |
− | </pre>
| |