xref: /freebsd/sys/contrib/dev/acpica/acpica_prep.sh (revision eacee0ff7ec955b32e09515246bd97b6edcd2b0f)
1#!/bin/sh
2# $FreeBSD$
3#
4# Unpack an ACPI CA drop and restructure it to fit the FreeBSD layout
5#
6
7src=$1
8wrk=./_acpi_ca_unpack
9dst=./acpi_ca_destination
10
11# files to remove
12stripdirs="compiler"
13stripfiles="osunixxf.c 16bit.h Makefile a16find.c a16utils.asm a16utils.obj\
14    acintel.h aclinux.h acmsvc.h acwin.h acwin64.h getopt.c"
15
16# pre-clean
17echo pre-clean
18rm -rf ${wrk}
19rm -rf ${dst}
20mkdir -p ${wrk}
21mkdir -p ${dst}
22
23# unpack
24echo unpack
25tar -x -z -f ${src} -C ${wrk}
26
27# strip files
28echo strip
29for i in ${stripdirs}; do
30    find ${wrk} -name ${i} -type d | xargs rm -r
31done
32for i in ${stripfiles}; do
33    find ${wrk} -name ${i} -type f -delete
34done
35
36# move files to destination
37echo copy
38find ${wrk} -type f | xargs -J % mv % ${dst}
39
40# post-clean
41echo post-clean
42rm -rf ${wrk}