2 /* $OpenBSD: build.c,v 1.1 2006/01/09 20:03:40 damien Exp $ */
6 * Damien Bergamini <damien.bergamini@free.fr>
8 * Permission to use, copy, modify, and distribute this software for any
9 * purpose with or without fee is hereby granted, provided that the above
10 * copyright notice and this permission notice appear in all copies.
12 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
13 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
14 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
15 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
16 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
17 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
18 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
21 #include <sys/types.h>
28 #include "microcode.h"
31 output(const char *name
, const uint8_t *ucode
, int size
)
36 printf("creating %s length %d\n", name
, size
);
38 fd
= open(name
, O_WRONLY
| O_CREAT
| O_TRUNC
, 0644);
42 rlen
= write(fd
, ucode
, size
);
46 errx(1, "%s: short write", name
);
54 output("ral-rt2561", rt2561
, sizeof rt2561
);
55 output("ral-rt2561s", rt2561s
, sizeof rt2561s
);
56 output("ral-rt2661", rt2661
, sizeof rt2661
);