bootdisk: installer-pkgs (HEAD) [malekith]

PLD CVS pld-cvs-commit w pld.org.pl
Pon, 29 Lip 2002, 13:09:28 CEST


Module name:	bootdisk
Changes by:	malekith	02/07/29 13:09:26

Modified files:
	installer-pkgs

Log message:
- don't add dhcpcd if we have dhcp-client or pump
- if is_smp() then replace kernel with kernel-smp
- removed apt and wuch from pkgs_installer case ... esac (they never worked
  and prolly never will)
- removed workaround for poldek bug in url handling with multiple /
- do a grep error: on poldek log before screaming about installation failure
  -- it will be easier for user to locate error now
- if installing from http/ftp, set it in /dest/etc/poldek.conf instead of
  ftp.pld.org.pl

Index: installer-pkgs
===================================================================
RCS file: /cvsroot/bootdisk/batch-installer/installer-pkgs,v
diff -d -u -r1.78 -r1.79
--- installer-pkgs	2002/07/26 10:45:22	1.78
+++ installer-pkgs	2002/07/29 11:09:25	1.79
@@ -64,8 +64,8 @@
 # now we can load rpm (notice that this is loaded into dest!)
 load_package rpm
 
-# it looks I cannot avoid glibc despite of most bianaries
-# are static: poldek probably does some ldopen to get to nsswitch
+# Even for statically linked binary (like poldek) there is need
+# for libresolv.so and nssswitch.conf file... :< 
 load_package libc
 
 # make sure we have bootloader
@@ -80,13 +80,27 @@
     add_rpm pcmcia-cs
 fi
 
-# if we were installing using dhcp, better add dhcp client
-if test "$net_ipaddr" = dhcp ; then
-  add_rpm dhcpcd
+# if we were installing using dhcp or user asked for dhcp ipaddr in
+# installer.sysconf, better add dhcp client
+if test "$net_ipaddr" = dhcp || \
+   ( load_sys_config; test "$net_ipaddr" = dhcp ); then
+  if has_rpm pump || has_rpm dhcp-client ; then
+    : skip
+  else
+    add_rpm dhcpcd
+  fi
 fi
 
-# if user asked for dhcp ipaddr, we also better have it
-( load_sys_config; if test "$net_ipaddr" = dhcp ; then add_rpm dhcpcd ; fi )
+if is_smp ; then
+  if is_mini_iso ; then
+    : # skip, no kernel-smp on mini-iso
+  elif has_rpm kernel ; then
+    grep -v '^kernel$' $pkgsfile > $pkgsfile.tmp
+    cat $pkgsfile.tmp > $pkgsfile
+    rm -f $pkgsfile.tmp
+    add_rpm kernel-smp
+  fi
+fi
 
 export PATH="/dest/installer/bin:$PATH"
 
@@ -122,10 +136,6 @@
 log info "langs = $pkgs_install_langs, docs = $pkgs_install_docs"
 
 case "$pkgs_installer" in
-    apt)
-	# apt-get -o RPM::Options="-vv --root=/cośtam"
-	die "apt not yet implemented"
-	;;
     poldek)
 	load_package poldek
 
@@ -143,7 +153,11 @@
 	fi
 
 	export TMPDIR=/installer/tmp
-	poldek_opt="--mercy --mkdir --cachedir=/dest/installer/tmp --log=/var/log/installer --install-dist=/dest -v --pset $pkgsfile"
+	poldek_log=/dest/installer/poldek.log
+	echo -n > $poldek_log
+	poldek_opt="--mercy --mkdir --cachedir=/dest/installer/tmp"
+	poldek_opt="$poldek_opt --log=$poldek_log"
+	poldek_opt="$poldek_opt --install-dist=/dest -v --pset $pkgsfile"
 
 	case "$source" in 
 	    cdrom)
@@ -156,62 +170,33 @@
 		fi
 		;;
 	    *)
-		# workaround poldek's bug in handling urls
-		dir=$(echo "$dir" | sed -e 's|//*|/|g' | sed -e 's|:/|://|')
 		poldek_opt="$poldek_opt -s $dir/"
