gnu-efi2netbsd revision 1.1.10.2 1 1.1.10.2 tls #! /bin/sh
2 1.1.10.2 tls #
3 1.1.10.2 tls # $NetBSD: gnu-efi2netbsd,v 1.1.10.2 2014/08/20 00:04:22 tls Exp $
4 1.1.10.2 tls #
5 1.1.10.2 tls # Copyright (c) 2011 The NetBSD Foundation, Inc.
6 1.1.10.2 tls # All rights reserved.
7 1.1.10.2 tls #
8 1.1.10.2 tls # Redistribution and use in source and binary forms, with or without
9 1.1.10.2 tls # modification, are permitted provided that the following conditions
10 1.1.10.2 tls # are met:
11 1.1.10.2 tls # 1. Redistributions of source code must retain the above copyright
12 1.1.10.2 tls # notice, this list of conditions and the following disclaimer.
13 1.1.10.2 tls # 2. Redistributions in binary form must reproduce the above copyright
14 1.1.10.2 tls # notice, this list of conditions and the following disclaimer in the
15 1.1.10.2 tls # documentation and/or other materials provided with the distribution.
16 1.1.10.2 tls #
17 1.1.10.2 tls # THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
18 1.1.10.2 tls # ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
19 1.1.10.2 tls # TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
20 1.1.10.2 tls # PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
21 1.1.10.2 tls # BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
22 1.1.10.2 tls # CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
23 1.1.10.2 tls # SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
24 1.1.10.2 tls # INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
25 1.1.10.2 tls # CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
26 1.1.10.2 tls # ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
27 1.1.10.2 tls # POSSIBILITY OF SUCH DAMAGE.
28 1.1.10.2 tls #
29 1.1.10.2 tls # gnu-efi2netbsd: convert an gnu-efi source tree into a
30 1.1.10.2 tls # NetBSD gnu-efi source tree, under src/sys/external/bsd,
31 1.1.10.2 tls #
32 1.1.10.2 tls # Rough instructions for importing new gnu-efi release:
33 1.1.10.2 tls #
34 1.1.10.2 tls # $ cd /some/where/temporary
35 1.1.10.2 tls # $ tar xpfz /new/gnu-efi/release/tar/file
36 1.1.10.2 tls # $ sh /usr/src/sys/external/bsd/gnu-efi/gnu-efi2netbsd gnu-efi-x.y
37 1.1.10.2 tls # $ cd gnu-efi-x.y
38 1.1.10.2 tls # $ cvs -d cvs.netbsd.org:/cvsroot import -m "Import gnu-efi-x.yz" src/sys/external/bsd/gnu-efi/dist GNU_EFI gnu-efi-x_y_z
39 1.1.10.2 tls # - check makefiles to see if any extra sources have been added.
40 1.1.10.2 tls # - update distrib/sets if necessary.
41 1.1.10.2 tls
42 1.1.10.2 tls if [ $# -ne 1 ]; then echo "gnu-efi2netbsd src"; exit 1; fi
43 1.1.10.2 tls
44 1.1.10.2 tls r=$1
45 1.1.10.2 tls case "$r" in
46 1.1.10.2 tls /*)
47 1.1.10.2 tls ;;
48 1.1.10.2 tls *)
49 1.1.10.2 tls r=`/bin/pwd`/$r
50 1.1.10.2 tls ;;
51 1.1.10.2 tls esac
52 1.1.10.2 tls
53 1.1.10.2 tls cd $r
54 1.1.10.2 tls
55 1.1.10.2 tls ### Remove GPL components
56 1.1.10.2 tls rm -r $r/debian
57 1.1.10.2 tls rm $r/gnuefi/setjmp_*.S
58 1.1.10.2 tls
59 1.1.10.2 tls ### Remove the $'s around RCS tags
60 1.1.10.2 tls cleantags $r
61 1.1.10.2 tls
62 1.1.10.2 tls ### Add our NetBSD RCS Id
63 1.1.10.2 tls find $r -type f -and \( -name '*.[Sch]' -or -name '*.lds' \) -print | while read c; do
64 1.1.10.2 tls sed 1q < $c | grep -q '\$NetBSD' || (
65 1.1.10.2 tls echo "/* \$NetBSD\$ */" >/tmp/gnu-efi2n$$
66 1.1.10.2 tls echo "" >>/tmp/gnu-efi2n$$
67 1.1.10.2 tls cat $c >> /tmp/gnu-efi2n$$
68 1.1.10.2 tls touch -r $c /tmp/gnu-efi2n$$
69 1.1.10.2 tls mv /tmp/gnu-efi2n$$ $c && echo added NetBSD RCS tag to $c
70 1.1.10.2 tls )
71 1.1.10.2 tls done
72 1.1.10.2 tls
73 1.1.10.2 tls echo done
74 1.1.10.2 tls
75 1.1.10.2 tls ### Clean up any CVS directories that might be around.
76 1.1.10.2 tls echo "cleaning up CVS residue."
77 1.1.10.2 tls find $r -type d -name "CVS" -print | xargs rm -r
78 1.1.10.2 tls echo done
79 1.1.10.2 tls
80 1.1.10.2 tls ### Fixing file and directory permissions.
81 1.1.10.2 tls echo "Fixing file/directory permissions."
82 1.1.10.2 tls (
83 1.1.10.2 tls find $r -type f -print | xargs chmod u+rw,go+r
84 1.1.10.2 tls find $r -type d -print | xargs chmod u+rwx,go+rx
85 1.1.10.2 tls )
86 1.1.10.2 tls echo done
87 1.1.10.2 tls
88 1.1.10.2 tls exit 0
89