Difference between revisions of "KERNEL CUSTOM BUILD"

From wiki.linuxonlinehelp.eu
Jump to navigation Jump to search
m
m
Line 3: Line 3:
 
Current:
 
Current:
  
1. Make Backup of the System Disk (dd diskdump)
+
1. Make Backup of the System Disk (dd = disk dump)
  
2. Use a copy of the current updated GENERIC Kernel config File !!
+
2. Use a copy of the current updated "GENERIC" Kernel Config File !! (located /usr/src/sys/amd64-or-i386/GENERIC)
  
3. If you want to upgrade to 9.0 use GENERIC-File of FreeBSD 9.0  !!! path /usr/src/sys/i386/conf/GENERIC make a copy named "custom" and edit it to modify)
+
3. If you want to upgrade to 9.0 use GENERIC-File of FreeBSD 9.0  !!! path /usr/src/sys/i386/conf/GENERIC make a copy named "CUSTOM" and edit it to modify
  
 
4. Download the current sources of the Base System wget ftp://ftp.freebsd.org/pub/FreeBSD/releases/i386/9.0-RELEASE/src.txz
 
4. Download the current sources of the Base System wget ftp://ftp.freebsd.org/pub/FreeBSD/releases/i386/9.0-RELEASE/src.txz
Line 20: Line 20:
 
cp  /usr/src/sys/i386/conf/GENERIC  /usr/src/sys/i386/conf/custom
 
cp  /usr/src/sys/i386/conf/GENERIC  /usr/src/sys/i386/conf/custom
 
</pre>
 
</pre>
7. Edit custom and change desciption GENERIC to custom, delete lines of unwanted modules, save and exit custom
+
7. Edit custom and change "Desciption" inside "GENERIC" to "CUSTOM", delete lines of unwanted modules, save and exit CUSTOM file.
 
 
 
8. Rebuild world with:
 
8. Rebuild world with:
 
<pre>
 
<pre>
Line 50: Line 49:
 
<hr>
 
<hr>
  
Old:
+
Old 7.XX:
 
<pre>
 
<pre>
 
- insert Freebsd i386 CD (netinstall)  
 
- insert Freebsd i386 CD (netinstall)  

Revision as of 11:09, 11 May 2017

Major INFO! TAKE ALWAYS the GENERIC FILE of the LAST RELEASE AS Template to copy it to CUSTOM cause much Changes done there!

Current:

1. Make Backup of the System Disk (dd = disk dump)

2. Use a copy of the current updated "GENERIC" Kernel Config File !! (located /usr/src/sys/amd64-or-i386/GENERIC)

3. If you want to upgrade to 9.0 use GENERIC-File of FreeBSD 9.0 !!! path /usr/src/sys/i386/conf/GENERIC make a copy named "CUSTOM" and edit it to modify

4. Download the current sources of the Base System wget ftp://ftp.freebsd.org/pub/FreeBSD/releases/i386/9.0-RELEASE/src.txz

5. Extract it to /usr/src with

tar -C / -xvzf src.txz

6. cp GENERIC to custom

cp  /usr/src/sys/i386/conf/GENERIC  /usr/src/sys/i386/conf/custom

7. Edit custom and change "Desciption" inside "GENERIC" to "CUSTOM", delete lines of unwanted modules, save and exit CUSTOM file. 8. Rebuild world with:

cd /usr/src
make -s buildworld

9. Build Custom Kernel

make -s buildkernel KERNCONF=custom

10. Install Custom Kernel

make -s installkernel

11. Reboot to Single Mode or Remote via SSH disable most uneeded services at /etc/rc.conf with "#", but not SSH !!!

12. Install World

mergemaster -p
make -s installworld
mergemaster -i

13. enable services at /etc/rc.conf remove "#" and Reboot the FreeBSD Server

14. TEST THE SYSTEM + DO SECURITY CHECKS! (sockstat -4 / -6 = open Ports)



Old 7.XX:

- insert Freebsd i386 CD (netinstall) 
- Boot Server from CD 
- select keyboard for your Country 
- select Custom Expert Install at Install Mananger "sysinstall" 
- make a "minimal" setup 
- reboot 
- login as root 
- start $sysinstall 
- select distributions 
- select src 
- select base+tools+sys 
- install sources from ftp.freebsd.org 
exit sysinstall mananger 
- as root go $cd /usr/src/sys/i386/conf 
download "custom" Kernelfile from here 
- copy into custom into /usr/src/sys/i386/conf 
- run as root: 
$/usr/sbin/config custom 
$cd ..compile/custom 
$make cleandepend 
$make depend 
$make 
$make install 
$make clean 

KERNEL-FILE-CONFIG