+		case "$net_proxy" in
+		  "" | none )
+		    : nothing
+		    ;;
+		  * )
+		    export SNARF_PROXY="$net_proxy"
+		    echo "ftp_get       = /bin/snarf %P %D" > /tmp/poldekrc
+		    echo "http_get      = /bin/snarf %P %D" >> /tmp/poldekrc
+		    poldek_opt="$poldek_opt --conf=/tmp/poldekrc"
+		    ;;
+		esac
 		;;
 	esac
 	message
 	if LANG=C LC_ALL=C poldek $poldek_opt ; then
-	  : ok
+	  cat $poldek_log >> /var/log/installer
 	else
 	  log error "$(nls "PACKAGES INSTALLATION FAILED!!!")"
-	  log error "$(nls "poldek returned with error, possibly you should check")"
-	  log error "$(nls "list of packages passed and/or /var/log/installer.")"
-	  log error "$(nls "For the actual error, please look above, and in case")"
-	  log error "$(nls "of commiting bug report, please include error above")"
-	  log error "$(nls "not this text.")"
+	  # filter out important information
+	  grep error: $poldek_log
+	  log error "$(nls "You might want to try installing just basic packages,")"
+	  log error "$(nls "and install rest after reboot.")"
+	  cat $poldek_log >> /var/log/installer
 	  exit 1
 	fi
 	;;
-    wuch)
-	load_package wuch
-	message
-
-	echo -n >/dest/installer/tmp/wuch.conf
-	# shit, we have to parse dir et all
-	case "$dir" in
-	ftp://*) 
-	    proto=ftp
-	    hostname=`echo "$dir" | sed 's@[a-z]*://@@' | sed 's@/.*$@@'`
-	    hostdir=`echo "$dir" | sed 's@[a-z]*://@@' | sed 's@^[^/]*@@'`
-	    host="$hostname,$hostdir"
-	    ;;
-	/*) 
-	    proto=dir
-	    host="$dir"
-	    ;;
-	*) 
-	    die "wuch does not support this: $dir"
-	    ;;
-	esac
-
-	echo "source=Source,$proto,`dirname $host`,`basename $host`,`basename $host`" >>/dest/installer/tmp/wuch.conf
-
-	export TMPDIR=/dest/installer/tmp/
-	export WUCH_TEMP=/dest/installer/tmp/
-	export WUCH_VAR=/dest/installer/tmp/
-	#wuch_opt="--config-file=/dest/installer/tmp/wuch.conf -d /dest"
-	wuch_opt="--config-file=/dest/installer/tmp/wuch.conf -d /dest -c $pkgsfile -L"
-	#wuch_opt="--config-file=/dev/null --source=\"Source,$proto,`dirname $host`,`basename $host`,`basename $host`\" -d /dest -c $pkgsfile -L"
-	log info "running wuch $wuch_opt"
-	wuch $wuch_opt || {
-	  log error "PACKAGES INSTALLATION FAILED!!!"
-	  log error "wuch returned with error, possibly you should check"
-	  log error "list of packages passed and/or /var/log/installer."
-	  exit 1
-	}
-	;;
     *)
 	die "Unknown RPM installer $pkgs_installer"
 	;;
@@ -225,6 +210,18 @@
 cp -f /etc/installer.conf /dest/etc && chmod 600 /dest/etc/installer.conf
 cp -f /etc/installer.sysconf /dest/etc && chmod 600 /dest/etc/installer.sysconf
 cp -f $pkgsfile /dest/etc && chmod 600 /dest/etc/installer.pkgs
+
+case $source in
+  net )
+    if test -f /dest/etc/poldek.conf ; then
+      cp /dest/etc/poldek.conf /tmp
+      ( 
+        echo "# Installer changed ftp://ftp.pld.org.pl/ to $source_device in this file"
+	sed -e "s|ftp://ftp.pld.org.pl|$source_device|g" /tmp/poldek.conf
+      ) > /dest/etc/poldek.conf
+    fi
+    ;;
+esac
 
 # remove garbage
 rm -fr /dest/installer



Więcej informacji o liście dyskusyjnej pld-installer