summaryrefslogtreecommitdiffstats
path: root/meta/recipes-kernel/update-modules/update-modules-1.0/update-modules
diff options
context:
space:
mode:
authorLaurentiu Palcu <laurentiu.palcu@intel.com>2013-02-04 13:36:51 +0200
committerRichard Purdie <richard.purdie@linuxfoundation.org>2013-02-04 12:41:56 +0000
commit285471c31284284d36a811b2bbd584104c3f9196 (patch)
treead87fc1061eb0d8e0245fe3885f185407c68d3e7 /meta/recipes-kernel/update-modules/update-modules-1.0/update-modules
parent75f470cd18d693a9a96d9849291c2c8de4dcbeb8 (diff)
downloadpoky-285471c31284284d36a811b2bbd584104c3f9196.tar.gz
update-modules: remove recipe from oe-core
update-modules is not used anymore. Any references to it have been removed, some time ago, from all recipes/bbclasses. It stayed in oe-core in case anybody still wanted to use it. Time for it to go. (From OE-Core rev: b8c5f1facd9f9878e137f803b45e99d4e7214d20) Signed-off-by: Laurentiu Palcu <laurentiu.palcu@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-kernel/update-modules/update-modules-1.0/update-modules')
-rwxr-xr-xmeta/recipes-kernel/update-modules/update-modules-1.0/update-modules209
1 files changed, 0 insertions, 209 deletions
diff --git a/meta/recipes-kernel/update-modules/update-modules-1.0/update-modules b/meta/recipes-kernel/update-modules/update-modules-1.0/update-modules
deleted file mode 100755
index 99040a1ab4..0000000000
--- a/meta/recipes-kernel/update-modules/update-modules-1.0/update-modules
+++ /dev/null
@@ -1,209 +0,0 @@
1#!/bin/sh
2#
3# This is the update-modules script for Debian GNU/Linux.
4# Copyright 1998-2001 Wichert Akkerman <wakkerma@debian.org>
5# Licensed under the GNU GPL, version 2
6#
7
8MODCONFFILE=/etc/modules.conf
9MODCONFTMPFILE="${MODCONFFILE}.$$"
10MODULESFILE=/etc/modules
11MODULESTMPFILE="${MODULESFILE}.$$"
12
13ARCHDIR=/etc/modutils/arch
14CPUDIR=/etc/modutils/cpu
15HEADER="### This file is automatically generated by update-modules"
16
17set -e
18
19if [ "$1" = "force" ] ; then
20 force=1
21else
22 force=
23fi
24
25# Reset the sorting order since we depend on it
26LC_COLLATE=C
27export LC_COLLATE
28
29depdir()
30{
31 dep=`grep '[[:space:]]*depfile' "${MODCONFFILE}" | tail -n 1 | sed -e 's/depfile=//' -e 's,/[^/]*$,,'`
32 if [ -z "$dep" ] ; then
33 dep="/lib/modules/`uname -r`"
34 fi
35
36 echo $dep
37}
38
39arch() {
40 local model=`uname -m`
41 case $model in
42 i[0-9]86) model=i386; ;;
43 sun4u) model=sparc64; ;;
44 arm*) model=arm; ;;
45 ppc) model=powerpc; ;;
46 esac
47 echo $model
48}
49
50archmodel() {
51 local arch=`arch`
52 local model=""
53 if [ $arch = "m68k" ]; then
54 if [ -f /proc/hardware ]; then
55 model=`sed -ne 's/^Model:[[:space:]]*//p' /proc/hardware`
56 case $model in
57 Atari*) model="atari"; ;;
58 Amiga*) model="amiga"; ;;
59 Macintosh*) model="mac"; ;;
60 Motorola*) model="MVME"; ;;
61 *) model="generic"; ;;
62 esac
63 model=".${model}"
64 else
65 echo "/proc/hardware does not exist, assuming general m68k system"
66 model=".generic"
67 fi
68 elif [ $arch = "powerpc" ]; then
69 if [ -f /proc/cpuinfo ]; then
70 model=`sed -ne 's/^machine[[:space:]]*:[[:space:]]*//p' /proc/cpuinfo`
71 case $model in
72 Amiga*) model="apus"; ;;
73 Power*) model="pmac"; ;;
74 *) model="generic"; ;;
75 esac
76 model=".${model}"
77 else
78 echo "/proc/cpuinfo does not exist, assuming general powerpc system"
79 model=".generic"
80 fi
81 fi
82 echo "${arch}${model}"
83}
84
85checkoverwrite() {
86 local cfgfile="$1"
87
88 if [ -f "$cfgfile" ]; then
89 if ! sed -ne 1p "$cfgfile" | grep -q "^$HEADER" ; then
90 echo "Error: the current $cfgfile is not automatically generated." >&2
91 if [ -z "$force" ]; then
92 echo "Use \"update-modules force\" to force (re)generation."
93 exit 1
94 else
95 echo "force specified, (re)generating file anyway."
96 fi
97 fi
98 fi
99}
100
101createfile() {
102 cat <<EOF > "$1"
103$HEADER"
104#
105# Please do not edit this file directly. If you want to change or add
106# anything please take a look at the files in /etc/modutils, /etc/modules-load.d
107# and read the manpage for update-modules.
108#
109EOF
110}
111
112addfile() {
113 local src="$1"
114 local tgt="$2"
115
116 echo "### update-modules: start processing $src" >> "$tgt"
117 if [ -x "$src" ]; then
118 if ! "$src" >> "$tgt" ; then
119 echo "Error while executing $src, aborting" >&2
120 exit 1
121 fi
122 else
123 cat "$src" >> "$tgt"
124 fi
125 cat <<EOF >> "$tgt"
126
127### update-modules: end processing $cfg
128
129EOF
130}
131
132
133checkoverwrite "$MODCONFFILE"
134
135if [ 0 -ne "`id -u`" ]; then
136 echo "You have to be root to do this." >&2
137 exit 2
138fi
139
140model=`archmodel`
141oldmodel=$model
142
143while [ ! -f "${ARCHDIR}/${model}" ]; do
144 oldmodel=$model
145 model=`echo $oldmodel | sed -e 's/\.[^.]\+//'`
146 if [ "$model" = "$oldmodel" ]; then
147 break
148 fi
149 echo "Configuration for $oldmodel not found, trying $model"
150done
151
152CONF="${ARCHDIR}/${model}"
153
154if [ ! -f "$CONF" ]; then
155 ## echo "Architecture-specific modutils configuration not found, using defaults"
156 CONF="${ARCHDIR}/generic"
157fi
158
159[ -e "$MODCONFFILE" ] && cp -f "$MODCONFFILE" "${MODCONFFILE}.old"
160
161createfile "$MODCONFTMPFILE"
162createfile "$MODULESTMPFILE"
163
164# well we're using /etc/modprobe.d/*.conf instead of /etc/modutils/*.conf anyway..
165for cfg in /etc/modutils/* $CONF ; do
166 if [ -f "$cfg" ]; then # this check is necesarry to skip /etc/modutils/archs
167 if echo $cfg | grep -q '\.dpkg-[a-z]*\|~$' ; then
168 true
169 elif echo $cfg | grep -q '\.conf$' ; then
170 addfile "$cfg" "$MODCONFTMPFILE"
171 else
172 echo "Please migrate your $cfg file to /etc/modules-load.d/*.conf"
173 addfile "$cfg" "$MODULESTMPFILE"
174 fi
175 fi
176done
177for cfg in /etc/modules-load.d/*.conf; do
178 if [ -f "$cfg" ]; then # this check is necesarry to skip weird entries
179 if echo $cfg | grep -q '\.dpkg-[a-z]*\|~$' ; then
180 true
181 else
182 addfile "$cfg" "$MODULESTMPFILE"
183 fi
184 fi
185done
186
187first_time=0
188if [ ! -f $MODULESFILE ]; then
189 first_time=1
190fi
191
192mv "$MODCONFTMPFILE" "$MODCONFFILE"
193mv "$MODULESTMPFILE" "$MODULESFILE"
194
195# Don't run modutils.sh if systemd is installed
196if [ $first_time -eq 1 ] && [ ! -e /bin/systemctl ]; then
197 /etc/init.d/modutils.sh || true
198fi
199
200# We also call depmod here to stop insmod from complaining that modules.conf
201# is more recent then modules.dep
202#
203if [ -d "`depdir`" -a -f /proc/modules ]
204then
205 depmod -A || true
206fi
207
208exit 0
209