Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 25 Jan 1999 04:58:14 -0800
From:      "Jordan K. Hubbard" <jkh@zippy.cdrom.com>
To:        stable@FreeBSD.ORG
Subject:   Guinea pigs wanted.
Message-ID:  <5788.917269094@zippy.cdrom.com>

next in thread | raw e-mail | index | archive | help
In the following shell archive you'll find a set of patches, to be
applied relative to a 3.0S or 4.0C /usr/src tree, and a shell script
which you should move into /usr/src/release/scripts.  Once you've done
that, you should be able to type "make upgrade" to update your 2.2.x
or 3.0C fully to an ELF 3.0S or 4.0C system (depending on what's in
your /usr/src).

THESE PATCHES ARE ALPHA TEST QUALITY!  They might just as soon destroy
as upgrade your system and you should not do it on a production box
(heh heh! :).  Until I've gotten some feedback on and committed a
final version of these changes to the tree, they should be used by
bleeding-edge types only.  These patches take you right up to and over
the edge in one swoop, so be aware that if you set NOCONFIRM=yes
you'll even get rebooted once the kernel and new boot blocks are
installed.  You Have Been Warned, etc.

- Jordan


# This is a shell archive.  Save it in a file, remove anything before
# this line, and then unpack it by entering "sh file".  Note, it may
# create directories; files and directories will be owned by you and
# have default permissions.
#
# This archive contains:
#
#	upgrade.diffs
#	doupgrade.sh
#
echo x - upgrade.diffs
sed 's/^X//' >upgrade.diffs << 'END-of-upgrade.diffs'
XIndex: Makefile
X===================================================================
XRCS file: /home/ncvs/src/Makefile,v
Xretrieving revision 1.222
Xdiff -u -u -r1.222 Makefile
X--- Makefile	1998/12/28 17:03:49	1.222
X+++ Makefile	1999/01/25 11:42:37
X@@ -63,25 +63,19 @@
X #           Upgrading an i386 system from a.out to elf format
X #
X #
X-# The aout->elf transition build is performed by doing a `make aout-to-elf'
X-# or a `make aout-to-elf-build' followed by a `make aout-to-elf-install'.
X+# The aout->elf transition build is performed by doing a `make upgrade' (or
X+# `make aout-to-elf') or in two steps by a `make aout-to-elf-build' followed
X+# by a `make aout-to-elf-install', depending on user preference.
X # You need to have at least 320 Mb of free space for the object tree.
X #
X # The upgrade process checks the installed release. If this is 3.0-CURRENT,
X # it is assumed that your kernel contains all the syscalls required by the
X # current sources.
X #
X-# For installed systems where `uname -r' reports something other than
X-# 3.0-CURRENT, the upgrade process expects to build a kernel using the
X-# kernel configuration file sys/i386/conf/GENERICupgrade. This file is
X-# defaulted to the GENERIC kernel configuration file on the assumption that
X-# it will be suitable for most systems. Before performing the upgrade,
X-# replace sys/i386/conf/GENERICupgrade with your own version if your
X-# hardware requires a different configuration.
X-#
X # The upgrade procedure will stop and ask for confirmation to proceed
X # several times. On each occasion, you can type Ctrl-C to abort the
X-# upgrade.
X+# upgrade.  Optionally, you can also start it with NOCONFIRM=yes and skip
X+# the confirmation steps.
X #
X # At the end of the upgrade procedure, /etc/objformat is created or
X # updated to contain OBJFORMAT=elf. From then on, you're elf by default.
X@@ -134,6 +128,9 @@
X #
X # Handle the upgrade targets, using the source relative mk files.
X #
X+
X+upgrade:	aout-to-elf
X+
X ${UPGRADE} : upgrade_checks
X 	@cd ${.CURDIR}; \
X 		make -f Makefile.upgrade -m ${.CURDIR}/share/mk ${.TARGET}
XIndex: Makefile.upgrade
X===================================================================
XRCS file: /home/ncvs/src/Makefile.upgrade,v
Xretrieving revision 1.9.2.1
Xdiff -u -u -r1.9.2.1 Makefile.upgrade
X--- Makefile.upgrade	1999/01/25 01:50:17	1.9.2.1
X+++ Makefile.upgrade	1999/01/25 11:44:47
X@@ -39,16 +39,24 @@
X # with them (in case the installed kernel is an older version), then 
X # install the elf world.
X #
X-aout-to-elf aout-to-elf-install :				\
X+aout-to-elf aout-to-elf-install :	/var/db/update.cfg	\
X 		${MAKEOBJDIRPREFIX}/do_aout_buildworld		\
X 		${MAKEOBJDIRPREFIX}/do_elf_buildworld		\
X 		${MAKEOBJDIRPREFIX}/do_move_aout_libs		\
X 		${MAKEOBJDIRPREFIX}/do_aout_installworld	\
X-		${MAKEOBJDIRPREFIX}/do_aout_kernel		\
X+		${MAKEOBJDIRPREFIX}/do_elf_kernel		\
X 		${MAKEOBJDIRPREFIX}/do_elf_installworld		\
X 		${MAKEOBJDIRPREFIX}/do_set_objformat		\
X-		${MAKEOBJDIRPREFIX}/do_install_kernel_reboot
X+		${MAKEOBJDIRPREFIX}/do_reboot
X 
X+# front-load all the information we're going to need.
X+/var/db/update.cfg:
X+	@if [ -f ${.CURDIR}/release/scripts/doupgrade.sh ]; then \
X+	    env MACHINE=${MACHINE} sh ${.CURDIR}/release/scripts/doupgrade.sh 1 /var/db/update.cfg; \
X+	else \
X+	    echo "Your source tree must not be fully populated; unable to find upgrade script"; echo "in ${.CURDIR}/release/scripts/doupgrade.sh."; exit 1; \
X+	fi
X+
X #
X # Just do the build parts of the transition build.
X #
X@@ -186,39 +194,15 @@
X 	@touch ${MAKEOBJDIRPREFIX}/do_aout_installworld
X 
X #
X-# The installed kernel may not match the world that is installed, so build
X-# a generic kernel, but don't install it. The user can decide if the kernel
X-# needs to be installed. Perhaps we should install it in the root
X-# directory as an obscure name just in case a reboot is required?
X+# Build and install a new kernel, as well as the boot blocks necessary to
X+# boot it.
X #
X-${MAKEOBJDIRPREFIX}/do_aout_kernel :
X-.if	${INSTALLEDVERSION} >= 300003
X-	@echo
X-	@echo "--------------------------------------------------------------"
X-	@echo " You are already running 3.0, so a kernel build"
X-	@echo " is probably not required."
X-	@echo "--------------------------------------------------------------"
X-.else
X-	@echo
X-	@echo "--------------------------------------------------------------"
X-	@echo " Building a generic kernel using the new aout tools"
X-	@echo "--------------------------------------------------------------"
X-.if	exists(${.CURDIR}/sys/compile/GENERICupgrade)
X-	@rm -rf ${.CURDIR}/sys/compile/GENERICupgrade
X-.endif
X-.if	!exists(${.CURDIR}/sys/${MACHINE}/conf/GENERICupgrade)
X-	-cp ${.CURDIR}/sys/${MACHINE}/conf/GENERIC \
X-		${.CURDIR}/sys/${MACHINE}/conf/GENERICupgrade
X-.endif
X-	@cd ${.CURDIR}/sys/${MACHINE}/conf; config GENERICupgrade
X-	@-cd ${.CURDIR}/sys/compile/GENERICupgrade; \
X-		OBJFORMAT=aout make KERNFORMAT=aout depend && \
X-		OBJFORMAT=aout make KERNFORMAT=aout all
X-	@cd ${.CURDIR}/sys/compile/GENERICupgrade; \
X-		OBJFORMAT=aout make KERNFORMAT=aout depend && \
X-		OBJFORMAT=aout make KERNFORMAT=aout all
X-.endif
X-	@touch ${MAKEOBJDIRPREFIX}/do_aout_kernel
X+${MAKEOBJDIRPREFIX}/do_elf_kernel :
X+	@if [ -f /var/db/update.cfg -a -f ${.CURDIR}/release/scripts/doupgrade.sh ]; then \
X+	     env MACHINE=${MACHINE} sh ${.CURDIR}/release/scripts/doupgrade.sh 2 /var/db/update.cfg; \
X+	fi
X+	@touch ${MAKEOBJDIRPREFIX}/do_elf_kernel
X+	@rm -f /var/db/update.cfg
X 
X #
X # Install the elf world overwriting just about all the previously installed
X@@ -246,6 +230,9 @@
X 		PATH=${AOUTTMPPATH} OBJFORMAT=elf NOTOOLS=1 \
X 		TOOLROOT=${MAKEOBJDIRPREFIX}/aout${.CURDIR}/tmp \
X 		make -f Makefile.inc1 -m ${.CURDIR}/share/mk installworld
X+	@if [ ! -f /etc/pam.conf ]; then cp ${.CURDIR}/etc/pam.conf /etc; fi
X+	@if [ ! -f /etc/auth.conf ]; then cp ${.CURDIR}/etc/auth.conf /etc; fi
X+	@if [ ! -f /etc/login.conf ]; then cp ${.CURDIR}/etc/login.conf /etc; fi
X 	@touch ${MAKEOBJDIRPREFIX}/do_elf_installworld
X 
X #
X@@ -261,43 +248,21 @@
X 	@touch ${MAKEOBJDIRPREFIX}/do_set_objformat
X 
X #
X-# If not already running a current kernel, install the GENERICupgrade kernel
X-# and reboot.
X+# Time to reboot!
X #
X-${MAKEOBJDIRPREFIX}/do_install_kernel_reboot	:
X-.if	${INSTALLEDVERSION} >= 300003
X-	@echo
X-	@echo "--------------------------------------------------------------"
X-	@echo " Your system has been updated to run elf by default!"
X-	@echo
X-	@echo " You should reboot your system now."
X-	@echo "--------------------------------------------------------------"
X-	@touch ${MAKEOBJDIRPREFIX}/do_install_kernel_reboot
X-.else
X+${MAKEOBJDIRPREFIX}/do_reboot	:
X .if !defined(NOCONFIRM)
X 	@echo
X 	@echo "--------------------------------------------------------------"
X-	@echo " Your system has been updated to run elf by default!"
X+	@echo " Your system has now been fully updated to elf!"
X 	@echo
X-	@echo " Since you are running ${INSTALLEDNAME}, the kernel must"
X-	@echo " be installed before the system is rebooted. You can type"
X-	@echo " Ctrl-C to abort the kernel installation (at your own risk),"
X-	@echo " or press return for the kernel to be installed and the"
X-	@echo " system rebooted."
X+	@echo " It's now time to reboot from your new ELF kernel."
X+	@echo " You can type Ctrl-C to abort this (at your own risk)"
X+	@echo " or press return to reboot the system."
X 	@echo "--------------------------------------------------------------"
X 	@${MAKEOBJDIRPREFIX}/sh -c "read -p \"Return to continue or Ctrl-C to abort: \" _e"
X .endif
X-	@echo
X-	@echo "--------------------------------------------------------------"
X-	@echo " Installing a new GENERICupgrade kernel"
X-	@echo "--------------------------------------------------------------"
X-	@cd ${.CURDIR}/sys/compile/GENERICupgrade; \
X-		OBJFORMAT=aout make KERNFORMAT=aout depend
X-	@echo
X-	@echo "--------------------------------------------------------------"
X 	@echo " Rebooting......."
X 	@echo "--------------------------------------------------------------"
X-	@touch ${MAKEOBJDIRPREFIX}/do_install_kernel_reboot
X+	@touch ${MAKEOBJDIRPREFIX}/do_reboot
X 	@-${MAKEOBJDIRPREFIX}/reboot
X-.endif
X-
END-of-upgrade.diffs
echo x - doupgrade.sh
sed 's/^X//' >doupgrade.sh << 'END-of-doupgrade.sh'
X#!/bin/sh
X
X# Simple helper script for upgrade target.
X
X# Expects MACHINE to be passed in with the environment, the "pass number"
X# as the first argument the name of the file to leave its droppings in
X# as the second.
X
XPASS=$1
XCONF=$2
Xcd /sys/${MACHINE}/conf
X
X# Create kernel configuration file for pass #1
Xif [ $PASS -eq 1 ]; then
X	echo "The following files are in /sys/${MACHINE}/conf:"; echo
X	ls -C
X	echo; echo -n "Which config file do you wish to use? [GENERIC] "
X	read answer
X	if [ -z "${answer}" ]; then
X		KERN=GENERIC
X	else
X		KERN="${answer}"
X	fi
X	if [ ! -f ${KERN} ]; then
X		KERN=GENERIC
X	fi
X	if [ ! -f ${KERN}.bkup ]; then
X		cp ${KERN} ${KERN}.bkup
X	fi
X	sed -e 's/^device.*sc0.*$/ \
Xcontroller      atkbdc0 at isa? port IO_KBD tty \
Xdevice          atkbd0  at isa? tty irq 1 \
Xdevice          vga0    at isa? port ? conflicts \
Xdevice          sc0     at isa? tty \
Xpseudo-device   splash \
X/' < ${KERN}.bkup > ${KERN}
X
X	if [ -r /dev/wd0a ]; then
X		ROOTDEV=wd0
X	else
X		ROOTDEV=da0
X	fi
X	echo -n "What is your boot device (e.g. wd0 or da0)? [${ROOTDEV}] "
X	read answer
X	if [ -n "${answer}" ]; then
X		ROOTDEV="${answer}"
X	fi
X	echo "KERNEL=${KERN}" > ${CONF}
X	echo "ROOTDEV=${ROOTDEV}" >> ${CONF}
Xfi
X
X# Build and install kernel as pass #2
Xif [ $PASS -eq 2 -a -f ${CONF} ]; then
X	. ${CONF}
X	if ! file /kernel | grep -q ELF; then
X	   echo "--------------------------------------------------------------"
X	   echo " Installing new boot blocks"
X	   echo "--------------------------------------------------------------"
X	   if ! disklabel -B ${ROOTDEV}; then
X		echo "Installation of new boot blocks failed!  Please correct"
X		echo "this manually BEFORE you reboot your system!"
X		exit 1
X	   fi
X	fi
X	echo "--------------------------------------------------------------"
X	echo " Building an elf kernel for ${KERNEL} using the new tools"
X	echo "--------------------------------------------------------------"
X	config -r ${KERNEL}
X	cd /sys/compile/${KERNEL} && make -B depend -DFORCE all install
Xfi
END-of-doupgrade.sh
exit




To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-stable" in the body of the message



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?5788.917269094>