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

Re: Minor installation defects



Hello,

	I tried your changes, but I have more errors for you to solve for
me, I'm not too proficient with shell scripts. I'm sending you the
modified 'dpkg-hurd' and 'cross-install' files, along with the script
output of the installation in the file 'cross.log'. Please investigate
this. Thanks for the help,

----------------------------------------
Ashutosh S. Rajekar
Pune Institute of Computer Technology,
University of Pune, India.
http://i.am/asr
----------------------------------------
Script started on Wed May 26 21:42:40 1999
[root@Distix /extra]# bash -x ./cross-install /hurd

+ alias rm=rm -if

+ alias cp=cp -if

+ alias mv=mv -if

+ alias ls=ls --color=tty

+ [ -f /etc/bashrc ]

+ . /etc/bashrc

++ PS1=[\u@\h \W]\$ 

++ alias which=type -path

+ plist=base/base-files base/base-passwd base/bash base/libc0.2 base/libncurses4        base/libreadlineg2 base/dpkg base/fileutils base/findutils base/gnumach        base/grep base/gzip base/hurd base/mawk base/ncurses-bin        base/perl-base interpreters/perl base/sed base/shellutils        base/tar base/textutils base/e2fsprogs

+ oplist=base/ae admin/locales text/less base/hostname base/diff base/debianutils

       base/slang1

+ hostname=Distix

++ pwd

+ dpkghurd=/extra/dpkg-hurd

++ pwd

+ nativeinstall=/extra/native-install

++ pwd

+ log=/extra/install.log

+ set -u -e

+95: PS4=+$LINENO: 

+105: [ ! 1 = 1 ]

++1: pwd

+107: repository=/extra

+109: echo Determining destination directory.

Determining destination directory.

+114: expr /hurd : /

+114: echo You are using an absolute path, fine.

You are using an absolute path, fine.

+114: dest=/hurd

+115: echo dest = /hurd

dest = /hurd

+116: echo log = /extra/install.log

log = /extra/install.log

+117: cat

+148: [ ! -e /hurd/usr ]

+148: echo We now can setup a link from /usr to the root directory.

We now can setup a link from /usr to the root directory.

+148: echo The idea is that the Hurd provides better facilities to spread

The idea is that the Hurd provides better facilities to spread

+148: echo the data on several media, and the /usr tree is not needed

the data on several media, and the /usr tree is not needed

+148: echo anymore. However, because Debian per se assumes that /usr

anymore. However, because Debian per se assumes that /usr

+148: echo is a seperate directory, this could lead to subtle problems.

is a seperate directory, this could lead to subtle problems.

+148: echo



+148: echo You have now the choice between making /usr a symlink or

You have now the choice between making /usr a symlink or

+148: echo a real directory tree. It is recommended to answer yes, though,

a real directory tree. It is recommended to answer yes, though,

+148: echo because this is what we use to test the system.

because this is what we use to test the system.

+148: echo



+148: echo Please answer y if you want me to install the symlink.

Please answer y if you want me to install the symlink.

+148: read x

y

+148: [ xy = x ]

+148: [ xy = xy ]

+148: echo



+148: echo Setting up link from usr to root directory to comply with Hurd philosophy.

Setting up link from usr to root directory to comply with Hurd philosophy.

+148: rm -f /hurd/usr

+148: ln -s . /hurd/usr

+154: echo



+155: echo Preparing dpkg's database.

Preparing dpkg's database.

+157: install -d -m 755 -o root -g root /hurd/var/lib/dpkg/info /hurd/var/lib/dpkg/updates

+158: touch /hurd/var/lib/dpkg/status /hurd/var/lib/dpkg/available

+163: echo



+164: echo I will now install packages. If you have multiple versions of the

I will now install packages. If you have multiple versions of the

+165: echo same package available, it may be that I don't reckognize the latest.

same package available, it may be that I don't reckognize the latest.

+166: echo Please remove the offending old version in this case and start from

Please remove the offending old version in this case and start from

+167: echo scratch.

scratch.

+168: echo



+169: echo Installing necessary packages, this may take some time.

Installing necessary packages, this may take some time.

+171: cd /hurd

++1: ls -1 /extra/base/base-files_*.deb

++1: tail -n 1

+193: package=

++1: ls -1 /extra/base/base-files_*.deb

++1: wc -l

+193: matches=      0

+193: [ 0 = 0 ]

++1: basename base/base-files

+193: pname=base-files

++1: ls -1 /extra/base-files_2.1.6.deb

++1: tail -n 1

+193: package=/extra/base-files_2.1.6.deb

