Esempio n. 1
0
/*
 * hook called after upgrade() or install() has finished setting
 * up the target disk but immediately before the user is given the
 * ``disks are now set up'' message.
 *
 * On pmax, we take this opportuinty to update the bootblocks.
 */
int
md_post_newfs(void)
{
	char *bootxx;
	int error;

	/* XXX boot blocks ... */
	if (target_already_root()) {
		/* /usr is empty and we must already have bootblocks? */
		return 0;
	}

	msg_display(MSG_dobootblks, diskdev);
	cp_to_target("/usr/mdec/boot.pmax", "/boot.pmax");
	bootxx = bootxx_name();
	if (bootxx != NULL) {
		error = run_program(RUN_DISPLAY | RUN_NO_CLEAR,
		    "/usr/sbin/installboot /dev/r%sc %s", diskdev, bootxx);
		free(bootxx);
	} else
		error = -1;

	if (error != 0)
		process_menu(MENU_ok,
		    deconst("Warning: disk is probably not bootable"));

	return 0;
}
Esempio n. 2
0
/*
 * hook called after upgrade() or install() has finished setting
 * up the target disk but immediately before the user is given the
 * ``disks are now set up'' message.
 */
int
md_post_newfs(void)
{
    if (!nobootfs) {
        msg_display(msg_string(MSG_copybootloader), diskdev);
        cp_to_target("/usr/mdec/boot", PART_BOOT_FAT12_PI_MOUNT);
    }

    return 0;
}
Esempio n. 3
0
/*
 * hook called after upgrade() or install() has finished setting
 * up the target disk but immediately before the user is given the
 * ``disks are now set up'' message.
 *
 * On the news68k, we use this opportunity to install the boot blocks.
 */
int
md_post_newfs(void)
{
	const char *bootfile = "/boot";

	msg_display(MSG_dobootblks, diskdev);
	cp_to_target("/usr/mdec/boot", bootfile);
	sync();
	run_program(RUN_DISPLAY, "/usr/sbin/installboot /dev/r%sc %s %s",
	    diskdev, "/usr/mdec/bootxx", bootfile);
	return 0;
}
Esempio n. 4
0
File: md.c Progetto: ryo/netbsd-src
/*
 * hook called after upgrade() or install() has finished setting
 * up the target disk but immediately before the user is given the
 * ``disks are now set up'' message.
 *
 * On the x68k, we use this opportunity to install the boot blocks.
 */
int
md_post_newfs(void)
{
	/* boot blocks ... */
	msg_display(MSG_dobootblks, pm->diskdev);
	cp_to_target("/usr/mdec/boot", "/boot");
	if (run_program(RUN_DISPLAY | RUN_NO_CLEAR,
	    "/usr/mdec/installboot.new /usr/mdec/sdboot_ufs /dev/r%sa",
	    pm->diskdev))
		process_menu(MENU_ok,
			deconst("Warning: disk is probably not bootable"));
	return 0;
}
Esempio n. 5
0
File: md.c Progetto: ryo/netbsd-src
/*
 * hook called after upgrade() or install() has finished setting
 * up the target disk but immediately before the user is given the
 * ``disks are now set up'' message.
 *
 * On the ews4800mips, we use this opportunity to install the boot blocks.
 */
int
md_post_newfs(void)
{
	int flags;

	flags = RUN_DISPLAY | RUN_FATAL;
	cp_to_target("/usr/mdec/boot", "/stand/boot");
	run_program(flags, "/usr/sbin/installboot /dev/r%s%c %s",
	    pm->diskdev, 'a' + getrawpartition(),
	    "/usr/mdec/bootxx_bfs");

	return 0;
}
Esempio n. 6
0
/*
 * hook called after upgrade() or install() has finished setting
 * up the target disk but immediately before the user is given the
 * ``disks are now set up'' message..
 *
 * On mvme68k, we use this opportunity to install the boot blocks.
 */
int
md_post_newfs(void)
{

	/* boot blocks ... */
	msg_display(MSG_dobootblks, diskdev);
	cp_to_target("/usr/mdec/bootsd", "/.bootsd");
	if (run_program(RUN_DISPLAY | RUN_NO_CLEAR,
	    "/usr/mdec/installboot %s /usr/mdec/bootxx /dev/r%sa",
	    target_expand("/.bootsd"), diskdev))
		process_menu(MENU_ok,
			deconst("Warning: disk is probably not bootable"));
	return 0;
}
Esempio n. 7
0
/*
 * hook called after upgrade() or install() has finished setting
 * up the target disk but immediately before the user is given the
 * ``disks are now set up'' message.
 *
 * On mipsco, we take this opportuinty to update the bootblocks.
 */
int
md_post_newfs(void)
{

	/* XXX boot blocks ... */
	if (target_already_root()) {
		/* /usr is empty and we must already have bootblocks?*/
		return 0;
	}

	printf(msg_string(MSG_dobootblks), diskdev);
	cp_to_target("/usr/mdec/boot", "/boot");
	if (run_program(RUN_DISPLAY | RUN_NO_CLEAR,
	    "/usr/mdec/installboot /dev/r%sc /usr/mdec/bootxx_ffs", diskdev))
		process_menu(MENU_ok,
			deconst("Warning: disk is probably not bootable"));
	return 0;
}
Esempio n. 8
0
/*
 * hook called after upgrade() or install() has finished setting
 * up the target disk but immediately before the user is given the
 * ``disks are now set up'' message.
 */
int
md_post_newfs(void)
{
	int error;

	error = cp_to_target("/usr/mdec/boot", "/boot");
	if (error)
		return error;

	/* boot blocks ... */
	msg_display(MSG_dobootblks, diskdev);
	if (run_program(RUN_DISPLAY | RUN_NO_CLEAR,
	    "/usr/sbin/installboot -v /dev/r%sc /usr/mdec/xxboot",
	    diskdev))
		process_menu(MENU_ok,
			 deconst("Warning: disk is probably not bootable"));
	return 0;
}
Esempio n. 9
0
/*
 * hook called after upgrade() or install() has finished setting
 * up the target disk but immediately before the user is given the
 * ``disks are now set up'' message.
 *
 * On the Alpha, we use this opportunity to install the boot blocks.
 */
int
md_post_newfs(void)
{
	char *bootxx;
	int error;

	msg_display(MSG_dobootblks, diskdev);
	cp_to_target("/usr/mdec/boot", "/boot");
	bootxx = bootxx_name();
	if (bootxx != NULL) {
		error = run_program(RUN_DISPLAY | RUN_NO_CLEAR,
		    "/usr/sbin/installboot /dev/r%sc %s", diskdev, bootxx);
		free(bootxx);
	} else
		error = -1;

	if (error != 0)
		process_menu(MENU_ok,
		    deconst("Warning: disk is probably not bootable"));

	return 0;
}
Esempio n. 10
0
/*
 * hook called after upgrade() or install() has finished setting
 * up the target disk but immediately before the user is given the
 * ``disks are now set up'' message.
 *
 * On the macppc, we use this opportunity to install the boot blocks.
 */
int
md_post_newfs(void)
{
	const char *bootfile = "/boot";

	/*
	 * XXX
	 * Only OpenFirmware version 1 and 2 machines need installboot(8)
	 * and it uses a faked Apple partition map with the primary bootxx.
	 * installboot(8) assumes that root partition is at the beginning of
	 * the disk and put a faked Apple partition map at the top of
	 * the partition, so it won't work if root partition has some
	 * offset from physical block 0 where the Apple driver descriptor
	 * map resides on.
	 *
	 * On OpenFirmware version 3 machines, the strategy used on OF1/2
	 * machines doesn't work (they don't recognize boot code info
	 * in Apple partition map entries) and they need to have
	 * an extra native partition (HFS or MSDOSFS) which can be
	 * recognized by the newer firmware to put a loadable bootloader.
	 * installboot(8) against partition `a' on such machines might
	 * corrupt existing disklabel or a valid Apple partition map.
	 *
	 * Currently there is no way to see OF version on running machine
	 * yet, so assume partition a has some offset on OF3 machines
	 * and don't try installboot(8) in that case.
	 */
	if (bsdlabel[PART_A].pi_offset != 0)
		return 0;

	msg_display(MSG_dobootblks, diskdev);
	cp_to_target("/usr/mdec/ofwboot", bootfile);
	sync();
	run_program(RUN_DISPLAY, "/usr/sbin/installboot /dev/r%sa %s %s",
	    diskdev, "/usr/mdec/bootxx", bootfile);
	return 0;
}