Differences
This shows you the differences between two versions of the page.
| Both sides previous revision Previous revision Next revision | Previous revision | ||
| mohammedfarrag:kernelsizereduction [2010/07/30 18:24] – MohammedFarrag | mohammedfarrag:kernelsizereduction [2022/08/15 06:53] (current) – renamed from MohammedFarrag/FreeBSD 8.0 Kernel Size Reduction KubilayKocak | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| ====== FreeBSD 8.0 Kernel Size Reduction ====== | ====== FreeBSD 8.0 Kernel Size Reduction ====== | ||
| + | |||
| This document aims to customize the kernel for reducing its size and use additional files to cause the reduction. | This document aims to customize the kernel for reducing its size and use additional files to cause the reduction. | ||
| ==== Tools ==== | ==== Tools ==== | ||
| + | |||
| du -cHA, top, perl files to compress the size of /bin and /sbin | du -cHA, top, perl files to compress the size of /bin and /sbin | ||
| Line 14: | Line 16: | ||
| | MSDOSFS, UFS_DIRHASH, | | MSDOSFS, UFS_DIRHASH, | ||
| | INET6, SYSVSHM, SYSVMSG, SYSVSEM, KTRACE | 142848 KB | 141177 KB | 1671 KB | [[https:// | | INET6, SYSVSHM, SYSVMSG, SYSVSEM, KTRACE | 142848 KB | 141177 KB | 1671 KB | [[https:// | ||
| - | | Using Dynamic Executables and Remove Static Ones | /bin ==> 971 KB & /sbin ==> 3607 KB | /bin ==> 971 KB & /sbin ==> 2978 | 629 KB | [[https:// | + | | Using Dynamic Executables and Remove Static Ones | /bin ==> 971 KB & /sbin ==> 3607 KB | /bin ==> 971 KB & /sbin ==> 2978 | 629 KB | [[https:// |
| | Sysctl maxusers=4 | 1./var ==> 70582 KB \\ 2.Free Available Memory = 445 | 1./var ==> 70556 KB \\ 2. Free Available Memory = 446 | 1. /var ==> 26 KB \\ 2. For Available Memory = 1MB | [[https:// | | Sysctl maxusers=4 | 1./var ==> 70582 KB \\ 2.Free Available Memory = 445 | 1./var ==> 70556 KB \\ 2. Free Available Memory = 446 | 1. /var ==> 26 KB \\ 2. For Available Memory = 1MB | [[https:// | ||
| + | | Using Perl Files | /bin ==> 728 KB | /bin ==> 1367 KB | 639 KB | [[https:// | ||
| + | | Sysctl net.inet.tcp.msl=" | ||
| - | | Using Perl Files | /bin ==> 728 KB | /bin ==> 1367 KB | 639 KB | [[https:// | + | ==== Section1 ==== |
| - | | Sysctl net.inet.tcp.msl=" | ||
| - | |||
| - | === Section1 === | ||
| There were three different machines loaded in the kernel configuration file and minimized to only the exact machine type.Be Careful, if you don't know your machine type, you may get a kernel crash. | There were three different machines loaded in the kernel configuration file and minimized to only the exact machine type.Be Careful, if you don't know your machine type, you may get a kernel crash. | ||
| - | === Section2 === | + | ==== Section2 |
| - | 1.Steps : # cd /usr/src \\ | + | - Steps : # cd /usr/src \\ # make buildworld \\ # make buildkernel \\ # make installkernel \\ # shutdown -r now \\ |
| - | # make buildworld \\ | + | - Notice that if you get any problem with your current binaries, you won't be able to retrieve the ones. |
| - | # make buildkernel \\ | + | |
| - | # make installkernel \\ | + | ==== Section3 ==== |
| - | # shutdown -r now \\ | + | |
| - | - Notice that if you get any problem with your current binaries, you won't be able to retrieve the original | + | |
| - | === Section3 === | ||
| - You will face a problem in Kernel Building or compilation if you set maxusers to 2 & you were running X Windows System \\ | - You will face a problem in Kernel Building or compilation if you set maxusers to 2 & you were running X Windows System \\ | ||
| - To use this at each boot process ==> I. recompile it inside the configuration file. or II. put it inside / | - To use this at each boot process ==> I. recompile it inside the configuration file. or II. put it inside / | ||
| - | === Section4 === | + | ==== Section4 ==== |
| - | %%< | + | |
| - | # run loadbin.pl \\ | + | |
| - | # you can use this command at startup by running it from load.conf file \\ | + | |
| - | # don't forget to use the termination.pl to compress all the files again and you can run it combined with the shutdown process\\ | + | |
| - | # see snapshots for more details about how to run the document. \\ | + | |
| - | # This process reduces the directory approximately half the size.\\ | + | |
| - | - The same process can be done for /sbin directory but don't forget to include the the sbins needed in the names.files file. \\ | + | |
| - | === Section5 === | + | - Steps : # use names.files to include all the binaries you need \\ # run loadbin.pl \\ # you can use this command at startup by running it from load.conf file \\ # don't forget to use the termination.pl to compress all the files again and you can run it combined with the shutdown process\\ |
| - | Lessen max segment life to conserve resources ==> ACK waiting time in miliseconds | + | - The same process can be done for /sbin directory but don't forget to include the the sbins needed in the names.files file |
| + | |||
| + | ==== Section5 ==== | ||
| + | |||
| + | Lessen max segment life to conserve resources ==> ACK waiting time in milliseconds | ||
| ===== Important Notes ===== | ===== Important Notes ===== | ||
| - | 1. You can use extra kernel size reduction by using the options MUTEX_NOINLINE, | + | - You can use extra kernel size reduction by using the options MUTEX_NOINLINE, |
| - | 2. Don't use any debug options when you recompile the kernel. | + | |
| - | 3. Don't try to remove any configurations used to mount root at kernel compilation process or you will face a problem during your next boot \\ | + | |
| - | Some of these processes are FFS, GEOM_GPT, ..etc \\ | + | |
| - | 4. You can perform only one executable for all bins using crunchgen(). | + | |
| - | 5. Using -O3 debug option for CFLAGS or COPTFLAGS | + | |
| ===== Resources ===== | ===== Resources ===== | ||
| Line 63: | Line 57: | ||
| ===== Comments and Suggestions ===== | ===== Comments and Suggestions ===== | ||
| - | You can send your comments and suggestions to mailto: | ||
| - | Submitted | + | You can send your comments and suggestions to < |
| - | reviewed by : | + | |
| + | * Published | ||
| + | | ||