summaryrefslogtreecommitdiff
blob: 214cb743f8b1c1c337161edd72fdb22542d57a7a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
--- generate-modprobe.conf.agriffis	2004-04-05 01:22:23.000000000 -0400
+++ generate-modprobe.conf	2004-05-07 17:54:41.993713800 -0400
@@ -1,20 +1,33 @@
-#! /bin/sh -e
-
+#!/bin/bash
+#
 # Naive shell script to translate modules.conf + defaults to modprobe.conf
 # Normal caveats apply, as with any machine translation.
-if [ $# -gt 2 -o x"$1" = x--help ]; then
-    echo "Usage: $0 [--stdin] [modprobe.conf]"
-    echo "   Converts your current modules setup to modprobe.conf."
-    echo "   Don't trust it too much."
-    echo " Version 0.1"
-    exit 1
-fi
+#
+# Updated 07 May 2004 by Aron Griffis <agriffis@gentoo.org> to support
+# --assume-kernel option for Gentoo LiveCD building.  See
+# http://bugs.gentoo.org/show_bug.cgi?id=49926
 
+# Parse command-line
 STDIN=
-if [ "$1" = "--stdin" ]; then
-  STDIN=1
-  shift
-fi
+KV=`uname -r`
+while [[ "$1" == --* ]]; do
+    case "$1" in
+	--assume-kernel=*)
+	    KV=${1#*=}
+	    ;;
+	--stdin)
+	    STDIN=1
+	    ;;
+	*)
+	    echo "Usage: $0 [--stdin] [--assume-kernel=n.n.n] [modprobe.conf]"
+	    echo "   Converts your current modules setup to modprobe.conf."
+	    echo "   Don't trust it too much."
+	    echo " Version 0.1"
+	    exit 1
+	    ;;
+    esac
+    shift
+done
 
 # Set up output if specified.
 if [ $# -eq 1 ]; then exec > $1; fi
@@ -221,7 +234,7 @@
 	($0 $MODULE)
 	;;
     # Ignore default lines which are not required any more.
-    "path[boot]=/lib/modules/boot"|"path[toplevel]=/lib/modules/`uname -r`"|"path[toplevel]=/lib/modules/2.4"|"path[kernel]=/lib/modules/kernel"|"path[fs]=/lib/modules/fs"|"path[net]=/lib/modules/net"|"path[scsi]=/lib/modules/scsi"|"path[block]=/lib/modules/block"|"path[cdrom]=/lib/modules/cdrom"|"path[ipv4]=/lib/modules/ipv4"|"path[ipv6]=/lib/modules/ipv6"|"path[sound]=/lib/modules/sound"|"path[fc4]=/lib/modules/fc4"|"path[video]=/lib/modules/video"|"path[misc]=/lib/modules/misc"|"path[pcmcia]=/lib/modules/pcmcia"|"path[atm]=/lib/modules/atm"|"path[usb]=/lib/modules/usb"|"path[ide]=/lib/modules/ide"|"path[ieee1394]=/lib/modules/ieee1394"|"path[mtd]=/lib/modules/mtd"|"generic_stringfile=/lib/modules/`uname -r`/modules.generic_string"|"pcimapfile=/lib/modules/`uname -r`/modules.pcimap"|"isapnpmapfile=/lib/modules/`uname -r`/modules.isapnpmap"|"usbmapfile=/lib/modules/`uname -r`/modules.usbmap"|"parportmapfile=/lib/modules/`uname -r`/modules.parportmap"|"ieee1394mapfile=/lib/modules/`uname -r`/modules.ieee1394map"|"pnpbiosmapfile=/lib/modules/`uname -r`/modules.pnpbiosmap"|"depfile=/lib/modules/`uname -r`/modules.dep"|"persistdir=/var/lib/modules/persist")
+    "path[boot]=/lib/modules/boot"|"path[toplevel]=/lib/modules/$KV"|"path[toplevel]=/lib/modules/2.4"|"path[kernel]=/lib/modules/kernel"|"path[fs]=/lib/modules/fs"|"path[net]=/lib/modules/net"|"path[scsi]=/lib/modules/scsi"|"path[block]=/lib/modules/block"|"path[cdrom]=/lib/modules/cdrom"|"path[ipv4]=/lib/modules/ipv4"|"path[ipv6]=/lib/modules/ipv6"|"path[sound]=/lib/modules/sound"|"path[fc4]=/lib/modules/fc4"|"path[video]=/lib/modules/video"|"path[misc]=/lib/modules/misc"|"path[pcmcia]=/lib/modules/pcmcia"|"path[atm]=/lib/modules/atm"|"path[usb]=/lib/modules/usb"|"path[ide]=/lib/modules/ide"|"path[ieee1394]=/lib/modules/ieee1394"|"path[mtd]=/lib/modules/mtd"|"generic_stringfile=/lib/modules/$KV/modules.generic_string"|"pcimapfile=/lib/modules/$KV/modules.pcimap"|"isapnpmapfile=/lib/modules/$KV/modules.isapnpmap"|"usbmapfile=/lib/modules/$KV/modules.usbmap"|"parportmapfile=/lib/modules/$KV/modules.parportmap"|"ieee1394mapfile=/lib/modules/$KV/modules.ieee1394map"|"pnpbiosmapfile=/lib/modules/$KV/modules.pnpbiosmap"|"depfile=/lib/modules/$KV/modules.dep"|"persistdir=/var/lib/modules/persist")
 	;;
 
     # Ignore prune lines unless they end in .o or .ko, which would