Patch title: Release 94 bulk changes
Abstract:
File: /pliant/fullpliant/menu.page
Key:
    Removed line
    Added line
   
module "/pliant/language/context.pli"
module "/pliant/language/stream.pli"
module "/pliant/admin/file.pli"
if os_api="linux"
  module "/pliant/linux/storage/filesystem.pli"
module "/pliant/protocol/http/proxy.pli"
module "/pliant/util/crypto/proxy.pli"
module "/pliant/fullpliant/this_computer.pli"
module "/pliant/fullpliant/shutdown.pli"
if os_api="linux"
  module "/pliant/fullpliant/embedded/command.pli"
  module "/pliant/linux/storage/filesystem.pli"
  module "/pliant/linux/kernel/module.pli"


if os_api="linux"
  button "mount floppy" noeol
    kernel_load_module "floppy"
    kernel_load_module "msdos"
    filesystem_mount "device:/fd0" "embedded:/mnt/floppy/" "
    reload_page
  button "unmount floppy" noeol
    filesystem_dismount "embedded:/mnt/floppy/"
    reload_page
module "/pliant/language/context.pli"
module "/pliant/language/stream.pli"
module "/pliant/admin/file.pli"
if os_api="linux"
  module "/pliant/linux/storage/filesystem.pli"
module "/pliant/protocol/http/proxy.pli"
module "/pliant/util/crypto/proxy.pli"
module "/pliant/fullpliant/this_computer.pli"
module "/pliant/fullpliant/shutdown.pli"
if os_api="linux"
  module "/pliant/fullpliant/embedded/command.pli"
  module "/pliant/linux/storage/filesystem.pli"
  module "/pliant/linux/kernel/module.pli"


