diff options
author | Mark Kettenis <kettenis@cvs.openbsd.org> | 2020-07-04 21:11:05 +0000 |
---|---|---|
committer | Mark Kettenis <kettenis@cvs.openbsd.org> | 2020-07-04 21:11:05 +0000 |
commit | a4f3f15e9a0dd3e78ed1dbd43af1b7d17181a6d2 (patch) | |
tree | 1306045efa742a1ed0dc8048f026f7d95959a331 | |
parent | d7b1ed9f3dfb85865e1043a53b19bf8d28f06ef6 (diff) |
Installer bits for powerpc64.
-rw-r--r-- | distrib/Makefile | 4 | ||||
-rw-r--r-- | distrib/notes/Makefile | 4 | ||||
-rw-r--r-- | distrib/powerpc64/Makefile | 8 | ||||
-rw-r--r-- | distrib/powerpc64/ramdisk/Makefile | 55 | ||||
-rw-r--r-- | distrib/powerpc64/ramdisk/install.md | 121 | ||||
-rw-r--r-- | distrib/powerpc64/ramdisk/list | 98 |
6 files changed, 286 insertions, 4 deletions
diff --git a/distrib/Makefile b/distrib/Makefile index 78d727a831a..e0e1807a28b 100644 --- a/distrib/Makefile +++ b/distrib/Makefile @@ -1,11 +1,11 @@ -# $OpenBSD: Makefile,v 1.52 2019/05/11 07:18:14 deraadt Exp $ +# $OpenBSD: Makefile,v 1.53 2020/07/04 21:11:03 kettenis Exp $ SUBDIR= special notes .if make(obj) SUBDIR+=alpha amd64 armv7 arm64 hppa i386 \ landisk loongson luna88k macppc \ - octeon sgi sparc64 + octeon powerpc64 sgi sparc64 .elif exists(${MACHINE}) SUBDIR+=${MACHINE} .endif diff --git a/distrib/notes/Makefile b/distrib/notes/Makefile index 2e2f8981c4d..28245532e57 100644 --- a/distrib/notes/Makefile +++ b/distrib/notes/Makefile @@ -1,4 +1,4 @@ -# $OpenBSD: Makefile,v 1.48 2019/05/11 07:18:14 deraadt Exp $ +# $OpenBSD: Makefile,v 1.49 2020/07/04 21:11:04 kettenis Exp $ NOPROG= NOMAN= @@ -19,7 +19,7 @@ all: $(TARG) allarchs: @cd $(.CURDIR); \ for arch in alpha amd64 arm64 armv7 hppa i386 landisk \ - loongson luna88k macppc octeon sgi sparc64; \ + loongson luna88k macppc octeon powerpc64 sgi sparc64; \ do ${MAKE} M=$$arch; done $(TARG): $(DEP) diff --git a/distrib/powerpc64/Makefile b/distrib/powerpc64/Makefile new file mode 100644 index 00000000000..bd4e37b7022 --- /dev/null +++ b/distrib/powerpc64/Makefile @@ -0,0 +1,8 @@ +# $OpenBSD: Makefile,v 1.1 2020/07/04 21:11:04 kettenis Exp $ + +SUBDIR= ramdisk + +unconfig: + cd ramdisk; ${MAKE} unconfig + +.include <bsd.subdir.mk> diff --git a/distrib/powerpc64/ramdisk/Makefile b/distrib/powerpc64/ramdisk/Makefile new file mode 100644 index 00000000000..678d9acf4a8 --- /dev/null +++ b/distrib/powerpc64/ramdisk/Makefile @@ -0,0 +1,55 @@ +# $OpenBSD: Makefile,v 1.1 2020/07/04 21:11:04 kettenis Exp $ + +MTREE= ${UTILS}/mtree.conf +RAMDISK= RAMDISK + +LISTS= ${.CURDIR}/list +UTILS= ${.CURDIR}/../../miniroot + +all: bsd.rd + +MRDISKTYPE= rdroot +MRMAKEFSARGS= -o disklabel=${MRDISKTYPE},minfree=0,density=4096 + +bsd.rd: mr.fs bsd + cp bsd bsd.rd + rdsetroot bsd.rd mr.fs + +bsd: + cd ${.CURDIR}/../../../sys/arch/${MACHINE}/compile/${RAMDISK} && \ + su ${BUILDUSER} -c '${MAKE} config && ${MAKE} clean && exec ${MAKE}' + cp -p ${.CURDIR}/../../../sys/arch/${MACHINE}/compile/${RAMDISK}/obj/bsd bsd + +mr.fs: instbin + rm -rf $@.d + install -d -o root -g wheel $@.d + mtree -def ${MTREE} -p $@.d -u + CURDIR=${.CURDIR} OBJDIR=${.OBJDIR} OSrev=${OSrev} \ + TARGDIR=$@.d UTILS=${UTILS} RELEASEDIR=${RELEASEDIR} \ + sh ${UTILS}/runlist.sh ${LISTS} + rm $@.d/instbin + makefs ${MRMAKEFSARGS} $@ $@.d + +instbin.mk instbin.cache instbin.c: instbin.conf + crunchgen -E -D ${.CURDIR}/../../.. -L ${DESTDIR}/usr/lib \ + -c instbin.c -e instbin -m instbin.mk instbin.conf + +instbin: instbin.mk instbin.cache instbin.c + ${MAKE} -f instbin.mk SRCLIBDIR=${.CURDIR}/../../../lib all + +instbin.conf: ${LISTS} + awk -f ${UTILS}/makeconf.awk ${LISTS} > instbin.conf + +.ifdef RELEASEDIR +install: + cp bsd.rd ${RELEASEDIR}/bsd.rd + chmod a+r ${RELEASEDIR}/bsd.rd +.endif + +clean cleandir: + rm -f *.core mr.fs instbin instbin.mk instbin.cache \ + lib*.a lib*.olist instbin.map *.o *.lo *.c bsd bsd.rd + rm -rf instbin.con + rm -rf cd-dir mr.fs.d + +.include <bsd.obj.mk> diff --git a/distrib/powerpc64/ramdisk/install.md b/distrib/powerpc64/ramdisk/install.md new file mode 100644 index 00000000000..c308c9f0b4c --- /dev/null +++ b/distrib/powerpc64/ramdisk/install.md @@ -0,0 +1,121 @@ +# $OpenBSD: install.md,v 1.1 2020/07/04 21:11:04 kettenis Exp $ +# +# +# Copyright (c) 1996 The NetBSD Foundation, Inc. +# All rights reserved. +# +# This code is derived from software contributed to The NetBSD Foundation +# by Jason R. Thorpe. +# +# 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. +# +# THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS +# ``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 THE REGENTS OR CONTRIBUTORS 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. +# +# +# machine dependent section of installation/upgrade script. +# + +NCPU=$(sysctl -n hw.ncpufound) +NEWFSARGS_msdos="-F 16 -L boot" + +md_installboot() { +} + +md_prep_fdisk() { + local _disk=$1 _d + + local bootparttype="C" + local bootsectorstart="32768" + local bootsectorsize="32768" + local bootsectorend=$(($bootsectorstart + $bootsectorsize)) + local bootfstype="msdos" + local newfs_args=${NEWFSARGS_msdos} + + while :; do + _d=whole + if disk_has $_disk mbr; then + fdisk $_disk + else + echo "MBR has invalid signature; not showing it." + fi + ask "Use (W)hole disk or (E)dit the MBR?" "$_d" + case $resp in + [wW]*) + echo -n "Creating a ${bootfstype} partition and an OpenBSD partition for rest of $_disk..." + fdisk -e ${_disk} <<__EOT >/dev/null +reinit +e 0 +${bootparttype} +n +${bootsectorstart} +${bootsectorsize} +f 0 +e 3 +A6 +n +${bootsectorend} + +write +quit +__EOT + echo "done." + disklabel $_disk 2>/dev/null | grep -q "^ i:" || disklabel -w -d $_disk + newfs -t ${bootfstype} ${newfs_args} ${_disk}i + return ;; + [eE]*) + # Manually configure the MBR. + cat <<__EOT + +You will now create one MBR partition to contain your OpenBSD data +and one MBR partition on which the OpenBSD boot program is located. +Neither partition will overlap any other partition. + +The OpenBSD MBR partition will have an id of 'A6' and the boot MBR +partition will have an id of '${bootparttype}' (${bootfstype}). +The boot partition will be at least 16MB and be the first 'MSDOS' +partition on the disk. + +$(fdisk ${_disk}) +__EOT + fdisk -e ${_disk} + disk_has $_disk mbr openbsd && return + echo No OpenBSD partition in MBR, try again. ;; + esac + done +} + +md_prep_disklabel() { + local _disk=$1 _f=/tmp/i/fstab.$1 + + md_prep_fdisk $_disk + + disklabel_autolayout $_disk $_f || return + [[ -s $_f ]] && return + + # Edit disklabel manually. + # Abandon all hope, ye who enter here. + disklabel -F $_f -E $_disk +} + +md_congrats() { +} + +md_consoleinfo() { +} diff --git a/distrib/powerpc64/ramdisk/list b/distrib/powerpc64/ramdisk/list new file mode 100644 index 00000000000..756372d90e8 --- /dev/null +++ b/distrib/powerpc64/ramdisk/list @@ -0,0 +1,98 @@ +# $OpenBSD: list,v 1.1 2020/07/04 21:11:04 kettenis Exp $ + +SRCDIRS distrib/special + +# copy the crunched binary, link to it, and kill it +COPY ${OBJDIR}/instbin instbin +LINK instbin bin/arch +LINK instbin bin/cat +LINK instbin bin/chmod bin/chgrp sbin/chown +LINK instbin bin/cp +LINK instbin bin/date +LINK instbin bin/dd +LINK instbin bin/df +LINK instbin bin/ed +LINK instbin bin/hostname +LINK instbin bin/ksh bin/sh +LINK instbin bin/ln +LINK instbin bin/ls +LINK instbin bin/md5 bin/sha256 bin/sha512 +LINK instbin bin/mkdir +LINK instbin bin/mt bin/eject +LINK instbin bin/mv +LINK instbin bin/pax bin/tar +LINK instbin bin/rm +LINK instbin bin/sleep +LINK instbin bin/stty +LINK instbin bin/sync +LINK instbin sbin/bioctl +LINK instbin sbin/dhclient +LINK instbin sbin/disklabel +LINK instbin sbin/dmesg +LINK instbin sbin/fdisk +LINK instbin sbin/fsck +LINK instbin sbin/fsck_ext2fs +LINK instbin sbin/fsck_ffs +LINK instbin sbin/growfs +LINK instbin sbin/ifconfig +LINK instbin sbin/init +LINK instbin sbin/mknod +LINK instbin sbin/mount +LINK instbin sbin/mount_cd9660 +LINK instbin sbin/mount_ext2fs +LINK instbin sbin/mount_ffs +LINK instbin sbin/mount_msdos +LINK instbin sbin/mount_nfs +LINK instbin sbin/newfs +LINK instbin sbin/newfs_ext2fs +LINK instbin sbin/newfs_msdos +LINK instbin sbin/ping sbin/ping6 +LINK instbin sbin/reboot sbin/halt +LINK instbin sbin/route +LINK instbin sbin/slaacd +LINK instbin sbin/sysctl +LINK instbin sbin/umount +LINK instbin usr/bin/doas +LINK instbin usr/bin/encrypt +LINK instbin usr/bin/grep usr/bin/egrep usr/bin/fgrep +LINK instbin usr/bin/gzip usr/bin/gunzip usr/bin/gzcat +LINK instbin usr/bin/more usr/bin/less +LINK instbin usr/bin/sed +LINK instbin usr/bin/signify +LINK instbin usr/bin/tee +LINK instbin usr/sbin/chroot +LINK instbin usr/sbin/pwd_mkdb +ARGVLINK ksh -sh +SPECIAL rm bin/md5 + +SPECIAL awk -f ${UTILS}/trimcerts.awk ${DESTDIR}/etc/ssl/cert.pem etc/ssl/cert.pem +LINK instbin usr/bin/ftp-ssl usr/bin/ftp +SPECIAL rm usr/bin/ftp-ssl + +# copy the MAKEDEV script and make some devices +SCRIPT ${DESTDIR}/dev/MAKEDEV dev/MAKEDEV +SPECIAL cd dev; sh MAKEDEV ramdisk + +# various files that we need in /etc for the install +COPY ${CURDIR}/../../miniroot/group etc/group +COPY ${CURDIR}/../../miniroot/master.passwd etc/master.passwd +SPECIAL pwd_mkdb -p -d etc master.passwd; rm etc/master.passwd +COPY ${DESTDIR}/etc/signify/openbsd-${OSrev}-base.pub etc/signify/openbsd-${OSrev}-base.pub +COPY ${CURDIR}/../../miniroot/protocols etc/protocols +COPY ${CURDIR}/../../miniroot/services etc/services +TERMCAP vt100,vt220,dumb usr/share/misc/termcap + +SYMLINK /tmp/i/fstab.shadow etc/fstab +SYMLINK /tmp/i/resolv.conf.shadow etc/resolv.conf +SYMLINK /tmp/i/hosts etc/hosts + +# and the installation tools +SCRIPT ${CURDIR}/../../miniroot/dot.profile .profile +SCRIPT ${CURDIR}/../../miniroot/install.sub install.sub +SCRIPT ${CURDIR}/install.md install.md +SPECIAL chmod 755 install.sub +SYMLINK install.sub autoinstall +SYMLINK install.sub install +SYMLINK install.sub upgrade + +TZ |