#!/bin/bash # # receive # # This script takes the zip files generated by ship, and puts them # in the proper places in a Linux kernel tree. # # # DUMPDIR=/root/received LINUXDIR=/root/linux/ SRCDIR=/root/desk ACPISUBDIRS="utilities dispatcher events hardware executer namespace\ parser resources tables debugger" ACPIVER="linuxdebug" if [ -n "$1" -a "$1" = "new" ]; then LINUXVER="linux-new" else LINUXVER="linux" fi echo Clearing $DUMPDIR rm -rf $DUMPDIR mkdir $DUMPDIR mkdir -p $DUMPDIR/drivers/acpi echo "Unzipping to $DUMPDIR" unzip $SRCDIR/$ACPIVER.zip -d $DUMPDIR/drivers/acpi >/dev/null unzip $SRCDIR/$LINUXVER.zip -d $DUMPDIR >/dev/null echo Flattening directory structure mv $DUMPDIR/drivers/acpi/interpreter/* $DUMPDIR/drivers/acpi rmdir $DUMPDIR/drivers/acpi/interpreter rm -rf $DUMPDIR/drivers/acpi/ia64 echo Deleting extraneous files/dirs rm -f $DUMPDIR/drivers/acpi/utilities/utclib.c rm -f $DUMPDIR/drivers/acpi/parser/psfind.c rm -f $DUMPDIR/drivers/acpi/include/platform/acwin.h rm -f $DUMPDIR/drivers/acpi/include/platform/acefi.h rm -f $DUMPDIR/drivers/acpi/include/platform/acmsvc.h rm -f $DUMPDIR/drivers/acpi/include/platform/acfreebsd.h find $DUMPDIR -name "*.scc" |xargs rm echo Copying Subdirectory Makefiles for i in $ACPISUBDIRS; do cp $DUMPDIR/drivers/acpi/subdirectories/Makefile \ $DUMPDIR/drivers/acpi/$i done rm -rf $DUMPDIR/drivers/acpi/subdirectories #echo Moving OSPM includes to include directory #mkdir -p $DUMPDIR/drivers/acpi/ospm/include #find $DUMPDIR/drivers/acpi/ospm -name "*.h" | xargs -i mv {} \ # $DUMPDIR/drivers/acpi/ospm/include echo Fixing line-termination (cd $DUMPDIR;d2u) >/dev/null echo Fixing permissions chmod -R a-x $DUMPDIR chmod -R u+rw $DUMPDIR find $DUMPDIR -type d|xargs chmod a+x echo "Copying to acpi directory" rm -rf $LINUXDIR/drivers/acpi cp -r $DUMPDIR/* $LINUXDIR echo Done.