Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #! /bin/sh
- # Build_Kernel Ver. .0000000001
- # Never run in /usr/src. Adjust <whatever-kernel>.
- #Dependency Check...probably needs to be package adjusted since I wrote this 6 years ago...:)
- sudo apt-get install -y --force-yes build-essential bin86 kernel-package libqt3-headers libqt3-mt-dev wget libncurses5 libncurses5-dev
- #Wget the kernel
- wget https://www.kernel.org/pub/linux/kernel/v4.x/new_kernel
- #Untar the kernel0
- tar -xJf whatever_kernel.xz
- #Symbolic link the kernel directory
- ln -s /some/path linux
- #Apply any patches here. Repeat a Wget for the patch itself but they offer fully patched kernels now.
- #wget http://www.kernel.org/pub/linux/kernel//v2.6/snapshots/patch-2.6.37-git17.bz2
- #Apply patch
- #sudo bunzip2 patch-2.6.37-git17.bz2
- #sudo cp pat linux
- #sudo cp patch-2.6.37-git17 linux
- cd linux
- #Copy the previously used config for re-use in the new kernel.
- sudo cp /boot/config-??? .config
- #Apply any patches here. 'patch -p1 < <whatever-patch>'
- #sudo patch -p1 < patch-2.6.37-git17
- #sudo patch -p1 < xfs2.patch
- #Make the Menu. Adjust options -> Save.
- sudo make xconfig
- #Make it clean
- sudo make-kpkg clean
- #sleep 180
- #sleep 60
- #Build the new kernel.Adjust Concurrency to the CPU cores +1. Install if the build completed successfully.
- #Add a break here if the build didn't complete successfully or add '&& sudo dpkg -i *.deb' after the step below. We can just move out of the directory if the stage is successful.
- #Move files from /include/generated to /include/linux
- #sudo cp /usr/src/linux/incldue/generated/* /usr/src/linux/include/linux
- #Only builds image not headers which you will have to add if you need it. kernel_headers btw**
- sudo CONCURRENCY_LEVEL="NR_CPUS Plus one" make-kpkg --initrd kernel_image modules_image && cd ..
- #Back out of the linux directory
- #cd ..
- #Install the image and headers
- sudo dpkg -i linux*.deb
- #Remove the Kernel Directory and downloaded bz2s.
- #sleep 30
- ##sudo rm -rf /usr/src/linux-3.6.7 && sudo rm /usr/src/linux
- #Symbolic Link the *new* headers directory to /lib/modules/<whatever-kernel>/build & source
- #First remove bad links if there are any.
- #Move .deb
- #sudo mv linux*.deb /some/path
- #Only need ed if you instal headers
- #sudo rm /lib/modules/3.13.6/build && sudo rm /lib/modules/3.13.6/source
- #Now synbolic link the new header directory to build and source. Forget what this does!!
- #sudo ln -s /media/ubu/Stuff/stuff/linux /lib/modules/3.13.6/build && sudo ln -s /media/ubu/Stuff/stuff/linux /lib/modules/3.13.6/source
- #sudo ln -s /usr/src/linux-headers-3.1.0-rc10 /lib/modules/3.1.0-rc10/build && sudo ln -s /usr/src/linux-headers-3.1.0-rc10 /lib/modules/3.1.0-rc10/source
- #Reinstall any video,etc drivers after reboot or add a stage for envyng or something like that yourself.;)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement