bootdisk: ui-wizard (HEAD) [malekith]

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


Module name:	bootdisk
Changes by:	malekith	02/07/29 13:20:42

Modified files:
	ui-wizard

Log message:
- allow jump to step with setting $STEP
- support $boot_loader_device
- detect mini-iso
- support $net_proxy
- handle /etc/installer.pkgs changed by user better
- support $clock_utc
- use parse_boot_loader_entry()

Index: ui-wizard
===================================================================
RCS file: /cvsroot/bootdisk/batch-installer/ui/ui-wizard,v
diff -d -u -r1.24 -r1.25
--- ui-wizard	2002/07/26 10:20:23	1.24
+++ ui-wizard	2002/07/29 11:20:41	1.25
@@ -35,7 +35,12 @@
 find_config_paths "$@"
 load_or_create_config
 
-step=prep
+if [ "$STEP" ] ; then
+  step=$STEP
+else
+  step=prep
+fi
+
 sysconf=
 
 # helpers to get to next/prev step
@@ -46,7 +51,7 @@
   fi
   echo -n "dest profile pkgs pkgsopt "
   # sysconfig:
-  echo -n "sysnet sysnetip sysnetdev hostname rootpass user lang boot "
+  echo -n "sysnet sysnetip sysnetdev hostname rootpass user lang boot bootdev "
   # finish...
   echo "run fini"
 }
@@ -197,6 +202,10 @@
 	  source_filesystem=iso9660
 	  ok=x
         fi
+	rm -f /tmp/is-mini-iso
+	if is_mini_iso ; then
+	  echo yes >/tmp/is-mini-iso
+	fi
         umount /src
       fi
     done
@@ -248,6 +257,9 @@
 <br><br>
 $(nls "Source exact directory:") <input id=source_dir caption="$source_dir">
 <br>$(nls "If you are not sure about exact directory, leave it untouched.")
+<br><br>$(nls "HTTP/FTP proxy to use: ")
+<input caption="$net_proxy" id=net_proxy><br>
+$(nls "Example proxy: %s" "http://squid.foobar.org:3128/")
 EOF
   source_filesystem=net
 }
@@ -633,11 +645,31 @@
 last_pkg_set=
 
 pre_profile () {
+  if test -f /tmp/is-mini-iso ; then
+    info $(nls "You appear to be installing from MINI-ISO.<br>In this case you can only select one of 'MINI-ISO' or 'base' installation profiles.")
+  fi
+}
+
+md5 () {
+  md5sum "$1" | (read sum file; echo $sum)
 }
 
 display_profile () {
   if [ "$last_pkg_set" = "" ] ; then
-    last_pkg_set=$pkgsetsdir/basic
+    # if /etc/installer.pkgs contains basic pkgset, we can select it
+    # or mini-iso, otherwise config was loaded from disk or created
+    # using some other way and we shouldn't touch it unless explicitly
+    # told to.
+    if [ $(md5 $pkgsetsdir/basic) = $(md5 $pkgsfile) ] ; then
+      if test -f /tmp/is-mini-iso ; then
+        last_pkg_set=$pkgsetsdir/MINI-ISO
+      else
+        last_pkg_set=$pkgsetsdir/basic
+      fi
+    else
+      last_pkg_set=$pkgsetsdir/LAST
+      cp $pkgsfile $last_pkg_set
+    fi
   fi
   echo "<meta active=pkg_set>"
   nls "Please select desired installation profile.<br><br>"
@@ -818,6 +850,7 @@
 # sysnetdev
 ###
 pre_sysnetdev () {
+  sysconf=yes
   if [ "$net_device" = "" ] ; then
     net_device=eth0
   fi
@@ -840,6 +873,7 @@
 # hostname
 ###
 pre_hostname () {
+  sysconf=yes
   if [ "$net_config" = dhcp -o "$net_ipaddr" = dhcp ] ; then
     return 1 # skip
   fi
@@ -860,6 +894,7 @@
 # rootpass
 ###
 pre_rootpass () {
+  sysconf=yes
 }
 
 display_rootpass () {
@@ -904,6 +939,7 @@
 # user
 ###
 pre_user () {
+  sysconf=yes
 }
 
 display_user () {
@@ -1001,6 +1037,7 @@
 ###
 
 pre_lang () {
+  sysconf=yes
 }
 
 display_lang () {
@@ -1009,8 +1046,19 @@
   nls "de_AT for German in .at, en_GB for British English and so on.<br><br>"
   
   echo "$(nls "Language :") <input id=lang caption='$lang'><br>"
-  echo "$(nls "Timezone :") <input id=timezone caption='$timezone'><br>"
-  echo "<button res=1 caption='$(nls "Browse timezones")'>"
+  echo "$(nls "Timezone :") <input id=timezone caption='$timezone'> "
+  echo "<button res=1 caption='$(nls "_Browse timezones")'><br><br>"
+  
+  utc=1
+  if [ "$clock_utc" = no ] ; then
+    utc=0
+  fi
+
+  echo -n "<check id=clock_utc checked=$utc> "
+  
+  nls "My hardware clock runs UTC.<br>"
+  nls "Hardware clock running UTC is normal on Unix boxes, however Windows<br>"
+  nls "can't get it, so if you are using Windows better uncheck this."
 }
 
 post_lang () {
@@ -1051,27 +1099,7 @@
   nls "Current ,,other'' OS configuration:<br><br>"
   for img in $boot_loader_other ; do
     some=1
-    id=1
-    for f in $(echo $img | tr ":" " ") ; do
-      eval f${id}=$f
-      id=$(($id+1))
-    done
-    img_os=$f1
-    img_label=$f2
-    img_root=$f3
-    img_kernel=
-    img_initrd=
-    case $img in
-    linux:*:*:*:* )
-      img_kernel=$f3
-      img_initrd=$f4
-      img_root=$f5
-      ;;
-    linux:*:*:* )
-      img_kernel=$f3
-      img_root=$f4
-      ;;
-    esac
+    eval $(parse_boot_loader_entry $img)
     nls "%s is %s with root = %s<br>" "$img_label" "$img_os" "$img_root"
     if [ "$img_kernel" != "" ] ; then
       nls "      kernel = %s, initrd = %s<br>" "$img_kernel" "$img_initrd"
@@ -1080,7 +1108,7 @@
   echo "<br>"
   nls "If you are happy with it, just press [ Next >> ],<br>"
   nls "otherwise "
-  echo "<button caption='$(nls "_Configure bootloader")' res=1>.<br>"
+  echo "<button caption='$(nls "_Configure bootloader")' res=1>."
 }
 
 post_boot () {
@@ -1093,6 +1121,39 @@
   esac
 }
 
+###
+# bootdev
+###
+pre_bootdev () {
+}
+
+display_bootdev () {
+  nls "Bootloader can be installed in several places.<br>"
+  nls "The most common choice is to install it on first hard disk's<br>"
+  nls "Master Boot Record (MBR). This is reflected by /dev/hda or<br>"
+  nls "/dev/sda choice below (for IDE or SCSI respectively).<br><br>"
+  nls "However it is also possible to install bootloader at the<br>"
+  nls "beginning of hard disk partition and chain-load it later,<br>"
+  nls "from other bootloader.<br><br>"
+  nls "A choice of 'auto' means to install bootloader on MBR of disk<br>"
+  nls "that contains /boot (or / if there is no /boot) partition.<br><br>"
+  nls "In the most common case of single IDE drive, leave it<br>"
+  nls "with 'auto'.<br><br>"
+  nls "Bootloader device: "
+cat <<EOF
+<menu id=bld hidden=1>
+<item id=auto>$(nls Automatic)
+<item id=/dev/hda>$(nls "First IDE drive")
+<item id=/dev/sda>$(nls "First SCSI drive")
+<item id=/dev/hda1>$(nls "First partition on 1st IDE drive")
+</menu>
+<input id=boot_loader_device label='$(nls "_Examples")' 
+caption='$boot_loader_device' menu=bld>
+EOF
+}
+
+post_bootdev () {
+}
 
 ###
 # run



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