freebsd-dev/sys/contrib/dev/acpica/acpica_prep.sh
Andriy Gapon e21bbd1743 MFC r197104,197105,197106,197107,197688,198237,199337,199338,200553,200554,
202771,202773: bring acpica version to 20100121

MFC details:
r197104 | jkim | 2009-09-12 01:48:53 +0300 (Sat, 12 Sep 2009) | 4 lines
MFV:    r196804
Import ACPICA 20090903

r197105 | jkim | 2009-09-12 01:49:34 +0300 (Sat, 12 Sep 2009) | 2 lines
Catch up with ACPICA 20090903.

r197106 | jkim | 2009-09-12 01:50:15 +0300 (Sat, 12 Sep 2009) | 2 lines
Catch up with ACPICA 20090903.

r197107 | jkim | 2009-09-12 01:56:08 +0300 (Sat, 12 Sep 2009) | 2 lines
Canonify include paths for newly added files.

r197688 | jkim | 2009-10-01 23:56:15 +0300 (Thu, 01 Oct 2009) | 4 lines
Compile ACPI debugger and disassembler for kernel modules
unconditionally.
These files will generate almost empty object files without
ACPI_DEBUG/DDB
options.  As a result, size of acpi.ko will increase slightly.

r198237 | jkim | 2009-10-19 19:12:58 +0300 (Mon, 19 Oct 2009) | 2 lines
Merge ACPICA 20091013.

r199337 | jkim | 2009-11-16 23:47:12 +0200 (Mon, 16 Nov 2009) | 2 lines
Merge ACPICA 20091112.

r199338 | jkim | 2009-11-16 23:53:56 +0200 (Mon, 16 Nov 2009) | 2 lines
Add a forgotten module Makefile change from the previous commit.

r200553 | jkim | 2009-12-15 00:24:04 +0200 (Tue, 15 Dec 2009) | 2 lines
Merge ACPICA 20091214.

r200554 | jkim | 2009-12-15 00:28:32 +0200 (Tue, 15 Dec 2009) | 3 lines
Remove _FDE quirk handling as these quirks are automatically repaired
by ACPICA layer since ACPICA 20091214.

r202771 | jkim | 2010-01-21 23:14:28 +0200 (Thu, 21 Jan 2010) | 2 lines
Merge ACPICA 20100121.

r202773 | jkim | 2010-01-21 23:31:39 +0200 (Thu, 21 Jan 2010) | 2 lines
Fix a new header inclusion.

Discussed with:		jkim, jhb
No objections from:	acpi@
2010-02-06 12:03:25 +00:00

90 lines
2.7 KiB
Bash
Executable File

#!/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=`realpath ./_acpi_ca_unpack`
dst=`realpath ./acpi_ca_destination`
# files that should keep their full directory path
fulldirs="common compiler debugger disassembler dispatcher events \
executer hardware include namespace parser resources tables \
tools utilities"
# files to remove
stripdirs="acpisrc acpixtract examples generate os_specific"
stripfiles="Makefile README acintel.h aclinux.h acmsvc.h acnetbsd.h \
acos2.h accygwin.h acefi.h acwin.h acwin64.h aeexec.c \
aehandlers.c aemain.c aetables.c osunixdir.c readme.txt \
utclib.c"
# include files to canonify
src_headers="acapps.h accommon.h acconfig.h acdebug.h acdisasm.h \
acdispat.h acevents.h acexcep.h acglobal.h achware.h acinterp.h \
aclocal.h acmacros.h acnames.h acnamesp.h acobject.h acopcode.h \
acoutput.h acparser.h acpi.h acpiosxf.h acpixf.h acpredef.h \
acresrc.h acrestyp.h acstruct.h actables.h actbl.h actbl1.h \
actbl2.h actypes.h acutils.h amlcode.h amlresrc.h \
platform/acenv.h platform/acfreebsd.h platform/acgcc.h"
comp_headers="aslcompiler.h asldefine.h aslglobal.h asltypes.h"
platform_headers="acfreebsd.h acgcc.h"
# pre-clean
echo pre-clean
rm -rf ${wrk} ${dst}
mkdir -p ${wrk}
mkdir -p ${dst}
# 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
# copy files
echo copying full dirs
for i in ${fulldirs}; do
find ${wrk} -name ${i} -type d | xargs -J % mv % ${dst}
done
echo copying remaining files
find ${wrk} -type f | xargs -J % mv % ${dst}
# canonify include paths
for H in ${src_headers}; do
find ${dst} -name "*.[chy]" -type f | \
xargs sed -i "" -e "s|[\"<]$H[\">]|\<contrib/dev/acpica/include/$H\>|g"
done
for H in ${comp_headers}; do
find ${dst}/compiler -name "*.[chly]" -type f | \
xargs sed -i "" -e "s|[\"<]$H[\">]|\<contrib/dev/acpica/compiler/$H\>|g"
done
for H in ${platform_headers}; do
find ${dst}/include/platform -name "*.h" -type f | \
xargs sed -i "" -e "s|[\"<]$H[\">]|\<contrib/dev/acpica/include/platform/$H\>|g"
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/contrib/dev/acpica src/sys/dev/acpica \\"
echo " src/sys/amd64/acpica src/sys/i386/acpica src/sys/ia64/acpica \\"
echo " src/sys/amd64/include src/sys/i386/include src/sys/ia64/include \\"
echo " src/sys/boot src/sys/conf src/sys/modules/acpi src/usr.sbin/acpi"