This is the mail archive of the cygwin@cygwin.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: I am not going to let cygwin BSOD my Windows 2000 Server


George Hester wrote:


> The information I have garnered here has helped to maybe stick my toes in
> the fire again.  I will wait a while and see if there is any good soul that
> can explain the procedures for a manual setup. And if that is pie in the sky
> then at that point I will decide if walking around with a few less toes is
> worth it.


[Robert, Chris : this isn't intended to detract from setup.exe.  In 
fact, I hope it actually serves to demonstrate how much setup.exe DOES 
for you (since this DOESN'T do those things).  In the future, when 
luddite reactionaries insist on installing cygwin by hand, point them to 
this message with the appropriate disclaimers.  Hopefully we can 
short-circuit future threads of this type.]

Okay, here:

Cygwin used to distribute a "bootstrap.zip" file that allowed 
anti-setup.exe people to shoot themselves in the foot (or head). 
However, in the recent reorganization of the cygwin ftp site, it went 
away.  Well, never let it be said that the cygwin folks are 
overprotective; if you want to shoot yourself in the foot we'll give you 
the tools....

I don't guarantee that this will create a working cygwin installation on 
your system.  I don't even guarantee that the scripts will run without 
error.  I don't warrant the scripts against totally scrogging your 
entire system.  If you use these scripts, you indemnify me and everybody 
else on the planet against any damage they may or may not cause.

Neither I nor anyone else will support these scripts or answer any 
further questions about them.  Neither I nor anyone else will support 
any cygwin installation created by them.  You are totally, completely, 
100% and in all other ways on your own.

That having been said, go here: 
http://www.neuro.gatech.edu/users/cwilson/cygutils/cygwin-bootstrap/

and download bootstrap.zip.  Unpack it.  run bootstrap.bat from a 
command prompt.  Afterwards, you may even be able to use the 
manual_install.bash and manual_uninstall.bash script to (painfully) 
maintain your system.  But then again, maybe not.

The scripts are attached here; bootstrap.zip contains them as well as 
cygwin1.dll, tar.exe, gunzip.exe, gzip.exe, bunzip2.exe, mount.exe, 
sh.exe, bash.exe, and the cygwin-1.3.10-1 package (total size: 1.7M). 
bootstrap-src.zip contains all appropriate sources (total size: 8.4M).

--Chuck
This is absolutely, totally, and completely unsupported.
No one will answer any questions about it.  No one will
support a system that was installed using this method.

If it works, great.  If not, also great.  If it completely 
destroys your system, it's your fault, not mine.

How to use:
  - unpack bootstrap.zip using your favorite unzipper
  - run "bootstrap.bat"
  - you now have the core cygwin kernel installed but almost
    nothing else.  There's bash.exe, sh.exe and a few utilities,
	 but you'd better install some packages.
  - the end.

You can also use "manual_install.bash" and "manual_uninstall.bash"
to add or remove cygwin packages.

What these scripts don't do:
  they don't parse filename / version numbers exactly the same
    as the official setup
  they don't handle upgrades (you have to uninstall and then install)
    -- which makes it difficult to upgrade the 'bash' package, for 
	    instance. Ditto gzip, tar, bzip2, and cygwin itself.
  you have to manually correct the /etc/setup/installed.db file; these
    scripts will leave duplicate entries after a reinstall, and don't
	 remove uninstalled entries
  you don't get a handy shortcut for starting cygwin
  they do NOT understand prerequisites and dependencies -- it's even
    possible for the postinstall scripts to fail because they aren't
	 "saved" until the end, and the postinstall script might call an
	 executable that hasn't yet been installed.

rem set this to the desired '/' location
rem other than the '/' vs. '\' difference, the following
rem two variable must be the same
set CYGROOT=C:\cygwin
set CYGROOT_FWDSLASH=C:/cygwin
rem set this to -t for text mounts
set BIN_OR_TEXT=-b
rem set this to -u for a non-system-global installation
set SYSTEM_OR_USER=-s

set CYGVER=1.3.10-1

mkdir %CYGROOT%
mkdir %CYGROOT%\usr
mkdir %CYGROOT%\bin
mkdir %CYGROOT%\lib
mkdir %CYGROOT%\etc
mkdir %CYGROOT%\etc\setup

mount %BIN_OR_TEXT% %SYSTEM_OR_USER% %CYGROOT_FWDSLASH% /
mount %BIN_OR_TEXT% %SYSTEM_OR_USER% -f %CYGROOT_FWDSLASH%/usr/bin /bin
mount %BIN_OR_TEXT% %SYSTEM_OR_USER% -f %CYGROOT_FWDSLASH%/usr/lib /lib
mount %BIN_OR_TEXT% %SYSTEM_OR_USER% --change-cygdrive-prefix /cygdrive

bunzip2 -dc cygwin-%CYGVER%.tar.bz2 | tar -C / -x -v -f -
bunzip2 -dc cygwin-%CYGVER%.tar.bz2 | tar tvf - | gawk '{print $6}' | gzip > %CYGROOT%\etc\setup\cygwin.lst.gz

copy bunzip2.exe %CYGROOT%\usr\bin
copy tar.exe %CYGROOT%\usr\bin
copy gunzip.exe %CYGROOT%\usr\bin
copy sh.exe %CYGROOT%\usr\bin
copy gawk.exe %CYGROOT%\usr\bin
copy manual_install.bash %CYGROOT%\usr\bin
copy manual_uninstall.bash %CYGROOT%\usr\bin

#!/bin/bash
shopt -sq extglob

# NOTE: this uses a different algorithm
# for parsing the package name/version/release
# than setup.  However, it mostly works...
parseName() {
  REM=${1%%*([^-])}
  REL=${1##$REM}
  NEXT=${REM%%-}
  REM=${NEXT%%*([^-])}
  VER=${NEXT##$REM}
  PKG=${REM%%-}
}
do_postinstall() {
  while read line ; do
    case $line in
      etc/postinstall/*) 
        `/$line`
         mv /$line /$line.done
         ;;
      *) ;;
    esac
  done < /etc/setup/${PKG}.lst
}

# we need /etc/setup/installed.db so that 'cygcheck -c' will work
if [ ! -f /etc/setup/installed.db ] ; then
  echo "INSTALLED.DB 2" > /etc/setup/installed.db
fi

for fn in $* ; do
  case $fn in
    *-src.tar*) echo "I don't do -src packages" ;;
    *.tar.bz2) 
	   parseName ${fn%%.tar.bz2} 
		echo Installing $PKG  Version $VER  Release $REL
	   bunzip2 -dc $fn | tar -C / -x -v -f -
		bunzip2 -dc $fn | tar -t -v -f - | gawk '{print $6}' |\
		 > /etc/setup/${PKG}.lst
		do_postinstall
		gzip /etc/setup/${PKG}.lst
		echo "$PKG $fn 0" >> /etc/setup/installed.db
      ;;		
	 *.tar.gz)
	   parseName ${fn%%.tar.gz} 
		echo Installing $PKG  Version $VER  Release $REL
	   gunzip -dc $fn | tar -C / -x -v -f -
		gunzip -dc $fn | tar -t -v -f - | gawk '{print $6}' |\
		 > /etc/setup/${PKG}.lst.gz
		do_postinstall
		gzip /etc/setup/${PKG}.lst
		echo "$PKG $fn 0" >> /etc/setup/installed.db
      ;;
	 *) echo bad filespec: $fn ;;
  esac
done

echo "It's up to you to sort and eliminate duplicates in"
echo "/etc/setup/installed.db"

#!/bin/bash
shopt -sq extglob

# NOTE: this uses a different algorithm
# for parsing the package name/version/release
# than setup.  However, it mostly works...
parseName() {
  REM=${1%%*([^-])}
  REL=${1##$REM}
  NEXT=${REM%%-}
  REM=${NEXT%%*([^-])}
  VER=${NEXT##$REM}
  PKG=${REM%%-}
}
do_uninstall () {
  DO_POSTSCRIPT=no
  while read line ; do
    case $line in
      etc/postuninstall/*) DO_POSTSCRIPT=$line
      ;;
      */) # ignore directories
      ;;
      *) rm -f /$line
      ;;
    esac
  done < /etc/setup/${PKG}.lst
  if [ "$DO_POSTSCRIPT" -ne "no" ] ; then
    `/$line`
    mv /$line /$line.done
  fi	
}


for fn in $* ; do
  case $fn in
    *-src.tar*) echo "I don't do -src packages" ;;
    *.tar.bz2) 
	   parseName ${fn%%.tar.bz2} 
		echo Unnstalling $PKG  Version $VER  Release $REL
	   gunzip /etc/setup/${PKG}.lst.gz
		do_uninstall
		rm /etc/setup/${PKG}.lst
		echo "$PKG $fn REMOVED" >> /etc/setup/installed.db
      ;;		
	 *.tar.gz)
	   parseName ${fn%%.tar.gz} 
		echo Uninstalling $PKG  Version $VER  Release $REL
	   gunzip /etc/setup/${PKG}.lst.gz
		do_uninstall
		rm /etc/setup/${PKG}.lst
		echo "$PKG $fn REMOVED" >> /etc/setup/installed.db
      ;;
	 *) echo bad filespec: $fn ;;
  esac
done

echo "It's up to you to remove the appropriate entries from"
echo "/etc/setup/installed.db"


--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]