diff options
author | Michael I. Bushnell <mib@gnu.org> | 1996-07-08 20:21:02 +0000 |
---|---|---|
committer | Michael I. Bushnell <mib@gnu.org> | 1996-07-08 20:21:02 +0000 |
commit | 90f0dc86d50d5ada3c90be9fcd0abe9b9d4e8b2d (patch) | |
tree | 5137d8cd4538f0006e70ecf37a3efd6cc0f40ebf /release | |
parent | c05364b65344a0cf83657b8abd3ac65b0e62f194 (diff) |
Initial revision
Diffstat (limited to 'release')
-rw-r--r-- | release/INSTALL-binary | 252 | ||||
-rw-r--r-- | release/Makefile | 45 | ||||
-rw-r--r-- | release/README | 13 | ||||
-rw-r--r-- | release/SETUP | 11 | ||||
-rw-r--r-- | release/dist-README | 18 | ||||
-rwxr-xr-x | release/install-stripped | 165 | ||||
-rw-r--r-- | release/tool-Makefile | 124 |
7 files changed, 628 insertions, 0 deletions
diff --git a/release/INSTALL-binary b/release/INSTALL-binary new file mode 100644 index 00000000..971c1d5e --- /dev/null +++ b/release/INSTALL-binary @@ -0,0 +1,252 @@ +-*- Text -*- +Instructions for bootstrapping the Hurd from binary images (i486). +Last updated 17 Apr 95 + +This directory contains i486 binaries for the Hurd and various +programs built to run under it. They were built with current GCC +sources (generally 2.7.*) and recent binutils snapshot from +ftp.cygnus.com:private/gas, configured for target `i486-gnu'. All +program binaries are stripped to save disk space; the installed +libraries have the debugging information stripped to speed linking. + + +STEP I: + +Unpack the binary distribution onto a fresh disk partition, which needs +to be BSD FFS format. The boot loader we use (GRUB) does not yet +understand how to boot from a Linux ext2fs filesystem, though this is +expected to change very soon. + +Make the disk partition with newfs or mkfs on your favorite BSD +system. Then unpack the binaries with tar onto that partition. If +you are building your own binaries as described in INSTALL-cross, it +is perfectly fine to use this partition as the Hurd installation +staging area. + +[If you do not have a system running BSD, the NetBSD 2-floppy install set +contains enough tools to make a new filesystem using newfs and copy to +it from nfs.] + +If you're going to be booting native, you probably need to change the +device on which paging is done. This is done in a file in the hurd +partition called `boot/servers.boot', on the line which looks like: + + /dev/sd0b $(add-paging-file) $(default-pager) + +`sd0b' is the paging device. Replace this with the correct device name +(this is a mach partition name; see step II below for a bit about +partition naming), or delete the line if you don't want paging. + +(CAVEAT: Hurd partitions, especially the root partition, may have +filesystem extensions that BSD does not know about. Most of these are +ignored by the BSD kernel and filesystem tools. One of them, `passive +translators' (a/k/a non-transient mounts), is not understood by the +BSD fsck. If you run the BSD fsck on a Hurd partition with such +translators, things might fail *massively*. The Hurd version of fsck +does not, of course, have any such problem.) + +Fsck and unmount the new partition before using it, to make sure it's clean. + + +STEP II: + +Boot from this partition. + +There are currently two ways of booting the hurd that are know to work: + +A: Using the grub bootloader (written by Erich Boleyn <erich@uruk.org>): + + Grub can load the mach4 kernel (version UK22), included with this binary + distribution. Mach4-UK22 uses linux device drivers, which are generally + more functional than the previous mach ones (however the current build + mechanism for mach4 links in every linux driver, even unused ones, so the + kernel binary is very big). + + To use grub, get the grub distribution (version 0.1 is known to work, and + these instructions are for that; the mach4-UK02p21 kernel included with + this distribution works only with grub version 0.0), and follow the + instructions to put grub on either a floppy disk or a bootable partition; + there should be a copy of the grub distribution in the same location you + found this hurd distribution. + + Then reboot the system with grub, and answer the prompts like so: + + 1) `root-partition:' -- the partition where the hurd image is; this is + generally something like `hd(0,e)'. + + 2) `kernel:' -- use: + + /boot/kernel root=sd0e + + and replace sd0e with the name of the root device. Note that the + naming convention here is from mach, and is different than that used to + specify the root device in (1). SCSI disks in mach are named `sd??' + and non-SCSI disks `hd??'. [Also note that these may also be + different that the names used by whatever OS used to create the hurd + partition in the first place!] + + 3) `module:' -- use: + + /boot/serverboot + + for the first one, and then just hit return for the second to end the + list. + + 4) Hit return to boot the system... + + Mach should load, and then the Hurd should start, saying something like: + + Hurd server bootstrap: ufs exec init proc auth. + Single-user bootstrap: term sh. + bash# + + Using this method, a script file called /boot/servers.boot is loaded + to specify how to start the initial hurd servers; this file probably + should be modified to specifiy the paging device, as in step I. + +B: Booting the hurd under another mach os, such as lites: + + To do this you need to have an executable copy of the `uxboot' + program, which isn't included in the binary distribution. However, if you + have the source distribution, it is built in the `boot' subdirectory (and + not installed). Uxboot is not a hurd program, and is built using + strange linker magic; it currently works on either ux or lites, but it + maybe Once you have uxboot, you can boot a hurd partition by + saying (while in the root of the source distribution build tree): + + boot/uxboot hurd.boot sd0e + + where sd0e is of course replaced by the mach device name of the partition + with the hurd binary distribution on it. The file hurd.boot contains + specifics of how to boot, and may be changed, e.g., to use ext2fs instead + of ufs. + + +STEP III: + +When GNU boots the first time, you might see some confusing messages, +and you may notice that pipes don't work. + +Before you change anything, you may have to make the root filesystem +writable -- if the clean bit wasn't set, it will have been made +read-only automatically, printing obvious warning messages to that +effect. Since things aren't set up enough at this point to fsck it, +just make it writable using the command + + fsysopts / --writable + +In order to set up the translators for this to be a fully functional +Hurd system, say + + /bin/sh /SETUP + +Now run `sync' and then `halt'. Boot the system again, and it should +start up normally. + + +STEP IV: + +Now you have a Hurd system. Some things you will want to do before +you get going are: + +A: cd to /dev and make useful devices. At least pty's thus: + ./MAKEDEV ptyp ptyq + + Also add any disk device you have; you must specify both unit number + *and* partition. Something like `sd0a' or `rd1f' is called for. + +B: If you want to use the network, set it up thus: + + settrans /servers/socket/2 NN.NN.NN.NN eth0 + + where NN.NN.NN.NN is your IP address (not hostname, IP address). + Gatewaying is not supported yet, you will only be able to talk to + hosts on your local net. + +C: You can mount a partition (say hd0a) by saying: + + settrans /mnt /hurd/ufs /dev/rhd0a + +(This is equivalent to Unixy `mount /dev/hd0a /mnt'.) + +(Note that you are using the *RAW* device here. In theory, it's +irrelevant [and this is really only being used to get a name in a +clever but strange way], but there are minor bugs in the non-raw +versions, so don't try and use them.) + +If it's a Linux ext2 format disk, just do + + settrans /mnt /hurd/ext2fs /dev/rhd0a + +You can make it readonly thus: + + settrans /mnt /hurd/ufs -r /dev/rhd0a + +In all these cases, note that all the args after `/mnt' are a command +line being sent to the filesystem program when it starts. The syntax +of settrans is: + + settrans [settrans-option-args] file command-line + +settrans itself also supports several args. (Use settrans --help for +a summary.) To see the args supported by a ufs or ext2fs, say +`/hurd/ufs --help' or `/hurd/ext2fs --help'. + +The mounts created this way are not transient--they will last across +reboots, being recorded directly on disk. To get rid of one, say: +`settrans /mnt' with no further args. The command `showtrans /mnt' +will show you where it's at right now. + +A temporary mount (which lasts only until the filesystem program is +killed or the system is rebooted) can be accomplished by giving the -a +option to settrans thus: `settrans -a /mnt /hurd/ufs /dev/rsd0a'. +(Note the placement of this option, as an arg to settrans, is +different from the -r options you might give to the filesystem.) +`showtrans' does not display these temporary mounts. + +NFS mounts, not surprisingly, are done thus: + + settrans /mnt /hurd/nfs /remote/file/system remote.host.org + +(You may also use the host:fs and fs@host notations if you prefer.) +NFS supports many options; use `/hurd/nfs --help' to see them all. + +You should also examine the /etc/rc script we've written; it's pretty +specific to our use right now and you might want to make sure it makes +sense for you. Perhaps you will want to edit the password file too. + + +MISCELLANEOUS NOTES: + +Fscking: + +The /sbin/fsck program does not currently work, so you have to use the +individual fsck backends, /sbin/fsck.ufs & /sbin/fsck.ext2. These programs +do not know when a partition is in use by an active filesystem, so you must +to be careful that the partition you're fscking is quiescent. If it's not +the root filesystem, you can shut it down with the command `settrans -a +ROOTDIR' (ROOTDIR is the node where the filesystem translator is attached). +To fsck the root filesystem, make sure it's readonly, which can be done using +the command `fsysopts / --readonly'. Once fsck has completed, if it wrote on +the partition, the (still running) root filesystem must be informed of this +fact, using the command `fsysopts / --remount --writable' (--remount tells +the filesystem to reload all its data structures from disk); if fsck didn't +actually change anything, you can leave out the --remount option. + +The /sbin/fsck.ufs program currently does not ever set the clean bit, so +you're likely to find that the root filesystem is being declared dirty and +forced readonly every time you boot. + +GDB: + +The version of gdb included in this release has various features not used by +most systems, in particular, the `thread' and `info thread' commands. + +The hurd gdb can also debug running programs without halting them, which is +useful to debug crucial system servers that can't be stopped without wedging +the system. To do this, give the commands `set task pause off', `set +exceptions off', and `set signals off', before attaching to the process. Of +course, gdb may get confused because data structures are changing underneath +it, but this generally works pretty well. + +The `portinfo' program is also very useful for debugging. diff --git a/release/Makefile b/release/Makefile new file mode 100644 index 00000000..bb11e957 --- /dev/null +++ b/release/Makefile @@ -0,0 +1,45 @@ +# Makefile for Hurd release tools +# Copyright (C) 1996 Free Software Foundation, Inc. +# Written by Michael I. Bushnell, p/BSG. +# +# This file is part of the GNU Hurd. +# +# The GNU Hurd is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation; either version 2, or (at +# your option) any later version. +# +# The GNU Hurd is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA. + +dir := release +makemode := misc + +# Files that go into the root of binary distributions +dist-files = INSTALL-binary dist-README SETUP + +# Tools for making images +tool-files = tool-Makefile install-stripped + +DIST_FILES = README $(dist-files) install-stripped image-Makefile + +include ../Makeconf + +ifneq ($(dist-root),) +install-dist: + cp INSTALL-binary $(dist-root)/ + cp dist-README $(dist-root)/README + cp SETUP $(dist-root)/SETUP +endif + +ifneq ($(tool-root),) +install-tools: + cp install-stripped $(tool-root)/ + cp tool-Makefile $(tool-root)/Makefile +endif diff --git a/release/README b/release/README new file mode 100644 index 00000000..fcb6a260 --- /dev/null +++ b/release/README @@ -0,0 +1,13 @@ +As if the editor cared that this was -*- Text -*-. + +This directory contains tools and scripts useful in setting up Hurd +binary distributions. None of it is installed by default, but it's +provided here for those who might find it helpful. + +Use `make install-dist dist-root=FOO' to install the files that go +into the root of binary distributions. + +Use `make install-tools tool-root=FOO' to install the tools that are +used to build binary distributions. + + diff --git a/release/SETUP b/release/SETUP new file mode 100644 index 00000000..13101df8 --- /dev/null +++ b/release/SETUP @@ -0,0 +1,11 @@ +#!/bin/bash +# Setup critical hurd translators + +set -v + +# Set up the PFLOCAL server so we can do pipes +/bin/settrans -c /servers/socket/1 /hurd/pflocal + +# Setup crucial devices +cd /dev +/bin/sh ./MAKEDEV std diff --git a/release/dist-README b/release/dist-README new file mode 100644 index 00000000..6bc9e8cd --- /dev/null +++ b/release/dist-README @@ -0,0 +1,18 @@ +-*- Text -*- + +Welcome to the GNU Hurd! + + +For instructions on compiling and installing the GNU Hurd from an +already running Hurd system, see the file `INSTALL'. + +For instructions on compiling and installing the GNU Hurd from any +other kind of system (including any other Mach-based system) see the +file INSTALL-cross. + +For instructions on installing binary images and setting up a Hurd +system, see the file INSTALL-binary. (These binary images could be +the ones we distribute, or the ones you have built yourself as +described in INSTALL-cross.) + + diff --git a/release/install-stripped b/release/install-stripped new file mode 100755 index 00000000..f972fc54 --- /dev/null +++ b/release/install-stripped @@ -0,0 +1,165 @@ +#! /usr/local/bin/bash + +# Shell script to copy files and directories, stripping things appropriately. +# Executable programs are stripped completely, and library archives +# have debugging symbols removed. + +usage() +{ + echo >&2 "Usage: $0 [-N NEWER-THAN-FILE] SOURCE-DIR TARGET-DIR" + exit 1 +} + +# If non-null, only copy files newer than this file when copying directories. +newer_than='' + +while :; do + case "$1" in + -N) newer_than="$2"; shift 2 + if test -r "$newer_than"; then + case "$newer_than" in [!/]*) + newer_than=`pwd`/"$newer_than" + esac + else + # There is no such file, so don't try to use it + newer_than='' + fi;; + -*) usage;; + *) break;; + esac +done + +if [ $# -lt 2 ]; then + usage +fi + +OBJCOPY=${OBJCOPY:-i386-gnu-objcopy} + +check_inode() +{ + inode=`ls -dli "$1" | awk '{ print $1 }'` + eval "old_inode=\${inode_${inode}}" + eval "inode_${inode}=$2" +} + +# Prints the files in DIR, only using those newer than $newer_than if +# it's non-null +dir_files() +{ + case "$newer_than" in + "") test='';; + *) test="-newer $newer_than";; + esac + + find $1 -maxdepth 1 \( ! -type d $test -print \) \ + | sed "s@^$1/@@" +} + +copy() +{ + local from=$1 + local to=$2 + + plaincopy() + { + rm -f $to + echo "$from -> $to" + ln -f $from $to 2>/dev/null || install -m 644 -c $from $to + } + + objcopy() + { + if $OBJCOPY --strip-debug $from $to; then + echo "strip-debug $from -> $to" + else + plaincopy + fi + } + + copysymlink () + { + linkto="`ls -ld $from | awk '{ print $NF }'`" + if test -L $to; then + oldlinkto="`ls -ld $to | awk '{ print $NF }'`" + else + oldlinkto=not-the-value-of-any-real-symlink + fi + + if test $linkto != $oldlinkto; then + rm -f $to + echo "making symlink $to -> $linkto" + ln -s $linkto $to + fi + } + + makelocalhardlink () + { + fromino=`ls -dli "$from" | awk '{ print $1 }'` + toino=`ls -dli "$to" | awk '{print $1 }'` + if test $fromino != $toino; then + echo "$to linked to $old_inode" + ln -f $old_inode $to + fi + } + + check_inode $from $to + +# Not necessary; the other bits already do necessary deletion. +# test -d $to || { test -e $to && rm -f $to } + + if test -L $from; then + copysymlink + elif test "$old_inode"; then + makelocalhardlink + elif test -d $from; then + if test ! -d $to; then + echo making $to + mkdir -p $to + fi + for file in `dir_files $from` ..; do + test "$file" = .. && continue + copy $from/$file $to/$file + done + else + case $from in + *.a) + read p l o g size rest <<foo +`ls -l $from` +foo +# I've reenabled installing large libraries; please don't change +# this without syncing with mib first. +# if test $size -gt 200000; then +# echo "skipping large library $from ($size)" +# else + objcopy +# fi + ;; + *.o | *.so | *.so.*) + objcopy + ;; + *) + if test -x $from; then + if $OBJCOPY -S $from $to 2>/dev/null; then + echo "strip $from -> $to" + else + plaincopy + fi + else + plaincopy + fi + ;; + esac + fi +} + +if [ $# -gt 2 ]; then + eval "todir=\${$#}" + test -d $todir || { echo >&2 With multiple args, last must be a directory. + exit 1; } + while [ $# -gt 1 ]; do + copy $1 $todir/`basename $1` + shift + done +else + copy $1 $2 +fi diff --git a/release/tool-Makefile b/release/tool-Makefile new file mode 100644 index 00000000..375042e4 --- /dev/null +++ b/release/tool-Makefile @@ -0,0 +1,124 @@ +# Makefile for hurd image frobnication. + +export GNUTARGET=elf32-i386 +export OBJCOPY=i386-gnu-objcopy + +BF=bfloppy-image +RF=rfloppy-image + +bfloppy-files = $(bfloppy-bootfs:%=hurd/%) $(bfloppy-bootprogs:%=boot/%) \ + lib/ld.so boot/servers.boot +bfloppy-bootfs = ufs +bfloppy-bootprogs = kernel bootstrap + +$(BF)/boot/servers.boot: hurd-image/boot/floppy.boot + -rm -f $@ + @test -d $(@D) || mkdir -p $(@D) + cp $< $@ + +$(BF)/%/: hurd-image/%/ + test -d $@ || mkdir -p $@ +$(BF)/%: hurd-image/% + -rm -f $@ + @test -d $(@D) || mkdir -p $(@D) + ln $< $@ || cp $< $@ + +$(BF): $(bfloppy-files:%=$(BF)/%) +$(BF).tar: $(bfloppy-files:%=$(BF)/%) + rm -f $@ + cd $(BF); tar covf ../$@ $(^:$(BF)/%=%) + +rfloppy-files = $(rfloppy-hurd:%=hurd/%) $(rfloppy-progs:%=bin/%) \ + $(rfloppy-solib:%=lib/%.so) hurd/exec \ + lib/libc.so lib/libhurduser.so lib/libmachuser.so \ + servers/exec servers/socket/1 \ + README tmp/ dev/MAKEDEV +rfloppy-hurd = auth devio null init proc term +rfloppy-progs = sh ls cat settrans # mkfs +rfloppy-solib = libtrivfs libthreads libshouldbeinlibc libports \ + libpager libioserver libihash libfshelp ld + +libc-satisfies = $(rfloppy-hurd:%=hurd/%) $(rfloppy-progs:%=bin/%) $(rfloppy-solib:%=lib/%.so) + +libc-obj-dir = /gd4/gnu/libc/i386 +smallso-LDFLAGS = -Wl,-rpath-link=/lib + +libc-USERS = +libc-DEPS = + +$(RF)/lib/libc.so: hurd-image/lib/libc.so hurd-image/lib/libhurduser.so hurd-image/lib/libmachuser.so $(libc-satisfies:%=hurd-image/%) + mksmallso $(smallso-LDFLAGS) \ + $@ $(libc-obj-dir)/libc_pic.a '-Lhurd-image/lib -lhurduser -lmachuser' \ + $(filter-out $(firstword $^),$^) + +$(RF)/lib/libhurduser.so: $(RF)/lib/libc.so $(libc-satisfies:%=hurd-image/%) + mksmallso $(smallso-LDFLAGS) $@ $(libc-obj-dir)/libhurduser_pic.a -Lhurd-image/lib -lmachuser $(filter-out $(firstword $^),$^) + +$(RF)/lib/libmachuser.so: $(RF)/lib/libc.so $(RF)/lib/libhurduser.so $(libc-satisfies:%=hurd-image/%) + mksmallso $(smallso-LDFLAGS) $@ $(libc-obj-dir)/libmachuser_pic.a '' $(filter-out $(firstword $^),$^) + +$(addprefix $(RF)/,$(rfloppy-hurd:%=hurd/%) $(rfloppy-progs:%=bin/%)): \ + $(RF)/%: hurd-image/% + @test -d $(@D) || mkdir -p $(@D) + gzip -9v -c $< > $@.new + chmod 555 $@.new + mv -f $@.new $@ + +$(RF)/%/: hurd-image/%/ + test -d $@ || mkdir -p $@ +$(RF)/%: hurd-image/% + -rm -f $@ + @test -d $(@D) || mkdir -p $(@D) + ln $< $@ || cp $< $@ + +$(RF): $(rfloppy-files:%=$(RF)/%) +$(RF).tar: $(rfloppy-files:%=$(RF)/%) + rm -f $@ + cd $(RF); tar covf ../$@ $(^:$(RF)/%=%) + +MOUNT_POINT = /mnt +VND = vnd0 +VND_DEV = /dev/${VND}a +VND_RDEV = /dev/r${VND}a +MDEC = /usr/mdec + +floppy%-image.fs: /tmp/floppy%-image.fs; cp -f $< $@ + +/tmp/floppy%-image.fs: floppy%-image.tar + dd if=/dev/zero of=$@.new bs=10k count=144 + vnconfig -v -c ${VND_DEV} $@.new + disklabel -w -B -b ${MDEC}/fdboot -s ${MDEC}/bootfd ${VND} floppy3 + newfs -O -m 0 -o space -i 5120 -c 80 ${VND_RDEV} floppy3 + mount ${VND_DEV} ${MOUNT_POINT} + tar -f $< -C ${MOUNT_POINT} -xv + df -i ${MOUNT_POINT} + umount ${MOUNT_POINT} + vnconfig -u ${VND_DEV} $@.new + mv -f $@.new $@ + +hurd-image.tar: hurd-image hurd-image.stamp + tar cof $@ $< + +%.gz: % + gzip -9v -c $< > $@.new + mv -f $@.new $@ + +%:: %.gz + gunzip -c $< > $@.new + mv -f $@.new $@ + + +instdirs := $(patsubst ../hurdinst/%,%,\ + $(filter-out ../hurdinst,\ + $(shell find ../hurdinst -type d -print \ + | sort -r))) + +hurd-image/%/.stamp: ../hurdinst/% + @./install-stripped -N $@ $< $(@D) + @echo $< `date` > $@ + @echo updated $(@D)/ +hurd-image.stamp: $(instdirs:%=hurd-image/%/.stamp); touch $@ +hurd-image: hurd-image.stamp + + +
\ No newline at end of file |