++1: ls -1 /extra/base-files_2.1.6.deb

++1: wc -l

+193: matches=      1

+193: [ 1 = 0 ]

+193: [ 1 != 1 ]

+193: echo - /extra/base-files_2.1.6.deb

- /extra/base-files_2.1.6.deb

+193: /extra/dpkg-hurd --unpack /extra/base-files_2.1.6.deb --force-depends

+193: break

+194: echo



+195: echo Installing optional packages, this may take some time.

Installing optional packages, this may take some time.

++1: ls -1 /extra/base/ae_*.deb

++1: tail -n 1

+216: package=

++1: ls -1 /extra/base/ae_*.deb

++1: wc -l

+216: matches=      0

+216: [ 0 = 0 ]

++1: basename base/ae

+216: pname=ae

++1: ls -1 /extra/ae_962-23.deb

++1: tail -n 1

+216: package=/extra/ae_962-23.deb

++1: ls -1 /extra/ae_962-23.deb

++1: wc -l

+216: matches=      1

+216: [ 1 = 0 ]

+216: [ 1 != 1 ]

+216: echo - /extra/ae_962-23.deb

- /extra/ae_962-23.deb

+216: /extra/dpkg-hurd --unpack /extra/ae_962-23.deb --force-depends

+216: break

+218: set +e

++1: grep -v Preparing to replace\|Unpacking\|pre-dependency problem\|Selecting previously deselected package\|pre-depends on\|overriding problem because --force enabled\|(Reading database ...\| package architecture (hurd-i386) does not match system\|is not installed.\|but has never been configured.\|dpkg-deb: building package /extra/install.log

+219: errors=/extra/dpkg-hurd: [: too many arguments

/extra/dpkg-hurd: [: too many arguments

/extra/dpkg-hurd: syntax error near unexpected token `fi'

/extra/dpkg-hurd: [: too many arguments

/extra/dpkg-hurd: [: too many arguments

/extra/dpkg-hurd: syntax error near unexpected token `fi'

+220: set -e

+228: [ ! x/extra/dpkg-hurd: [: too many arguments

/extra/dpkg-hurd: [: too many arguments

/extra/dpkg-hurd: syntax error near unexpected token `fi'

/extra/dpkg-hurd: [: too many arguments

/extra/dpkg-hurd: [: too many arguments

/extra/dpkg-hurd: syntax error near unexpected token `fi' = x ]

+228: echo



+228: echo dpkg did return unusual messages, please investigate:

dpkg did return unusual messages, please investigate:

+228: echo



+228: grep -v ^rm: /tmp/.*: Device or resource busy$\|Preparing to replace\|Unpacking\|pre-dependency problem\|Selecting previously deselected package\|pre-depends on\|overriding problem because --force enabled\|(Reading database ...\| package architecture (hurd-i386) does not match system\|is not installed.\|but has never been configured.\|dpkg-deb: building package /extra/install.log

/extra/dpkg-hurd: [: too many arguments

/extra/dpkg-hurd: [: too many arguments

/extra/dpkg-hurd: syntax error near unexpected token `fi'

/extra/dpkg-hurd: [: too many arguments

/extra/dpkg-hurd: [: too many arguments

/extra/dpkg-hurd: syntax error near unexpected token `fi'

+228: exit 1

[root@Distix /extra]# exit
Script done on Wed May 26 21:43:04 1999
#!/bin/bash
#
# Copyright (c) 1999 by Marcus Brinkmann <Marcus.Brinkmann@ruhr-uni-bochum.de>
#
#   This program 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 of
#   the License, or (at your option) any later version.
#
#   This program 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 Library General Public License for more details.
#
#   You should have received a copy of the GNU General Public
#   License along with this library; if not, write to the Free Software
#   Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.

# cross-install <path>
#
# for example: cross-install /gnu
#
#    1 Jan 1999 - v0.0 <Marcus.Brinkmann@ruhr-uni-bochum.de>
#        Original created by Marcus Brinkmann.
#                 v0.1 Added etc/login and terminal support.
#                 v0.2 Fixed typo in passwd file.
#    4 Jan 1999 - v1.0 Added logging and verbose messages.
#                      Adding checks for certain malfunctions.
#                      Cleaned up the hacks.
#                      Only using ONE directory of base packages.
#   16 Jan 1999 - v1.1 now works with or without the symlink /usr -> /
#                      Uncommented timezone option.
#                      Install perl tar file only if it exists.
#   16 Feb 1999 - v1.2 Fix stupid error.
#                      Added error check for dpkg run.
#   2  Mar 1999 - v1.3 Replace [ == ] with [ = ], because former doesn't
#                      work on all systems (Emmanuel Michon).
#                      Only install known packages.
#                      Change working directory before applying patches (Brian May)
#                      Check if servers.boot is a conffile and needs to be copied.
#   6  Mar 1999 - v1.4 slang0.99.38 -> slang1 (Brian May)
#                      Don't bail out for NFS kernel problem (Brian May).
#                 v1.5 Do install terminfo in /usr/share, not in /share.
#                      Copy boot/servers.boot, not /servers.boot (Gavin Lewis)
#   28 Mar 1999	- v1.6 Add link from mtab to fstab.
#                      Patch shlibs of libc6 package, or dpkg-shlibdeps won't work.
#                      Make it work for flat and hierarchical repository.
#                      Move if/fi to include more patches against dpkg (thanks Santiago!)
#   27 Apr 1999 - v2.0 Update package list, move perl.dist to perl (because
#                      glibc 2.1.1 needs perl to configure, sucker!)
#                      Copy also dpkg-hurd to ${dest}.
#   2  Mai 1999 - v2.1 Remove base/timezones, add base/e2fsprogs

# INSTRUCTIONS:
#
# * Mount your hurd partition, created with "mke2fs -o hurd /dev/???"
# * Make a directory somewhere, and put the following files in it:
#   cross-install    - this file. Installs the base packages on the hurd partition.
#   native-install   - To be run after booting to the Hurd.
#   dpkg-hurd        - a script to cross install packages even if they contain pre* scripts.
#   Also the packages mentioned in ${plist}, below:

plist="base/base-files base/base-passwd base/bash base/libc0.2 base/libncurses4 \
       base/libreadlineg2 base/dpkg base/fileutils base/findutils base/gnumach \
       base/grep base/gzip base/hurd base/mawk base/ncurses-bin \
       base/perl-base interpreters/perl base/sed base/shellutils \
       base/tar base/textutils base/e2fsprogs"
oplist="base/ae admin/locales text/less base/hostname base/diff base/debianutils
       base/slang1"

# If you only want  a minimal base system, leave out packages listed in
# ${oplist}. I don't recommend that, though. (but you can also install
# them natively, later). Note that the system is not fully functional
# without some of the ${oplist} packages, and random things may break.
#
# It is possible to work from a Debian mirror, use .../binary-hurd-i386/ as
# the repository directory.
#
# Then enter the directory ("cd path/to/repository") and run
#  ./cross-install /gnu
# where /gnu is the mount point of your hurd partition.

#
# CONFIGURATION
#
hostname="Distix"
dpkghurd="`pwd`/dpkg-hurd"
nativeinstall="`pwd`/native-install"
log="`pwd`/install.log"

# END OF CONFIGURATION

set -u -e

PS4='+$LINENO: '

err ()
{
    echo "$0: $1" 1>&2
    exit 1
}

if [ ! "$#" = 1 ] ; then
  err "exactly one argument is required, the destination directory"
fi

repository="`pwd`"

echo Determining destination directory.
expr "${1}" > /dev/null : / \
 && { echo You are using an absolute path, fine. ; \
      dest="${1}"; } \
 || { echo You are using a relative path, prepending working directory. ; \
      dest="`pwd`/${1}"; }
echo dest = ${dest}
echo log = ${log}
cat > ${log} < /dev/null

#############################
# Comply to Hurd philosophy.
#############################

if [ ! -e ${dest}/usr ] ; then
	echo We now can setup a link from /usr to the root directory.
        echo The idea is that the Hurd provides better facilities to spread
        echo the data on several media, and the /usr tree is not needed
        echo anymore. However, because Debian per se assumes that /usr
        echo is a seperate directory, this could lead to subtle problems.
        echo
        echo You have now the choice between making /usr a symlink or
        echo a real directory tree. It is recommended to answer yes, though,
	echo because this is what we use to test the system.
        echo
        echo Please answer "y" if you want me to install the symlink.
        read x
        if [ x$x = x ] ; then
		echo You have given no answer, so I will terminate the
                echo installation process. Come back if you have made up
                echo your mind. Thank you.
		exit 0
	fi
	if [ x$x = xy ] ; then
		echo
		echo Setting up link from usr to root directory to comply with Hurd philosophy.
		rm -f ${dest}/usr
		ln -s . ${dest}/usr
	fi
fi

###########################
# Prepare dpkg's database.
###########################
# INFO: This is needed so dpkg-hurd does actually work.
echo
echo Preparing dpkg\'s database.

install -d -m 755 -o root -g root ${dest}/var/lib/dpkg/{info,updates}
touch ${dest}/var/lib/dpkg/{status,available}

##########################
# cross-install packages.
##########################
echo
echo I will now install packages. If you have multiple versions of the
echo same package available, it may be that I don\'t reckognize the latest.
echo Please remove the offending old version in this case and start from
echo scratch.
echo
echo Installing necessary packages, this may take some time.

cd ${dest}
for pname in ${plist}
do
	package=`ls -1 ${repository}/${pname}_*.deb 2> /dev/null | tail -n 1`
	matches=`ls -1 ${repository}/${pname}_*.deb 2> /dev/null | wc -l`

	if [ ${matches} = 0 ] ; then
		pname=`basename ${pname}`
		package=`ls -1 ${repository}/${pname}_*.deb 2> /dev/null | tail -n 1`
		matches=`ls -1 ${repository}/${pname}_*.deb 2> /dev/null | wc -l`
	fi

	if [ ${matches} = 0 ] ; then
		echo - ${pname} could not be found, but it is needed.
		exit 1
	else
		if [ ${matches} != 1 ] ; then
			echo There is more than one version of package ${pname} available, choosing the alphabetically last.
		fi
		echo - ${package}
		${dpkghurd} --unpack ${package} --force-depends >> ${log} 2>&1 || break
	fi
done
echo
echo Installing optional packages, this may take some time.
for pname in ${oplist}
do
	package=`ls -1 ${repository}/${pname}_*.deb 2> /dev/null | tail -n 1`
	matches=`ls -1 ${repository}/${pname}_*.deb 2> /dev/null | wc -l`

	if [ ${matches} = 0 ] ; then
		pname=`basename ${pname}`
		package=`ls -1 ${repository}/${pname}_*.deb 2> /dev/null | tail -n 1`
		matches=`ls -1 ${repository}/${pname}_*.deb 2> /dev/null | wc -l`
	fi

	if [ ${matches} = 0 ] ; then
		echo - ${pname} could not be found, let us hope it is not vital.
	else
		if [ ${matches} != 1 ] ; then
			echo There is more than one version of package ${pname} available, choosing the alphabetically last.
		fi
		echo - ${package}
		${dpkghurd} --unpack ${package} --force-depends >> ${log} 2>&1 || break
	fi
done

set +e
errors=`grep -v 'Preparing to replace\|Unpacking\|pre-dependency problem\|Selecting previously deselected package\|pre-depends on\|overriding problem because --force enabled\|(Reading database ...\| package architecture (hurd-i386) does not match system\|is not installed.\|but has never been configured.\|dpkg-deb: building package' ${log}`
set -e

if [ ! "x${errors}" = x ] ; then
	echo
	echo dpkg did return unusual messages, please investigate:
	echo
	grep -v '^rm: /tmp/.*: Device or resource busy$\|Preparing to replace\|Unpacking\|pre-dependency problem\|Selecting previously deselected package\|pre-depends on\|overriding problem because --force enabled\|(Reading database ...\| package architecture (hurd-i386) does not match system\|is not installed.\|but has never been configured.\|dpkg-deb: building package' ${log}
	exit 1
fi

##############################
# Prepare initial translator.
##############################
# FIX: Should be done in the Hurd.
echo
echo Setting up initial translator hook.

install -d -m 755 -o root -g root ${dest}/servers/socket
touch ${dest}/servers/exec

#####################################
# Make sure boot/servers.boot exists
#####################################
# Explanation: It is a conf file in some versions of Hurd.

echo
echo Latest hurd packages declare boot/servers.boot as a conffile, lemme check.

if [ -e ${dest}/boot/servers.boot.dpkg-new ] ; then
	echo Yes, found it. I will copy boot/servers.boot.dpkg-new to boot/servers.boot
	cp ${dest}/boot/servers.boot.dpkg-new ${dest}/boot/servers.boot
else
	echo Nope, not your version. Please make sure that you check boot/servers.boot after
        echo your next update of the hurd package, because your changes will be overriden.
fi

############################
# Move perl in proper place
############################
# Explanation: Latest glibc package needs perl (and awk) to configure!

if [ ! -e ${dest}/usr/bin/perl ] ; then
	if [ -e ${dest}/usr/bin/perl.dist ] ; then
		echo
		echo Moving perl into place.
		mv ${dest}/usr/bin/perl.dist ${dest}/usr/bin/perl
	else
		echo
		echo Warning, I couldn\'t find perl!
	fi
fi

####################
# make link for df.
####################
# FIX: Notify upstream to get back support for path option.
echo
echo Linking mounted fs table to fstab.

install -d -m 755 -o root -g root ${dest}/var/run
ln -s /etc/fstab ${dest}/var/run/mtab

#############################
# Copy native install script
#############################
echo
echo Copying the native install script and dpkg-hurd.

cp ${nativeinstall} ${dest}
cp ${dpkghurd} ${dest}

#####################
# Fake libc6 package
#####################
# Is this really needed?
# Update: apr 99: Currently, yes. Too many packages require it.

if [ ! -e ${dest}/var/lib/dpkg/info/libc6.list ] ; then
	echo
	echo Although we have libc0.2 packages, we need an entry for libc6 because
	echo of dpkg\'s dependency system.

cat >> ${dest}/var/lib/dpkg/status << '_NIL_'
Package: libc6
Status: install ok installed
Version: 2.0.110

_NIL_

	touch ${dest}/var/lib/dpkg/info/libc6.list
fi

#####################
# Patch libc6 shlibs
#####################
# This is fixed in libc0.2 (>= 2.1)

if [ -e ${dest}/var/lib/dpkg/info/libc0.2.shlibs ] ; then
	if ! grep libc0.2 ${dest}/var/lib/dpkg/info/libc0.2.shlibs > /dev/null; then
		echo
		echo Hacking shlibs file of libc0.2 package, do you have an old version?
		sed -e s/\$/libc0.2/ ${dest}/var/lib/dpkg/info/libc0.2.shlibs > ${dest}/libc0.2.shlibs.new
		mv ${dest}/libc0.2.shlibs.new ${dest}/var/lib/dpkg/info/libc0.2.shlibs
	fi
fi

########################################################
# make some essential directories for configure of dpkg
########################################################
# FIX: Later.
if [ ! -e ${dest}/etc/rc0.d ] ; then
        echo
        echo Making etc/rc\?.d directories for dpkg
        for nr in 0 1 2 3 4 5 6 S
        do
                install -d -m 755 -o root -g root ${dest}/etc/rc${nr}.d
        done
        install -d -m 755 -o root -g root ${dest}/etc/rc.boot
fi

grep Source:\ dpkg-hurd ${dest}/var/lib/dpkg/status > /dev/null 2>&1 && newdpkg=y || newdpkg=n

if [ x${newdpkg} = xn ] ; then

	####################
	# Patch dpkg-divert
	####################
	echo
	echo Fixing Debian scripts for the Hurd

cd ${dest}
patch -p0 << '_NIL_' 
*** usr/sbin/dpkg-divert~   Sat Jan  2 01:40:22 1999
--- usr/sbin/dpkg-divert    Sun Jan  3 00:01:52 1999
***************
*** 1,7 ****
  #! /usr/bin/perl --

! #use POSIX; &ENOENT;
! sub ENOENT { 2; }
  # Sorry about this, but POSIX.pm isn't necessarily available

  $version="1.4.1"; # This line modified by Makefile
--- 1,7 ----
  #! /usr/bin/perl --

! use POSIX; &ENOENT;
! #sub ENOENT { 2; }
  # Sorry about this, but POSIX.pm isn't necessarily available

  $version="1.4.1"; # This line modified by Makefile
_NIL_

cd ${dest}
patch -p0 << '_NIL_'
*** usr/sbin/update-alternatives~   Sat Jan  2 01:40:22 1999
--- usr/sbin/update-alternatives    Sat Jan  2 23:41:47 1999
***************
*** 1,7 ****
  #! /usr/bin/perl --

! #use POSIX; &ENOENT;
! sub ENOENT { 2; }
  # Sorry about this, but POSIX.pm isn't necessarily available

  $version="1.4.1"; # This line modified by Makefile
--- 1,7 ----
  #! /usr/bin/perl --

! use POSIX; &ENOENT;
! #sub ENOENT { 2; }
  # Sorry about this, but POSIX.pm isn't necessarily available

  $version="1.4.1"; # This line modified by Makefile
_NIL_

cd ${dest}
patch -p0 << '_NIL_'
*** usr/sbin/install-info~  Sat Jan  2 01:40:22 1999
--- usr/sbin/install-info   Sun Jan  3 00:04:44 1999
***************
*** 208,217 ****
      }
  }

! if (!$nowrite && !link("$infodir/dir","$infodir/dir.lock")) {
!     die "$name: failed to lock dir for editing! $!\n".
!         ($! =~ m/exists/i ? "try deleting $infodir/dir.lock ?\n" : '');
! }

  open(OLD,"$infodir/dir") || &ulquit("$name: open $infodir/dir: $!\n");
  @work= <OLD>;
--- 208,217 ----
      }
  }

! #if (!$nowrite && !link("$infodir/dir","$infodir/dir.lock")) {
! #    die "$name: failed to lock dir for editing! $!\n".
! #        ($! =~ m/exists/i ? "try deleting $infodir/dir.lock ?\n" : '');
! #}

  open(OLD,"$infodir/dir") || &ulquit("$name: open $infodir/dir: $!\n");
  @work= <OLD>;
***************
*** 338,349 ****
          &ulquit("$name: cannot backup old $infodir/dir, giving up: $!\n");
      rename("$infodir/dir.new","$infodir/dir") ||
          &ulquit("$name: install new $infodir/dir: $!\n");
! unlink("$infodir/dir.lock") || die "$name: unlock $infodir/dir: $!\n";
  }

  sub ulquit {
!     unlink("$infodir/dir.lock") ||
!         warn "$name: warning - unable to unlock $infodir/dir: $!\n";
      die $_[0];
  }

--- 338,349 ----
          &ulquit("$name: cannot backup old $infodir/dir, giving up: $!\n");
      rename("$infodir/dir.new","$infodir/dir") ||
          &ulquit("$name: install new $infodir/dir: $!\n");
! #unlink("$infodir/dir.lock") || die "$name: unlock $infodir/dir: $!\n";
  }

  sub ulquit {
! #    unlink("$infodir/dir.lock") ||
! #        warn "$name: warning - unable to unlock $infodir/dir: $!\n";
      die $_[0];
  }
_NIL_


fi

##################
# Setup hostname.
##################
echo
echo Hey, ${hostname} is really a nice hostname for your machine!

echo ${hostname} > ${dest}/etc/hostname

##############
# Setup ttys.
##############
echo
echo Setting up the terminal. Activate it with \"export TERM=mach\" if
echo booting single user mode.

cat << '_NIL_' > ${dest}/etc/ttys
console "/libexec/getty 9600"           mach    on      secure trusted console
_NIL_

##################
# Setup terminal. 
##################
# FIX: WILL BE IN NCURSES-BASE.
# #30109, #31375

if [ ! -e ${dest}/usr/share/terminfo/m ] ; then
	echo Installing terminfo directory.
	install -d -m 755 -o root -g root ${dest}/share/terminfo/m
fi

if [ ! -e ${dest}/usr/share/terminfo/m/mach ] ; then
	echo Installing terminfo entry for mach.
	cd ${dest}
uudecode << '_NIL_'
begin 666 usr/share/terminfo/m/mach
M&@$2``D``P"E`.D`;6%C:'Q-86-H($-O;G-O;&4```$````````!`%``"``9
M`/__```"`/____\$``<`"P#_____#P`@`"(`__\F`/____\H`/__+`#_____
M,`#_______\T`#D`________________/@!#`/_______T@`________30#_
M______________________]2`/__5@#_______]8`/__7`#__________V``
M9`!H`&P`<`!T`'@`?`"``(0`B`",`/__D`"4`)@`G`"@`/_______Z0`____
M____________________________________J`#_____JP"T`/____^]`,8`
MSP#__]@`_____________________________________^$`___________C
M`/__________________________________________________________
M___________________E``<`#0`;8P`;6TL`&UM*`!M;)6DE<#$E9#LE<#(E
M9$@`"@`;6T@`"``;6T,`&UM!`!M;30`;6S5M`!M;,6T`&ULW;0`;6S=M`!M;
M,&T`&ULP;0`;6TP`"``;6SD`&UM"`!M/4``;3UD`&T]1`!M/4@`;3U,`&T]4
M`!M/50`;3U8`&T]7`!M/6``;6T@`&UM``!M;1``;6T8`&UM5`!M;5@`;6T,`
M&UM!``T*`!M;)7`Q)61-`!M;)7`Q)61"`!M;)7`Q)61,`!M;)7`Q)61$`!M;
8)7`Q)61#`!M;)7`Q)61!``H`"0`;6UD`
`
end
_NIL_
fi
if [ ! -e ${dest}/usr/share/terminfo/m/mach-bold ] ; then
        echo Installing terminfo entry for mach-bold.
        cd ${dest}
uudecode << '_NIL_'
begin 666 usr/share/terminfo/m/mach-bold
M&@$V``D``P"E`.\`;6%C:"UB;VQD?$UA8V@@0V]N<V]L92!W:71H(&)O;&0@
M:6YS=&5A9"!O9B!U;F1E<FQI;F4```$````````!`%``"``9`/__```"`/__
M__\$``<`"P#_____#P`@`"(`__\F`/____\H`/__+`#_____,`#_______\T
M`#D`________________/@!#`$@`_____TT`________4@!7`/__________
M__________]<`/__8`#_______]B`/__9@#__________V@`;`!P`'0`>`!\
M`(``A`"(`(P`D`"4`/__F`":`)X`H@"F`/_______ZH`________________
M________________________K@#_____L0"Z`/_____#`,P`U0#__]X`____
M_________________________________^<`___________I`/__________
M____________________________________________________________
M_______K``<`#0`;8P`;6TL`&UM*`!M;)6DE<#$E9#LE<#(E9$@`"@`;6T@`
M"``;6T,`&UM!`!M;30`;6S5M`!M;,6T`&ULW;0`;6S=M`!M;,6T`&ULP;0`;
M6S!M`!M;,&T`&UM,``@`&ULY``H`&T]0`!M/60`;3U$`&T]2`!M/4P`;3U0`
M&T]5`!M/5@`;3U<`&T]8`!M;2``;6T``"``;6T8`&UM5`!M;5@`;6T,`&UM!
M``T*`!M;)7`Q)61-`!M;)7`Q)61"`!M;)7`Q)61,`!M;)7`Q)61$`!M;)7`Q
5)61#`!M;)7`Q)61!``H`"0`;6UD`
`
end
_NIL_
fi

##################
# Setup etc/login
##################
# This is in latest hurd packages.

if [ ! -e ${dest}/etc/login ] ; then
	echo
	echo Setting up etc/login.

	install -d -m 755 -o root -g root ${dest}/etc/login
cat << '_NIL_' > ${dest}/etc/login/README
This is a hurd login shell; it is a normal user shell, but has no user
privileges.  To login as a user with a userid of USER, use the command:

  login USER

other useful commands:

  ql USER       # quick login -- just start a shell in USER's home directory
  su USER       # set the id of the current (login) shell to USER
                # (use the `unsu' command to undo this, or just exit the shell)
_NIL_

cat << '_NIL_' > ${dest}/etc/login/.bash_login
. .bashrc
. .profile
_NIL_

cat << '_NIL_' > ${dest}/etc/login/.bashrc
# login -- a normal login
alias login='exec login -p -R-p -R-aHOME -R-aMOTD -R-e_LOGIN_RETRY=yes'
alias logon=login
alias l=login

# quick login -- don't act like a login shell, but do cd to $HOME
alias ql='exec login -pSL -aMOTD -R-p -R-aHOME -R-aMOTD -R-e_LOGIN_RETRY=yes'

alias help='cat $HOME/README'
alias '?'=help
_NIL_

cat << '_NIL_' > ${dest}/etc/login/.profile
PS1='login> '
test "$_LOGIN_RETRY" || echo "Use \`login USER' to login, or \`help' for more information."
unset _LOGIN_RETRY
_NIL_

touch ${dest}/etc/login/.hushlogin
fi

echo
echo Now boot the Hurd and run
echo ./native-install
echo
#!/bin/bash
#
# Copyright (c) 1998 - This script is hereby placed in the public domain
#                      by Marcus Brinkmann.
#
# dpkg-hurd - poor man's dpkg.
#
# Usage dpkg-hurd -i|--install package_*.deb [options]
#    or dpkg-hurd --unpack package_*.deb [options]
#    or dpkg-hurd -r|--remove package [options]
#    or dpkg-hurd --purge package [options]
#    or dpkg-hurd -s|-L package
#    or dpkg-hurd -l|-S  [pattern]
#
#    [options] are passed through to dpkp. A good example is
#              "--force-depends".
#
# Warning: This script is for bootstrapping a Debian/Gnu Hurd system
#          onto an empty ext2 partition.  The {pre,post}{inst,rem}
#          scripts are not run.
#
# Note:    The action must be the first argument, the package the second.
#          Multiple packages can't be processed at one command line.
#
# Change history:
#    19 Dec 1998 - v0.0 <Marcus.Brinkmann@ruhr-uni-bochum.de>
#        Original created by Marcus Brinkmann.
#    22 Dec 1998 - v0.1 Jeff Sheinberg <jeffsh@erols.com>
#        Error checking, automatic update of status file.
#    24 Dec 1998 - v0.2 Jeff Sheinberg <jeffsh@erols.com>
#        Remove by package name, fix bugs in name.list file creation.
#    TODO - add lockfile and trap exit & int, merge with deb_remove.
#    28 Dec 1998 - v0.3 Marcus Brinkmann <brinkmd@debian.org>
#        Extract package name from deb file, not from file name.
#        Rebuild package w/o install scripts and use dpkg directly.
#        Added -r and -p as well as -s,-S,-l,-L options.
#     1 Jan 1999 - v0.3.1 Marcus Brinkmann <brinkmd@debian.org>
#                  Added the possibility to add options.
#                - v0.3.2 Fixed typo in grep (Package: instead Package)
#    15 Apr 1999 - v0.3.3 Make it a bit more verbose (Pavel Roskin)
#                  Specify admindir explicitely to make it work on
#                  non-Debian systems. (patch by Pavel Roskin)
#    TODO - fix all those race conditions and use proper tmp dir!
#                - v0.3.3 Minor fix by Matthew Vernon <mcv21@cam.ac.uk>
#                  No longer expects the /usr -> / symlink

