1 /* $OpenBSD: build.c,v 1.2 2006/11/13 02:52:46 jsg Exp $ */
5 * Damien Bergamini <damien.bergamini@free.fr>
7 * Permission to use, copy, modify, and distribute this software for any
8 * purpose with or without fee is hereby granted, provided that the above
9 * copyright notice and this permission notice appear in all copies.
11 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
12 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
13 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
14 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
15 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
16 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
17 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
20 #include <sys/types.h>
27 #include "microcode.h"
30 output(const char *name
, const uint8_t *ucode
, int size
)
35 printf("creating %s length %d\n", name
, size
);
37 fd
= open(name
, O_WRONLY
| O_CREAT
| O_TRUNC
, 0644);
41 rlen
= write(fd
, ucode
, size
);
45 errx(1, "%s: short write", name
);
53 output("zyd-zd1211", zd1211_firmware
, sizeof zd1211_firmware
);
54 output("zyd-zd1211b", zd1211b_firmware
, sizeof zd1211b_firmware
);