home *** CD-ROM | disk | FTP | other *** search
/ Australian Personal Computer 2003 July / CD 2 Debian 3.0r1 / Debian.iso / isolinux / root.bin / root / usr / lib / debootstrap / scripts / woody < prev   
Encoding:
Text File  |  2002-03-14  |  7.1 KB  |  211 lines

  1. mirror_style release
  2. download_style apt
  3.  
  4. work_out_debs () {
  5.  
  6.     required="base-files base-passwd bash bsdutils debconf debianutils diff dpkg e2fsprogs fileutils findutils grep gzip hostname libcap1 libc6 libdb2 libdb3 libgdbmg1 libncurses5 libnewt0 libpam-modules libpam-runtime libpam0g libperl5.6 libpopt0 libreadline4 libstdc++2.10-glibc2.2 login makedev mawk modutils mount ncurses-base ncurses-bin passwd perl-base procps sed shellutils slang1 sysvinit tar textutils util-linux whiptail"
  7.  
  8.     base="adduser apt apt-utils at base-config bsdmainutils console-common console-tools console-tools-libs console-data cpio cron dhcp-client ed exim fdutils gettext-base groff-base ifupdown info klogd libident libldap2 liblockfile1 libpcre3 libsasl7 libwrap0 logrotate mailx man-db manpages modconf nano net-tools netbase netkit-inetd netkit-ping nvi ppp pppconfig pppoe pppoeconf libpcap0 sysklogd tasksel tcpd telnet $additional"
  9.  
  10.     without_package () {
  11.         echo "$2" | tr ' ' '\n' | grep -v "^$1$" | tr '\n' ' '
  12.     }
  13.  
  14.     LIBC6=libc6
  15.     IPFWTOOL=iptables
  16.  
  17.     case $ARCH in
  18.         "alpha")
  19.             required="$(without_package "libc6" "$required") libc6.1"
  20.             base="$base setserial aboot pciutils"
  21.             LIBC6="libc6.1"
  22.         IPFWTOOL="ipchains"
  23.             ;;
  24.         "arm")
  25.             base="$base setserial libgpmg1"
  26.         IPFWTOOL="ipchains iptables"
  27.             ;;
  28.         "i386")
  29.             required="$(without_package "libperl5.6" "$required") mbr"
  30.             base="$base lilo pciutils setserial syslinux psmisc pcmcia-cs"
  31.         IPFWTOOL="ipchains iptables"
  32.             ;;
  33.         "ia64")
  34.             required="$(without_package "libc6" "$required") libc6.1 gcc-2.96-base"
  35.             base="$base elilo efibootmgr dosfstools libparted1.4 parted"
  36.             LIBC6="libc6.1"
  37.             ;;
  38.         "m68k")
  39.             base="$base atari-bootstrap atari-fdisk amiga-fdisk eject mac-fdisk pmac-fdisk-cross setserial vmelilo"
  40.         IPFWTOOL="ipchains"
  41.             ;;
  42.         "powerpc")
  43.             base="$base quik mac-fdisk amiga-fdisk psmisc powerpc-utils setserial pciutils hfsutils yaboot pcmcia-cs"
  44.         IPFWTOOL="ipchains iptables"
  45.             ;;
  46.         "sparc")
  47.             base="$base silo eject pciutils sparc-utils"
  48.         IPFWTOOL="ipchains iptables"
  49.             ;;
  50.         "mips")
  51.             base="$base dvhtool pciutils setserial" # pcmcia-cs
  52.             ;;
  53.         "mipsel")
  54.             base="$base delo pciutils setserial" # pcmcia-cs
  55.             ;;
  56.         "hppa")
  57.             base="$base palo libstdc++3 gcc-3.0-base"
  58.             required="$(without_package "libstdc++2.10-glibc2.2" "$required")"
  59.             ;;
  60.         s390|s390x)
  61.             # base-config depends on console-data and console-common
  62.             # so we can't exclude them although they are useless on s390
  63.             base="$base s390-tools telnetd"
  64.             base="$(without_package "console-tools" "$base")"
  65.             base="$(without_package "console-tools-libs" "$base")"
  66.             base="$(without_package "fdutils" "$base")"
  67.             base="$(without_package "ppp" "$base")"
  68.             base="$(without_package "pppconfig" "$base")"
  69.             base="$(without_package "pppoe" "$base")"
  70.             base="$(without_package "pppoeconf" "$base")"
  71.             ;;
  72.         *)
  73.             # who knows?
  74.             ;;
  75.     esac
  76.  
  77.     base="$base $IPFWTOOL"
  78.  
  79.     all_debs="$required $base"
  80.  
  81.     for x in $exclude; do
  82.       all_debs="$(without_package "$x" "$all_debs")"
  83.     done
  84.     
  85. }
  86.  
  87. install_debs () {
  88.     extract $required
  89.  
  90.     mkdir -p "$TARGET/var/lib/dpkg"
  91.     : >"$TARGET/var/lib/dpkg/status"
  92.     : >"$TARGET/var/lib/dpkg/available"
  93.  
  94.     setup_etc
  95.     if [ ! -e "$TARGET/etc/fstab" ]; then
  96.         echo '# UNCONFIGURED FSTAB FOR BASE SYSTEM' > "$TARGET/etc/fstab"
  97.         chown 0.0 "$TARGET/etc/fstab"; chmod 644 "$TARGET/etc/fstab"
  98.     fi
  99.  
  100.     setup_proc
  101.     setup_devices
  102.  
  103.     in_target /sbin/ldconfig
  104.  
  105.     p () {
  106.     baseprog="$(($baseprog + ${1:-1}))"
  107.     }
  108.  
  109.     x_feign_install () {
  110.         local pkg="$1"
  111.         local deb="$(debfor $pkg)"
  112.         local ver="$(
  113.             ar -p "$TARGET/$deb" control.tar.gz | zcat |
  114.                 tar -O -xf - control ./control 2>/dev/null |
  115.                 sed -ne 's/^Version: *//Ip' | head -n 1
  116.         )"
  117.  
  118.         mkdir -p "$TARGET/var/lib/dpkg/info"
  119.  
  120.         echo \
  121. "Package: $pkg
  122. Version: $ver
  123. Status: install ok installed" >> "$TARGET/var/lib/dpkg/status"
  124.  
  125.         touch "$TARGET/var/lib/dpkg/info/${pkg}.list"
  126.     }
  127.  
  128.     x_core_install () {
  129.     smallyes '' | in_target dpkg --force-depends --install $(debfor "$@")
  130.     }
  131.  
  132.     x_feign_install dpkg
  133.  
  134.     DEBIAN_FRONTEND=Noninteractive
  135.     export DEBIAN_FRONTEND
  136.  
  137.     baseprog=0
  138.     bases=40
  139.  
  140.     p; progress $baseprog $bases "Installing base system" #1
  141.     info "Installing core packages..."
  142.  
  143.     p; progress $baseprog $bases #2
  144.     ln -s mawk $TARGET/usr/bin/awk
  145.     x_core_install base-files base-passwd
  146.     p; progress $baseprog $bases #3
  147.     x_core_install dpkg
  148.  
  149.     if [ ! -e "$TARGET/etc/localtime" ]; then
  150.         ln -sf /usr/share/zoneinfo/UTC "$TARGET/etc/localtime"
  151.     fi
  152.  
  153.     p; progress $baseprog $bases #4
  154.     x_core_install $LIBC6
  155.  
  156.     p; progress $baseprog $bases #5
  157.     x_core_install perl-base
  158.     p; progress $baseprog $bases #6
  159.     rm $TARGET/usr/bin/awk
  160.     x_core_install mawk
  161.     p; progress $baseprog $bases #7
  162.     x_core_install debconf
  163.  
  164.     info "Unpacking required packages..."
  165.  
  166.     p; progress $baseprog $bases #8
  167.     smallyes '' | repeat 5 in_target_failmsg "Failure while unpacking required packages.  This will be attempted up to five times." dpkg --force-depends --unpack $(debfor $required)
  168.     p 10; progress $baseprog $bases #18
  169.  
  170.     info "Configuring required packages..."
  171.  
  172.     mv "$TARGET/sbin/start-stop-daemon" "$TARGET/sbin/start-stop-daemon.REAL"
  173.     echo \
  174. "#!/bin/sh
  175. echo
  176. echo \"Warning: Fake start-stop-daemon called, doing nothing\"" > "$TARGET/sbin/start-stop-daemon"
  177.     chmod 755 "$TARGET/sbin/start-stop-daemon"
  178.  
  179.     setup_dselect_method apt
  180.     on_exit "in_target_nofail umount /dev/pts"
  181.  
  182.     p; progress $baseprog $bases #19
  183.     smallyes '' | in_target_failmsg "Failure while configuring required packages." dpkg --configure --pending --force-configure-any --force-depends
  184.     p 10; progress $baseprog $bases #29 
  185.  
  186.     if [ ! -e "$TARGET/etc/exim/exim.conf" ]; then
  187.         mkdir -p "$TARGET/etc/exim"
  188.         touch "$TARGET/etc/exim/exim.conf"
  189.     fi
  190.  
  191.     info "Installing base packages..."
  192.  
  193.     p; progress $baseprog $bases #30
  194.     smallyes '' | repeat 5 in_target_failmsg "Failure while installing base packages.  This will be re-attempted up to five times." dpkg --force-auto-select --force-overwrite --force-confold --skip-same-version --unpack $(debfor $base)
  195.  
  196.     rm -f "$TARGET/usr/sbin/sendmail"
  197.     ln -s /bin/true "$TARGET/usr/sbin/sendmail"
  198.  
  199.     smallyes '' | repeat 5 in_target_failmsg "Failure while configuring base packages.  This will be attempted 5 times." dpkg  --force-confold --skip-same-version  --configure -a
  200.  
  201.     rm -f "$TARGET/usr/sbin/sendmail"
  202.     ln -s exim "$TARGET/usr/sbin/sendmail"
  203.  
  204.     p 9; progress $baseprog $bases #39
  205.  
  206.     mv "$TARGET/sbin/start-stop-daemon.REAL" "$TARGET/sbin/start-stop-daemon"
  207.  
  208.     progress $bases $bases #40
  209.     info "Base system installed successfully."
  210. }
  211.