Rebase.diff -r1.2 -r1.2.18.1 src/distrib/vax/cdroms/installcd/Makefile
(tls)
--- src/distrib/vax/cdroms/installcd/Makefile 2012/01/15 22:34:34 1.2
+++ src/distrib/vax/cdroms/installcd/Makefile 2014/08/10 06:48:55 1.2.18.1
@@ -1,17 +1,97 @@ | @@ -1,17 +1,97 @@ | |||
1 | # $NetBSD: Makefile,v 1.2 2012/01/15 22:34:34 jmcneill Exp $ | 1 | # $NetBSD: Makefile,v 1.2.18.1 2014/08/10 06:48:55 tls Exp $ | |
2 | CDBASE= vaxcd # gives ${CDBASE}.iso | 2 | CDBASE= vaxcd # gives ${CDBASE}.iso | |
3 | CDRELEASE= true # include $RELEASEDIR/$MACHINE | 3 | CDRELEASE= true # include $RELEASEDIR/$MACHINE | |
4 | CDKERNELS= install.ram.gz netbsd | 4 | CDKERNELS= ${RELEASEDIR}/${MACHINE}/binary/kernel/netbsd-GENERIC.gz netbsd.gz | |
5 | CDINSTKERNEL= ../../ramdisk-kernel | 5 | CDRELEASE_NOISOS=true | |
6 | CDMAKEFSEXTRAOPTS+=-F ./fs.spec | |||
6 | 7 | |||
7 | #make the CD bootable | 8 | CLEANFILES+= fs.spec | |
8 | prepare_md_post: | 9 | ||
10 | # for PRINTOBJDIR | |||
11 | .include <bsd.own.mk> | |||
12 | SYSINSTDIR!= cd ${.CURDIR}/../../../../usr.sbin/sysinst/arch/${MACHINE} && ${PRINTOBJDIR} | |||
13 | ||||
14 | # prepare mutliuser install environment | |||
15 | image_md_pre: | |||
9 | ${RM} -f cdrom/boot | 16 | ${RM} -f cdrom/boot | |
10 | ${CP} ${DESTDIR}/usr/mdec/boot cdrom/boot | 17 | ${CP} ${DESTDIR}/usr/mdec/boot cdrom/boot | |
11 | ${RM} -f bootxx.${MACHINE} | 18 | ${RM} -f bootxx.${MACHINE} | |
12 | ${CP} ${DESTDIR}/usr/mdec/xxboot bootxx.${MACHINE} | 19 | ${CP} ${DESTDIR}/usr/mdec/xxboot bootxx.${MACHINE} | |
20 | ${RM} -rf cdrom/libexec/dhcpcd-hooks/* | |||
21 | ${MKDIR} -p cdrom/libexec/dhcpcd-hooks | |||
22 | ${CP} ${.CURDIR}/../../../common/10-resolv.conf cdrom/libexec/dhcpcd-hooks | |||
23 | ${CP} ${.CURDIR}/../../../common/99-print-sysinst cdrom/libexec/dhcpcd-hooks | |||
24 | ${MKDIR} cdrom/etc | |||
25 | ${HOST_LN} -fs /tmp/gettytab cdrom/etc/gettytab | |||
26 | ${INSTALL} ${COPY} ${.CURDIR}/etc.ttys cdrom/etc/ttys | |||
27 | ${INSTALL} ${COPY} ${.CURDIR}/etc.rc cdrom/etc/rc | |||
28 | ${INSTALL} ${COPY} -m 0555 ${.CURDIR}/install.sh cdrom/install.sh | |||
29 | ${MKDIR} cdrom/mnt2 cdrom/targetroot | |||
30 | ${INSTALL} ${COPY} -m 0555 ${SYSINSTDIR}/sysinst cdrom | |||
31 | for f in ${SYSINSTDIR}/sysinstmsgs.??; do \ | |||
32 | ${INSTALL} ${COPY} $$f cdrom; \ | |||
33 | done | |||
34 | ${TOOL_GZIP} -d -f cdrom/netbsd.gz | |||
35 | echo '. type=dir optional' > ./fs.spec | |||
36 | echo './dev type=dir optional' >> ./fs.spec | |||
37 | ${HOST_SH} cdrom/dev/MAKEDEV -s all | ${TOOL_SED} -e '1d' -e 's:^\./:./dev/:' >> ./fs.spec | |||
38 | ${MKDIR} cdrom/var | |||
39 | ${MKDIR} cdrom/kern | |||
13 | 40 | |||
41 | # make the CD bootable | |||
14 | image_md_post: | 42 | image_md_post: | |
15 | ${TOOL_INSTALLBOOT} -m${MACHINE} ${CDIMAGE} bootxx.${MACHINE} | 43 | ${TOOL_INSTALLBOOT} -m${MACHINE} ${CDIMAGE} bootxx.${MACHINE} | |
16 | 44 | |||
45 | CDRUNTIME+= ./bin | |||
46 | CDRUNTIME+= ./dev/MAKEDEV | |||
47 | CDRUNTIME+= ./etc | |||
48 | CDRUNTIME+= ./lib | |||
49 | CDRUNTIME+= ./libdata | |||
50 | CDRUNTIME+= ./libexec | |||
51 | CDRUNTIME+= ./mnt | |||
52 | CDRUNTIME+= ./sbin | |||
53 | # CDRUNTIME+= ./stand | |||
54 | CDRUNTIME+= ./tmp | |||
55 | CDRUNTIME+= ./usr/bin/ftp | |||
56 | CDRUNTIME+= ./usr/bin/getopt | |||
57 | CDRUNTIME+= ./usr/bin/gunzip | |||
58 | CDRUNTIME+= ./usr/bin/gzcat | |||
59 | CDRUNTIME+= ./usr/bin/gzip | |||
60 | CDRUNTIME+= ./usr/bin/grep | |||
61 | CDRUNTIME+= ./usr/bin/less | |||
62 | CDRUNTIME+= ./usr/bin/more | |||
63 | CDRUNTIME+= ./usr/bin/netstat | |||
64 | CDRUNTIME+= ./usr/bin/progress | |||
65 | CDRUNTIME+= ./usr/bin/sed | |||
66 | CDRUNTIME+= ./usr/bin/sort | |||
67 | CDRUNTIME+= ./usr/bin/tip | |||
68 | CDRUNTIME+= ./usr/bin/tput | |||
69 | CDRUNTIME+= ./usr/bin/vi | |||
70 | CDRUNTIME+= ./usr/bin/vmstat | |||
71 | CDRUNTIME+= ./usr/lib/libbz2.so* | |||
72 | CDRUNTIME+= ./usr/lib/libc.so* | |||
73 | CDRUNTIME+= ./usr/lib/libcurses.so* | |||
74 | CDRUNTIME+= ./usr/lib/libedit.so* | |||
75 | CDRUNTIME+= ./usr/lib/libgcc_s.so* | |||
76 | CDRUNTIME+= ./usr/lib/libintl.so* | |||
77 | CDRUNTIME+= ./usr/lib/libkvm.so* | |||
78 | CDRUNTIME+= ./usr/lib/liblzma.so* | |||
79 | CDRUNTIME+= ./usr/lib/libterminfo.so* | |||
80 | CDRUNTIME+= ./usr/lib/libutil.so* | |||
81 | CDRUNTIME+= ./usr/lib/libz.so* | |||
82 | .if (${MKCRYPTO} != "no") | |||
83 | CDRUNTIME+= ./usr/lib/libcrypto.so* | |||
84 | CDRUNTIME+= ./usr/lib/libssl.so* | |||
85 | .endif | |||
86 | CDRUNTIME+= ./usr/libexec/ld.elf_so | |||
87 | CDRUNTIME+= ./usr/libexec/getty | |||
88 | CDRUNTIME+= ./usr/mdec | |||
89 | CDRUNTIME+= ./usr/sbin/chat | |||
90 | CDRUNTIME+= ./usr/sbin/chroot | |||
91 | CDRUNTIME+= ./usr/sbin/installboot | |||
92 | CDRUNTIME+= ./usr/sbin/pppd | |||
93 | CDRUNTIME+= ./usr/sbin/wiconfig | |||
94 | CDRUNTIME+= ./usr/share/misc/terminfo.cdb | |||
95 | CDRUNTIME+= ./usr/share/locale | |||
96 | ||||
17 | .include "${.CURDIR}/../../../common/Makefile.bootcd" | 97 | .include "${.CURDIR}/../../../common/Makefile.bootcd" |
# $NetBSD: etc.rc,v 1.3.2.2 2014/08/10 06:48:55 tls Exp $
#
# Copyright (c) 1997 Perry E. Metzger
# Copyright (c) 1994 Christopher G. Demetriou
# All rights reserved.
#
# 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. See http://www.NetBSD.org/ for
# information about NetBSD.
# 4. The name of the author may not be used to endorse or promote products
# derived from this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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.
#
# <<Id: LICENSE,v 1.2 2000/06/14 15:57:33 cgd Exp>>
PATH=/sbin:/bin:/usr/bin:/usr/sbin:/
export PATH
# hack to get around bugs in kernfs's rootdev/rrootdev lookup.
ls -l /dev/* > /dev/null 2>&1
lowmemfail()
{
cat << "EOM"
This machine seems to not have enough memory for this install method.
Please refer to the installation documentation on how to create and
boot a custom kernel and how to install with that.
Please use the 'halt' command to stop the machine.
EOM
exec sh
}
# if /dev has not been populated by init, it may be a stock "MAKEDEV all"
# variant without "opty" - in which case we need to mount a ptyfs
if [ ! -r /dev/ttypf ]; then
if mount | grep '^ptyfs on /dev/pts' >/dev/null 2>&1; then
# do not mount it again
else
mount -t ptyfs ptyfs /dev/pts
fi
fi
# mount a few tempfs to allow modifications over the CD contents
mount -t tmpfs tmpfs /tmp || lowmemfail
mount -t tmpfs tmpfs /var || lowmemfail
mount -t tmpfs -o union tmpfs /etc || lowmemfail
# prepare important directories in the tmpfses, so dhcpcd and vi will work
mkdir -p /var/run /var/db /var/tmp
# create a gettytab to autologin and run sysinst (etc/gettytab is a symlink
# to /tmp/gettytab)
echo "# Autostart sysinst" > /tmp/gettytab
echo -n "sysinst:al=root:lo=/install.sh:im=:sp#" >> /tmp/gettytab
stty speed >> /tmp/gettytab
# done, move on to multiuser mode
exit 0
# $NetBSD: etc.ttys,v 1.1.2.2 2014/08/10 06:48:55 tls Exp $
#
# re-launch the sysinst wrapper script on console
#
# name getty type status comments
#
console "/usr/libexec/getty sysinst" wsvt25 on secure
#! /bin/sh -m
# $NetBSD: install.sh,v 1.1.2.2 2014/08/10 06:48:55 tls Exp $
#
# -
# Copyright (c) 2010 The NetBSD Foundation, Inc.
# All rights reserved.
#
# This code is derived from software contributed to The NetBSD Foundation
# by Martin Husemann <martin@NetBSD.org>.
#
# 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 FOUNDATION 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.
# setup basic environment
PATH=/sbin:/bin:/usr/bin:/usr/sbin:/
export PATH
termfile=/tmp/sysinst.term
# Check if we are on a framebuffer or on serial console and default
# the terminal type accordingly.
# There is no /var/db/dev.cdb, so sysctl might not map the devicename properly;
# ttyE0 is 68,0 -> 0x4400
case $(sysctl -nx kern.consdev) in
440*000000000000)
TERM=wsvt25
;;
*)
if [ -r ${termfile} ]; then
. ${termfile}
else
TERM=vt220
fi
;;
esac
export TERM
HOME=/
export HOME
BLOCKSIZE=1k
export BLOCKSIZE
EDITOR=ed
export EDITOR
SHELL=/bin/sh
export SHELL
umask 022
stty newcrt werase ^W intr ^C kill ^U erase ^?
if [ $TERM != "wsvt25" ]; then
cat << "EOM"
You are using a serial console, we do not know your terminal emulation.
Please select one, typical values are:
vt100
ansi
xterm
EOM
echo -n "Terminal type (just hit ENTER for '$TERM'): "
read ans
if [ -n "$ans" ];then
TERM=$ans
fi
fi
# run the installation or upgrade script.
cd /
cmd=./sysinst
while [ -n "${cmd}" ]
do
${cmd}
if [ $? = 4 ]; then
echo "Oops, something went wrong - we will try again"
exit
else
if [ -n "$(jobs)" ]; then
tput clear
echo "You have stopped sysinst, return to it by" \
"typing 'exit' or ^D."
${SHELL} -i
cmd="fg"
else
cmd=""
fi
fi
done
# remember terminal type, now that we know it for sure
echo "TERM=${TERM}" > ${termfile}
echo
echo "To return to the installer, quit this shell by typing 'exit' or ^D."
exec ${SHELL}