Patch title: Release 92 bulk changes
Abstract:
File: /fullpliant/boot.pli
Key:
    Removed line
    Added line
abstract
  [This is the boot script for the FullPLiant operating system.]

module "/pliant/language/context.pli"
module "/pliant/fullpliant/this_computer.pli"
module "/pliant/language/stream.pli"
module "/pliant/linux/storage/partition.pli"
module "/pliant/linux/storage/filesystem.pli"
module "/pliant/linux/network/boot.pli"
module "/pliant/linux/kernel/module.pli"
module "/pliant/admin/file.pli"
module "/pliant/admin/execute.pli"

constant medium this_computer:env:"pliant":"system":"medium"
constant embedded this_computer:env:"pliant":"system":"embedded"
constant checkdisk (file_query "file:/boot/checkdisk.flag" standard)=defined

function boot
  plugin first
  console "This computer is "+computer_fullname eol
  if medium<>"nfs" and medium<>"cdrom"
    var Str root := this_computer:env:"partition":"root":"device"
    if root<>""
      console "Remounting / read write." eol
      if (filesystem_mount root "file:/" "remount")=failure
      console "Remounting / read write" (shunt checkdisk ", check forced" "") "." eol
      if (filesystem_mount root "file:/" "remount"+(shunt checkdisk " check" ""))=failure
        console "Failed to remount / read write." eol
      if checkdisk
        file_delete "file:/boot/checkdisk.flag"
    else
      console "There is no root partition defined." eol
  (var Stream log) open "file:/log/pliant.log" append+safe
  log writeline "boot "+string:datetime
  log close
  console "Mounting /proc filesystem." eol
  if (filesystem_mount "file:proc" "file:/proc" "filesystem [dq]proc[dq]")=failure
    console "Failed to mount /proc filesystem." eol
  else
    (var Stream s) open "file:/proc/sys/kernel/hostname" out+safe
    s writeline computer_name
    s open "file:/proc/sys/kernel/domain" out+safe
    s writeline computer_domain
    s close
  console "Configuring kernel modules dependencies" eol
  execute "depmod -a "
  if medium="cdrom"
    console "Mounting /tmp in a RAM filesystem" eol
    partition_format "device:/ram1" "ext2" "standard"
    if (filesystem_mount "device:/ram1" "file:/tmp" "")=failure
      console "Failed to mount /tmp in a RAM read write filesystem." eol
  plugin early
  each m this_computer:env:"module"
    console "Loading " m:"module" " kernel module" eol
    execute "insmod "+m:"module"+(shunt m:"options"<>"" " " "")+m:"options" quiet # FIXME: might not work with Linux 2.6 kernel
    kernel_load_module m:"module" m:"options"
  console "Starting kernel helper daemons" eol
  if (file_query "file:/bin/irqbalance" standard)=defined
    console "  IRQ balancing" eol
    file_tree_create "file:/var/run/" # wallaround dirty Debian patch
    execute "irqbalance"
    file_delete "file:/var/run/irqbalance.pid"
    file_delete "file:/var/run/"
    file_delete "file:/var/"
  if (file_query "file:/bin/cardmgr" standard)=defined
    console "PCMCIA setup" eol
    execute "cardmgr -o -c /bin/pcmcia -p /tmp/cardmgr.pid -s /tmp/cardmgr.stab"
  filesystem_scan
  each p this_computer:env:"partition"
    if p:"filesystem"="swap"
      execute "mkswap "+(file_os_name p:"device")
    eif p:"mountpoint"<>"" and p:"mountpoint"<>"file:/"
      console "Mounting "+keyof:p+" partition" eol
      if (filesystem_mount p:"device" p:"mountpoint" "")=failure
      if (filesystem_mount p:"device" p:"mountpoint" p:"options"+(shunt checkdisk " check" ""))=failure
        console "Failed to mount "+keyof:p+" at "+p:"mountpoint" eol
  if embedded<>""
    module "embedded/boot.pli"
    embedded_boot1 this_computer
  net_boot
  (var Stream flag) open "file:/boot/boot.flag" out+safe ; flag close
boot

function boot_custom
  safe
    plugin boot
  failure err
    (var Stream log) open "file:/boot/boot.log" out+safe
    log writeline err
boot_custom

if embedded<>""
  console "Booting embedded system" eol
  module "/pliant/language/stream/filesystembase.pli"
  module "/pliant/language/stream/multi.pli"
  pliant_multi_file_system mount "target:/" "embedded:/" pliant_default_file_system
  module "embedded/configure.pli"
  embedded_configure this_computer false
  pliant_multi_file_system dismount "target:/"
  module "embedded/boot.pli"
  embedded_boot2 this_computer