2 #if HAVE_NBTOOL_CONFIG_H
3 #include "nbtool_config.h"
8 __RCSID("$NetBSD: ews4800mips.c,v 1.1 2005/12/29 15:32:20 tsutsui Exp $");
11 #include <sys/param.h>
15 #include "installboot.h"
17 static int ews4800mips_setboot(ib_params
*);
19 struct ib_mach ib_mach_ews4800mips
=
20 { "ews4800mips", ews4800mips_setboot
, no_clearboot
, no_editboot
, 0};
22 struct bbinfo_params ews4800mips_bbparams
= {
23 EWS4800MIPS_BBINFO_MAGIC
,
24 EWS4800MIPS_BOOT_BLOCK_OFFSET
,
25 EWS4800MIPS_BOOT_BLOCK_BLOCKSIZE
,
26 EWS4800MIPS_BOOT_BLOCK_MAX_SIZE
,
32 ews4800mips_setboot(ib_params
*params
)
34 u_int8_t buf
[EWS4800MIPS_BOOT_BLOCK_MAX_SIZE
];
37 rv
= pread(params
->s1fd
, buf
, sizeof buf
, 0);
39 warn("Reading `%s'", params
->stage1
);
41 } else if (rv
!= sizeof buf
) {
42 warnx("Reading `%s' : short read", params
->stage1
);
46 if (params
->flags
& IB_NOWRITE
)
49 if (params
->flags
& IB_VERBOSE
)
50 printf("Writing boot block\n");
52 rv
= pwrite(params
->fsfd
, buf
, sizeof buf
, 0);
54 warn("Writing `%s'", params
->filesystem
);
56 } else if (rv
!= sizeof buf
) {
57 warnx("Writing `%s': short write", params
->filesystem
);