if os_api="linux"
  button "mount floppy" noeol
    kernel_load_module "floppy"
    kernel_load_module "msdos"
    filesystem_mount "device:/fd0" "embedded:/mnt/floppy/" "
    reload_page
  button "unmount floppy" noeol
    filesystem_dismount "embedded:/mnt/floppy/"
    reload_page
  button "mount CDROM" noeol
  page button "mount CDROM" noeol
    kernel_load_module "cdrom"
    kernel_load_module "ide-cd"
    kernel_load_module "isofs"
    kernel_load_module "cdrom"
    kernel_load_module "ide-cd"
    kernel_load_module "isofs"
    var Str device
    (var Stream proc) open "file:/proc/ide/hdc/media" in+saf
    if proc:readline="cdrom"
      device := "device:/hdc"
    else
      proc open "file:/proc/ide/hdb/media" in+safe
    var Str device := ""
    for (var Int i) 0 3
      (var Stream proc) open "file:/proc/ide/hd"+(character "a":number+i)+"/media" in+safe
      if proc:readline="cdrom"
      if proc:readline="cdrom"
        device := "device:/hdb"
      else
        proc open "file:/proc/ide/hdd/media" in+safe
        if proc:readline="cdrom"
          device := "device:/hdd"
        else
          device := ""
        device := "device:/hd"+(character "a":number+i)
    if device<>""
      filesystem_mount device "embedded:/mnt/cdrom/" "filesy
    if device<>""
      filesystem_mount device "embedded:/mnt/cdrom/" "filesy
      reload_page
    else
      text "Could not find an IDE CDROM in the computer !"
    else
      text "Could not find an IDE CDROM in the computer !"
    reload_page
  button "unmount CDROM" noeol
    filesystem_dismount "embedded:/mnt/cdrom/"
    kernel_unload_module "isofs"
    reload_page
  button "unmount CDROM" noeol
    filesystem_dismount "embedded:/mnt/cdrom/"
    kernel_unload_module "isofs"
    reload_page
  button "mount USB storage" noeol
  page button "mount USB storage" noeol
    kernel_load_module "sg"
    kernel_load_module "sd_mod"
    kernel_load_module "usb-uhci" # 2.4
    kernel_load_module "uhci_hcd" # 2.6
    kernel_load_module "ehci_hcd"
    kernel_load_module "usb-storage"
    kernel_load_module "msdos"
    kernel_load_module "sg"
    kernel_load_module "sd_mod"
    kernel_load_module "usb-uhci" # 2.4
    kernel_load_module "uhci_hcd" # 2.6
    kernel_load_module "ehci_hcd"
    kernel_load_module "usb-storage"
    kernel_load_module "msdos"
    sleep 1
    if (filesystem_mount "device:/sda1" "embedded:/mnt/usb/"
      filesystem_mount "device:/sda1" "embedded:/mnt/usb/" "
    reload_page
    kernel_load_module "nls_cp437"
    var CBool first := true
    part scan_usb
      for (var Int i) 7 0 step -1
        if (filesystem_bus "device:/sd"+(character "a":number+i))="usb"
          var Str device := "device:/sd"+(character "a":number+i)
          for (var Int j) 0 3
            if (filesystem_mount device+(shunt (j .and. 2)<>0 "" "1") "embedded:/mnt/usb/" (shunt (j .and. 1)<>0 "filesystem [dq]msdos[dq]" ""))=success
              reload_page
              leave scan_usb
      if first
        sleep 5
        first := false
        restart scan_usb
      text "Could not find an USB storage connected to the computer !"
  button "unmount USB" noeol
    filesystem_dismount "embedded:/mnt/usb/"
    reload_page
  eol

execute_dynamic_page "pliant:/pliant/protocol/http/login.htm
  button "unmount USB" noeol
    filesystem_dismount "embedded:/mnt/usb/"
    reload_page
  eol

execute_dynamic_page "pliant:/pliant/protocol/http/login.htm
button "Power off" noeol
  title "Power off"
  para
    [Do you really want to power off this computer ? ]
    button "yes" noeol
      shutdown 30 "poweroff"
    button "no"
      goto_backward
  if os_api="linux"
    para
      [Just ]
      button "suspend" noeol
        constant vesa_backup (file_query "file:/bin/vbetool" standard)=success
        module "/pliant/language/os.pli"
        module "/pliant/linux/kernel/device.pli"
        module "/pliant/admin/execute.pli"
        if vesa_backup
          constant os_VT_ACTIVATE 5606h
          os_ioctl 0 os_VT_ACTIVATE (cast 1 Address)
          sleep 5
          kernel_make_device "device:/mem"
          execute "vbetool vbestate save" output "file:/tmp/vesa"
        os_sync
        if false
          embedded_command "/usr/bin/apm -s" ""
        else
          # don't do that because math processor will not be restored properly
          # (var Stream s) open "file:/sys/power/state" out+safe
          # s writeline "mem"
          # s close
          execute "pliant reset command 'console [dq]mem[dq]" output "file:/sys/power/state"
        if vesa_backup
          execute "vbetool post"
          execute "vbetool vbestate restore" input "file:/tmp/vesa"
          file_delete "file:/tmp/vesa"
          os_ioctl 0 os_VT_ACTIVATE (cast 2 Address)
        goto_backward
      [ the laptop.]

if os_api="linux"
if os_api="linux"
  if (this_computer:env:"kernel":"make":"CONFIG_APM"="y")
    button "Suspend" noeol
      embedded_command "/usr/bin/apm -s" ""
  (var Stream sys) open "file:/sys/devices/system/cpu/cpu0/cpufreq/scaling_available_frequencies" in+safe
  var Str freqs := sys readline
  if freqs<>""
    (var Stream sys) open "file:/sys/devices/system/cpu/cpu0/cpufreq/scaling_cur_freq" in+safe
    var Str freq := sys readline
    sys close
    fixed [   ]
    select "Processor frequency: " (var Str freq) noeol
      while (freqs parse (var Int khz) any:(var Str remain))
        option (string khz/1000000)+" Ghz" string:khz
        freqs := remain
    button "set frequency"
      (var Stream sys2) open "file:/sys/devices/system/cpu/cpu0/cpufreq/scaling_setspeed" out+safe
      sys2 writeline freq
      sys2 close
      thread
        sleep 2
        embedded_command "sync" ""
        embedded_command "hdparm -y "+(file_os_name this_computer:env:"partition":"root":"device") ""
      reload_page
      reload_page
button "Power off"
  title "Power off"
  [Do you really want to power off this computer ? ]
  button "yes" noeol
    shutdown 30 "poweroff"
  button "no"
    goto_backward