set -u -e

PS4='+$LINENO: '

err ()
{
    echo "$0: $1" 1>&2
    exit 1
}

vld="var/lib/dpkg"
vldi="${vld}/info"
[ -d ./${vld} ] || \
  err "cd is \`$PWD', must be run from a dpkg root directory"
[ -d ./lost+found ] || \
  err "cd is \`$PWD', must be run from a partition root filesystem directory where lost+found resides"
#[ -L ./usr -a ./ -ef usr/ ] \
#  || err "cd is \`$PWD', must be run from a hurd root filesystem directory"

# [ "$#" == 2 ] || err "exactly two arguments, an action and a *.deb file or package name is required"

if [ "${1}" == "-i" -o "${1}" == "--install" -o "${1}" == "--unpack" ] ; then
case ${1} in 
"-i"|"--install"|"--unpack")

	action="${1}"
	file="${2}"
	name=`dpkg --info ${file} | grep Package: - | sed -e "s/ Package: //"`

	[ -f ${file} ] || err "file \`${file}' does not exist"

	# Construct directory hierarchie
	ctrl=temp_build/${name}/DEBIAN
	mkdir -m 0755 -p ${ctrl}

	# Extract the files from the .deb archive.
	dpkg-deb --extract ${file} ${ctrl}/..

	# Extract control info and create control files.
	dpkg-deb --control ${file} ${ctrl}

	# Move the package scripts out of the build dir.
	for f in preinst postinst prerm postrm
	do
	  if [ -e ${ctrl}/${f} ] ; then
	     mv ${ctrl}/${f} temp_build/
	  fi 
	done

	# Now repack the file.
	dpkg --build temp_build/${name}

	# Move old prerm and postrm scripts out of the way.
	for f in prerm postrm
	do
	  if [ -e ${vldi}/${name}.${f} ] ; then
	     mv ${vldi}/${name}.${f} ${vldi}/${name}.${f}.backup
	  fi
	done

	shift
	shift
	dpkg --root=. --admindir=${vld} --force-architecture ${action} ${@-} temp_build/${name}.deb

	# Move new package scripts into dpkg's repository
	for f in preinst postinst prerm postrm
	do
	  if [ -e temp_build/${f} ] ; then
	     mv temp_build/${f} ${vldi}/${name}.${f}
	  fi
	  if [ -e ${vldi}/${name}.${f}.backup ] ; then
	     rm ${vldi}/${name}.${f}.backup
	  fi
	done

	# Clean temp directory.
	rm -fR temp_build
	exit 0
	;;
esac
fi

if [ "${1}" == "-r" -o "${1}" == "--remove" -o "${1}" == "--purge" ] ; then
case ${1} in 
"-r"|"--remove"|"--purge")

	action="${1}"
	name="${2}"

	# Move old prerm and postrm scripts out of the way.
	for f in prerm postrm
	do
	  if [ -e ${vldi}/${name}.${f} ] ; then
	     mv ${vldi}/${name}.${f} ${vldi}/${name}.${f}.backup
	  fi
	done

	shift
	shift

	dpkg --root=. --admindir=${vld} --force-architecture ${action} ${@-} ${name}

	for f in prerm postrm
	do
	  if [ -e ${vldi}/${name}.${f}.backup ] ; then
	     rm ${vldi}/${name}.${f}.backup
	  fi
	done
	exit 0
	;;
esac	

fi
	
if [ "${1}" == "-s" -o "${1}" == "-S" -o "${1}" == "-l" -o "${1}" == "-L" ] ; then
case ${1} in
"-s"|"-S"|"-l"|"-L")
	dpkg --root=. --admindir=${vld} "${@}"
	exit 0
fi
	;;
esac

# dpkg-hurd - end of file

Reply to: