# remove building modules from makeworld,makekernel.



## Alain De Vos (Sep 9, 2022)

This is my output of kldstat,

```
Id Refs Address                Size Name 
 1  270 0xffffffff80200000  2257718 kernel 
 2    1 0xffffffff82459000   5dbb08 openzfs.ko 
 3    2 0xffffffff82a35000     53c0 xdr.ko 
 4    1 0xffffffff82a3b000     b010 opensolaris.ko 
 5    1 0xffffffff82a47000     33d8 cc_cubic.ko 
 6    1 0xffffffff82d20000     3570 fdescfs.ko 
 7    1 0xffffffff82d24000    12da0 fusefs.ko 
 8    1 0xffffffff82d37000     43e8 cryptodev.ko 
 9    1 0xffffffff82d3c000     3268 filemon.ko 
10    1 0xffffffff82e00000   53e438 vmm.ko 
11    3 0xffffffff82d40000    84160 drm.ko 
12    3 0xffffffff82dc5000     cbf0 linuxkpi_gplv2.ko 
13    1 0xffffffff8333f000   151df0 radeonkms.ko 
14    1 0xffffffff82dd2000     f7e8 ttm.ko 
15    1 0xffffffff82de2000     3258 radeon_CAICOS_pfp_bin.ko 
16    1 0xffffffff82de6000     3658 radeon_CAICOS_me_bin.ko 
17    1 0xffffffff82dea000     2cd8 radeon_BTC_rlc_bin.ko 
18    1 0xffffffff82ded000     7ef8 radeon_CAICOS_mc_bin.ko 
19    1 0xffffffff82df5000     8098 radeon_CAICOS_smc_bin.ko 
20    1 0xffffffff83491000    341f0 radeon_SUMO_uvd_bin.ko 
21    1 0xffffffff834c6000     25f0 snd_driver.ko 
22    1 0xffffffff834c9000     4320 snd_ad1816.ko 
23    1 0xffffffff834ce000     3278 snd_als4000.ko 
24    1 0xffffffff834d2000     4258 snd_atiixp.ko 
25    1 0xffffffff834d7000     3270 snd_cmi.ko 
26    1 0xffffffff834db000     4268 snd_cs4281.ko 
27    2 0xffffffff834e0000    13110 snd_csa.ko 
28    1 0xffffffff834f4000     a408 snd_ds1.ko 
29    1 0xffffffff834ff000    14f90 snd_emu10kx.ko 
30    1 0xffffffff83514000     6508 snd_envy24.ko 
31    3 0xffffffff8351b000     2118 snd_spicds.ko 
32    1 0xffffffff8351e000     56e8 snd_envy24ht.ko 
33    1 0xffffffff83524000     7288 snd_es137x.ko 
34    1 0xffffffff8352c000     44d8 snd_ess.ko 
35    4 0xffffffff83531000     3438 snd_sbc.ko 
36    1 0xffffffff83535000     2298 snd_fm801.ko 
37    2 0xffffffff83538000     8d20 snd_mss.ko 
38    1 0xffffffff83541000     6450 snd_maestro.ko 
39    1 0xffffffff83548000     7d48 snd_maestro3.ko 
40    1 0xffffffff83550000     f248 snd_neomagic.ko 
41    1 0xffffffff83560000     32b8 snd_sb16.ko 
42    1 0xffffffff83564000     3318 snd_sb8.ko 
43    1 0xffffffff83568000     4298 snd_solo.ko 
44    1 0xffffffff8356d000     32c8 snd_t4dwave.ko 
45    1 0xffffffff83571000     52b8 snd_via8233.ko 
46    1 0xffffffff83577000     3258 snd_via82c686.ko 
47    1 0xffffffff8357b000     4278 snd_vibes.ko 
48    1 0xffffffff83580000     2258 cpuctl.ko 
49    1 0xffffffff83583000     2108 coretemp.ko 
50    1 0xffffffff83586000    1264c hwpmc.ko 
51    1 0xffffffff83599000     3280 ichsmb.ko 
52    2 0xffffffff8359d000     2180 smbus.ko 
53    1 0xffffffff835a0000     8bd8 ipmi.ko 
54    1 0xffffffff835a9000     3700 sem.ko 
55    1 0xffffffff835ad000     b4b0 usb_template.ko 
56    1 0xffffffff835b9000     23e0 ulpt.ko 
57    1 0xffffffff835bc000     3480 umodem.ko 
58    2 0xffffffff835c0000     4da0 ucom.ko 
59    1 0xffffffff835c5000     33e0 uslcom.ko 
60    1 0xffffffff835c9000     21f4 nmdm.ko 
61    1 0xffffffff835cc000     22d8 iic.ko 
62    1 0xffffffff835cf000     4364 iicbus.ko 
63    1 0xffffffff835d4000     3d40 ow.ko 
64    1 0xffffffff835d8000     5ac0 udf.ko 
65    1 0xffffffff835de000     3360 uhid.ko 
66    1 0xffffffff835e2000     4370 ums.ko 
67    3 0xffffffff835e7000     4828 libiconv.ko 
68    1 0xffffffff835ec000     3090 libmchain.ko 
69    1 0xffffffff835f0000     2150 cd9660_iconv.ko 
70    1 0xffffffff835f3000     2150 msdosfs_iconv.ko 
71    1 0xffffffff835f6000     2ac0 sysctlinfo.ko 
72    1 0xffffffff835f9000     6780 cuse.ko 
73    4 0xffffffff83600000     abb0 netgraph.ko 
74    1 0xffffffff8360b000     31f8 ng_ether.ko 
75    1 0xffffffff8360f000     5228 ng_pppoe.ko 
76    1 0xffffffff83615000     3a50 ng_socket.ko 
77    1 0xffffffff83619000     33a0 usbhid.ko 
78    1 0xffffffff8361d000     3228 hidbus.ko 
79    1 0xffffffff83621000     7680 if_bridge.ko 
80    1 0xffffffff83629000     50f0 bridgestp.ko 
81    1 0xffffffff8362f000     4770 nullfs.ko 
82    1 0xffffffff83634000     2a20 mac_ntpd.ko
```
Which means I don't need any other module. 
How do i build kernel and world removing "any other module" then listed above ?


