Add UFS2 root and boot support.

This commit is contained in:
tsutsui 2009-04-22 17:21:47 +00:00
parent af8acc11fd
commit ba5d4af029
2 changed files with 23 additions and 6 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: md.c,v 1.4 2009/04/22 16:53:15 tsutsui Exp $ */
/* $NetBSD: md.c,v 1.5 2009/04/22 17:21:47 tsutsui Exp $ */
/*
* Copyright 1997,2002 Piermont Information Systems Inc.
@ -104,14 +104,22 @@ md_post_disklabel(void)
int
md_post_newfs(void)
{
char *bootxx;
int error;
printf (msg_string(MSG_dobootblks), diskdev);
cp_to_target("/usr/mdec/boot", "/boot");
if (run_program(RUN_DISPLAY | RUN_NO_CLEAR,
"/usr/sbin/installboot -v -m landisk /dev/r%sa /usr/mdec/bootxx_ffsv1",
diskdev))
bootxx = bootxx_name();
if (bootxx != NULL) {
error = run_program(RUN_DISPLAY | RUN_NO_CLEAR,
"/usr/sbin/installboot -v /dev/r%sa %s", diskdev, bootxx);
free(bootxx);
} else
error = -1;
if (error != 0)
process_menu(MENU_ok,
deconst("Warning: disk is probably not bootable"));
deconst("Warning: disk is probably not bootable"));
return 0;
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: md.h,v 1.1 2008/04/14 17:24:56 skrll Exp $ */
/* $NetBSD: md.h,v 1.2 2009/04/22 17:21:47 tsutsui Exp $ */
/*
* Copyright 1997 Piermont Information Systems Inc.
@ -46,6 +46,15 @@
/* Megs required for a full X installation. */
#define XNEEDMB 340
/* have support for booting from UFS2 */
#define HAVE_UFS2_BOOT
/* have file system specific primary boot loader */
#define HAVE_BOOTXX_xFS
#define BOOTXXDIR "/usr/mdec"
#define BOOTXX_FFSV1 "bootxx_ffsv1"
#define BOOTXX_FFSV2 "bootxx_ffsv2"
/*
* Default filesets to fetch and install during installation or upgrade.
* The standard sets are: base etc comp games man misc text