# coldplug - why?

## afabco

I guess I still don't get it.  What's the point of coldplug?  What's the advantage?  What problem(s) is it supposed to solve?

I've tried googling, but all that comes up is a lot of discussion and questions.  Is there a home that explains what it is and what it does and why?  Or is this one of those (many) things where you gotta know what it's all about before you can understand what it's all about?  :Smile: 

----------

## Deathwing00

coldplug behaves like hotplug does with the difference that it loads modules of devices that are already connected to the computer at boot time.

--

Moved from Installing Gentoo.

----------

## Pasketti

The system gets a notification when a device is connected/disconnected.

This means that the system is not told about devices that are already connected at boot.  Coldplug handles those.

----------

## afabco

ok, the light comes on.  A little.

My first response though, is that anything that is needed for booting is already compiled into the kernel, so the advantage coldplug offers it that it is supposed to handle the modules for already-plugged-in devices that are -not- needed for boot?  This would be things like nic drivers or 8250.o or loop.o?  Things that would normally go into /etc/modules.autoload/kernel-2.6 ?  And that don't load up on their own after boot (nic drivers, 8250.o, loop.o, etc)

----------

## chunderbunny

That's exactly right. Coldplug basically just automatically detects hardware at boot and tries to load an appropriate kernel module for each device it finds. As you say, anything which is essential to the boot process will be compiled into the kernel, but things like nic drivers, video card drivers, USB drivers, ALSA drivers etc can all be automatically loaded by coldplug. Yes, you can have your modules loaded by /etc/modules.autoload.d/kernel-2.6 and if you do that for every module then coldplug will be redundant. But if you don't want to have to remember to edit that file every time you get a new divece, or compile a new module then coldplug saves you some effort.

----------

## afabco

so it's only for devices.  

Next question. What's a device?   :Smile: 

Or rephrased, what will coldplug recognize?

Presumably the IDE chipset driver still needs to be compiled into the kernel, as do the filesystems?

And coldplug is a do-it and exit service?  so it doesn't replace hotplug?

What determines whether it's a coldplug module or a hotplug module?

Where's the homepage with all these answers?   :Smile: 

----------

## rmh3093

no no.... its more like this.....

lets say you have a laptop but it uses a ps2 mouse touchpad, you could have ps2 support compiled into the kernel, but then you compile usb as a module because sometimes you use a usb mouse, if you boot your computer without a usb mouse connected initially, hotplug would not load uhci_hcd (or what ever you have) so you would have to modprobe it after you log in or add it to /etc/modules.autoload.d/kernel-2.X

coldplug basically loads everything that is compiled as modules that isnt already loaded and that doesnt fail upon load, even if you use it or not.

----------

## beandog

coldplug loads the drivers for my ati-remote, my usb tv tuner, and my other video cards, because I'm too lazy to put all the modules in autoload.d.  It's great.  :Smile: 

----------

## supermihi

So, if I know what modules I need at boot time (and put them in /etc/modules.autoload.d) and if I'm not using too much stuff that could or could not be connected to my box at startup, I can safely remove coldplug?

I'm asking because I noticed that coldplug takes a lot of time in my bootup process, scanning all usb, pci, scsi ... busses, and since startup time is one of the last advantages of windows remaining in my opinion, I'd like to turn it off.

----------

## afabco

That's my understanding.  I never bothered to put it in as it seems kind of pointless unless you're doing a livecd or something that will be used on different (and differently configured) machines.

Of course, anyone who knows any better is welcome to correct me.  Please.

----------

## dsd

yes, most people dont want or need coldplug

----------

## afabco

Well, just as a lark this weekend I emerge'd coldplug to see if it bought anything.  First thing I noticed is that it didn't catch ide_cd or psmouse.  So even if you use coldplug, you'll still have to use modules.autoload/kernel-2.6, just maybe not so much.

----------

## supermihi

I also had problems with ide-cd. I think it only autoloads the module if a cdrom is in the drive, but I'm not sure for that. So, coldplug really sucks.  :Wink: 

----------

## Kern3lP4nic

From the hotplug man page:

 *hotplug man page wrote:*   

> hotplug agents aren't necessarily called only by the kernel though.  While the OS is initializing, the "cold-plugging" case, the hotplug script in /etc/init.d/hotplug is invoked to make sure that all device connected at boot are properly configured, applying the same rules as if they were connected later.

 

Does this mean that coldplug is redundant when hoplug is already installed?

----------

## supermihi

No, it's kinda addition to hotplug for devices plugged in BEFORE you turn on your computer. If you plug in an USB memory stick while your machine is running, hotplug recognizes the new device and will load the according module. If the stick is in at boottime, hotplug won't do anything, and you'd have to load the modules by hand. So, (if I understood right), coldplug lets hotplug check ALL devices as if they were hotplugged.

----------

## beandog

 *supermihi wrote:*   

> I also had problems with ide-cd. I think it only autoloads the module if a cdrom is in the drive, but I'm not sure for that. So, coldplug really sucks. 

 

Actually, from my experience, ide-cd seems to load itself no matter what -- coldplug or not.

Kinda like the floppy module too sometimes.  Even if you never use a floppy, the kernel still loads the module.

Assuming you have auotmatic module loading turned on.

----------

