1#!/bin/sh
2#/* ISDN4BSD code */
3#
4# $MirOS: src/sys/dev/microcode/daic/gendnloadh,v 1.1.7.1 2005/03/06 16:33:46 tg Exp $
5
6# Copyright (c) 1997 Martin Husemann <martin@rumolt.teuto.de>
7# All rights reserved.
8#
9# Redistribution and use in source and binary forms, with or without
10# modification, are permitted provided that the following conditions
11# are met:
12# 1. Redistributions of source code must retain the above copyright
13#    notice, this list of conditions and the following disclaimer.
14# 2. The name of the author may not be used to endorse or promote products
15#    derived from this software withough specific prior written permission
16#
17# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
18# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
19# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
20# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
21# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
22# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
23# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
24# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
26# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27
28if [ \! -e dnload.bin ]; then
29	echo "Faking dnload.h"
30	cp dnload.h-dist dnload.h
31	exit 0
32fi
33
34echo "Generating dnload.h from dnload.bin"
35
36cat << EOF > dnload.h
37/*
38 * File: dnload.h
39 * Generated from: `ls -lT dnload.bin | awk '{print $10, $6, $7, $8, $9}'`
40 * By: `id -un`@`hostname`, `date`
41 *
42 * DO NOT EDIT THIS FILE!
43 */
44
45/* ------------------------------------------------------------------------- */
46static u_int8_t dnload[] = {
47EOF
48
49hexdump -v -e '" /* %04.4_ax */\t" 8/1 "0x%02x, " "\n"' -s 0x200 dnload.bin >> dnload.h
50
51cat << EOF >> dnload.h
52 0
53};
54
55/* ------------------------------------------------------------------------- */
56EOF
57