----------



## SirDice (Sep 9, 2022)

Why are you loading snd_driver?


```
MODULES_OVERRIDE
                   (str) Set to a list of modules to build instead of all of
                   them.
....
     NO_MODULES    (bool) Set to not build modules with the kernel.
...
     WITHOUT_MODULES
                   (str) Set to a list of modules to exclude from the build.
                   This provides a somewhat easier way to exclude modules you
                   are certain you will never need than specifying
                   MODULES_OVERRIDE.  This is applied after MODULES_OVERRIDE.
```
make.conf(5)


----------



## Alain De Vos (Sep 9, 2022)

I had problems with my intel HDA sound card. Somewhere i load all sound drivers.


----------



## SirDice (Sep 9, 2022)

Alain De Vos said:


> I had problems with my intel HDA sound card.


That's snd_hda(4) and should be included in GENERIC.


----------



## Alain De Vos (Sep 9, 2022)

snd_hda seems to be part of the kernel so i removed snd_driver from rc.conf.
Currently i have

```
Id Refs Address                Size Name 
 1  169 0xffffffff80200000  2257718 kernel 
 2    1 0xffffffff82458000     33d8 cc_cubic.ko 
 3    1 0xffffffff8245d000   5dbb08 openzfs.ko 
 4    2 0xffffffff82a39000     53c0 xdr.ko 
 5    1 0xffffffff82a3f000     b010 opensolaris.ko 
 6    1 0xffffffff82d20000     3570 fdescfs.ko 
 7    1 0xffffffff82d24000    12da0 fusefs.ko 
 8    1 0xffffffff82d37000     43e8 cryptodev.ko 
 9    1 0xffffffff82d3c000     3268 filemon.ko 
10    1 0xffffffff82e00000   53e438 vmm.ko 
11    3 0xffffffff82d40000    84160 drm.ko 
12    3 0xffffffff82dc5000     cbf0 linuxkpi_gplv2.ko 
13    1 0xffffffff8333f000   151df0 radeonkms.ko 
14    1 0xffffffff82dd2000     f7e8 ttm.ko 
15    1 0xffffffff82de2000     3258 radeon_CAICOS_pfp_bin.ko 
16    1 0xffffffff82de6000     3658 radeon_CAICOS_me_bin.ko 
17    1 0xffffffff82dea000     2cd8 radeon_BTC_rlc_bin.ko 
18    1 0xffffffff82ded000     7ef8 radeon_CAICOS_mc_bin.ko 
19    1 0xffffffff82df5000     8098 radeon_CAICOS_smc_bin.ko 
20    1 0xffffffff83491000    341f0 radeon_SUMO_uvd_bin.ko 
21    1 0xffffffff834c6000     2258 cpuctl.ko 
22    1 0xffffffff834c9000     2108 coretemp.ko 
23    1 0xffffffff834cc000    1264c hwpmc.ko 
24    1 0xffffffff834df000     3280 ichsmb.ko 
25    2 0xffffffff834e3000     2180 smbus.ko 
26    1 0xffffffff834e6000     8bd8 ipmi.ko 
27    1 0xffffffff834ef000     3700 sem.ko 
28    1 0xffffffff834f3000     b4b0 usb_template.ko 
29    1 0xffffffff834ff000     23e0 ulpt.ko 
30    1 0xffffffff83502000     3480 umodem.ko 
31    2 0xffffffff83506000     4da0 ucom.ko 
32    1 0xffffffff8350b000     33e0 uslcom.ko 
33    1 0xffffffff8350f000     21f4 nmdm.ko 
34    1 0xffffffff83512000     22d8 iic.ko 
35    1 0xffffffff83515000     4364 iicbus.ko 
36    1 0xffffffff8351a000     3d40 ow.ko 
37    1 0xffffffff8351e000     5ac0 udf.ko 
38    1 0xffffffff83524000     3360 uhid.ko 
39    1 0xffffffff83528000     4370 ums.ko 
40    3 0xffffffff8352d000     4828 libiconv.ko 
41    1 0xffffffff83532000     3090 libmchain.ko 
42    1 0xffffffff83536000     2150 cd9660_iconv.ko 
43    1 0xffffffff83539000     2150 msdosfs_iconv.ko 
44    1 0xffffffff8353c000     2ac0 sysctlinfo.ko 
45    1 0xffffffff8353f000     6780 cuse.ko 
46    4 0xffffffff83546000     abb0 netgraph.ko 
47    1 0xffffffff83551000     31f8 ng_ether.ko 
48    1 0xffffffff83555000     5228 ng_pppoe.ko 
49    1 0xffffffff8355b000     3a50 ng_socket.ko 
50    1 0xffffffff8355f000     33a0 usbhid.ko 
51    1 0xffffffff83563000     3228 hidbus.ko 
52    1 0xffffffff83567000     7680 if_bridge.ko 
53    1 0xffffffff8356f000     50f0 bridgestp.ko 
54    1 0xffffffff83575000     4770 nullfs.ko 
55    1 0xffffffff8357a000     2a20 mac_ntpd.ko
```
So I did not needed to load the other snd drivers.


