Skip to contentSkip to conversation

RPMs for hotplug scripts

PATCH Greg KH 3 participants 4 messages Jan 16, 2001 – Jan 17, 2001

lore
Share & tools
lore

Greg KH

author
#0 lore raw

Hi,

I was working on a bunch of other rpm spec files today so thought I would knock out one for the hotplug scripts.

Attached is a noarch package, a src.rpm package, a spec file, and a small patch that I made to the usb.rc startup script (to allow it to be inserted using the chkconfig utility). I based this on the Jan 13, 2001 tarball that David made available.

Could people check this over to see if I messed anything up?

David, do you want to check the hotplug.spec file into cvs, or do you want me to? Does the patch look ok (with the exception of my horrible english, bleah, what a bad cut and paste job...)

I built and kinda tested this on a RedHat 6.2, Immunix 6.2, RedHat 7.0, and Immunix 7.0 distros. I don't know if the startup script will work with other distros, or if it will even play nice with RedHat (they start up USB before the rc scripts get called.)

Hope this helps some people out.

greg k-h

Signature · 1 line
greg@(kroah|wirex).com

Summary: Linux Hotplug Scripts
Name: hotplug
Version: 20010113
Release: 2
Group: Applications/System
License: GPL
Url: http://linux-hotplug.sourceforge.net/
BuildArchitectures: noarch
Source0: %{name}-%{version}.tar.gz
BuildRoot: /var/tmp/%{name}-root
Patch0: hotplug-20010113_chkconfig.patch

%description
This package contains the scripts necessary for hotplug Linux support.

%prep
%setup -q
%patch0 -p1 -b .chkconfig

%build
rm -rf $RPM_BUILD_ROOT

# nothing to really do here right now	

%install

# build directories
rm -rf ${RPM_BUILD_ROOT}
mkdir -p ${RPM_BUILD_ROOT}/sbin
mkdir -p ${RPM_BUILD_ROOT}/etc/hotplug
mkdir -p ${RPM_BUILD_ROOT}/etc/rc.d/init.d
# install the main hotplug script
install -m 755 hotplug ${RPM_BUILD_ROOT}/sbin
# install the helper hotplug scripts
cp -a *.agent ${RPM_BUILD_ROOT}/etc/hotplug
cp -a *.functions ${RPM_BUILD_ROOT}/etc/hotplug
# install the usb startup script
cp -a usb.rc ${RPM_BUILD_ROOT}/etc/rc.d/init.d/usb

%files
%defattr(-,root,root)
/sbin/*
/etc/rc.d/init.d/usb
/etc/hotplug/*
%doc README

%post
chkconfig --add usb

%preun
chkconfig --del usb

%changelog
* Mon Jan 15 2001 Greg Kroah-Hartman <[email protected]>
- First cut at a spec file for the hotplug scripts.
- added patch to usb.rc to allow chkconfig to install and remove it.

usb.rc +4 -0
diff -au hotplug-20010113/usb.rc hotplug-20010113-greg/usb.rc
@@ -16,6 +16,10 @@
 # link USB keyboard support into the kernel (USB core, UHCI/OHCI,
 # hid, input, keybdev; and likely mousedev) so the system console
 # can't be removed by accident.
+#
+# chkconfig: 2345 01 99
+# description: USB rc file. This rc script inserts brings the usb \
+#	       up and down safely.
 
 
 PATH=/sbin:/bin:/usr/sbin:/usr/bin
#1 lore raw
Quoted 2 lines

I was working on a bunch of other rpm spec files today so thought I would knock out one for the hotplug scripts.

Great -- thanks!

Quoted 10 lines

Attached is a noarch package, a src.rpm package, a spec file, and a small patch that I made to the usb.rc startup script (to allow it to be inserted using the chkconfig utility). I based this on the Jan 13, 2001 tarball that David made available.

Could people check this over to see if I messed anything up?

David, do you want to check the hotplug.spec file into cvs, or do you want me to? Does the patch look ok (with the exception of my horrible english, bleah, what a bad cut and paste job...)

I think I'll take this opportunity to move the scripts into CVS at the linux-usb project, along with spec file. Toplevel "admin" directory seem OK? That'll involve tweaking file locations a bit in the "source" distribution (hence spec file), I suspect.

Quoted 4 lines

I built and kinda tested this on a RedHat 6.2, Immunix 6.2, RedHat 7.0, and Immunix 7.0 distros. I don't know if the startup script will work with other distros, or if it will even play nice with RedHat (they start up USB before the rc scripts get called.)

I think what we need is a generic "hotplug startup" script, not one that's USB-specific. That'd be the slot into which other things will fit ... like synthesizing hotplug events that were missed before filesystems were mounted.

Presumably it'll behave on Mandrake too (Chmouel can verify :-) and that's likely as good as we can get for the moment.

Quoted 1 line

Hope this helps some people out.

Yep!

- Dave

Quoted 2 lines

greg k-h

_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
[email protected]
http://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel

author
#2 lore raw
In reply to Greg KH
Quoted 4 lines · David Brownell

I think I'll take this opportunity to move the scripts into CVS at the linux-usb project, along with spec file. Toplevel "admin" directory seem OK? That'll involve tweaking file locations a bit in the "source" distribution (hence spec file), I suspect.

Yeah, if you move the files into the place you want in cvs, I'll update the spec file to reflect it.

thanks,

greg k-h

Signature · 6 lines
greg@(kroah|wirex).com

_______________________________________________
Linux-hotplug-devel mailing list  http://linux-hotplug.sourceforge.net
[email protected]
http://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel
#3 lore raw
In reply to Greg KH
Quoted 2 lines · David Brownell

Presumably it'll behave on Mandrake too (Chmouel can verify :-) and that's likely as good as we can get for the moment.

it works, but well missing some common use of what using in initscripts by standard (like action/daemon/subsys) and thing like that. if i get some time i'll send you the patches...

Signature · 7 lines
MandrakeSoft Inc                     http://www.chmouel.org
                      --Chmouel

_______________________________________________
Linux-hotplug-devel mailing list  http://linux-hotplug.sourceforge.net
[email protected]
http://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel