blob: bb1605cbfb6bd0d909a5cdff6f2a76b2cb5ba3cc (
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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
|
#!/bin/sh
# $FreeBSD$
#
# Unpack an ACPI CA drop and restructure it to fit the FreeBSD layout
#
if [ ! $# -eq 1 ]; then
echo "usage: $0 acpica_archive"
exit
fi
src=$1
wrk=./_acpi_ca_unpack
dst=./acpi_ca_destination
# files that should keep their full directory path
fulldirs="common compiler"
# files to remove
stripdirs="generate acpisrc"
stripfiles="16bit.h Makefile README a16find.c a16utils.asm \
a16utils.lst a16utils.obj adisasm.h acdos16.h acintel.h \
aclinux.h acmsvc.h acnetbsd.h acwin.h acwin64.h readme.txt"
# files to update paths in
src_update_files="acpi.h acpiosxf.h"
# pre-clean
echo pre-clean
rm -rf ${wrk}
rm -rf ${dst}
mkdir -p ${wrk}
mkdir -p ${dst}
# fetch document
echo fetch document
fetch http://developer.intel.com/technology/iapc/acpi/downloads/CHANGES.txt
tr -d '\r' < CHANGES.txt > CHANGES.txt.tmp
mv CHANGES.txt.tmp CHANGES.txt
# unpack
echo unpack
tar -x -z -f ${src} -C ${wrk}
# strip files
echo strip
for i in ${stripdirs}; do
find ${wrk} -name ${i} -type d | xargs rm -r
done
for i in ${stripfiles}; do
find ${wrk} -name ${i} -type f -delete
done
echo copying full dirs
for i in ${fulldirs}; do
find ${wrk} -name ${i} -type d | xargs -J % mv % ${dst}
done
# move files to destination
echo copying flat dirs
find ${wrk} -type f | xargs -J % mv % ${dst}
mv CHANGES.txt ${dst}
# update src/headers for appropriate paths
echo updating paths
for i in ${src_update_files}; do
i=${dst}/$i
sed -e 's/platform\///' $i > $i.new && mv $i.new $i
done
# post-clean
echo post-clean
rm -rf ${wrk}
# assist the developer in generating a diff
echo "Directories you may want to 'cvs diff':"
echo " src/sys/dev/acpica src/sys/i386/acpica src/sys/ia64/acpica \\"
echo " src/sys/modules/acpi src/sys/boot src/sys/i386/include \\"
echo " src/usr.sbin/acpi src/sys/contrib/dev/acpica"
|