bootdisk/trunk/batch-installer/installer-prep
hawk
cvs at pld-linux.org
Tue Mar 21 22:47:21 CET 2006
Author: hawk
Date: Tue Mar 21 22:47:18 2006
New Revision: 7262
Modified:
bootdisk/trunk/batch-installer/installer-prep
Log:
- if we are installing from net, try to load modules from net to avoid
addons juggling (but fallback to addons when network loading fails)
- small cosmetic
Modified: bootdisk/trunk/batch-installer/installer-prep
==============================================================================
--- bootdisk/trunk/batch-installer/installer-prep (original)
+++ bootdisk/trunk/batch-installer/installer-prep Tue Mar 21 22:47:18 2006
@@ -75,46 +75,55 @@
test -d "$modules_dir" || die "No $modules_dir directory"
if test ! -r "$modules_dir/${1}.o"; then
- # try to load from addons diskette
- package=`find_package ${1}`
- test "$package" || die "No package contains module $1"
- addons=`find_addons $package`
- test "$addons" || die "No addons disk contains package $package"
- first=yes
- # the source will be the diskette, temporarily
- # (that _is_ mountable)
- tmp=$source_not_mountable
- source_not_mountable=""
- while : ; do
- if grep -q "$source_mountpoint" /proc/mounts; then
- umount $source_mountpoint || :
+ package=`find_package ${1}`
+ test "$package" || die "No package contains module $1"
+ # if we are installing from net, try to fetch whole required package
+ # (to avoid fetching it again if some other module from it will be needed)
+ if test -n "$source_not_mountable"; then
+ if load_package $package; then
+ tmp="value"
fi
-
- if mount /dev/fd0 -t ext2 $source_mountpoint 2>/dev/null ; then
- if load_package $package ${1}.o; then
- break
- else
- nls "This disk does not contain package %s with module %s.\n" "$package" "$1"
+ fi
+ # if fetching from network wasn't executed or has failed, search for
+ # required module on addons disks
+ if test -z $tmp ; then
+ addons=`find_addons $package`
+ test "$addons" || die "No addons disk contains package $package"
+ first=yes
+ # the source will be the diskette, temporarily
+ # (that _is_ mountable)
+ tmp=$source_not_mountable
+ source_not_mountable=""
+ while : ; do
+ if grep -q "$source_mountpoint" /proc/mounts; then
+ umount $source_mountpoint || :
fi
- else
- if test ! "$first" ; then
- nls "Cannot mount diskette!\n"
+
+ if mount /dev/fd0 -t ext2 $source_mountpoint 2>/dev/null ; then
+ if load_package $package ${1}.o; then
+ break
+ else
+ nls "This disk does not contain package %s with module %s.\n" "$package" "$1"
+ fi
+ else
+ if test ! "$first" ; then
+ nls "Cannot mount diskette!\n"
+ fi
fi
- fi
-
- if test "$first" ; then
- nls "Module %s is not available, package %s must be loaded.\n" "$1" "$package"
- nls "Please insert disk \"addons %d\" and press Enter\n" "$addons"
- first=
- else
- nls "Try another disk and press Enter.\n"
- fi
- read ans
- done
- # restore correct value
- source_not_mountable=$tmp
- umount $source_mountpoint || :
+ if test "$first" ; then
+ nls "Module %s is not available, package %s must be loaded.\n" "$1" "$package"
+ nls "Please insert disk \"addons %d\" and press Enter\n" "$addons"
+ first=
+ else
+ nls "Try another disk and press Enter.\n"
+ fi
+ read ans
+ done
+ # restore correct value
+ source_not_mountable=$tmp
+ umount $source_mountpoint || :
+ fi
fi
# find and load modules on which our wanted module depends
@@ -180,7 +189,10 @@
;;
esac
snarf -n "$file"
- ) || die "Cannot get $file"
+ ) || {
+ log warn "`nls "Cannot get %s" "$file"`"
+ return 1
+ }
file="$tmp/${pkg}.tar.gz"
else
file="${source_mountpoint}${source_dir}/$inst_dir/${pkg}.tar.gz"
@@ -189,7 +201,7 @@
# try without source_dir (for addons disk)
file="${source_mountpoint}/$inst_dir/${pkg}.tar.gz"
test -f "$file" || {
- echo "No file ${source_mountpoint}${source_dir}/$inst_dir/${pkg}.tar.gz nor ${source_mountpoint}/$inst_dir/${pkg}.tar.gz"
+ log warn "`nls "No file %s nor %s" "${source_mountpoint}${source_dir}/$inst_dir/${pkg}.tar.gz" "${source_mountpoint}/$inst_dir/${pkg}.tar.gz"`"
return 1
}
}
@@ -521,12 +533,15 @@
inst_dir="$INSTALLER_DIR"
-# needed before $0 testing...
if test "X$source" = "Xnet" ; then
+ # needed before $0 testing...
source_not_mountable=1
+ # configure network to avoid using addons disks where possible
+ load_net_device_modules
+ configure_network
fi
-# invoked as load_nodule runs function load_module,
+# invoked as load_nodule runs function load_module
if test "x`basename $0 || :`" = "xload_module"; then
load_module "$@"; exit $?
# invoked as load_device_modules, runs function load_device_modules
@@ -606,7 +621,7 @@
;;
esac
-# invoked as load_package runs function load_package,
+# invoked as load_package runs function load_package
if test "x`basename $0 || :`" = "xload_package"; then
load_package "$@"; exit $?
fi
More information about the pld-cvs-commit
mailing list