----------



## Alain De Vos (Sep 9, 2022)

I'm adding to my kernel config file,

```
nodevice      snd_driver
nodevice      snd_ad1816
nodevice      snd_als4000
nodevice      snd_atiixp
nodevice      snd_cmi
nodevice      snd_cs4281
nodevice      snd_csa
nodevice      snd_ds1
nodevice      snd_emu10kx
nodevice      snd_envy24
nodevice      snd_spicds
nodevice      snd_envy24ht
nodevice      snd_es137x
nodevice      snd_ess
nodevice      snd_sbc
nodevice      snd_fm801
nodevice      snd_mss
nodevice      snd_maestro
nodevice      snd_maestro3
nodevice      snd_neomagic
nodevice      snd_sb16
nodevice      snd_sb8
nodevice      snd_solo
nodevice      snd_t4dwave
nodevice      snd_via8233
nodevice      snd_via82c686
nodevice      snd_vibes
```


----------



## wolffnx (Sep 9, 2022)

Alain De Vos said:


> This is my output of kldstat,
> 
> ```
> Id Refs Address                Size Name
> ...



simply look into 
	
	



```
/boot/kernel
```
 directory for .ko files , for example, any file (correct me if I am wrong) begining with "if_" are network cards, and so long, be very carefull with that

and like SirDice points , put the modules names in /etc/make.conf
example 
	
	



```
WITHOUT_MODULES if_nge , if_muge
```

or better, I never try it but you can use 
	
	



```
MODULES_OVERRIDE
```
 and put the modules that you see in kldstat there


----------



## Alain De Vos (Sep 9, 2022)

I have a load of if_, but i might not know what i'm doing,

```
./kernel/if_qlxgbe.ko
./kernel/if_rue.ko
./kernel/if_ti.ko
./kernel/if_vge.ko
./kernel/if_cdceem.ko
./kernel/if_bfe.ko
./kernel/if_kue.ko
./kernel/if_alc.ko
./kernel/if_stf.ko
./kernel/if_gif.ko
./kernel/if_axe.ko
./kernel/if_cxgbe.ko
./kernel/if_urndis.ko
./kernel/if_ipw.ko
./kernel/if_rsu.ko
./kernel/if_ix.ko
./kernel/if_cxl.ko
./kernel/if_ath.ko
./kernel/if_ndis.ko
./kernel/if_lagg.ko
./kernel/if_ice.ko
./kernel/if_mxge.ko
./kernel/if_axge.ko
./kernel/if_bwn.ko
./kernel/if_gre.ko
./kernel/if_nfe.ko
./kernel/if_vmx.ko
./kernel/if_ath_pci.ko
./kernel/if_et.ko
./kernel/if_me.ko
./kernel/if_axp.ko
./kernel/if_sk.ko
./kernel/if_ste.ko
./kernel/if_vr.ko
./kernel/if_cue.ko
./kernel/if_rl.ko
./kernel/if_cxgb.ko
./kernel/if_msk.ko
./kernel/if_vtnet.ko
./kernel/if_upgt.ko
./kernel/if_vte.ko
./kernel/if_rtwn_pci.ko
./kernel/if_sume.ko
./kernel/if_an.ko
./kernel/if_otus.ko
./kernel/if_bge.ko
./kernel/if_ixv.ko
./kernel/if_rtwn_usb.ko
./kernel/if_ipheth.ko
./kernel/if_wpi.ko
./kernel/if_bridge.ko
./kernel/if_malo.ko
./kernel/if_ale.ko
./kernel/ng_gif_demux.ko
./kernel/if_iavf.ko
./kernel/if_udav.ko
./kernel/if_bnxt.ko
./kernel/if_iwlwifi.ko
./kernel/if_le.ko
./kernel/if_ntb.ko
./kernel/if_lio.ko
./kernel/if_gem.ko
./kernel/if_nge.ko
./kernel/if_fwip.ko
./kernel/if_dc.ko
./kernel/if_sis.ko
./kernel/if_cc.ko
./kernel/if_ixlv.ko
./kernel/if_cas.ko
./kernel/if_ural.ko
./kernel/if_bwi.ko
./kernel/if_muge.ko
./kernel/if_sge.ko
./kernel/if_ae.ko
./kernel/if_epair.ko
./kernel/if_mgb.ko
./kernel/if_fxp.ko
./kernel/if_qlnxe.ko
./kernel/if_mos.ko
./kernel/if_iwm.ko
./kernel/if_ena.ko
./kernel/if_vxlan.ko
./kernel/if_vlan.ko
./kernel/if_igc.ko
./kernel/if_zyd.ko
./kernel/if_jme.ko
./kernel/if_mwl.ko
./kernel/if_em.ko
./kernel/if_infiniband.ko
./kernel/if_igb.ko
./kernel/if_ic.ko
./kernel/if_iwn.ko
./kernel/if_ccv.ko
./kernel/if_qlxgb.ko
./kernel/if_bce.ko
./kernel/if_bxe.ko
./kernel/if_disc.ko
./kernel/if_lge.ko
./kernel/if_cxlv.ko
./kernel/if_ral.ko
./kernel/if_ure.ko
./kernel/if_enc.ko
./kernel/if_run.ko
./kernel/if_re.ko
./kernel/if_cxgbev.ko
./kernel/if_ixl.ko
./kernel/if_stge.ko
./kernel/if_edsc.ko
./kernel/if_smsc.ko
./kernel/if_xl.ko
./kernel/if_my.ko
./kernel/if_cdce.ko
./kernel/if_rum.ko
./kernel/if_uath.ko
./kernel/if_tuntap.ko
./kernel/if_urtw.ko
./kernel/if_age.ko
./kernel/if_iwi.ko
./kernel/if_qlnxev.ko
./kernel/if_oce.ko
./kernel/if_fwe.ko
./kernel/if_aue.ko
./kernel/if_qlxge.ko
```


----------



## Alain De Vos (Sep 9, 2022)

The only one that is loaded is:

```
if_bridge.ko
```


----------



## wolffnx (Sep 9, 2022)

and what if you output of ifconfig?
nevermind,you should have define your network card in your kernel config file for sure


----------



## wolffnx (Sep 9, 2022)

maybe is a shoot in the foot, but you can put this in your /etc/make.conf and build your kernel
make sure to have the boot loader menu enabled (to select other kernel if this wont work)
and make a copy of your /boot/kernel directory


```
MODULES_OVERRIDE  fdescfs.ko,cryptodev.ko,filemon.ko,vmm.ko,drm.ko,linuxkpi_gplv2.ko,radeonkms.ko,ttm.ko,radeon_CAICOS_pfp_bin.ko,radeon_CAICOS_me_bin.ko,radeon_BTC_rlc_bin.ko,radeon_CAICOS_mc_bin.ko,radeon_CAICOS_smc_bin.ko,radeon_SUMO_uvd_bin.ko,cpuctl.ko,coretemp.ko,hwpmc.ko,ichsmb.ko,smbus.ko,ipmi.ko,sem.ko,usb_template.ko,ulpt.ko,umodem.ko,ucom.ko,uslcom.ko,nmdm.ko,iic.ko,iicbus.ko,ow.ko,udf.ko,uhid.ko,ums.ko,libiconv.ko,libmchain.ko,cd9660_iconv.ko,msdosfs_iconv.ko,sysctlinfo.ko,cuse.ko,netgraph.ko,ng_ether.ko,ng_pppoe.ko,ng_socket.ko,usbhid.ko,hidbus.ko,if_bridge.ko,bridgestp.ko,nullfs.ko,mac_ntpd.ko,cc_cubic.ko ,openzfs.ko ,xdr.ko ,opensolaris.ko ,fdescfs.ko ,fusefs.ko
```


----------



## SirDice (Sep 9, 2022)

Alain De Vos said:


> I'm adding to my kernel config file,
> 
> ```
> nodevice      snd_driver
> ...


You don't need all those `nodevice` lines. What `nodevice` does is when you start with an `include GENERIC` is to remove anything that was included in GENERIC. Most of these aren't included in GENERIC to begin with, so you don't need to `nodevice` them.

Everything is always built as a module, regardless if you put them in your kernel config or not. The kernel config just defines what's statically included in your kernel. Nothing more. It doesn't tell the system which modules to build and which don't. That's what MODULES_OVERRIDE and WITHOUT_MODULES does.


----------



## SirDice (Sep 9, 2022)

wolffnx said:


> nevermind,you should have define your network card in your kernel config file for sure


It's fine to load these as modules. What you do need to include in your custom kernel configuration is everything that's required to actually boot the system. Once the kernel is running and the system is booting the rest can be loaded dynamically as modules. That includes any interface drivers you might need (unless you are network booting the system of course).


----------



## Alain De Vos (Sep 9, 2022)

So i put in make.conf (not src.conf) the line ?

```
WITHOUT_MODULES = snd_driver snd_ad1816 snd_als4000 snd_atiixp snd_cmi snd_cs4281 snd_csa snd_ds1 snd_emu10kx snd_envy24 snd_spicds snd_envy24ht snd_es137x snd_ess snd_sbc snd_fm801 snd_mss snd_maestro snd_maestro3 snd_neomagic snd_sb16 snd_sb8 snd_solo snd_t4dwave snd_via8233 snd_via82c686 snd_vibes if_iwm if_mos if_ena if_muge if_mgb if_fxp if_ural if_infiniband if_mwl if_ic if_ixlv if_fwip if_zyd if_igc if_jme if_igb if_ae if_ipheth if_qlxge if_bnxt if_udav if_em if_iavf if_ccv if_malo if_iwn if_bce if_iwlwifi if_rtwn_usb if_ral if_bxe if_otus if_lge if_enc if_sume if_upgt if_rtwn_pci if_ure if_cxgb if_cdceem if_run if_qlxgb if_xl if_ixl if_qlxgbe if_urndis if_axge if_mxge if_re if_lagg if_ndis if_rum if_vxlan if_ath_pci if_age if_epair if_qlnxe if_fwe if_my if_oce if_iwi if_aue if_cxgbev if_ix if_rue if_vge if_urtw if_uath if_bfe if_kue if_alc if_stf if_axe if_gif if_rsu if_ti if_cdce if_ipw if_et if_ice if_sk if_vr if_cxl if_tuntap if_me if_ath if_vmx if_nfe if_rl if_bwn ng_gif_demux if_gre if_smsc if_edsc if_axp if_ste if_stge if_qlnxev if_msk if_cue if_vte if_bge if_cxlv if_disc if_vtnet if_ixv if_ale if_an if_wpi if_dc if_cc if_gem if_ntb if_lio if_cas if_nge if_vlan if_sis if_sge if_le if_bwi if_cxgbe i915_cnl_dmc_ver1_06_bin i915_kbl_dmc_ver1_04_bin i915_bxt_guc_33_0_0_bin i915_skl_guc_ver9_33_bin i915_bxt_guc_ver9_29_bin i915_bxt_huc_2_0_0_bin i915_skl_huc_ver01_07_bin i915_ehl_guc_33_0_4_bin i915_kbl_huc_ver02_00_bin i915_glk_huc_4_0_0_bin i915_icl_dmc_ver1_09_bin i915_bxt_huc_ver01_8_bin i915_glk_huc_ver03_01_bin i915_icl_huc_ver8_4_bin i915_glk_dmc_ver1_04_bin i915_glk_guc_33_0_0_bin i915_kbl_guc_ver9_39_bin i915_tgl_huc_7_5_0_bin i915_ehl_huc_9_0_0_bin i915_bxt_huc_ver01_07_bin i915_tgl_dmc_ver2_04_bin i915_icl_huc_9_0_0_bin i915_cml_huc_4_0_0_bin i915_cml_guc_33_0_0_bin i915_kbl_guc_33_0_0_bin i915_icl_guc_33_0_0_bin i915_skl_guc_33_0_0_bin i915_tgl_dmc_ver2_08_bin i915kms i915_kbl_huc_4_0_0_bin i915_bxt_dmc_ver1_07_bin i915_skl_huc_2_0_0_bin i915_icl_dmc_ver1_07_bin i915_rkl_dmc_ver2_02_bin i915_cnl_dmc_ver1_07_bin i915_skl_dmc_ver1_27_bin i915_tgl_guc_35_2_0_bin
```

Will this have effect on buildkernel or buildworld or both ?


----------



## SirDice (Sep 9, 2022)

Alain De Vos said:


> Will this have effect on buildkernel or buildworld or both ?


No kernel modules are built during the buildworld phase (nothing kernel related is built during this phase).


----------



## Alain De Vos (Sep 9, 2022)

So if i understand correctly to have /boot/kernel less populated you put no_device in KERNCONF.
To have /boot/modules less populated you put the line WITHOUT_MODULES in make.conf


----------



## zirias@ (Sep 9, 2022)

No and no.

/boot/modules is the place for installation of _3rd-party_ modules (from ports).


----------



## SirDice (Sep 9, 2022)

Alain De Vos what's the end-goal here? Unless you are space constraint (building for some small embedded device for example) there's really not much to gain. Just save yourself a lot of headaches and let the system build everything. If you're looking to shave off some _build_ time you should look into WITH_META_MODE instead.


----------



## Alain De Vos (Sep 9, 2022)

The end goal is rather very simple. Have a streamlined system where directory /boot contains as little as possible but i can use all functionality i need.
Disk usage "du -h /boot" should be as low as possible.
[If i wanted bloatware i used akonadi/nepomuk/strigi/baloo/UBUNTU.]


----------



## Alain De Vos (Sep 9, 2022)

Alain De Vos said:


> ```
> WITHOUT_MODULES = snd_driver snd_ad1816 snd_als4000 snd_atiixp snd_cmi snd_cs4281 snd_csa snd_ds1 snd_emu10kx snd_envy24 snd_spicds snd_envy24ht snd_es137x snd_ess snd_sbc snd_fm801 snd_mss snd_maestro snd_maestro3 snd_neomagic snd_sb16 snd_sb8 snd_solo snd_t4dwave snd_via8233 snd_via82c686 snd_vibes if_iwm if_mos if_ena if_muge if_mgb if_fxp if_ural if_infiniband if_mwl if_ic if_ixlv if_fwip if_zyd if_igc if_jme if_igb if_ae if_ipheth if_qlxge if_bnxt if_udav if_em if_iavf if_ccv if_malo if_iwn if_bce if_iwlwifi if_rtwn_usb if_ral if_bxe if_otus if_lge if_enc if_sume if_upgt if_rtwn_pci if_ure if_cxgb if_cdceem if_run if_qlxgb if_xl if_ixl if_qlxgbe if_urndis if_axge if_mxge if_re if_lagg if_ndis if_rum if_vxlan if_ath_pci if_age if_epair if_qlnxe if_fwe if_my if_oce if_iwi if_aue if_cxgbev if_ix if_rue if_vge if_urtw if_uath if_bfe if_kue if_alc if_stf if_axe if_gif if_rsu if_ti if_cdce if_ipw if_et if_ice if_sk if_vr if_cxl if_tuntap if_me if_ath if_vmx if_nfe if_rl if_bwn ng_gif_demux if_gre if_smsc if_edsc if_axp if_ste if_stge if_qlnxev if_msk if_cue if_vte if_bge if_cxlv if_disc if_vtnet if_ixv if_ale if_an if_wpi if_dc if_cc if_gem if_ntb if_lio if_cas if_nge if_vlan if_sis if_sge if_le if_bwi if_cxgbe i915_cnl_dmc_ver1_06_bin i915_kbl_dmc_ver1_04_bin i915_bxt_guc_33_0_0_bin i915_skl_guc_ver9_33_bin i915_bxt_guc_ver9_29_bin i915_bxt_huc_2_0_0_bin i915_skl_huc_ver01_07_bin i915_ehl_guc_33_0_4_bin i915_kbl_huc_ver02_00_bin i915_glk_huc_4_0_0_bin i915_icl_dmc_ver1_09_bin i915_bxt_huc_ver01_8_bin i915_glk_huc_ver03_01_bin i915_icl_huc_ver8_4_bin i915_glk_dmc_ver1_04_bin i915_glk_guc_33_0_0_bin i915_kbl_guc_ver9_39_bin i915_tgl_huc_7_5_0_bin i915_ehl_huc_9_0_0_bin i915_bxt_huc_ver01_07_bin i915_tgl_dmc_ver2_04_bin i915_icl_huc_9_0_0_bin i915_cml_huc_4_0_0_bin i915_cml_guc_33_0_0_bin i915_kbl_guc_33_0_0_bin i915_icl_guc_33_0_0_bin i915_skl_guc_33_0_0_bin i915_tgl_dmc_ver2_08_bin i915kms i915_kbl_huc_4_0_0_bin i915_bxt_dmc_ver1_07_bin i915_skl_huc_2_0_0_bin i915_icl_dmc_ver1_07_bin i915_rkl_dmc_ver2_02_bin i915_cnl_dmc_ver1_07_bin i915_skl_dmc_ver1_27_bin i915_tgl_guc_35_2_0_bin
> ```


Does this line looks sane or not for a desktop PC ?


----------



## zirias@ (Sep 9, 2022)

It does not. No excluding of any modules is sane on anything but a space-cramped embedded device.

If you need to save space on a desktop, install from release binaries:

```
$ du -hs /boot/kernel /usr/src
 96M    /boot/kernel
2,7G    /usr/src
```

To put that further into perspective, the minimum size for a fully compliant ESP, even if containing nothing but a tiny bootloader, is 256M.


----------



## jbo (Sep 10, 2022)

I think everything worth saying in this thread has been said. So in this rather rare occasion I'll do us the honors of starting the OT:



zirias@ said:


> [...], the minimum size for a fully compliant ESP, even if containing nothing but a tiny bootloader, is 256M.


Interesting, I thought it was 100M.


----------



## zirias@ (Sep 10, 2022)

jbodenmann said:


> Interesting, I thought it was 100M.


In fact, it depends on the sector size. There is no specified minimum size, but the filesystem *must* be FAT32 (not FAT12/16, and a few stupid implementations indeed only accept FAT32). With 4k sectors, this results in an effective minimum size of 256M. With (ancient) 512B sectors, 32M would already be enough.


----------



## Alain De Vos (Sep 10, 2022)

I don't know if comparison is wise but my /boot directory in gentoo-linux is 3X smaller compared to freebsd.


----------



## zirias@ (Sep 10, 2022)

Alain De Vos said:


> I don't know if comparison is wise but my /boot directory in gentoo-linux is 3X smaller compared to freebsd.


I don't think it is:

Linux installs kernel modules outside /boot (in /lib/modules).
Look at the absolute numbers, compare to something that *really* needs some considerable amount of space.


----------



## Phishfry (Sep 10, 2022)

zirias@ said:


> With (ancient) 512B sectors, 32M would already be enough.


That is close to what the Wiki shows too.


			UEFI - FreeBSD Wiki
		


I have to ask. What is the difference between -t fat32 and -t efi partition type for the ESP???


----------



## Alain De Vos (Sep 10, 2022)

EFI system partition - ArchWiki
					






					wiki.archlinux.org


----------



## bakul (Sep 10, 2022)

I think you can simply include all the modules you want in your kernel config file and do a make with -DNO_MODULES.


----------



## zirias@ (Sep 11, 2022)

Phishfry said:


> I have to ask. What is the difference between -t fat32 and -t efi partition type for the ESP???


The type identifier of the partition 
It's really just an identifier (so, you still _could_ place any filesystem you want on it), helping to identify what the partition is used for. For the ESP to be correctly identified by the UEFI BIOS, use the type `efi`.


bakul said:


> I think you can simply include all the modules you want in your kernel config file and do a make with -DNO_MODULES.


The kernel config isn't relevant for modules. What you probably mean is putting all the drivers/devices there, so they are built into the kernel instead. But then you won't have _any_ modules.


----------

