File: oss-move

package info (click to toggle)
alsa-driver 1.0.13-5etch1
  • links: PTS
  • area: main
  • in suites: etch
  • size: 20,108 kB
  • ctags: 50,477
  • sloc: ansic: 319,881; sh: 32,930; makefile: 2,015; python: 1,527; perl: 1,316; xml: 896; awk: 66
file content (201 lines) | stat: -rwxr-xr-x 4,323 bytes parent folder | download | duplicates (5)
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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
#!/bin/bash

basekdir=/usr/src/linux
#basekdir=/home/src/1/linux
kdir=$basekdir/drivers/sound
if [ "x$1" != "x" ]; then
  kdir="$1"
fi
backup=$kdir/../sound.backup

rm -rf `find $kdir -name "*.[ao]"`
rm -rf $kdir/oss
if [ -d $backup ]; then
  rm -rf $kdir/*
  mv $backup/* $kdir
fi

mkdir -p $backup
rm -rf $backup/*
cp -a $kdir/* $backup

mkdir $kdir/oss
mv $kdir/*.[chS] $kdir/oss
mv $kdir/README* $kdir/COPYING $kdir/CHANGELOG $kdir/oss
mv $kdir/Makefile $kdir/oss
mv $kdir/Config.in $kdir/oss
mv $kdir/cs4281 $kdir/oss
mv $kdir/dmasound $kdir/oss
mv $kdir/emu10k1 $kdir/oss
mv $kdir/oss/sound_firmware.[ch] $kdir
mv $kdir/oss/sound_core.c $kdir

cat > $kdir/Config.in << EOF
# drivers/sound/Config.in
#

mainmenu_option next_comment
comment 'Open Sound System'

tristate 'Open Sound System' CONFIG_SOUND_PRIME
if [ "\$CONFIG_SOUND_PRIME" != "n" ]; then
  source drivers/sound/oss/Config.in
fi

endmenu

mainmenu_option next_comment
comment 'Advanced Linux Sound Architecture'

tristate 'Advanced Linux Sound Architecture' CONFIG_SND
if [ "\$CONFIG_SND" != "n" ]; then
  source drivers/sound/Alsa-Config.in
fi

endmenu
EOF

cat > $kdir/Makefile << EOF
# Makefile for the Linux sound card driver
#

export-objs     := sound_core.o

obj-\$(CONFIG_SOUND) += soundcore.o

subdir-\$(CONFIG_SOUND_PRIME) += oss

ifeq (\$(CONFIG_SOUND_PRIME),y)
  obj-y += oss/sounddrivers.o
endif

subdir-\$(CONFIG_SND) += alsa lowlevel cards

ifeq (\$(CONFIG_SND),y)
  obj-y += alsa/s.o lowlevel/lowlevel.o cards/cards.o
endif

list-multi      := soundcore.o

soundcore-objs  := sound_core.o sound_firmware.o

O_TARGET := sounddrivers.o

include \$(TOPDIR)/Rules.make


soundcore.o: \$(soundcore-objs)
	\$(LD) -r -o \$@ \$(soundcore-objs)
EOF

cd $kdir
patch -p0 << EOF
--- sound_firmware.c.old	Tue Jul 10 13:23:20 2001
+++ sound_firmware.c	Tue Jul 10 13:24:22 2001
@@ -1,4 +1,4 @@
-#include "os.h"
+#include <linux/vmalloc.h>
 #define __KERNEL_SYSCALLS__
 #include <linux/module.h>
 #include <linux/fs.h>
EOF
cd -


cd $kdir/oss

if [ -d $kdir/alsa ]; then

  echo "ALSA already installed, trying to recover."

  patch -R -p0 << EOF
--- Makefile.old	Mon Mar 19 20:19:24 2001
+++ Makefile	Fri Mar 23 23:28:04 2001
@@ -83,6 +83,11 @@
   obj-y += dmasound/dmasound.o
 endif
 
+subdir-\$(CONFIG_SND) += alsa lowlevel cards
+
+ifeq (\$(CONFIG_SND),y)
+  obj-y += alsa/s.o lowlevel/lowlevel.o cards/cards.o
+endif
 
 # Declare multi-part drivers.
 
EOF

  patch -p0 << EOF
--- Config.in.old	Mon Oct 15 17:39:36 2001
+++ Config.in	Mon Oct 15 17:39:42 2001
@@ -212,12 +212,3 @@
   fi
 fi
 
-mainmenu_option next_comment
-comment 'Advanced Linux Sound Architecture'
-
-tristate 'Advanced Linux Sound Architecture' CONFIG_SND
-if [ "\$CONFIG_SND" != "n" ]; then
-  source drivers/sound/Alsa-Config.in
-fi
-
-endmenu
EOF

fi

patch -p0 << EOF
--- Makefile.old	Tue Jul 10 10:57:29 2001
+++ Makefile	Tue Jul 10 11:02:55 2001
@@ -9,12 +9,11 @@
 
 export-objs	:=  ad1848.o audio_syms.o midi_syms.o mpu401.o \\
 		    msnd.o opl3.o sb_common.o sequencer_syms.o \\
-		    sound_core.o sound_syms.o uart401.o	\\
+		    sound_syms.o uart401.o	\\
 		    nm256_audio.o ac97.o ac97_codec.o aci.o
 
 # Each configuration option enables a list of files.
 
-obj-\$(CONFIG_SOUND)		+= soundcore.o
 obj-\$(CONFIG_SOUND_OSS)		+= sound.o
 obj-\$(CONFIG_SOUND_CS4232)	+= cs4232.o ad1848.o 
 
@@ -87,7 +86,7 @@
 # Declare multi-part drivers.
 
 list-multi	:= sound.o gus.o pas2.o sb.o sb_lib.o vidc_mod.o \\
-    soundcore.o wavefront.o
+    wavefront.o
 
 sound-objs	:= 							\\
     dev_table.o soundcard.o sound_syms.o		\\
@@ -95,8 +94,6 @@
     midi_syms.o midi_synth.o midibuf.o					\\
     sequencer.o sequencer_syms.o sound_timer.o sys_timer.o
 
-soundcore-objs	:= sound_core.o sound_firmware.o
-
 gus-objs	:= gus_card.o gus_midi.o gus_vol.o gus_wave.o ics2101.o
 pas2-objs	:= pas2_card.o pas2_midi.o pas2_mixer.o pas2_pcm.o
 sb-objs		:= sb_card.o
@@ -115,9 +112,6 @@
 
 sound.o: \$(sound-objs)
 	\$(LD) -r -o \$@ \$(sound-objs)
-
-soundcore.o: \$(soundcore-objs)
-	\$(LD) -r -o \$@ \$(soundcore-objs)
 
 gus.o: \$(gus-objs)
 	\$(LD) -r -o \$@ \$(gus-objs)

EOF
cd -

cat << EOF
The directory $kdir/../sound.backup contains backup of original sources.
Don't forget to run bellow command, if you apply the ALSA patch later:
mv $kdir/Makefile.orig $kdir/Makefile
EOF