# How to turn-off a few things?



## max21 (Jan 13, 2013)

Could someone please show me how turn-off cd0, usbus, ugen,uhub so they don't show up or work during and after booting?

Also, including OHCI and EHCI if these don't have effect on anything else.  All I want to use is my sada hard drive.  I have no scsi device and such attached.  I need to try a few things so I need a way to turn these off while the system is in the process of booting.  I want to comment them out at daemon level but I don't know where to start looking and playing.  I need to be able to turn them on manually while the system is running.  So whatever it takes, custom kernel, boot loader, daemon, or a script, I'll try it.

I have not read it yet but its interesting to see an thread about boot menu just when I'm about to post.

Thanks in advance


----------



## fonz (Jan 13, 2013)

max21 said:
			
		

> Could someone please show me how turn-off cd0, usbus, ugen,uhub so they don't show up or work during and after booting?
> [snip]
> I want to comment them out at daemon level


Build a new kernel without them. Instructions are in the Handbook.

Fonz


----------



## Michael-Sanders (Jan 13, 2013)

max21 said:
			
		

> Could someone please show me how turn-off cd0, usbus, ugen,uhub so they don't show up or work during and after booting?
> 
> [...]
> 
> I need to be able to turn them on manually while the system is running.



In as much as usb is concerned. Here's a tip, (as root) invoke:

`# usbconfig -d <UGEN> <OPT>`

For instance, to turn off (power off) device 2 on USB bus 3:

`# usbconfig -d ugen3.2 power_off`

Here's an even more detailed example I use in /etc/rc.local to _automagically_ poweroff my builtin USB camera (I don't use it so why waste the watts in power consumption?):


```
/usr/sbin/usbconfig -d `/usr/sbin/usbconfig | grep -i camera \
| cut -d : -f 1` power_off && echo usb camera: power off
```

read usbconfig(8) for more info.

Good luck.


----------



## wblock@ (Jan 13, 2013)

max21 said:
			
		

> Could someone please show me how turn-off cd0, usbus, ugen,uhub so they don't show up or work during and after booting?
> 
> Also, including OHCI and EHCI if these don't have effect on anything else.  All I want to use is my sada hard drive.  I have no scsi device and such attached.  I need to try a few things so I need a way to turn these off while the system is in the process of booting.



If these devices are causing problems during boot, changing BIOS settings is easier.  Disabling them in FreeBSD won't keep the system from booting from them anyway.  Also, disabling USB means no USB keyboards, mice, or anything else.

What is the problem, or what are you trying to achieve by disabling these devices?


----------



## max21 (Jan 15, 2013)

Hi wblock .. I replied yesterday but I don't see my post ..There is no problem.  I am simply trying to build an workstation and a more secure server using FreeBSD.  Since it's open-source I want to include some functions to do something that may come in handy.  No operating system is going to do everything for you.  If something is not possible, than I move on to the next thing I read about just to try it than determine if it is really useful or not.  Linix use Kick-Start to do some of the things I am after I think, so there got to be a tool that will allow FreeBSD to do the same thing if not more.  I came to open-source to custom build my OS before renting a dedicated server, and above all, just for knowledge.

Michael-Sanders, your way of doing things is what I been thinking about.   If it was possible, some things should not be eliminated at boot time or at the kernel because than even root can't do anything about it.  But still, _IF POSSIBLE_, an open-source OS should provide a way to allow users to boot the hardware features that he or she needs and nothing more.  Something is out here, but where.  But whatever the case you just took care of 80% of everything I been wanting to try.  Thanks a lot!


----------

