[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

[PATCH]: modutils-udeb for debian-installer



Package: modutils
Version: 2.4.1-1

Here's a patch to make a udeb of modutils for debian-installer.  It is still
possible that we will use busybox 'insmod', however busybox 'insmod' doesn't
currently support all our targetted archs.  In its current form this udeb
contains only the insmod binary.  I'm not convinced that is all we really want,
adding rmmod and lsmod is only an additional k or so.

I'm cc'ing debian-boot to perhaps generate some discussion.

This table is from modutils/insmod/README.combined:
                                       Stripped size (no 2.0 compatibility)
        insmod+rmmod                           41012 (38272)
        insmod+modprobe                        48912 (46188)
        insmod+rmmod+lsmod                     42136 (39584)
        insmod+rmmod+modprobe                  50048 (47324)
        insmod+rmmod+modprobe+lsmod            51076 (48524)
        insmod+rmmod+modprobe+lsmod+ksyms      52008 (49452)


In any case, it would be helpful if this was included in modutils.

Thanks,

David

diff -ur modutils-2.4.1.orig/Makefile.common.in modutils-2.4.1/Makefile.common.in
--- modutils-2.4.1.orig/Makefile.common.in	Thu Jan  4 17:45:19 2001
+++ modutils-2.4.1/Makefile.common.in	Thu Jan 25 21:10:49 2001
@@ -9,7 +9,7 @@
 AR		= @AR@
 ARCH		= @ARCH@
 CC		= @CC@
-CFLAGS		= @CFLAGS@
+CFLAGS		= @CFLAGS@ $(UDEB_CFLAGS)
 BUILDCC		= @BUILDCC@
 BUILDCFLAGS	= @BUILDCFLAGS@
 INSTALL		= @INSTALL_LOCAL@
diff -ur modutils-2.4.1.orig/debian/control modutils-2.4.1/debian/control
--- modutils-2.4.1.orig/debian/control	Thu Jan 25 23:03:04 2001
+++ modutils-2.4.1/debian/control	Thu Jan 25 23:02:28 2001
@@ -2,6 +2,7 @@
 Section: base
 Priority: required
 Maintainer: Wichert Akkerman <wakkerma@debian.org>
+Build-Depends: dpkg-dev (>= 1.7.0)
 Standards-Version: 3.2.0
 Bugs: debbugs://bugs.debian.org/
 Origin: debian
@@ -15,3 +16,11 @@
  These utilities are intended to make a Linux modular kernel
  manageable for all users, administrators and distribution
  maintainers.
+
+Package: modutils-udeb
+Section: debian-installer
+Architecture: any
+Depends: ${shlibs:Depends}
+Description: Linux module utilities for debian-installer.
+ modutils-udeb is a minimal package used by debian-installer.
+ This package contains only the binary 'insmod'.
diff -ur modutils-2.4.1.orig/debian/rules modutils-2.4.1/debian/rules
--- modutils-2.4.1.orig/debian/rules	Thu Jan 25 23:03:04 2001
+++ modutils-2.4.1/debian/rules	Thu Jan 25 22:49:09 2001
@@ -4,6 +4,11 @@
 package		:= modutils
 docdir		:= /usr/share/doc/$(package)
 tmpdir		:= $(shell pwd)/debian/tmp/
+udebtmpdir	:= $(shell pwd)/debian/modutils-udeb/
+version		:=$(shell dpkg-parsechangelog | grep ^Version: | cut -d ' ' -f 2)
+arch		:=$(shell dpkg --print-architecture)
+priority	:=$(shell grep ^Priority: debian/control | cut -d ' ' -f 2)
+udebfilename	:=$(package)-udeb_$(version)_$(arch).udeb 
 
 stamp-config:
 	mkdir -p debian/build
@@ -12,20 +17,29 @@
 		--mandir='$${prefix}'/share/man
 	touch stamp-config
 
+stamp-config-udeb:
+	mkdir -p debian/build-udeb
+	cd debian/build-udeb ; ../../configure --disable-root-check --disable-combined 
+	touch stamp-config-udeb
+
 stamp-build build: stamp-config
 	cd debian/build ; $(MAKE)
 	touch stamp-build
 
+stamp-build-udeb build-udeb: stamp-config-udeb
+	cd debian/build-udeb ; $(MAKE) UDEB_CFLAGS="-Os -fomit-frame-pointer"
+	touch stamp-build
+
 clean:
 	test -d debian
-	rm -rf debian/build debian/tmp
+	rm -rf debian/build debian/tmp debian/build-udeb debian/modutils-udeb
 	-rm -rf debian/files* debian/substvars
-	-rm -f stamp-config stamp-build
+	-rm -f stamp-config stamp-build stamp-config-udeb stamp-build-udeb debian/files~
 
 binary-indep:
 	@echo Nothing to do
 
-binary-arch: checkroot stamp-build
+binary-arch: checkroot stamp-build stamp-build-udeb
 	test -d debian
 	-rm -rf debian/tmp
 	install -d -m 755 -o root -g root debian/tmp
@@ -44,6 +58,17 @@
 
 	rm -f $(tmpdir)/usr/share/man/man8/kdstat.8
 
+# Install udeb binary
+	cd debian/build-udeb ; $(MAKE) exec_prefix=$(udebtmpdir) install
+
+# Remove all the udeb doesn't need
+	rm -rf $(udebtmpdir)/usr/
+	rm -f $(udebtmpdir)/sbin/depmod $(udebtmpdir)/sbin/genksyms \
+		$(udebtmpdir)/sbin/insmod_ksymoops_clean $(udebtmpdir)/sbin/kallsyms \
+		$(udebtmpdir)/sbin/kernelversion $(udebtmpdir)/sbin/ksyms \
+		$(udebtmpdir)/sbin/lsmod $(udebtmpdir)/sbin/modinfo \
+		$(udebtmpdir)/sbin/modprobe $(udebtmpdir)/sbin/rmmod
+
 # Do some changes for Debian
 	-strip debian/tmp/sbin/*
 	chmod 644 debian/tmp/usr/share/man/*/*
@@ -107,15 +132,33 @@
 	install -p -m 755 -o root -g root debian/prerm debian/tmp/DEBIAN
 	install -p -m 755 -o root -g root debian/postrm debian/tmp/DEBIAN
 
+# Install Debian system files for udeb
+	install -d -m 755 -o root -g root $(udebtmpdir)/DEBIAN
+	install -p -m 644 -o root -g root debian/control $(udebtmpdir)/DEBIAN
+
 # Some left-over stuff
 	install -d -m 755 -o root -g root debian/tmp/usr/bin
 	ln -s /sbin/genksyms debian/tmp/usr/bin/genksyms
 
+# generate modutils package
 	dpkg-shlibdeps debian/tmp/sbin/*
-	dpkg-gencontrol -isp
+	dpkg-gencontrol -isp -pmodutils 
 	chown -R root.root debian/tmp
 	chmod -R go=rX debian/tmp
 	dpkg --build debian/tmp ..
+
+# generate modutils-udeb package
+	dpkg-shlibdeps debian/modutils-udeb/sbin/*
+
+	# dpkg doesn't understand this will be a udeb, prevent it from
+	# writing an incorrent entry to debian/files
+	dpkg-gencontrol -pmodutils-udeb -Pdebian/modutils-udeb -fdebian/files~
+	
+	# register the udeb manually
+	dpkg-distaddfile $(udebfilename) \
+		debian-installer $(priority)
+	
+	dpkg --build debian/modutils-udeb ../$(udebfilename)  
 
 # Below here is fairly generic really
 



Reply to: