From 5b534b475ee8b6beb56e7409c9001f68f4ed83e6 Mon Sep 17 00:00:00 2001 From: tsutsui Date: Mon, 3 May 2010 14:14:35 +0000 Subject: [PATCH] Add sysinst(8) for hpcsh. Mostly taken from hpcsmips, but no non-English translations. Tested on HPW-50PA. --- distrib/hpcsh/miniroot/Makefile.inc | 10 +- distrib/hpcsh/miniroot/dot.profile | 4 +- distrib/hpcsh/miniroot/list | 11 +- distrib/utils/sysinst/Makefile | 3 +- distrib/utils/sysinst/arch/hpcsh/Makefile | 11 ++ distrib/utils/sysinst/arch/hpcsh/md.c | 177 +++++++++++++++++++ distrib/utils/sysinst/arch/hpcsh/md.h | 76 ++++++++ distrib/utils/sysinst/arch/hpcsh/menus.md.en | 40 +++++ distrib/utils/sysinst/arch/hpcsh/msg.md.en | 50 ++++++ 9 files changed, 365 insertions(+), 17 deletions(-) create mode 100644 distrib/utils/sysinst/arch/hpcsh/Makefile create mode 100644 distrib/utils/sysinst/arch/hpcsh/md.c create mode 100644 distrib/utils/sysinst/arch/hpcsh/md.h create mode 100644 distrib/utils/sysinst/arch/hpcsh/menus.md.en create mode 100644 distrib/utils/sysinst/arch/hpcsh/msg.md.en diff --git a/distrib/hpcsh/miniroot/Makefile.inc b/distrib/hpcsh/miniroot/Makefile.inc index 195a4ed2688e..5379ba21bca3 100644 --- a/distrib/hpcsh/miniroot/Makefile.inc +++ b/distrib/hpcsh/miniroot/Makefile.inc @@ -1,12 +1,12 @@ -# $NetBSD: Makefile.inc,v 1.5 2010/02/11 09:06:48 roy Exp $ +# $NetBSD: Makefile.inc,v 1.6 2010/05/03 14:14:35 tsutsui Exp $ -DBG= -O +WARNS= 1 +DBG= -Os IMAGESIZE= 4m MAKEFS_FLAGS= -o density=2k IMAGEENDIAN= le MAKEDEVTARGETS= all -#LISTS+= ${DISTRIBDIR}/common/list.sysinst +LISTS+= ${DISTRIBDIR}/common/list.sysinst.en MTREECONF+= ${.CURDIR}/mtree.usr.install -IMAGEDEPENDS+= ${ARCHDIR}/dot.profile \ - ${DESTDIR}/.profile ${DESTDIR}/etc/spwd.db +IMAGEDEPENDS+= ${ARCHDIR}/dot.profile diff --git a/distrib/hpcsh/miniroot/dot.profile b/distrib/hpcsh/miniroot/dot.profile index e8c66a1670c4..9ad91e47c218 100644 --- a/distrib/hpcsh/miniroot/dot.profile +++ b/distrib/hpcsh/miniroot/dot.profile @@ -1,4 +1,4 @@ -# $NetBSD: dot.profile,v 1.3 2010/05/01 12:59:26 tsutsui Exp $ +# $NetBSD: dot.profile,v 1.4 2010/05/03 14:14:35 tsutsui Exp $ # # Copyright (c) 1997 Perry E. Metzger # Copyright (c) 1994 Christopher G. Demetriou @@ -66,5 +66,5 @@ if [ "X${DONEPROFILE}" = "X" ]; then grep() sed -n "/$1/p" # run the installation or upgrade script. - # sysinst XXX + sysinst fi diff --git a/distrib/hpcsh/miniroot/list b/distrib/hpcsh/miniroot/list index 3583788475fe..a2779165fab5 100644 --- a/distrib/hpcsh/miniroot/list +++ b/distrib/hpcsh/miniroot/list @@ -1,4 +1,4 @@ -# $NetBSD: list,v 1.8 2010/05/01 12:18:44 tsutsui Exp $ +# $NetBSD: list,v 1.9 2010/05/03 14:14:35 tsutsui Exp $ # extras in bin #PROG bin/csh @@ -26,12 +26,5 @@ PROG usr/bin/rsh # Minimize use of MFS SYMLINK /tmp var/tmp -# various files that we need in /etc for the install -COPY ${DESTDIR}/etc/spwd.db etc/spwd.db -LINK etc/spwd.db etc/pwd.db - -# and the installation tools +# files that we need the installation tools COPY ${ARCHDIR}/dot.profile .profile - -# and a spare .profile -COPY ${DESTDIR}/.profile tmp/.hdprofile diff --git a/distrib/utils/sysinst/Makefile b/distrib/utils/sysinst/Makefile index 35e1462e9926..43de2cb1a67a 100644 --- a/distrib/utils/sysinst/Makefile +++ b/distrib/utils/sysinst/Makefile @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.14 2009/12/05 16:29:11 pooka Exp $ +# $NetBSD: Makefile,v 1.15 2010/05/03 14:14:35 tsutsui Exp $ # # sysinst is usually built when the crunched install binary is built, # but can be built here as a normal program for testing. @@ -25,6 +25,7 @@ SUBDIR += arch/hp300 SUBDIR += arch/hp700 SUBDIR += arch/hpcarm SUBDIR += arch/hpcmips +SUBDIR += arch/hpcsh SUBDIR += arch/i386 SUBDIR += arch/landisk SUBDIR += arch/mac68k diff --git a/distrib/utils/sysinst/arch/hpcsh/Makefile b/distrib/utils/sysinst/arch/hpcsh/Makefile new file mode 100644 index 000000000000..ae15a071bc99 --- /dev/null +++ b/distrib/utils/sysinst/arch/hpcsh/Makefile @@ -0,0 +1,11 @@ +# $NetBSD: Makefile,v 1.1 2010/05/03 14:14:35 tsutsui Exp $ +# +# Makefile for hpcsh +# + +MENUS_MD= menus.md.${SYSINSTLANG} menus.mbr +MSG_MD= msg.md.${SYSINSTLANG} msg.mbr.${SYSINSTLANG} + +LANGUAGES= # no translations ready yet + +.include "../../Makefile.inc" diff --git a/distrib/utils/sysinst/arch/hpcsh/md.c b/distrib/utils/sysinst/arch/hpcsh/md.c new file mode 100644 index 000000000000..095b751ac09a --- /dev/null +++ b/distrib/utils/sysinst/arch/hpcsh/md.c @@ -0,0 +1,177 @@ +/* $NetBSD: md.c,v 1.1 2010/05/03 14:14:35 tsutsui Exp $ */ + +/* + * Copyright 1997 Piermont Information Systems Inc. + * All rights reserved. + * + * Based on code written by Philip A. Nelson for Piermont Information + * Systems Inc. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed for the NetBSD Project by + * Piermont Information Systems Inc. + * 4. The name of Piermont Information Systems Inc. may not be used to endorse + * or promote products derived from this software without specific prior + * written permission. + * + * THIS SOFTWARE IS PROVIDED BY PIERMONT INFORMATION SYSTEMS INC. ``AS IS'' + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL PIERMONT INFORMATION SYSTEMS INC. BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF + * THE POSSIBILITY OF SUCH DAMAGE. + */ + +/* md.c -- hpcsh machine specific routines */ + +#include +#include +#include +#include +#include + +#include "defs.h" +#include "md.h" +#include "msg_defs.h" +#include "menu_defs.h" +#include "endian.h" +#include "mbr.h" + +void +md_init(void) +{ +} + +void +md_init_set_status(int minimal) +{ + + (void)minimal; +} + +int +md_get_info(void) +{ + + return set_bios_geom_with_mbr_guess(); +} + +/* + * md back-end code for menu-driven BSD disklabel editor. + */ +int +md_make_bsd_partitions(void) +{ + + return make_bsd_partitions(); +} + +/* + * any additional partition validation + */ +int +md_check_partitions(void) +{ + + return 1; +} + +/* + * hook called before writing new disklabel. + */ +int +md_pre_disklabel(void) +{ + + msg_display(MSG_dofdisk); + + /* write edited MBR onto disk. */ + if (write_mbr(diskdev, &mbr, 1) != 0) { + msg_display(MSG_wmbrfail); + process_menu(MENU_ok, NULL); + return 1; + } + return 0; +} + +/* + * hook called after writing disklabel to new target disk. + */ +int +md_post_disklabel(void) +{ + + return 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) +{ + + return 0; +} + +void +md_cleanup_install(void) +{ + +#ifndef DEBUG + enable_rc_conf(); +#endif +} + +int +md_pre_update(void) +{ + + return 1; +} + +/* Upgrade support */ +int +md_update(void) +{ + + md_post_newfs(); + return 1; +} + +int +md_post_extract(void) +{ + + return 0; +} + +int +md_check_mbr(mbr_info_t *mbri) +{ + + return 2; +} + +int +md_mbr_use_wholedisk(mbr_info_t *mbri) +{ + + return mbr_use_wholedisk(mbri); +} diff --git a/distrib/utils/sysinst/arch/hpcsh/md.h b/distrib/utils/sysinst/arch/hpcsh/md.h new file mode 100644 index 000000000000..c7e82f599d82 --- /dev/null +++ b/distrib/utils/sysinst/arch/hpcsh/md.h @@ -0,0 +1,76 @@ +/* $NetBSD: md.h,v 1.1 2010/05/03 14:14:35 tsutsui Exp $ */ + +/* + * Copyright 1997 Piermont Information Systems Inc. + * All rights reserved. + * + * Written by Philip A. Nelson for Piermont Information Systems Inc. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed for the NetBSD Project by + * Piermont Information Systems Inc. + * 4. The name of Piermont Information Systems Inc. may not be used to endorse + * or promote products derived from this software without specific prior + * written permission. + * + * THIS SOFTWARE IS PROVIDED BY PIERMONT INFORMATION SYSTEMS INC. ``AS IS'' + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL PIERMONT INFORMATION SYSTEMS INC. BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF + * THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +/* md.h -- Machine specific definitions for the hpcsh */ + + +#include +#include +#include +#include +#include + +/* hpcsh uses the mbr code. */ +#include "mbr.h" + +/* constants and defines */ + + +/* Extra megs for full X installation */ +#define XNEEDMB 340 + + +/* + * Default filesets to fetch and install during installation + * or upgrade. The standard sets are: + * base etc comp games man misc tests text xbase xcomp xetc xfont xserver + */ +#define SET_KERNEL_1_NAME "kern-GENERIC" +#define SET_KERNEL_2_NAME "kern-HPW650PA" + + +/* + * Machine-specific command to write a new label to a disk. + * For example, i386 uses "/sbin/disklabel -w -r", just like i386 + * miniroot scripts, though this may leave a bogus incore label. + * Sun ports should probably use DISKLABEL_CMD "/sbin/disklabel -w" + * to get incore to ondisk inode translation for the Sun proms. + * If not defined, we assume the port does not support disklabels and + * hand-edited disklabel will NOT be written by MI code. + */ +#define DISKLABEL_CMD "disklabel -w -r" diff --git a/distrib/utils/sysinst/arch/hpcsh/menus.md.en b/distrib/utils/sysinst/arch/hpcsh/menus.md.en new file mode 100644 index 000000000000..404bdf1e5981 --- /dev/null +++ b/distrib/utils/sysinst/arch/hpcsh/menus.md.en @@ -0,0 +1,40 @@ +/* $NetBSD: menus.md.en,v 1.1 2010/05/03 14:14:36 tsutsui Exp $ */ + +/* + * Copyright 1997 Piermont Information Systems Inc. + * All rights reserved. + * + * Written by Philip A. Nelson for Piermont Information Systems Inc. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed for the NetBSD Project by + * Piermont Information Systems Inc. + * 4. The name of Piermont Information Systems Inc. may not be used to endorse + * or promote products derived from this software without specific prior + * written permission. + * + * THIS SOFTWARE IS PROVIDED BY PIERMONT INFORMATION SYSTEMS INC. ``AS IS'' + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL PIERMONT INFORMATION SYSTEMS INC. BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF + * THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +/* Menu definitions for sysinst. hpcsh version, machine dependent. */ + diff --git a/distrib/utils/sysinst/arch/hpcsh/msg.md.en b/distrib/utils/sysinst/arch/hpcsh/msg.md.en new file mode 100644 index 000000000000..848b7bad66fe --- /dev/null +++ b/distrib/utils/sysinst/arch/hpcsh/msg.md.en @@ -0,0 +1,50 @@ +/* $NetBSD: msg.md.en,v 1.1 2010/05/03 14:14:36 tsutsui Exp $ */ + +/* + * Copyright 1997 Piermont Information Systems Inc. + * All rights reserved. + * + * Written by Philip A. Nelson for Piermont Information Systems Inc. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed for the NetBSD Project by + * Piermont Information Systems Inc. + * 4. The name of Piermont Information Systems Inc. may not be used to endorse + * or promote products derived from this software without specific prior + * written permission. + * + * THIS SOFTWARE IS PROVIDED BY PIERMONT INFORMATION SYSTEMS INC. ``AS IS'' + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL PIERMONT INFORMATION SYSTEMS INC. BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF + * THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +/* MD Message catalog -- English, hpcsh version */ + +message md_hello +{If you booted from an external device, you may now remove it. + +} + +message set_kernel_1 +{Kernel (GENERIC)} +message set_kernel_2 +{Kernel (HPW650PA)} +