Change bsddisklabel.c to export it's functions rather than declaring them
all static. This makes it possible to write a md_make_bsd_partitions() function without having to copy all of bsddisklabel.c into md.c. Make ofppc sysinst install sanely and in a bootable manner on both my 7044, and my pegasos. The only thing the user needs to do is pick the right kernel set.
This commit is contained in:
parent
7c8654b9e9
commit
e87796b3eb
@ -1,4 +1,4 @@
|
||||
# $NetBSD: Makefile,v 1.1 2008/01/02 11:39:01 mrg Exp $
|
||||
# $NetBSD: Makefile,v 1.2 2008/01/23 23:15:37 garbled Exp $
|
||||
|
||||
.include <bsd.own.mk>
|
||||
.include "${NETBSDSRCDIR}/distrib/common/Makefile.distrib"
|
||||
@ -13,6 +13,7 @@ ${V}= ${${V}DIR}/${F}.fs
|
||||
.endfor
|
||||
|
||||
MDSETTARGETS= INSTALL ${RAMDISK} -
|
||||
MDSETTARGETS+= INSTALL_B64 ${RAMDISK} -
|
||||
|
||||
MDSET_RELEASEDIR= binary/kernel
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
# $NetBSD: list.ramdisk,v 1.1 2008/01/02 11:39:02 mrg Exp $
|
||||
# $NetBSD: list.ramdisk,v 1.2 2008/01/23 23:15:37 garbled Exp $
|
||||
|
||||
SRCDIRS bin sbin usr.bin usr.sbin gnu/usr.bin libexec
|
||||
|
||||
@ -17,6 +17,8 @@ COPY ${NETBSDSRCDIR}/distrib/common/services etc/services
|
||||
|
||||
# we need the boot block in /usr/mdec + the MBR copy
|
||||
COPY ${DESTDIR}/usr/mdec/ofwboot usr/mdec/ofwboot
|
||||
COPY ${DESTDIR}/usr/mdec/netbsd.chrp usr/mdec/netbsd.chrp
|
||||
COPY ${DESTDIR}/usr/mdec/mkbootinfo usr/mdec/mkbootinfo 755
|
||||
|
||||
# and the common installation tools
|
||||
COPY ${CURDIR}/../common/termcap.mini usr/share/misc/termcap
|
||||
|
@ -1,2 +1,4 @@
|
||||
# $NetBSD: md.ofppc,v 1.7 2005/05/22 03:45:30 lukem Exp $
|
||||
# $NetBSD: md.ofppc,v 1.8 2008/01/23 23:15:37 garbled Exp $
|
||||
./usr/mdec/ofwboot base-sysutil-bin
|
||||
./usr/mdec/mkbootinfo base-sysutil-bin
|
||||
./usr/mdec/netbsd.chrp base-sysutil-bin
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: md.c,v 1.1 2008/01/02 11:30:30 mrg Exp $ */
|
||||
/* $NetBSD: md.c,v 1.2 2008/01/23 23:15:37 garbled Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright 1997 Piermont Information Systems Inc.
|
||||
@ -53,7 +53,14 @@
|
||||
#include "endian.h"
|
||||
|
||||
/* We use MBR_PTYPE_PREP like port-prep does. */
|
||||
static int nonewfsmsdos = 0, nobootfix = 0, bootpart = PART_BOOT;
|
||||
static int nonewfsmsdos = 0, nobootfix = 0, noprepfix=0;
|
||||
static int bootpart_fat12 = PART_BOOT_FAT12;
|
||||
static int bootpart_binfo = PART_BOOT_BINFO;
|
||||
static int bootpart_prep = PART_BOOT_PREP;
|
||||
static int bootinfo_mbr = 1;
|
||||
|
||||
/* bootstart/bootsize are for the fat */
|
||||
int binfostart, binfosize, bprepstart, bprepsize;
|
||||
|
||||
int
|
||||
md_check_mbr(mbr_info_t *mbri)
|
||||
@ -65,14 +72,51 @@ md_check_mbr(mbr_info_t *mbri)
|
||||
for (ext = mbri; ext; ext = ext->extended) {
|
||||
part = ext->mbr.mbr_parts;
|
||||
for (i = 0; i < MBR_PART_COUNT; part++, i++) {
|
||||
if (part->mbrp_type != MBR_PTYPE_PREP)
|
||||
continue;
|
||||
bootstart = part->mbrp_start;
|
||||
bootsize = part->mbrp_size;
|
||||
if (part->mbrp_type == MBR_PTYPE_FAT12) {
|
||||
bootstart = part->mbrp_start;
|
||||
bootsize = part->mbrp_size;
|
||||
} else if (part->mbrp_type == MBR_PTYPE_PREP &&
|
||||
part->mbrp_size < 50) {
|
||||
/* this is the bootinfo partition */
|
||||
binfostart = part->mbrp_start;
|
||||
binfosize = part->mbrp_size;
|
||||
bootinfo_mbr = i+1;
|
||||
} else if (part->mbrp_type == MBR_PTYPE_PREP &&
|
||||
part->mbrp_size > 50) {
|
||||
bprepstart = part->mbrp_start;
|
||||
bprepsize = part->mbrp_size;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (bootsize < (MIN_MD_BOOT/512)) {
|
||||
|
||||
/* we need to either have a pair of prep partitions, or a single
|
||||
* fat. if neither, things are broken. */
|
||||
if (!(bootsize >= (MIN_FAT12_BOOT/512) ||
|
||||
(binfosize >= (MIN_BINFO_BOOT/512) &&
|
||||
bprepsize >= (MIN_PREP_BOOT/512)))) {
|
||||
msg_display(MSG_bootnotright);
|
||||
msg_display_add(MSG_reeditpart, 0);
|
||||
process_menu(MENU_yesno, NULL);
|
||||
if (!yesno)
|
||||
return 0;
|
||||
return 1;
|
||||
}
|
||||
|
||||
/* check the prep partitions */
|
||||
if ((binfosize > 0 || bprepsize > 0) &&
|
||||
(binfosize < (MIN_BINFO_BOOT/512) ||
|
||||
bprepsize < (MIN_PREP_BOOT/512))) {
|
||||
msg_display(MSG_preptoosmall);
|
||||
msg_display_add(MSG_reeditpart, 0);
|
||||
process_menu(MENU_yesno, NULL);
|
||||
if (!yesno)
|
||||
return 0;
|
||||
return 1;
|
||||
}
|
||||
|
||||
/* check the fat12 parititons */
|
||||
if (bootsize > 0 && bootsize < (MIN_FAT12_BOOT/512)) {
|
||||
msg_display(MSG_boottoosmall);
|
||||
msg_display_add(MSG_reeditpart, 0);
|
||||
process_menu(MENU_yesno, NULL);
|
||||
@ -80,7 +124,11 @@ md_check_mbr(mbr_info_t *mbri)
|
||||
return 0;
|
||||
return 1;
|
||||
}
|
||||
if (bootstart == 0 || bootsize == 0) {
|
||||
|
||||
/* if both sets contain zero, thats bad */
|
||||
if ((bootstart == 0 || bootsize == 0) &&
|
||||
(binfosize == 0 || binfostart == 0 ||
|
||||
bprepsize == 0 || bprepstart == 0)) {
|
||||
msg_display(MSG_nobootpart);
|
||||
msg_display_add(MSG_reeditpart, 0);
|
||||
process_menu(MENU_yesno, NULL);
|
||||
@ -91,6 +139,16 @@ md_check_mbr(mbr_info_t *mbri)
|
||||
return 2;
|
||||
}
|
||||
|
||||
/*
|
||||
* NOTE, we use a reserved partition type, because some RS/6000 machines hang
|
||||
* hard if they find a FAT12, and if we use type prep, that indicates that
|
||||
* it should be read raw.
|
||||
* One partition for FAT12 booting
|
||||
* One partition for NetBSD
|
||||
* One partition to hold the bootinfo.txt file
|
||||
* One partition to hold ofwboot
|
||||
*/
|
||||
|
||||
int
|
||||
md_mbr_use_wholedisk(mbr_info_t *mbri)
|
||||
{
|
||||
@ -106,20 +164,37 @@ md_mbr_use_wholedisk(mbr_info_t *mbri)
|
||||
}
|
||||
memset(part, 0, MBR_PART_COUNT * sizeof *part);
|
||||
|
||||
part[0].mbrp_type = MBR_PTYPE_PREP;
|
||||
part[0].mbrp_size = MD_BOOT_SIZE/512;
|
||||
part[0].mbrp_type = MBR_PTYPE_RESERVED_x21;
|
||||
part[0].mbrp_size = FAT12_BOOT_SIZE/512;
|
||||
part[0].mbrp_start = bsec;
|
||||
part[0].mbrp_flag = 0;
|
||||
|
||||
part[1].mbrp_type = MBR_PTYPE_NETBSD;
|
||||
part[1].mbrp_size = dlsize - (bsec + MD_BOOT_SIZE/512);
|
||||
part[1].mbrp_start = bsec + MD_BOOT_SIZE/512;
|
||||
part[1].mbrp_size = dlsize - (bsec + FAT12_BOOT_SIZE/512 +
|
||||
BINFO_BOOT_SIZE/512 + PREP_BOOT_SIZE/512);
|
||||
part[1].mbrp_start = bsec + FAT12_BOOT_SIZE/512 + BINFO_BOOT_SIZE/512 +
|
||||
PREP_BOOT_SIZE/512;
|
||||
part[1].mbrp_flag = MBR_PFLAG_ACTIVE;
|
||||
|
||||
part[2].mbrp_type = MBR_PTYPE_PREP;
|
||||
part[2].mbrp_size = BINFO_BOOT_SIZE/512;
|
||||
part[2].mbrp_start = bsec + FAT12_BOOT_SIZE/512;
|
||||
part[2].mbrp_flag = 0;
|
||||
|
||||
part[3].mbrp_type = MBR_PTYPE_PREP;
|
||||
part[3].mbrp_size = PREP_BOOT_SIZE/512;
|
||||
part[3].mbrp_start = bsec + FAT12_BOOT_SIZE/512 + BINFO_BOOT_SIZE/512;
|
||||
part[3].mbrp_flag = 0;
|
||||
|
||||
ptstart = part[1].mbrp_start;
|
||||
ptsize = part[1].mbrp_size;
|
||||
bootstart = part[0].mbrp_start;
|
||||
bootsize = part[0].mbrp_size;
|
||||
binfostart = part[2].mbrp_start;
|
||||
binfosize= part[2].mbrp_size;
|
||||
bprepstart = part[3].mbrp_start;
|
||||
bprepsize = part[3].mbrp_size;
|
||||
bootinfo_mbr = 4;
|
||||
|
||||
return 1;
|
||||
}
|
||||
@ -151,6 +226,15 @@ md_pre_disklabel(void)
|
||||
int
|
||||
md_post_disklabel(void)
|
||||
{
|
||||
char bootdev[100];
|
||||
|
||||
if (bootstart == 0 || bootsize == 0)
|
||||
return 0;
|
||||
|
||||
snprintf(bootdev, sizeof bootdev, "/dev/r%s%c", diskdev,
|
||||
'a'+bootpart_fat12);
|
||||
run_program(RUN_DISPLAY, "/sbin/newfs_msdos %s", bootdev);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -158,6 +242,8 @@ int
|
||||
md_post_newfs(void)
|
||||
{
|
||||
|
||||
/* just in case */
|
||||
run_program(RUN_DISPLAY, "/sbin/umount /targetroot/boot");
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -172,25 +258,171 @@ md_copy_filesystem(void)
|
||||
int
|
||||
md_make_bsd_partitions(void)
|
||||
{
|
||||
int i;
|
||||
int part;
|
||||
int maxpart = getmaxpartitions();
|
||||
int partstart;
|
||||
int part_raw, part_bsd;
|
||||
int ptend;
|
||||
int no_swap = 0;
|
||||
partinfo *p;
|
||||
|
||||
return make_bsd_partitions();
|
||||
/*
|
||||
* Initialize global variables that track space used on this disk.
|
||||
* Standard 4.4BSD 8-partition labels always cover whole disk.
|
||||
*/
|
||||
if (ptsize == 0)
|
||||
ptsize = dlsize - ptstart;
|
||||
if (dlsize == 0)
|
||||
dlsize = ptstart + ptsize;
|
||||
|
||||
partstart = ptstart;
|
||||
ptend = ptstart + ptsize;
|
||||
|
||||
/* Ask for layout type -- standard or special */
|
||||
msg_display(MSG_layout,
|
||||
ptsize / (MEG / sectorsize),
|
||||
DEFROOTSIZE + DEFSWAPSIZE + DEFUSRSIZE,
|
||||
DEFROOTSIZE + DEFSWAPSIZE + DEFUSRSIZE + XNEEDMB);
|
||||
|
||||
process_menu(MENU_layout, NULL);
|
||||
|
||||
/* Set so we use the 'real' geometry for rounding, input in MB */
|
||||
current_cylsize = dlcylsize;
|
||||
set_sizemultname_meg();
|
||||
|
||||
/* Build standard partitions */
|
||||
memset(&bsdlabel, 0, sizeof bsdlabel);
|
||||
|
||||
/* Set initial partition types to unused */
|
||||
for (part = 0 ; part < maxpart ; ++part)
|
||||
bsdlabel[part].pi_fstype = FS_UNUSED;
|
||||
|
||||
/* Whole disk partition */
|
||||
part_raw = getrawpartition();
|
||||
if (part_raw == -1)
|
||||
part_raw = PART_C; /* for sanity... */
|
||||
bsdlabel[part_raw].pi_offset = 0;
|
||||
bsdlabel[part_raw].pi_size = dlsize;
|
||||
|
||||
if (part_raw == PART_D) {
|
||||
/* Probably a system that expects an i386 style mbr */
|
||||
part_bsd = PART_C;
|
||||
bsdlabel[PART_C].pi_offset = ptstart;
|
||||
bsdlabel[PART_C].pi_size = ptsize;
|
||||
} else {
|
||||
part_bsd = part_raw;
|
||||
}
|
||||
|
||||
if (bootsize != 0) {
|
||||
bsdlabel[PART_BOOT_FAT12].pi_fstype = FS_MSDOS;
|
||||
bsdlabel[PART_BOOT_FAT12].pi_size = bootsize;
|
||||
bsdlabel[PART_BOOT_FAT12].pi_offset = bootstart;
|
||||
bsdlabel[PART_BOOT_FAT12].pi_flags |= PART_BOOT_FAT12_PI_FLAGS;
|
||||
strlcpy(bsdlabel[PART_BOOT_FAT12].pi_mount,
|
||||
PART_BOOT_FAT12_PI_MOUNT,
|
||||
sizeof bsdlabel[PART_BOOT_FAT12].pi_mount);
|
||||
}
|
||||
if (binfosize != 0) {
|
||||
bsdlabel[PART_BOOT_BINFO].pi_fstype = FS_OTHER;
|
||||
bsdlabel[PART_BOOT_BINFO].pi_size = binfosize;
|
||||
bsdlabel[PART_BOOT_BINFO].pi_offset = binfostart;
|
||||
}
|
||||
if (bprepsize != 0) {
|
||||
bsdlabel[PART_BOOT_PREP].pi_fstype = FS_BOOT;
|
||||
bsdlabel[PART_BOOT_PREP].pi_size = bprepsize;
|
||||
bsdlabel[PART_BOOT_PREP].pi_offset = bprepstart;
|
||||
}
|
||||
|
||||
#ifdef PART_REST
|
||||
bsdlabel[PART_REST].pi_offset = 0;
|
||||
bsdlabel[PART_REST].pi_size = ptstart;
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Save any partitions that are outside the area we are
|
||||
* going to use.
|
||||
* In particular this saves details of the other MBR
|
||||
* partitions on a multiboot i386 system.
|
||||
*/
|
||||
for (i = maxpart; i--;) {
|
||||
if (bsdlabel[i].pi_size != 0)
|
||||
/* Don't overwrite special partitions */
|
||||
continue;
|
||||
p = &oldlabel[i];
|
||||
if (p->pi_fstype == FS_UNUSED || p->pi_size == 0)
|
||||
continue;
|
||||
if (layoutkind == 4) {
|
||||
if (PI_ISBSDFS(p))
|
||||
p->pi_flags |= PIF_MOUNT;
|
||||
} else {
|
||||
if (p->pi_offset < ptstart + ptsize &&
|
||||
p->pi_offset + p->pi_size > ptstart)
|
||||
/* Not outside area we are allocating */
|
||||
continue;
|
||||
if (p->pi_fstype == FS_SWAP)
|
||||
no_swap = 1;
|
||||
}
|
||||
bsdlabel[i] = oldlabel[i];
|
||||
}
|
||||
|
||||
if (layoutkind == 4) {
|
||||
/* XXX Check we have a sensible layout */
|
||||
;
|
||||
} else
|
||||
get_ptn_sizes(partstart, ptend - partstart, no_swap);
|
||||
|
||||
/*
|
||||
* OK, we have a partition table. Give the user the chance to
|
||||
* edit it and verify it's OK, or abort altogether.
|
||||
*/
|
||||
edit_check:
|
||||
if (edit_and_check_label(bsdlabel, maxpart, part_raw, part_bsd) == 0) {
|
||||
msg_display(MSG_abort);
|
||||
return 0;
|
||||
}
|
||||
if (md_check_partitions() == 0)
|
||||
goto edit_check;
|
||||
|
||||
/* Disk name */
|
||||
msg_prompt(MSG_packname, bsddiskname, bsddiskname, sizeof bsddiskname);
|
||||
|
||||
/* save label to disk for MI code to update. */
|
||||
(void) savenewlabel(bsdlabel, maxpart);
|
||||
|
||||
/* Everything looks OK. */
|
||||
return (1);
|
||||
}
|
||||
|
||||
int
|
||||
md_check_partitions(void)
|
||||
{
|
||||
int part;
|
||||
int part, fprep=0, ffat=0;
|
||||
|
||||
/* we need to find a boot partition, otherwise we can't create
|
||||
* our msdos fs boot partition. We make the assumption that
|
||||
* the user hasn't done something stupid, like move it away
|
||||
* from the MBR partition.
|
||||
*/
|
||||
for (part = PART_A; part < MAXPARTITIONS; part++)
|
||||
if (bsdlabel[part].pi_fstype == FS_BOOT) {
|
||||
bootpart = part;
|
||||
return 1;
|
||||
for (part = PART_A; part < MAXPARTITIONS; part++) {
|
||||
if (bsdlabel[part].pi_fstype == FS_MSDOS) {
|
||||
bootpart_fat12 = part;
|
||||
ffat++;
|
||||
} else if (bsdlabel[part].pi_fstype == FS_BOOT) {
|
||||
bootpart_prep = part;
|
||||
fprep++;
|
||||
} else if (bsdlabel[part].pi_fstype == FS_OTHER) {
|
||||
bootpart_binfo = part;
|
||||
fprep++;
|
||||
}
|
||||
}
|
||||
/* oh, the confusion */
|
||||
if (ffat >= 1 && fprep < 2)
|
||||
return 1;
|
||||
if (ffat < 1 && fprep >= 2)
|
||||
return 2;
|
||||
if (ffat >=1 && fprep >= 2)
|
||||
return 3;
|
||||
|
||||
msg_display(MSG_nobootpartdisklabel);
|
||||
process_menu(MENU_ok, NULL);
|
||||
@ -236,9 +468,11 @@ md_pre_update(void)
|
||||
for (ext = &mbr; ext; ext = ext->extended) {
|
||||
part = ext->mbr.mbr_parts;
|
||||
for (i = 0; i < MBR_PART_COUNT; part++, i++) {
|
||||
if (part->mbrp_type != MBR_PTYPE_PREP)
|
||||
continue;
|
||||
if (part->mbrp_size < (MIN_MD_BOOT/512)) {
|
||||
if (part->mbrp_type == MBR_PTYPE_PREP &&
|
||||
part->mbrp_size > 50)
|
||||
bootinfo_mbr = i+1;
|
||||
if (part->mbrp_type == MBR_PTYPE_RESERVED_x21 &&
|
||||
part->mbrp_size < (MIN_FAT12_BOOT/512)) {
|
||||
msg_display(MSG_boottoosmall);
|
||||
msg_display_add(MSG_nobootpartdisklabel, 0);
|
||||
process_menu(MENU_yesno, NULL);
|
||||
@ -248,8 +482,15 @@ md_pre_update(void)
|
||||
}
|
||||
}
|
||||
}
|
||||
if (md_check_partitions() == 0)
|
||||
nobootfix = 1;
|
||||
|
||||
i = md_check_partitions();
|
||||
switch (i) {
|
||||
case 0: nobootfix=1; noprepfix=1; break;
|
||||
case 1: noprepfix=1; break;
|
||||
case 2: nobootfix=1; break;
|
||||
default: break;
|
||||
}
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
@ -268,21 +509,58 @@ md_bios_info(char *dev)
|
||||
int
|
||||
md_post_extract(void)
|
||||
{
|
||||
char bootdev[100], bootbdev[100];
|
||||
char bootdev[100], bootbdev[100], version[64];
|
||||
|
||||
/* if we can't make it bootable, just punt */
|
||||
if (nobootfix)
|
||||
if (nobootfix && noprepfix)
|
||||
return 0;
|
||||
|
||||
snprintf(bootdev, sizeof bootdev, "/dev/r%s%c", diskdev, 'a'+bootpart);
|
||||
snprintf(bootbdev, sizeof bootbdev, "/dev/%s%c", diskdev, 'a'+bootpart);
|
||||
snprintf(version, sizeof version, "NetBSD/%s %s", MACH, REL);
|
||||
run_program(RUN_DISPLAY, "/usr/mdec/mkbootinfo '%s' %d "
|
||||
"/tmp/bootinfo.txt", version, bootinfo_mbr);
|
||||
|
||||
if (!nobootfix) {
|
||||
snprintf(bootdev, sizeof bootdev, "/dev/r%s%c", diskdev,
|
||||
'a'+bootpart_fat12);
|
||||
snprintf(bootbdev, sizeof bootbdev, "/dev/%s%c", diskdev,
|
||||
'a'+bootpart_fat12);
|
||||
|
||||
if (nonewfsmsdos == 0)
|
||||
run_program(RUN_DISPLAY, "/sbin/newfs_msdos %s", bootdev);
|
||||
run_program(RUN_DISPLAY, "/sbin/mount_msdos %s /mnt2", bootbdev);
|
||||
run_program(RUN_DISPLAY, "/bin/cp /usr/mdec/ofwboot /mnt2/ofwboot");
|
||||
run_program(RUN_DISPLAY, "/sbin/umount /mnt2");
|
||||
if (nonewfsmsdos == 0)
|
||||
run_program(RUN_DISPLAY, "/sbin/newfs_msdos %s",
|
||||
bootdev);
|
||||
run_program(RUN_DISPLAY, "/sbin/mount_msdos %s /mnt2",
|
||||
bootbdev);
|
||||
run_program(RUN_DISPLAY, "/bin/mkdir -p /mnt2/ppc");
|
||||
run_program(RUN_DISPLAY, "/bin/mkdir -p /mnt2/netbsd");
|
||||
run_program(RUN_DISPLAY, "/bin/cp /usr/mdec/ofwboot "
|
||||
"/mnt2/netbsd");
|
||||
run_program(RUN_DISPLAY, "/bin/cp /tmp/bootinfo.txt "
|
||||
"/mnt2/ppc");
|
||||
run_program(RUN_DISPLAY,
|
||||
"/bin/cp /usr/mdec/ofwboot /mnt2/ofwboot");
|
||||
run_program(RUN_DISPLAY, "/sbin/umount /mnt2");
|
||||
}
|
||||
|
||||
if (!noprepfix) {
|
||||
snprintf(bootdev, sizeof bootdev, "/dev/r%s%c", diskdev,
|
||||
'a'+bootpart_prep);
|
||||
snprintf(bootbdev, sizeof bootbdev, "/dev/%s%c", diskdev,
|
||||
'a'+bootpart_prep);
|
||||
run_program(RUN_DISPLAY, "/bin/dd if=/dev/zero of=%s bs=512",
|
||||
bootdev);
|
||||
run_program(RUN_DISPLAY, "/bin/dd if=/usr/mdec/ofwboot "
|
||||
"of=%s bs=512", bootbdev);
|
||||
|
||||
snprintf(bootdev, sizeof bootdev, "/dev/r%s%c", diskdev,
|
||||
'a'+bootpart_binfo);
|
||||
snprintf(bootbdev, sizeof bootbdev, "/dev/%s%c", diskdev,
|
||||
'a'+bootpart_binfo);
|
||||
run_program(RUN_DISPLAY, "/bin/dd if=/dev/zero of=%s bs=512",
|
||||
bootdev);
|
||||
run_program(RUN_DISPLAY, "/bin/dd if=/tmp/bootinfo.txt "
|
||||
"of=%s bs=512", bootbdev);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: md.h,v 1.1 2008/01/02 11:30:31 mrg Exp $ */
|
||||
/* $NetBSD: md.h,v 1.2 2008/01/23 23:15:37 garbled Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright 1997 Piermont Information Systems Inc.
|
||||
@ -49,20 +49,28 @@
|
||||
#include "mbr.h"
|
||||
|
||||
/* constants and defines */
|
||||
#define MD_BOOT_SIZE 100352000 /* 100MB boot partition */
|
||||
#define MIN_MD_BOOT 2097152 /* 2MB absoule minimum */
|
||||
#define PREP_BOOT_SIZE 1048576 /* 1MB for prep-style boot */
|
||||
#define BINFO_BOOT_SIZE 15*1024 /* 12k for bootinfo.txt */
|
||||
#define FAT12_BOOT_SIZE 10485760 /* 10MB boot partition */
|
||||
#define MIN_FAT12_BOOT 2097152 /* 2MB absoule minimum */
|
||||
#define MIN_PREP_BOOT 1048576
|
||||
#define MIN_BINFO_BOOT 13312
|
||||
#define PART_ROOT PART_A
|
||||
#define PART_SWAP PART_B
|
||||
#define PART_RAW PART_C
|
||||
#define PART_BOOT PART_D
|
||||
#define PART_USR PART_E /* Can be after PART_FIRST_FREE */
|
||||
#define PART_FIRST_FREE PART_F
|
||||
#define PART_BSD PART_D
|
||||
#define PART_BOOT_FAT12 PART_E
|
||||
#define PART_BOOT_BINFO PART_F
|
||||
#define PART_BOOT_PREP PART_G
|
||||
#define PART_USR PART_H /* Can be after PART_FIRST_FREE */
|
||||
#define PART_FIRST_FREE PART_I
|
||||
|
||||
/* We want the boot MSDOS partition mounted on /boot */
|
||||
#define PART_BOOT_PI_FLAGS (PIF_MOUNT)
|
||||
#define PART_BOOT_PI_MOUNT "/boot"
|
||||
#define PART_BOOT_FAT12_PI_FLAGS (PIF_MOUNT)
|
||||
#define PART_BOOT_FAT12_PI_MOUNT "/boot"
|
||||
|
||||
#define DEFSWAPRAM 32 /* Assume at least this RAM for swap calc */
|
||||
#define DEFSWAPSIZE 128
|
||||
#define DEFROOTSIZE 64 /* Default root size */
|
||||
#define DEFVARSIZE 32 /* Default /var size, if created */
|
||||
#define DEFUSRSIZE 256 /* Default /usr size, if /home */
|
||||
@ -81,6 +89,7 @@
|
||||
* from floppy.
|
||||
*/
|
||||
#define SET_KERNEL_1_NAME "kern-GENERIC"
|
||||
#define SET_KERNEL_2_NAME "kern-GENERIC_B64"
|
||||
#define MD_SETS_SELECTED SET_KERNEL_1, SET_SYSTEM, SET_X11_NOSERVERS
|
||||
|
||||
/*
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: msg.md.de,v 1.1 2008/01/02 11:30:32 mrg Exp $ */
|
||||
/* $NetBSD: msg.md.de,v 1.2 2008/01/23 23:15:37 garbled Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright 1997 Piermont Information Systems Inc.
|
||||
@ -63,6 +63,9 @@ booten. Sind Sie sicher, da
|
||||
message set_kernel_1
|
||||
{Kernel (GENERIC)}
|
||||
|
||||
message set_kernel_2
|
||||
{Kernel (GENERIC_B64)}
|
||||
|
||||
message nobootpart
|
||||
{There is no boot partition in the MBR partition table.}
|
||||
|
||||
@ -73,3 +76,16 @@ however a size of at least 100MB is reccomended.}
|
||||
message nobootpartdisklabel
|
||||
{There is no boot partition in the disklabel. The boot partition should
|
||||
match the boot partition you set up in the MBR partition table.}
|
||||
|
||||
message preptoosmall
|
||||
{You need to have two PReP partitions to boot an IBM RS/6000. One needs to
|
||||
be at least 1MB in size, and the other must be at least 1KB in size.}
|
||||
|
||||
message bootnotright
|
||||
{In order to boot ofppc, you need either a FAT12 partition of at least 2MB
|
||||
in size, or a pair of PReP partitions. The PReP partitions need to be at
|
||||
least 1KB, and 1MB in size. IBM RS/6000 machines generally need the PReP
|
||||
partitions, however some can utilize the FAT12. Most other machines require
|
||||
the FAT12 partition. If you are not sure which to choose, accept the
|
||||
defaults, and install all three. You do not currently have any partitions
|
||||
that meet the minimum requirements.}
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: msg.md.en,v 1.1 2008/01/02 11:30:32 mrg Exp $ */
|
||||
/* $NetBSD: msg.md.en,v 1.2 2008/01/23 23:15:37 garbled Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright 1997 Piermont Information Systems Inc.
|
||||
@ -63,13 +63,29 @@ sure you that you want to do this?
|
||||
message set_kernel_1
|
||||
{Kernel (GENERIC)}
|
||||
|
||||
message set_kernel_2
|
||||
{Kernel (GENERIC_B64)}
|
||||
|
||||
message nobootpart
|
||||
{There is no boot partition in the MBR partition table.}
|
||||
|
||||
message boottoosmall
|
||||
{The boot partition is too small. It needs to be at least 2MB in size,
|
||||
however a size of at least 100MB is reccomended.}
|
||||
{The FAT12 boot partition is too small. It needs to be at least 2MB in size,
|
||||
however a size of at least 10MB is reccomended.}
|
||||
|
||||
message nobootpartdisklabel
|
||||
{There is no boot partition in the disklabel. The boot partition should
|
||||
match the boot partition you set up in the MBR partition table.}
|
||||
|
||||
message preptoosmall
|
||||
{You need to have two PReP partitions to boot an IBM RS/6000. One needs to
|
||||
be at least 1MB in size, and the other must be at least 1KB in size.}
|
||||
|
||||
message bootnotright
|
||||
{In order to boot ofppc, you need either a FAT12 partition of at least 2MB
|
||||
in size, or a pair of PReP partitions. The PReP partitions need to be at
|
||||
least 1KB, and 1MB in size. IBM RS/6000 machines generally need the PReP
|
||||
partitions, however some can utilize the FAT12. Most other machines require
|
||||
the FAT12 partition. If you are not sure which to choose, accept the
|
||||
defaults, and install all three. You do not currently have any partitions
|
||||
that meet the minimum requirements.}
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: msg.md.es,v 1.1 2008/01/02 11:30:32 mrg Exp $ */
|
||||
/* $NetBSD: msg.md.es,v 1.2 2008/01/23 23:15:37 garbled Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright 1997 Piermont Information Systems Inc.
|
||||
@ -64,6 +64,9 @@ Puede que no sea posible iniciar desde ahi.
|
||||
message set_kernel_1
|
||||
{Núcleo (GENERIC)}
|
||||
|
||||
message set_kernel_2
|
||||
{N\xfacleo (GENERIC_B64)}
|
||||
|
||||
message nobootpart
|
||||
{There is no boot partition in the MBR partition table.}
|
||||
|
||||
@ -74,3 +77,16 @@ however a size of at least 100MB is reccomended.}
|
||||
message nobootpartdisklabel
|
||||
{There is no boot partition in the disklabel. The boot partition should
|
||||
match the boot partition you set up in the MBR partition table.}
|
||||
|
||||
message preptoosmall
|
||||
{You need to have two PReP partitions to boot an IBM RS/6000. One needs to
|
||||
be at least 1MB in size, and the other must be at least 1KB in size.}
|
||||
|
||||
message bootnotright
|
||||
{In order to boot ofppc, you need either a FAT12 partition of at least 2MB
|
||||
in size, or a pair of PReP partitions. The PReP partitions need to be at
|
||||
least 1KB, and 1MB in size. IBM RS/6000 machines generally need the PReP
|
||||
partitions, however some can utilize the FAT12. Most other machines require
|
||||
the FAT12 partition. If you are not sure which to choose, accept the
|
||||
defaults, and install all three. You do not currently have any partitions
|
||||
that meet the minimum requirements.}
|
||||
|
@ -63,6 +63,9 @@ chcesz to zrobic?
|
||||
message set_kernel_1
|
||||
{Kernel (GENERIC)}
|
||||
|
||||
message set_kernel_2
|
||||
{Kernel (GENERIC_B64)}
|
||||
|
||||
message nobootpart
|
||||
{There is no boot partition in the MBR partition table.}
|
||||
|
||||
@ -73,3 +76,16 @@ however a size of at least 100MB is reccomended.}
|
||||
message nobootpartdisklabel
|
||||
{There is no boot partition in the disklabel. The boot partition should
|
||||
match the boot partition you set up in the MBR partition table.}
|
||||
|
||||
message preptoosmall
|
||||
{You need to have two PReP partitions to boot an IBM RS/6000. One needs to
|
||||
be at least 1MB in size, and the other must be at least 1KB in size.}
|
||||
|
||||
message bootnotright
|
||||
{In order to boot ofppc, you need either a FAT12 partition of at least 2MB
|
||||
in size, or a pair of PReP partitions. The PReP partitions need to be at
|
||||
least 1KB, and 1MB in size. IBM RS/6000 machines generally need the PReP
|
||||
partitions, however some can utilize the FAT12. Most other machines require
|
||||
the FAT12 partition. If you are not sure which to choose, accept the
|
||||
defaults, and install all three. You do not currently have any partitions
|
||||
that meet the minimum requirements.}
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: bsddisklabel.c,v 1.43 2008/01/02 11:23:22 mrg Exp $ */
|
||||
/* $NetBSD: bsddisklabel.c,v 1.44 2008/01/23 23:15:37 garbled Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright 1997 Piermont Information Systems Inc.
|
||||
@ -91,26 +91,7 @@
|
||||
#define DEFSWAPSIZE 128
|
||||
#endif
|
||||
|
||||
static int set_ptn_size(menudesc *, void *);
|
||||
|
||||
struct ptn_info {
|
||||
int menu_no;
|
||||
struct ptn_size {
|
||||
int ptn_id;
|
||||
char mount[20];
|
||||
int dflt_size;
|
||||
int size;
|
||||
int limit;
|
||||
char changed;
|
||||
} ptn_sizes[MAXPARTITIONS + 1]; /* +1 for delete code */
|
||||
menu_ent ptn_menus[MAXPARTITIONS + 1]; /* +1 for unit chg */
|
||||
int free_parts;
|
||||
int free_space;
|
||||
struct ptn_size *pool_part;
|
||||
char exit_msg[70];
|
||||
};
|
||||
|
||||
static int
|
||||
int
|
||||
save_ptn(int ptn, int start, int size, int fstype, const char *mountpt)
|
||||
{
|
||||
static int maxptn;
|
||||
@ -156,7 +137,7 @@ save_ptn(int ptn, int start, int size, int fstype, const char *mountpt)
|
||||
return ptn;
|
||||
}
|
||||
|
||||
static void
|
||||
void
|
||||
set_ptn_titles(menudesc *m, int opt, void *arg)
|
||||
{
|
||||
struct ptn_info *pi = arg;
|
||||
@ -181,7 +162,7 @@ set_ptn_titles(menudesc *m, int opt, void *arg)
|
||||
p == pi->pool_part ? '+' : ' ', p->mount);
|
||||
}
|
||||
|
||||
static void
|
||||
void
|
||||
set_ptn_menu(struct ptn_info *pi)
|
||||
{
|
||||
struct ptn_size *p;
|
||||
@ -215,7 +196,7 @@ set_ptn_menu(struct ptn_info *pi)
|
||||
set_menu_numopts(pi->menu_no, m - pi->ptn_menus);
|
||||
}
|
||||
|
||||
static int
|
||||
int
|
||||
set_ptn_size(menudesc *m, void *arg)
|
||||
{
|
||||
struct ptn_info *pi = arg;
|
||||
@ -352,7 +333,7 @@ set_ptn_size(menudesc *m, void *arg)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void
|
||||
void
|
||||
get_ptn_sizes(int part_start, int sectors, int no_swap)
|
||||
{
|
||||
int i;
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: defs.h,v 1.133 2007/11/12 15:07:33 jmmv Exp $ */
|
||||
/* $NetBSD: defs.h,v 1.134 2008/01/23 23:15:37 garbled Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright 1997 Piermont Information Systems Inc.
|
||||
@ -54,6 +54,7 @@ deconst(const void *p)
|
||||
}
|
||||
|
||||
#include "msg_defs.h"
|
||||
#include "menu_defs.h"
|
||||
|
||||
#define min(a,b) ((a) < (b) ? (a) : (b))
|
||||
#define max(a,b) ((a) > (b) ? (a) : (b))
|
||||
@ -191,6 +192,22 @@ typedef struct _partinfo {
|
||||
#define PIF_RESET 0x1000 /* internal - restore previous values */
|
||||
} partinfo; /* Single partition from a disklabel */
|
||||
|
||||
struct ptn_info {
|
||||
int menu_no;
|
||||
struct ptn_size {
|
||||
int ptn_id;
|
||||
char mount[20];
|
||||
int dflt_size;
|
||||
int size;
|
||||
int limit;
|
||||
int changed;
|
||||
} ptn_sizes[MAXPARTITIONS + 1]; /* +1 for delete code */
|
||||
menu_ent ptn_menus[MAXPARTITIONS + 1]; /* +1 for unit chg */
|
||||
int free_parts;
|
||||
int free_space;
|
||||
struct ptn_size *pool_part;
|
||||
char exit_msg[70];
|
||||
};
|
||||
|
||||
/* variables */
|
||||
|
||||
@ -429,6 +446,11 @@ void unwind_mounts(void);
|
||||
|
||||
/* from bsddisklabel.c */
|
||||
int make_bsd_partitions(void);
|
||||
int save_ptn(int, int, int, int, const char *);
|
||||
void set_ptn_titles(menudesc *, int, void *);
|
||||
void set_ptn_menu(struct ptn_info *);
|
||||
int set_ptn_size(menudesc *, void *);
|
||||
void get_ptn_sizes(int, int, int);
|
||||
|
||||
/* from aout2elf.c */
|
||||
int move_aout_libs(void);
|
||||
|
Loading…
Reference in New Issue
Block a user