[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

native-install... I forgot to attach it



So here it is.

-- 
Juli-Manel Merino Vidal <jmmv@mail.com>

----------------------------------------
   Become a GNU! (http://www.gnu.org)
     Running Debian GNU/Linux woody
----------------------------------------
#!/bin/bash
#
# Copyright (c) 1998 - This script is hereby placed in the public domain
#                      by Marcus Brinkmann.
# Most of this script was taken from the SETUP script in Hurd CVS.

# native-install
#
#    1 Jan 1999 - v0.0 <Marcus.Brinkmann@ruhr-uni-bochum.de>
#        Original created by Marcus Brinkmann.
#   14 Jan 1999 - v0.1 Matthew Vernon <mcv21@cam.ac.uk>
#        Edited to deal with the removal of the /usr -> / symlink
#        This should work with or without the symlink
#   17 Feb 1999 - v1.0 Marcus Brinkmann <brinkmd@debian.org>
#        Create /etc/fstab.
#   27 Apr 1999 - v1.1 Marcus Brinkmann <brinkmd@debian.org>
#        Make it work with latest packages, libc needs awk configured.
#    5 Mar 1999 - v1.2 Marcus Brinkmann <brinkmd@debian.org>
#        We need /dev/fd early for calling #! scripts outside of our PATH.
#   13 May 1999 - v1.3
#        Add -v option to MAKEDEV, so we can watch progress.
#   17 May 1999 - v1.4
#        Shufle around the order of initial commands. Esp, copy
#        the password file before invoking MAKEDEV fd, before
#        calling dpkg first time.
#        Also, insert special calls to dpkg for missing dependencies.
#   27 May 1999 - v1.5
#        Explain how to reboot.
#    1 Jun 1999 - v2.0
#        Next generation. We create three crash servers and link to the
#        default. Requires hurd-19990529 at least.
#        Make pfinet point to dummy interface, so localhost works. Does only
#        work with Marks patch to GNU Mach.
#   22 Jun 1999 - v2.1
#        Set passive translator for /servers/exec, it doesn't harm and will
#        be useful for people who boot a Hurd inside a file system.
#        Add force-depends to dpkg. The perl situation requires this for
#        dpkg and adduser.
#        Fix tmp permission. Why is it bogus?
#    7 Sep 1999 - v2.2
#        Set passive translator for /servers/password.
#        Don't configure mawk or passwd early.
#        Don't make use of dummy interface.
#        Remove libexec/runsystem before configuring hurd.
#   16 Oct 1999 - v2.3
#        Set up local network only.
#    1 Mar 2000 - v2.4
#	 Various updates.
#    2 May 2000 - v2.5
#        Make translator links hard.
#   12 Sep 2000 - v2.6 Julio Merino <jmmv@mail.com>
#        Check if we are running on GNU/Hurd to avoid running this
#        script from GNU/Linux and breaking it.

# Make sure the filesystem is writeable

if [ ! -f /bin/fsysopts ]; then
    echo "Sorry, but you are not currently running GNU/Hurd."
    exit 1
fi

echo I am just checking if your filesystem is really writeable.
fsysopts / --writable

echo Fixing permissions on /tmp.
chmod -v 1777 /tmp

# Set up standard passive translators
echo
echo Now I set up the translators. If you get Operation not supported
echo errors, you have forgotten to set the file system owner to \"hurd\"!

/bin/settrans -c /servers/socket/1 /hurd/pflocal
/bin/settrans -c /servers/socket/2 /hurd/pfinet
/bin/settrans -k /servers/exec /hurd/exec
/bin/settrans -c /servers/crash-suspend /hurd/crash --suspend
/bin/settrans -c /servers/crash-kill /hurd/crash --kill
/bin/settrans -c /servers/password /hurd/password

# Not functional yet:
/bin/settrans -c /servers/crash-dump-core /hurd/crash --dump-core
if [ ! -e /servers/crash ] ; then
	/bin/ln crash-suspend /servers/crash
fi
if [ ! -e /servers/socket/local ] ; then
	/bin/ln 1 /servers/socket/local
fi
if [ ! -e /servers/socket/inet ] ; then
	/bin/ln 2 /servers/socket/inet
fi

# We need the password file to chown.

cp /usr/share/base-passwd/passwd.master /etc/passwd
cp /usr/share/base-passwd/group.master /etc/group

# We need /dev/fd to call scripts.
cd /dev
/bin/sh ./MAKEDEV -v fd

# Configure libc very soon.
/bin/dpkg --configure libc0.2
# Oooh. base-files does not like it.
rm /var/mail

# Configure packages with missing dependencies:
if [ -e /var/lib/dpkg/info/bsdutils.list ] ; then
	/bin/dpkg --configure --force-depends bsdutils
fi

# Setup crucial devices
echo
echo The next job is to setup device files.
cd /dev
/bin/sh ./MAKEDEV -v std ptyp ptyq

# Make sure that the runsystem stuff will work
if [ -e /libexec/runsystem.gnu -a -e /libexec/runsystem ] ; then
  echo Removing /libexec/runsystem again, so the Hurd packages can
  echo take care about it.
  rm /libexec/runsystem
fi

# Debian set up.
echo
echo Now I configure Debian packages. I\'ll do this twice, so all
echo packages get configured properly. You\'ll notice some warnings
echo and errors in the first run, that\'s okay.
echo
echo Please press enter now to start configuration.
read x

dpkg --pending --configure --force-depends || true
dpkg --pending --configure --force-depends || true

echo I just make sure that /libexec/runsystem is properly updated.
if [ ! -e /libexec/runsystem -a -e /libexec/runsystem.gnu ] ; then
  echo WHOA! We\'re in deep trouble. The Hurd package did not update
  echo the link in /libexec/runsystem. For now, I am making a link
  echo manually, but please report this.
  ln -s runsystem.gnu /libexec/runsystem
fi

echo The last step is to create /etc/fstab.

fstype=`fsysopts / | perl -ne 'm!^/hurd/(.*?)\.static.*?([^\s]+)\s*?$!; print $1;'`
rootpart=`fsysopts / | perl -ne 'm!^/hurd/(.*?)\.static.*?([^\s]+)\s*?$!; print $2;'`

if [ ! -e /dev/${rootpart} ] ; then
	cd /dev
	/bin/sh ./MAKEDEV ${rootpart} || true
fi

if [ x${fstype} = xext2fs ] ; then
	fstype=ext2
fi

cat > /etc/fstab << __GNU__
# /etc/fstab: static file system information
#
# <file system>	<mount point>	<type>	<options>		<dump>	<pass>
__GNU__

if [ ! -e /dev/${rootpart} ] ; then
	echo Couldn\'t determine root partition, sorry.
	echo You have to edit /etc/fstab to match your system.
	echo However, for your convenience, I will install a dummy entry.
	echo "#/dev/hd0s1	/		ext2	rw			1	1" >> /etc/fstab
else
	echo Your root partition is /dev/${rootpart}.
	echo Your file system type is ${fstype}.
	echo If this information is not correct, you need to edit /etc/fstab.
	echo "/dev/${rootpart}	/		${fstype}	rw			1	1" >> /etc/fstab
fi

echo
echo If you have a swap partition, please add it to /etc/fstab.
echo You should reboot the system now by entering "reboot", so all
echo translators come into place.
echo
echo All packages should be configured now. If there are errors\,
echo let me know.
echo
echo PS: There is a bug somewhere that can corrupt the terminal after
echo running native-install.
echo If it seems that only every second character you type is passed on
echo to the shell, try typing every character twice. For example, type
echo \"llss\<enter\>\<enter\>\" instead \"ls\<enter\>\".
echo A \"rreebboooott\<enter\>\<enter\>\" fixes this problem.
echo
echo Have fun exploring the Hurd, Marcus Brinkmann \<brinkmd\@debian.org\>
echo

Reply to: