Home | History | Annotate | Line # | Download | only in amiga
md.c revision 1.2.2.2
      1 /*	$NetBSD: md.c,v 1.2.2.2 2014/08/10 07:00:25 tls Exp $ */
      2 
      3 /*
      4  * Copyright 1997 Piermont Information Systems Inc.
      5  * All rights reserved.
      6  *
      7  * Based on code written by Philip A. Nelson for Piermont Information
      8  * Systems Inc.
      9  *
     10  * Redistribution and use in source and binary forms, with or without
     11  * modification, are permitted provided that the following conditions
     12  * are met:
     13  * 1. Redistributions of source code must retain the above copyright
     14  *    notice, this list of conditions and the following disclaimer.
     15  * 2. Redistributions in binary form must reproduce the above copyright
     16  *    notice, this list of conditions and the following disclaimer in the
     17  *    documentation and/or other materials provided with the distribution.
     18  * 3. The name of Piermont Information Systems Inc. may not be used to endorse
     19  *    or promote products derived from this software without specific prior
     20  *    written permission.
     21  *
     22  * THIS SOFTWARE IS PROVIDED BY PIERMONT INFORMATION SYSTEMS INC. ``AS IS''
     23  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
     24  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
     25  * ARE DISCLAIMED. IN NO EVENT SHALL PIERMONT INFORMATION SYSTEMS INC. BE
     26  * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
     27  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
     28  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
     29  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
     30  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
     31  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
     32  * THE POSSIBILITY OF SUCH DAMAGE.
     33  */
     34 
     35 /* md.c -- amiga machine specific routines */
     36 
     37 #include <stdio.h>
     38 #include <util.h>
     39 #include <sys/param.h>
     40 #include <machine/cpu.h>
     41 #include <sys/sysctl.h>
     42 
     43 #include "defs.h"
     44 #include "md.h"
     45 #include "msg_defs.h"
     46 #include "menu_defs.h"
     47 
     48 void
     49 md_init(void)
     50 {
     51 }
     52 
     53 void
     54 md_init_set_status(int flags)
     55 {
     56 	(void)flags;
     57 }
     58 
     59 int
     60 md_get_info(void)
     61 {
     62 	return 1;
     63 }
     64 
     65 /*
     66  * md back-end code for menu-driven BSD disklabel editor.
     67  */
     68 int
     69 md_make_bsd_partitions(void)
     70 {
     71 	return 1;
     72 }
     73 
     74 /*
     75  * any additional partition validation
     76  */
     77 int
     78 md_check_partitions(void)
     79 {
     80 	return 1;
     81 }
     82 
     83 /*
     84  * hook called before writing new disklabel.
     85  */
     86 int
     87 md_pre_disklabel(void)
     88 {
     89 	return 0;
     90 }
     91 
     92 /*
     93  * hook called after writing disklabel to new target disk.
     94  */
     95 int
     96 md_post_disklabel(void)
     97 {
     98 	return 0;
     99 }
    100 
    101 /*
    102  * hook called after upgrade() or install() has finished setting
    103  * up the target disk but immediately before the user is given the
    104  * ``disks are now set up'' message.
    105  */
    106 int
    107 md_post_newfs(void)
    108 {
    109 	/* boot blocks ... */
    110 	msg_display(MSG_dobootblks, pm->diskdev);
    111 	return run_program(RUN_DISPLAY,
    112 	    "/usr/mdec/installboot -v /usr/mdec/xxboot /dev/r%sa", pm->diskdev);
    113 }
    114 
    115 int
    116 md_post_extract(void)
    117 {
    118 	return 0;
    119 }
    120 
    121 void
    122 md_cleanup_install(void)
    123 {
    124 #ifndef DEBUG
    125 	enable_rc_conf();
    126 #endif
    127 }
    128 
    129 int
    130 md_pre_update(void)
    131 {
    132 	return 1;
    133 }
    134 
    135 /* Upgrade support */
    136 int
    137 md_update(void)
    138 {
    139 	md_post_newfs();
    140 	return 1;
    141 }
    142 
    143 int
    144 md_pre_mount()
    145 {
    146 	return 0;
    147 }
    148