Patch title: Release 94 bulk changes
Abstract:
File: /pliant/fullpliant/computer.page
Key:
    Removed line
    Added line
   
module "/pliant/language/context.pli"
module "rules.pli"
module "install.pli"
module "embedded/install.pli"
module "embedded/compile.pli"
module "computer.pli"
module "debian.pli"


            page button "Engrave a recovery CD" 
              if c:env:"partition":"root":"device"=""
                [You cannot engrave the CD without a root pa
              eif allowed:"administrator"
                title "Engrave a recovery CD"
                table columns 4 border 0
                  cell
                    highlight "warning:"
                  cell
                    [Selecting yes will eraze your] ; eol
                  cell
                    fixed [file:/usr/src/linux/] ; eol
                    fixed [file:/usr/src/pcmcia-cs/] ; eol
                    fixed [file:/usr/src/alsa-driver-xxx/] ;
                    fixed [file:/mnt/target/] ; eol
                  cell
                    [directories.]
                input "Name of the computers you want to rec
                select "Kind of CD: " (var Str rw)
                  option "Write only" ""
                  option "Read write" " rw"
                  option "store image to embedded:/tmp/recov
module "/pliant/language/context.pli"
module "rules.pli"
module "install.pli"
module "embedded/install.pli"
module "embedded/compile.pli"
module "computer.pli"
module "debian.pli"


            page button "Engrave a recovery CD" 
              if c:env:"partition":"root":"device"=""
                [You cannot engrave the CD without a root pa
              eif allowed:"administrator"
                title "Engrave a recovery CD"
                table columns 4 border 0
                  cell
                    highlight "warning:"
                  cell
                    [Selecting yes will eraze your] ; eol
                  cell
                    fixed [file:/usr/src/linux/] ; eol
                    fixed [file:/usr/src/pcmcia-cs/] ; eol
                    fixed [file:/usr/src/alsa-driver-xxx/] ;
                    fixed [file:/mnt/target/] ; eol
                  cell
                    [directories.]
                input "Name of the computers you want to rec
                select "Kind of CD: " (var Str rw)
                  option "Write only" ""
                  option "Read write" " rw"
                  option "store image to embedded:/tmp/recov
                var Bool isolinux := true
                select "CD boot loader: " isolinux
                  option "isolinux" "true"
                  option "GRUB" "false"
                [Do you really want to engrave the CD ? ]
                page button "yes" noeol
                  part engrave_cd
                    var Str all := target_names
                    while all<>""
                      if not (all parse any:(var Str first) 
                        first := all ; remain := ""
                      if (file_query "file:/fullpliant/archi
                        if not (exists computer:first)
                          text "There is no '"+first+"' in t
                        else
                          text "The target system archive fo
                        leave engrave_cd
                      all := remain
                    var ExtendedStatus status := install_tre
                    if status=success
                      var Str all := target_names
                      while all<>""
                        if not (all parse any:(var Str first
                          first := all ; remain := ""
                        file_copy "file:/fullpliant/archive/
                        var Str embedded := computer:first:e
                        if embedded<>""
                          file_copy "file:/fullpliant/archiv
                [Do you really want to engrave the CD ? ]
                page button "yes" noeol
                  part engrave_cd
                    var Str all := target_names
                    while all<>""
                      if not (all parse any:(var Str first) 
                        first := all ; remain := ""
                      if (file_query "file:/fullpliant/archi
                        if not (exists computer:first)
                          text "There is no '"+first+"' in t
                        else
                          text "The target system archive fo
                        leave engrave_cd
                      all := remain
                    var ExtendedStatus status := install_tre
                    if status=success
                      var Str all := target_names
                      while all<>""
                        if not (all parse any:(var Str first
                          first := all ; remain := ""
                        file_copy "file:/fullpliant/archive/
                        var Str embedded := computer:first:e
                        if embedded<>""
                          file_copy "file:/fullpliant/archiv
                        each partition computer:first:env:"partition"
                          if partition:"disk_image"<>""
                            file_copy "file:/fullpliant/archive/partition/"+partition:"disk_image"+".gz" "file:/mnt/target/fullpliant/archive/partition/"+partition:"disk_image"+".gz" extended+lazy
                        all := remain
                        all := remain
                      console "Building CD the embedded boot
                      status := install_floppy c "file:/mnt/
                      if false
                        console "Building CD the embedded boot floppy" eol
                        status := install_floppy c "file:/mnt/target/boot/floppy" c:env:"partition":"root":"device" ""
                      else
                        status := success
                      if status=success
                      if status=success
                        var Str boot := "boot [dq]boot/floppy[dq]"
                        if isolinux
                          (var Stream cfg) open "file:/mnt/target/boot/isolinux/isolinux.cfg" out+safe
                          # cfg writeline "default /boot/kernel root="+(file_os_name c:env:"partition":"root":"device")
                          cfg writeline "default /boot/kernel initrd=/boot/initrd.img root=/dev/ram0"
                          cfg close
                          boot := "boot [dq]boot/isolinux/isolinux.bin[dq] mkisofs_extra_options [dq]-c boot/isolinux/boot.cat -no-emul-boot -boot-load-size 4 -boot-info-table[dq]"
                        else
                          (var Stream cfg) open "file:/mnt/target/boot/grub/menu.lst" out+safe
                          cfg writeline "timeout 2"
                          cfg writeline "title FullPliant"
                          cfg writeline "kernel /boot/kernel root="+(file_os_name c:env:"partition":"root":"device")
                          cfg close
                          boot := "boot [dq]boot/grub/stage2_eltorito[dq] mkisofs_extra_options [dq]-c boot/grub/boot.cat -no-emul-boot -boot-load-size 4 -boot-info-table[dq]"
                        if rw="store"
                          console "storing CD image" eol
                        if rw="store"
                          console "storing CD image" eol
                          status := cdrom_image (var List:Fi
                          status := cdrom_image (var List:FileInfo empty_list) "path [dq]file:/mnt/target/[dq] title [dq]pliant_cdrom[dq] "+boot "embedded:/tmp/recover.cd"
                        else
                          console "Engraving the CD" eol
                        else
                          console "Engraving the CD" eol
                          status := cdrom_engrave "file:/mnt
                          status := cdrom_engrave "file:/mnt/target/" "title [dq]pliant_cdrom[dq] "+boot+rw+" indirect"
                      file_tree_delete "file:/mnt/target/"
                      console "done." eol
                      if status=success
                        goto_backward
                      else
                        text "failed: "+status:message
                    else
                      console "failed." eol
                      [Failed to engrave the bootable CD for
                      [Error message is: ] ; eol
                      fixed (text status:message)
                button "no"
                  goto_backward
              else
                [Only the administrator can do that !]


            page button "Build the bootable USB key" noeol
              if allowed:"administrator"
                      file_tree_delete "file:/mnt/target/"
                      console "done." eol
                      if status=success
                        goto_backward
                      else
                        text "failed: "+status:message
                    else
                      console "failed." eol
                      [Failed to engrave the bootable CD for
                      [Error message is: ] ; eol
                      fixed (text status:message)
                button "no"
                  goto_backward
              else
                [Only the administrator can do that !]


            page button "Build the bootable USB key" noeol
              if allowed:"administrator"
                var Str device
                part scan
                  for (var Int i) 7 0 step -1
                    device := "device:/sd"+(character "a":number+i)
                    if filesystem_bus:device="usb"
                      leave scan
                  [Could not find USB key device.]
                  return
                title "Build a bootable USB key"
                table columns 1 border 0
                  cell color (color hsl 0 50 75)
                title "Build a bootable USB key"
                table columns 1 border 0
                  cell color (color hsl 0 50 75)
                    [This will eraze all your datas on /dev/
                    text "This will eraze all your datas on "+device+" device, so you should absolutely not do that if it is one of your SCSI or SATA disks."
                table columns 4 border 0
                  cell
                    highlight "warning:"
                  cell
                    [Selecting yes will eraze your] ; eol
                  cell
                    fixed [embedded:/usr/src/linux/] ; eol
                    fixed [embedded:/usr/src/pcmcia-cs/] ; e
                    fixed [embedded:/usr/src/alsa-driver-xxx
                    fixed (text "embedded:/export/diskless/"
                  cell
                    [directories.]
                if (file_query "file:/fullpliant/archive/"+k
                  var Str key := shunt (file_query "file:/fu
                  select "What about the site key ? " (var S
                    option "do nothing" ""
                    if key="keep_site_key"
                      option "keep existing one" "keep_site_
                    option "generate a new one" "generate_si
                table columns 4 border 0
                  cell
                    highlight "warning:"
                  cell
                    [Selecting yes will eraze your] ; eol
                  cell
                    fixed [embedded:/usr/src/linux/] ; eol
                    fixed [embedded:/usr/src/pcmcia-cs/] ; e
                    fixed [embedded:/usr/src/alsa-driver-xxx
                    fixed (text "embedded:/export/diskless/"
                  cell
                    [directories.]
                if (file_query "file:/fullpliant/archive/"+k
                  var Str key := shunt (file_query "file:/fu
                  select "What about the site key ? " (var S
                    option "do nothing" ""
                    if key="keep_site_key"
                      option "keep existing one" "keep_site_
                    option "generate a new one" "generate_si
                input "USB key device: " device
                var Str format := "yes"
                select "Do you want to format USB key: " (va
                  option "yes" "yes"
                  option "no" "no"
                [Do you really want to build the USB key]
                page button "yes" noeol
                  kernel_load_module "scsi_mod"
                  kernel_load_module "sd_mod"
                  kernel_load_module "uscore"
                  kernel_load_module "usb-uhci" # 2.4
                  kernel_load_module "usb-ohci" # 2.4
                  kernel_load_module "ehci-hcd" # 2.4
                  kernel_load_module "uhci_hcd" # 2.6
                  kernel_load_module "ohci_hcd" # 2.6
                  kernel_load_module "ehci_hcd" # 2.6
                  kernel_load_module "usb-storage" # 2.4
                  kernel_load_module "usb_storage" # 2.6
                  sleep 1
                  if format="yes"
                var Str format := "yes"
                select "Do you want to format USB key: " (va
                  option "yes" "yes"
                  option "no" "no"
                [Do you really want to build the USB key]
                page button "yes" noeol
                  kernel_load_module "scsi_mod"
                  kernel_load_module "sd_mod"
                  kernel_load_module "uscore"
                  kernel_load_module "usb-uhci" # 2.4
                  kernel_load_module "usb-ohci" # 2.4
                  kernel_load_module "ehci-hcd" # 2.4
                  kernel_load_module "uhci_hcd" # 2.6
                  kernel_load_module "ohci_hcd" # 2.6
                  kernel_load_module "ehci_hcd" # 2.6
                  kernel_load_module "usb-storage" # 2.4
                  kernel_load_module "usb_storage" # 2.6
                  sleep 1
                  if format="yes"
                    partition_format "device:/sda" "ext2" ""
                  var ExtendedStatus status := filesystem_mo
                    partition_format device "ext2" "name [dq]pliant_usb[dq]"
                  var ExtendedStatus status := filesystem_mount device "file:/mnt/target/" ""
                  if status=success
                    status := install_tree c "file:/mnt/targ
                    if status=success
                      update_rights c "file:/mnt/target/"
                  if status=success
                    status := install_tree c "file:/mnt/targ
                    if status=success
                      update_rights c "file:/mnt/target/"
                      status := lilo_install c "file:/mnt/ta
                      status := lilo_install c "file:/mnt/target/" device c:env:"partition":"root":"device" c:env:"kernel":"constant":"options" ""
                    filesystem_dismount "file:/mnt/target/"
                  if status=success
                    goto_backward
                  else
                    [Failed to record USB key] ; eol
                    [Error message is: ] ; eol
                    fixed (text status:message)
                button "no"
                  goto_backward
              else
                [Only the administrator can do that !]
            button "and the boot floppy"
              if allowed:"administrator"
                title "Build the boot floppy for '"+keyof:c+
                para
                  [Please insert a floppy in this computer d
                para
                  highlight "warning: " ; [The floppy conten
                    filesystem_dismount "file:/mnt/target/"
                  if status=success
                    goto_backward
                  else
                    [Failed to record USB key] ; eol
                    [Error message is: ] ; eol
                    fixed (text status:message)
                button "no"
                  goto_backward
              else
                [Only the administrator can do that !]
            button "and the boot floppy"
              if allowed:"administrator"
                title "Build the boot floppy for '"+keyof:c+
                para
                  [Please insert a floppy in this computer d
                para
                  highlight "warning: " ; [The floppy conten
                select "Mode: " (var Str mode)
                  option "Physical floppy" "physical"
                  option "store image to embedded:/tmp/floppy.dd" "store"
                button "Build the floppy"
                button "Build the floppy"
                  var ExtendedStatus status := install_flopp
                  var ExtendedStatus status := install_floppy c (shunt mode="store" "embedded:/tmp/floppy.dd" "device:/fd0") "device:/sda" ""
                  if status=success
                    goto_backward
                  else
                    [Failed to build the boot floppy for ] ;
                    para
                      fixed (text status:message)
              else
                [Only the administrator can do that !]


          button "Make the new system bootable"
            if allowed:"administrator"
              var Str root := c:env:"partition":"root":"devi
              var Str distrib := c:env:"pliant":"system":"di
              title "Make the system bootable"
              para
                var Str sroot := root
                [The ] ; text distrib ; [ system is installe
              para
                  if status=success
                    goto_backward
                  else
                    [Failed to build the boot floppy for ] ;
                    para
                      fixed (text status:message)
              else
                [Only the administrator can do that !]


          button "Make the new system bootable"
            if allowed:"administrator"
              var Str root := c:env:"partition":"root":"devi
              var Str distrib := c:env:"pliant":"system":"di
              title "Make the system bootable"
              para
                var Str sroot := root
                [The ] ; text distrib ; [ system is installe
              para
                var Str gbd := "hd0"
                input "GRUB boot drive: " gbd
                var Str gbp := "hd0,0"
                input "GRUB boot partition: " gbp
              para
                var Str lbd := "device:/hda"
                var Str raid := c:env:"partition":"root":"ra
                if (root parse "device:/sd" any) or (root pa
                  lbd := "device:/sda"
                var Str boot := c:env:"hardware":"disk":"boo
                if boot<>""
                  lbd := boot
                input "Lilo boot drive: " lbd
                var Str geometry := "lba32"
                select "Lilo drive access mode: " geometry
                  option "auto select" ""
                  option "32 bits linear" "lba32"
                  option "24 bits linear" "linear"
                  option "old bios mode" "chs"
                var Str lbd := "device:/hda"
                var Str raid := c:env:"partition":"root":"ra
                if (root parse "device:/sd" any) or (root pa
                  lbd := "device:/sda"
                var Str boot := c:env:"hardware":"disk":"boo
                if boot<>""
                  lbd := boot
                input "Lilo boot drive: " lbd
                var Str geometry := "lba32"
                select "Lilo drive access mode: " geometry
                  option "auto select" ""
                  option "32 bits linear" "lba32"
                  option "24 bits linear" "linear"
                  option "old bios mode" "chs"
              para
                var Str gbd := "hd0"
                input "GRUB boot drive: " gbd
                var Str gbp := "hd0,0"
                input "GRUB boot partition: " gbp
              var Str options := c:env:"kernel":"constant":"
              input "Extra Linux kernel options: " options
              table columns 2 border 0
                cell (highlight "warning:")
                cell [If you had a working operating system 
              para
                [You are going to set the disk boot sector s
              [Now install: ]
              var Str options := c:env:"kernel":"constant":"
              input "Extra Linux kernel options: " options
              table columns 2 border 0
                cell (highlight "warning:")
                cell [If you had a working operating system 
              para
                [You are going to set the disk boot sector s
              [Now install: ]
              button "GRUB" noeol
                var Str grub_options := ""
                if true # this_computer:env:"pliant":"system
                  grub_install "file:/mnt/target/" gbd gbp
                  filesystem_mount sroot "file:/mnt/target/"
                  update_rights c "file:/mnt/target/"
                  grub_configure c "file:/mnt/target/" gbd g
                  filesystem_dismount "file:/mnt/target/"
                else
                  grub_install "file:/" gbd gbp
                  update_rights c "file:/"
                  grub_configure c "file:/" gbd gbp root opt
                goto_backward
              button "LILO" noeol
                var Str lilo_options := ""
                if geometry<>""
                  lilo_options += " geometry "+string:geomet
                if true # this_computer:env:"pliant":"system
                  filesystem_mount sroot "file:/mnt/target/"
                  update_rights c "file:/mnt/target/"
                  var Status status := lilo_install c "file:
                  filesystem_dismount "file:/mnt/target/"
                else
                  update_rights c "file:/"
                  var Status status := lilo_install c "file:
                if status=success
                  goto_backward
                else
                  [Failed to make the system bootable throug
              button "LILO" noeol
                var Str lilo_options := ""
                if geometry<>""
                  lilo_options += " geometry "+string:geomet
                if true # this_computer:env:"pliant":"system
                  filesystem_mount sroot "file:/mnt/target/"
                  update_rights c "file:/mnt/target/"
                  var Status status := lilo_install c "file:
                  filesystem_dismount "file:/mnt/target/"
                else
                  update_rights c "file:/"
                  var Status status := lilo_install c "file:
                if status=success
                  goto_backward
                else
                  [Failed to make the system bootable throug
              button "GRUB" noeol
                var Str grub_options := ""
                if true # this_computer:env:"pliant":"system":"medium"="nfs" or this_computer:env:"pliant":"system":"medium"="cdrom"
                  grub_install "file:/mnt/target/" gbd gbp
                  filesystem_mount sroot "file:/mnt/target/" "nocheck"
                  update_rights c "file:/mnt/target/"
                  grub_configure c "file:/mnt/target/" gbd gbp root options grub_options
                  filesystem_dismount "file:/mnt/target/"
                else
                  grub_install "file:/" gbd gbp
                  update_rights c "file:/"
                  grub_configure c "file:/" gbd gbp root options grub_options
                goto_backward
              button "none"
                goto_backward
            else
              [Only the administrator can do that !]


if allowed:"administrator"
  input "Computer name: " (var Str sid) noeol
  var Str cid := ""
  button "Create the new computer" noeol
    if not (exists computer:sid)
      computer create sid
      if cid<>""
        data_copy computer:cid computer:sid
    reload_page
  button "Delete the computer"
    computer delete sid
    reload_page
  input "... as a copy of: " cid
              button "none"
                goto_backward
            else
              [Only the administrator can do that !]


if allowed:"administrator"
  input "Computer name: " (var Str sid) noeol
  var Str cid := ""
  button "Create the new computer" noeol
    if not (exists computer:sid)
      computer create sid
      if cid<>""
        data_copy computer:cid computer:sid
    reload_page
  button "Delete the computer"
    computer delete sid
    reload_page
  input "... as a copy of: " cid