1995-01-23 15:42:59 +00:00
|
|
|
/*
|
|
|
|
* Copyright (c) 1995 Ugen J.S.Antsilevich
|
|
|
|
*
|
|
|
|
* Redistribution and use in source forms, with and without modification,
|
|
|
|
* are permitted provided that this entire comment appears intact.
|
|
|
|
*
|
|
|
|
* Redistribution in binary form may occur without any restrictions.
|
|
|
|
* Obviously, it would be nice if you gave credit where credit is due
|
|
|
|
* but requiring it would be too onerous.
|
|
|
|
*
|
|
|
|
* This software is provided ``AS IS'' without any warranties of any kind.
|
|
|
|
*
|
|
|
|
* Device configuration to kernel image saving utility.
|
|
|
|
*/
|
|
|
|
|
1998-06-08 06:44:05 +00:00
|
|
|
#ifndef lint
|
|
|
|
static const char rcsid[] =
|
1998-10-06 07:32:45 +00:00
|
|
|
"$Id: dset.c,v 1.13 1998/06/28 19:06:17 bde Exp $";
|
1998-06-08 06:44:05 +00:00
|
|
|
#endif /* not lint */
|
|
|
|
|
|
|
|
#include <err.h>
|
1995-01-23 15:42:59 +00:00
|
|
|
#include <fcntl.h>
|
|
|
|
#include <kvm.h>
|
1998-06-08 06:44:05 +00:00
|
|
|
#include <a.out.h>
|
1995-01-23 15:42:59 +00:00
|
|
|
#include <limits.h>
|
1998-06-08 06:44:05 +00:00
|
|
|
#include <paths.h>
|
|
|
|
#include <stdio.h>
|
|
|
|
#include <string.h>
|
1995-01-23 15:42:59 +00:00
|
|
|
#include <unistd.h>
|
|
|
|
#include <sys/stat.h>
|
|
|
|
#include <sys/types.h>
|
|
|
|
#include <sys/param.h>
|
|
|
|
#include "i386/isa/isa_device.h"
|
|
|
|
|
1997-09-09 12:51:02 +00:00
|
|
|
#include "i386/isa/pnp.h"
|
|
|
|
struct pnp_cinfo new_ov[MAX_PNP_LDN];
|
|
|
|
struct pnp_cinfo old_ov[MAX_PNP_LDN];
|
|
|
|
|
1995-01-23 15:42:59 +00:00
|
|
|
#define TRUE 1
|
|
|
|
#define FALSE 0
|
|
|
|
|
|
|
|
struct nlist nl[] = {
|
|
|
|
#define N_TABTTY 0
|
|
|
|
{"_isa_devtab_tty"},
|
|
|
|
#define N_TABBIO 1
|
|
|
|
{"_isa_devtab_bio"},
|
|
|
|
#define N_TABNET 2
|
|
|
|
{"_isa_devtab_net"},
|
1998-10-06 07:32:45 +00:00
|
|
|
#define N_TABCAM 3
|
|
|
|
{"_isa_devtab_cam"},
|
|
|
|
#define N_TABNULL 4
|
1995-01-23 15:42:59 +00:00
|
|
|
{"_isa_devtab_null"},
|
1998-06-08 06:44:05 +00:00
|
|
|
{""},
|
1995-01-23 15:42:59 +00:00
|
|
|
};
|
|
|
|
#define N_TABLAST N_TABNULL
|
|
|
|
|
|
|
|
struct nlist nlk[] = {
|
1995-03-12 13:27:24 +00:00
|
|
|
{"_isa_devlist"},
|
1998-06-08 06:44:05 +00:00
|
|
|
{""},
|
1995-01-23 15:42:59 +00:00
|
|
|
};
|
|
|
|
|
1997-03-12 18:54:52 +00:00
|
|
|
struct nlist nlaux[] = {
|
|
|
|
{"_num_eisa_slots"},
|
|
|
|
{""},
|
|
|
|
};
|
|
|
|
|
1997-09-09 12:51:02 +00:00
|
|
|
struct nlist nlpnp[] = {
|
|
|
|
{"_pnp_ldn_overrides"},
|
|
|
|
{""},
|
|
|
|
};
|
|
|
|
|
|
|
|
struct nlist nlconfig[] = {
|
|
|
|
{"config.o"},
|
|
|
|
{""},
|
|
|
|
};
|
|
|
|
|
1995-01-23 15:42:59 +00:00
|
|
|
int quiet = FALSE;
|
|
|
|
|
1995-05-30 06:12:45 +00:00
|
|
|
void
|
1995-01-23 15:42:59 +00:00
|
|
|
fatal(name, str)
|
|
|
|
char *name, *str;
|
|
|
|
{
|
|
|
|
if (quiet)
|
|
|
|
exit(1);
|
|
|
|
if (str)
|
1998-06-08 06:44:05 +00:00
|
|
|
errx(1, "%s: %s", name, str);
|
1995-01-23 15:42:59 +00:00
|
|
|
else
|
1998-06-08 06:44:05 +00:00
|
|
|
errx(1, "%s", name);
|
1995-01-23 15:42:59 +00:00
|
|
|
}
|
|
|
|
|
1995-05-30 06:12:45 +00:00
|
|
|
void
|
1995-01-23 15:42:59 +00:00
|
|
|
error(name, str)
|
|
|
|
char *name, *str;
|
|
|
|
{
|
|
|
|
if (quiet)
|
|
|
|
return;
|
|
|
|
if (str)
|
1998-06-08 06:44:05 +00:00
|
|
|
warnx("%s: %s", name, str);
|
1995-01-23 15:42:59 +00:00
|
|
|
else
|
1998-06-08 06:44:05 +00:00
|
|
|
warnx("%s", name);
|
1995-01-23 15:42:59 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
1998-06-08 06:44:05 +00:00
|
|
|
usage()
|
1995-01-23 15:42:59 +00:00
|
|
|
{
|
1998-06-08 06:44:05 +00:00
|
|
|
fprintf(stderr, "usage: dset [-qtv]\n");
|
|
|
|
exit(1);
|
1995-01-23 15:42:59 +00:00
|
|
|
}
|
|
|
|
|
1998-06-08 06:44:05 +00:00
|
|
|
int
|
1995-01-23 15:42:59 +00:00
|
|
|
main(ac, av)
|
|
|
|
int ac;
|
|
|
|
char **av;
|
|
|
|
{
|
1997-03-12 18:54:52 +00:00
|
|
|
int f, res, s, i;
|
1995-03-12 13:27:24 +00:00
|
|
|
int modified,dev_found;
|
1995-01-23 15:42:59 +00:00
|
|
|
int sym;
|
1995-03-12 13:27:24 +00:00
|
|
|
u_long pos, entry, pos1, pos_t;
|
1995-01-23 15:42:59 +00:00
|
|
|
u_long flags;
|
|
|
|
struct isa_device buf, buf1;
|
|
|
|
struct isa_driver dbuf;
|
|
|
|
char nbuf[5];
|
|
|
|
struct stat fst;
|
|
|
|
struct exec es;
|
|
|
|
kvm_t *kd;
|
|
|
|
static char errb[_POSIX2_LINE_MAX];
|
1996-10-01 14:42:36 +00:00
|
|
|
const char *kernel = NULL;
|
1995-01-23 15:42:59 +00:00
|
|
|
|
|
|
|
char ch;
|
|
|
|
int testonly = FALSE;
|
|
|
|
int verbose = FALSE;
|
|
|
|
|
1997-03-29 03:33:12 +00:00
|
|
|
while ((ch = getopt(ac, av, "qtv")) != -1)
|
1995-01-23 15:42:59 +00:00
|
|
|
switch (ch) {
|
|
|
|
case 'q':
|
|
|
|
quiet = TRUE;
|
|
|
|
break;
|
|
|
|
case 't':
|
|
|
|
testonly = TRUE;
|
|
|
|
/* In test mode we want to be verbose */
|
1996-10-01 14:42:36 +00:00
|
|
|
|
1995-01-23 15:42:59 +00:00
|
|
|
case 'v':
|
|
|
|
verbose = TRUE;
|
|
|
|
break;
|
1996-10-01 14:42:36 +00:00
|
|
|
|
1995-01-23 15:42:59 +00:00
|
|
|
case '?':
|
|
|
|
default:
|
1998-06-08 06:44:05 +00:00
|
|
|
usage();
|
1995-01-23 15:42:59 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
1996-10-02 07:22:26 +00:00
|
|
|
kernel = getbootfile();
|
1995-01-23 15:42:59 +00:00
|
|
|
if (verbose)
|
|
|
|
printf("Boot image: %s\n", kernel);
|
|
|
|
|
|
|
|
if (!(kd = kvm_open(NULL, NULL, NULL, O_RDONLY, errb)))
|
|
|
|
fatal("kvm_open", NULL);
|
|
|
|
|
|
|
|
if (kvm_nlist(kd, nlk) != 0)
|
|
|
|
fatal("kvm_nlist", NULL);
|
|
|
|
|
|
|
|
if (nlk[0].n_type == 0)
|
|
|
|
fatal("kvm_nlist", "bad symbol type");
|
|
|
|
|
|
|
|
if (nlist(kernel, nl) != 0)
|
|
|
|
fatal("nlist", NULL);
|
|
|
|
|
|
|
|
if (nl[0].n_type == 0)
|
|
|
|
fatal("nlist", "bad symbol type");
|
|
|
|
|
|
|
|
if (stat(kernel, &fst) < 0)
|
|
|
|
fatal("stat", NULL);
|
|
|
|
|
|
|
|
flags = fst.st_flags;
|
|
|
|
|
|
|
|
if (chflags(kernel, (u_long) 0) < 0)
|
|
|
|
fatal("chflags", NULL);
|
|
|
|
|
|
|
|
if ((f = open(kernel, O_RDWR)) <= 0)
|
|
|
|
fatal("open", NULL);
|
|
|
|
|
|
|
|
if (read(f, &es, sizeof(struct exec)) <= 0)
|
|
|
|
fatal("read header", NULL);
|
|
|
|
|
|
|
|
entry = es.a_entry;
|
|
|
|
|
|
|
|
for (sym = 0; sym <= N_TABLAST; sym++) {
|
|
|
|
if (verbose)
|
|
|
|
printf("\nTable: %s\n", nl[sym].n_name);
|
1996-05-02 09:09:04 +00:00
|
|
|
pos = nl[sym].n_value + getpagesize() - entry;
|
1995-01-23 15:42:59 +00:00
|
|
|
|
1995-03-12 13:27:24 +00:00
|
|
|
pos1 = nlk[0].n_value;
|
1995-01-23 15:42:59 +00:00
|
|
|
|
|
|
|
if (lseek(f, pos, SEEK_SET) != pos)
|
|
|
|
fatal("seek", NULL);
|
|
|
|
|
1995-03-12 13:27:24 +00:00
|
|
|
if (verbose)
|
|
|
|
printf("----------------------------------------------------\n");
|
|
|
|
|
1995-01-23 15:42:59 +00:00
|
|
|
do {
|
1995-03-12 13:27:24 +00:00
|
|
|
if ((res = read(f, (char *) &buf, sizeof(struct isa_device)))
|
|
|
|
<= 0)
|
|
|
|
fatal("read", NULL);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (kvm_read(kd, pos1, &pos_t, sizeof(u_long)) < 0)
|
|
|
|
fatal("kvmread", NULL);
|
|
|
|
dev_found = 0;
|
|
|
|
|
1997-09-18 14:08:40 +00:00
|
|
|
while(pos_t!=0) {
|
1995-03-12 13:27:24 +00:00
|
|
|
if (kvm_read(kd, pos_t, &buf1, sizeof(struct isa_device)) < 0)
|
1995-01-23 15:42:59 +00:00
|
|
|
fatal("kvmread", NULL);
|
|
|
|
|
1995-05-22 01:37:24 +00:00
|
|
|
if (buf1.id_id != buf.id_id) {
|
1995-03-12 13:27:24 +00:00
|
|
|
pos_t = (u_long)(buf1.id_next);
|
|
|
|
continue;
|
|
|
|
} else
|
|
|
|
dev_found=1;
|
|
|
|
|
|
|
|
if (buf1.id_driver)
|
|
|
|
if (kvm_read(kd, (u_long) buf1.id_driver,
|
|
|
|
&dbuf, sizeof(struct isa_driver)) < 0) {
|
|
|
|
error("kvm_read", "no driver");
|
|
|
|
} else {
|
|
|
|
if (kvm_read(kd, (u_long) dbuf.name,
|
|
|
|
nbuf, sizeof(nbuf)) < 0) {
|
|
|
|
error("kvm_read", NULL);
|
1995-01-23 15:42:59 +00:00
|
|
|
} else {
|
1995-03-12 13:27:24 +00:00
|
|
|
nbuf[sizeof(nbuf) - 1] = 0;
|
|
|
|
if (verbose)
|
|
|
|
printf("Device: %s%d\n", nbuf, buf1.id_unit);
|
1995-01-23 15:42:59 +00:00
|
|
|
}
|
1995-03-12 13:27:24 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
error("kvm_read", "no driver");
|
|
|
|
break;
|
1995-01-23 15:42:59 +00:00
|
|
|
|
1995-03-12 13:27:24 +00:00
|
|
|
};
|
1995-01-23 15:42:59 +00:00
|
|
|
|
1995-03-12 13:27:24 +00:00
|
|
|
if (!dev_found)
|
|
|
|
continue;
|
1995-01-23 15:42:59 +00:00
|
|
|
|
|
|
|
if (buf1.id_id != 0)
|
|
|
|
if (verbose)
|
1995-05-22 01:37:24 +00:00
|
|
|
printf(
|
1998-06-28 19:06:17 +00:00
|
|
|
"kernel: id=%u io=%X irq=%d drq=%d maddr=%p msize=%d flags=%X enabled=%X \n",
|
1995-05-22 01:37:24 +00:00
|
|
|
buf1.id_id, buf1.id_iobase, buf1.id_irq, buf1.id_drq,
|
|
|
|
buf1.id_maddr, buf1.id_msize, buf1.id_flags, buf1.id_enabled);
|
1995-01-23 15:42:59 +00:00
|
|
|
|
|
|
|
if (buf.id_id != 0)
|
|
|
|
if (verbose)
|
1995-05-22 01:37:24 +00:00
|
|
|
printf(
|
1998-06-28 19:06:17 +00:00
|
|
|
"file: id=%u io=%X irq=%d drq=%d maddr=%p msize=%d flags=%X enabled=%X \n",
|
1995-05-22 01:37:24 +00:00
|
|
|
buf.id_id, buf.id_iobase, buf.id_irq, buf.id_drq,
|
|
|
|
buf.id_maddr, buf.id_msize, buf.id_flags, buf.id_enabled);
|
1995-01-23 15:42:59 +00:00
|
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
* OK,now we'd compare values and set'em from kernel.
|
|
|
|
*/
|
|
|
|
modified = FALSE;
|
|
|
|
|
1995-03-12 13:27:24 +00:00
|
|
|
if (buf.id_iobase != -1 && buf.id_iobase !=
|
1995-01-23 15:42:59 +00:00
|
|
|
buf1.id_iobase) {
|
|
|
|
if (verbose)
|
|
|
|
printf("Setting IO addr\n");
|
|
|
|
buf.id_iobase = buf1.id_iobase;
|
|
|
|
modified = TRUE;
|
|
|
|
}
|
1995-03-12 13:27:24 +00:00
|
|
|
if (buf.id_irq != (u_short)-1 && buf.id_irq != buf1.id_irq) {
|
1995-01-23 15:42:59 +00:00
|
|
|
if (verbose)
|
|
|
|
printf("Setting IRQ\n");
|
|
|
|
buf.id_irq = buf1.id_irq;
|
|
|
|
modified = TRUE;
|
|
|
|
}
|
1995-03-12 13:27:24 +00:00
|
|
|
if (buf.id_drq != -1 && buf.id_drq != buf1.id_drq) {
|
1995-01-23 15:42:59 +00:00
|
|
|
if (verbose)
|
|
|
|
printf("Setting DRQ\n");
|
|
|
|
buf.id_drq = buf1.id_drq;
|
|
|
|
modified = TRUE;
|
|
|
|
}
|
1995-03-12 13:27:24 +00:00
|
|
|
if (buf.id_maddr != (caddr_t)-1 && buf.id_maddr != buf1.id_maddr) {
|
1995-01-23 15:42:59 +00:00
|
|
|
if (verbose)
|
|
|
|
printf("Setting memory addres\n");
|
|
|
|
buf.id_maddr = buf1.id_maddr;
|
|
|
|
modified = TRUE;
|
|
|
|
}
|
1995-05-22 01:37:24 +00:00
|
|
|
if (buf.id_msize != buf1.id_msize) {
|
|
|
|
if (verbose)
|
|
|
|
printf("Setting msize\n");
|
|
|
|
buf.id_msize = buf1.id_msize;
|
|
|
|
modified = TRUE;
|
|
|
|
}
|
1995-01-23 15:42:59 +00:00
|
|
|
if (buf.id_flags != buf1.id_flags) {
|
|
|
|
if (verbose)
|
|
|
|
printf("Setting flags\n");
|
|
|
|
buf.id_flags = buf1.id_flags;
|
|
|
|
modified = TRUE;
|
|
|
|
}
|
|
|
|
if (buf.id_enabled != buf1.id_enabled) {
|
|
|
|
if (verbose)
|
|
|
|
printf("Setting device enable/disable\n");
|
|
|
|
buf.id_enabled = buf1.id_enabled;
|
|
|
|
modified = TRUE;
|
|
|
|
}
|
1995-03-12 13:27:24 +00:00
|
|
|
if (verbose)
|
|
|
|
printf("----------------------------------------------------\n");
|
1995-01-23 15:42:59 +00:00
|
|
|
if (modified && !testonly) {
|
|
|
|
|
|
|
|
res = lseek(f, -(off_t) sizeof(struct isa_device),
|
|
|
|
SEEK_CUR);
|
|
|
|
if (write(f, &buf, sizeof(struct isa_device)) <= 0)
|
|
|
|
fatal("write", NULL);
|
|
|
|
|
|
|
|
}
|
|
|
|
} while (buf.id_id != 0 && buf1.id_id != 0);
|
|
|
|
}
|
|
|
|
|
1997-03-12 18:54:52 +00:00
|
|
|
if (kvm_nlist(kd, nlaux) != 0) {
|
|
|
|
/* num_eisa_conf need not exist, only handle it if found */
|
|
|
|
if (verbose)
|
|
|
|
printf("num_eisa_slots not found, ignoring.\n");
|
|
|
|
} else {
|
|
|
|
if (nlaux[0].n_type == 0)
|
|
|
|
fatal("kvm_nlist", "bad symbol type");
|
|
|
|
pos1 = nlaux[0].n_value;
|
|
|
|
if (kvm_read(kd, pos1, &s, sizeof(int)) < 0)
|
|
|
|
fatal("kvmread", NULL);
|
|
|
|
|
|
|
|
if (nlist(kernel, nlaux) != 0)
|
|
|
|
fatal("nlist", NULL);
|
|
|
|
if (nlaux[0].n_type == 0)
|
|
|
|
fatal("nlist", "bad symbol type");
|
|
|
|
pos = nlaux[0].n_value + getpagesize() - entry;
|
|
|
|
if (lseek(f, pos, SEEK_SET) != pos)
|
|
|
|
fatal("seek", NULL);
|
|
|
|
if ((res = read(f, (char *) &i, sizeof(int)))
|
|
|
|
<= 0)
|
|
|
|
fatal("read", NULL);
|
|
|
|
|
|
|
|
if (i != s) {
|
|
|
|
if (verbose)
|
|
|
|
printf("\nChanging num_eisa_slots from %d to %d.\n",
|
|
|
|
i, s);
|
|
|
|
if (!testonly) {
|
|
|
|
res = lseek(f, -(off_t) sizeof(int),
|
|
|
|
SEEK_CUR);
|
|
|
|
if (write(f, &s, sizeof(int)) <= 0)
|
|
|
|
fatal("write", NULL);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
1997-09-09 12:51:02 +00:00
|
|
|
if (kvm_nlist(kd, nlpnp) != 0) {
|
|
|
|
/* pnp_ldn_overrides need not exist, only handle it if found */
|
|
|
|
if (verbose)
|
|
|
|
printf("pnp_ldn_overrides not found, ignoring.\n");
|
|
|
|
} else {
|
|
|
|
if (nlpnp[0].n_type == 0)
|
|
|
|
fatal("kvm_nlist", "bad symbol type");
|
|
|
|
/* must handle it, read and write... */
|
|
|
|
pos1 = nlpnp[0].n_value ;
|
|
|
|
if (kvm_read(kd, pos1, &new_ov, sizeof(new_ov) ) < 0 )
|
|
|
|
fatal("kvmread", NULL);
|
|
|
|
if (nlist(kernel, nlpnp) != 0)
|
|
|
|
fatal("nlist", NULL);
|
|
|
|
if (nlpnp[0].n_type == 0)
|
|
|
|
fatal("nlist", "bad symbol type");
|
|
|
|
pos = nlpnp[0].n_value + getpagesize() - entry;
|
|
|
|
if (lseek(f, pos, SEEK_SET) != pos)
|
|
|
|
fatal("seek", NULL);
|
|
|
|
if ((res = read(f, (char *) &old_ov, sizeof(old_ov))) <= 0 )
|
|
|
|
fatal("read", NULL);
|
|
|
|
if (testonly || bcmp(&old_ov, &new_ov, sizeof(old_ov)) ) {
|
|
|
|
if (verbose) {
|
|
|
|
int i;
|
|
|
|
printf("CSN LDN conf en irq drq vendor_id. ....\n");
|
|
|
|
for (i=0; i < MAX_PNP_LDN ; i++) {
|
|
|
|
if (new_ov[i].csn>0 && new_ov[i].csn<255) {
|
|
|
|
int maxp, maxm;
|
|
|
|
for (maxp=7; maxp>=0 ; maxp--)
|
|
|
|
if (new_ov[i].port[maxp] !=0) break;
|
|
|
|
for (maxm=3; maxm>=0 ; maxm--)
|
|
|
|
if (new_ov[i].mem[maxm].base !=0) break;
|
|
|
|
printf("%3d %3d %-4s %c ",
|
|
|
|
new_ov[i].csn,
|
|
|
|
new_ov[i].ldn,
|
|
|
|
new_ov[i].override ? "OS":"BIOS",
|
|
|
|
new_ov[i].enable ? 'y':'n');
|
|
|
|
printf(new_ov[i].irq[0] == 0 ? " -":" %2d",
|
|
|
|
new_ov[i].irq[0]);
|
|
|
|
printf(new_ov[i].irq[1] == 0 ? " - ":"%-2d",
|
|
|
|
new_ov[i].irq[1]);
|
|
|
|
printf(new_ov[i].drq[0] == 4 ? " -":" %d",
|
|
|
|
new_ov[i].drq[0]);
|
|
|
|
printf(new_ov[i].drq[1] == 4 ? " -":" %d",
|
|
|
|
new_ov[i].drq[1]);
|
|
|
|
if (new_ov[i].vendor_id > 0)
|
|
|
|
printf(" 0x%08x", new_ov[i].vendor_id);
|
|
|
|
if (new_ov[i].flags > 0)
|
1998-06-28 19:06:17 +00:00
|
|
|
printf(" flags 0x%08lx", new_ov[i].flags);
|
1997-09-09 12:51:02 +00:00
|
|
|
if (maxp >=0) {
|
|
|
|
int j;
|
|
|
|
printf(" port 0x%x", new_ov[i].port[0]);
|
|
|
|
for(j=1;j<=maxp;j++)
|
|
|
|
printf(" 0x%x", new_ov[i].port[j]);
|
|
|
|
}
|
|
|
|
if (maxm >=0) {
|
|
|
|
int j;
|
1998-06-28 19:06:17 +00:00
|
|
|
printf(" mem 0x%lx", new_ov[i].mem[0].base);
|
1997-09-09 12:51:02 +00:00
|
|
|
for(j=1;j<=maxm;j++)
|
1998-06-28 19:06:17 +00:00
|
|
|
printf(" 0x%lx", new_ov[i].mem[j].base);
|
1997-09-09 12:51:02 +00:00
|
|
|
}
|
|
|
|
printf("\n");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (!testonly) {
|
|
|
|
res = lseek(f, -(off_t) sizeof(new_ov),
|
|
|
|
SEEK_CUR);
|
|
|
|
if (write(f,&new_ov, sizeof(new_ov)) <= 0)
|
|
|
|
fatal("write", NULL);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
1995-01-23 15:42:59 +00:00
|
|
|
if (chflags(kernel, flags) < 0)
|
|
|
|
fatal("chflags restore", NULL);
|
|
|
|
|
|
|
|
kvm_close(kd);
|
|
|
|
close(f);
|
1998-06-08 06:44:05 +00:00
|
|
|
return(0);
|
1995-01-23 15:42:59 +00:00
|
|
|
}
|