Patch title: Release 90 bulk changes
Abstract:
File: /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
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/] ; eol
                    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
                [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
                        all := remain
                      console "Building CD the embedded boot
                      install_floppy c "file:/mnt/target/boo
                      if rw="store"
                        console "storing CD image" eol
                        status := cdrom_image (var List:File
                      else
                        console "Engraving the CD" eol
                        status := cdrom_engrave "file:/mnt/t
                      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"
                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/
                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 [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
                [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
                        all := remain
                      console "Building CD the embedded boot
                      install_floppy c "file:/mnt/target/boo
                      if rw="store"
                        console "storing CD image" eol
                        status := cdrom_image (var List:File
                      else
                        console "Engraving the CD" eol
                        status := cdrom_engrave "file:/mnt/t
                      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"
                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/
                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/] ; eol
                    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
                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
                  execute "insmod scsi_mod"
                  execute "insmod sd_mod"
                  execute "insmod uscore"
                  execute "insmod usb-uhci"
                  execute "insmod usb-ohci"
                  execute "insmod usb-storage"
                  sleep 1
                  if format="yes"
                    partition_format "device:/sda" "ext2" ""
                  var ExtendedStatus status := filesystem_mo
                  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
                    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
                button "Build the floppy"
                  var ExtendedStatus status := install_flopp
                  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 "Build the tree for installing through NF
              if allowed:"administrator"
                title "Build the tree for installing '"+name
                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 (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
                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
                  execute "insmod scsi_mod"
                  execute "insmod sd_mod"
                  execute "insmod uscore"
                  execute "insmod usb-uhci"
                  execute "insmod usb-ohci"
                  execute "insmod usb-storage"
                  sleep 1
                  if format="yes"
                    partition_format "device:/sda" "ext2" ""
                  var ExtendedStatus status := filesystem_mo
                  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
                    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
                button "Build the floppy"
                  var ExtendedStatus status := install_flopp
                  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 "Build the tree for installing through NF
              if allowed:"administrator"
                title "Build the tree for installing '"+name
                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/] ; eol
                    fixed (text "embedded:/export/diskless/"
                  cell
                    [directories.]
                input "Name of the computer you want to inst
                [Do you really want to build the] ; fixed (t
                button "yes" noeol
                  var ExtendedStatus status := install_tree 
                  if status=success
                    if target_name<>""
                      file_copy "file:/fullpliant/archive/"+
                      var Str embedded := computer:target_na
                      if embedded<>""
                        file_copy "file:/fullpliant/archive/
                    goto_backward
                  else
                    [Failed to build the NFS root tree for ]
                    [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+
                var Str client_ip := name_ip keyof:c
                input "IP address of the target computer: " 
                var Str server_ip := name_ip computer_fullna
                input "IP address of the NFS server: " serve
                var Str net_mask := name_mask keyof:c
                input "Net mask: " net_mask
                para
                  [Please insert a floppy in this computer d
                para
                  highlight "warning: " ; [The floppy conten
                button "Build the floppy"
                  var Str options := "rw nfsroot=/export/dis
                  options += " ip="+client_ip+":"+server_ip+
                  var ExtendedStatus status := install_flopp
                  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 "Build the target system archive" noeol
            if allowed:"administrator"
              var Str distrib := c:env:"pliant":"system":"di
              title "Build file:/fullpliant/archive/"+keyof:
              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 (text "embedded:/export/diskless/"
                  cell
                    [directories.]
                input "Name of the computer you want to inst
                [Do you really want to build the] ; fixed (t
                button "yes" noeol
                  var ExtendedStatus status := install_tree 
                  if status=success
                    if target_name<>""
                      file_copy "file:/fullpliant/archive/"+
                      var Str embedded := computer:target_na
                      if embedded<>""
                        file_copy "file:/fullpliant/archive/
                    goto_backward
                  else
                    [Failed to build the NFS root tree for ]
                    [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+
                var Str client_ip := name_ip keyof:c
                input "IP address of the target computer: " 
                var Str server_ip := name_ip computer_fullna
                input "IP address of the NFS server: " serve
                var Str net_mask := name_mask keyof:c
                input "Net mask: " net_mask
                para
                  [Please insert a floppy in this computer d
                para
                  highlight "warning: " ; [The floppy conten
                button "Build the floppy"
                  var Str options := "rw nfsroot=/export/dis
                  options += " ip="+client_ip+":"+server_ip+
                  var ExtendedStatus status := install_flopp
                  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 "Build the target system archive" noeol
            if allowed:"administrator"
              var Str distrib := c:env:"pliant":"system":"di
              title "Build file:/fullpliant/archive/"+keyof:
              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/] ; eol
                  fixed [file:/mnt/target/] ; eol
                cell
                  [directories.]
              if (file_query "file:/fullpliant/archive/"+key
                var Str key := shunt (file_query "file:/full
                select "What about the site key ? " (var Str
                  option "do nothing" ""
                  if key="keep_site_key"
                    option "keep existing one" "keep_site_ke
                  option "generate a new one" "generate_site
              var Str embedded := c:env:"pliant":"system":"e
              var Str keep_emb := shunt embedded<>"" and (fi
              if keep_emb="yes"
                select "Do you want to keep the old embedded
                  option "yes" "yes"
                  option "no" "no"
              [Do you really want to build the system archiv
              button "yes" noeol
                var ExtendedStatus status := install_tree c 
                if status=success
                  file_tree_create "file:/fullpliant/archive
                  execute "tar -zc -f "+(file_os_name "file:
                  file_tree_delete "file:/mnt/target/"
                  if embedded<>""
                    if keep_emb<>"yes" or (file_query "file:
                      console "Building the embedded system.
                      embedded_install c "file:/mnt/target/"
                      file_tree_create "file:/fullpliant/arc
                      console "Recording the embedded system
                      execute "tar -zc -f "+(file_os_name "f
                      file_tree_delete "file:/mnt/target/"
                  goto_backward
                else
                  [Failed to build the target system archive
                  [Error message is:] ; eol
                  fixed (text status:message)
              button "no"
                goto_backward
            else
              [Only the administrator can do that !]


          button "Make the new system bootable"
            if allowed:"administrator"
              var Str root := c:env:"partition":"root":"devi
              title "Make "+root+" partition bootable"
              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"
                if (root parse "device:/sd" any)
                  lbd := "device:/sda"
                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 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 this_computer:env:"pliant":"system":"medi
                  grub_install "file:/mnt/target/" gbd gbp
                  filesystem_mount root "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
                  fixed [file:/mnt/target/] ; eol
                cell
                  [directories.]
              if (file_query "file:/fullpliant/archive/"+key
                var Str key := shunt (file_query "file:/full
                select "What about the site key ? " (var Str
                  option "do nothing" ""
                  if key="keep_site_key"
                    option "keep existing one" "keep_site_ke
                  option "generate a new one" "generate_site
              var Str embedded := c:env:"pliant":"system":"e
              var Str keep_emb := shunt embedded<>"" and (fi
              if keep_emb="yes"
                select "Do you want to keep the old embedded
                  option "yes" "yes"
                  option "no" "no"
              [Do you really want to build the system archiv
              button "yes" noeol
                var ExtendedStatus status := install_tree c 
                if status=success
                  file_tree_create "file:/fullpliant/archive
                  execute "tar -zc -f "+(file_os_name "file:
                  file_tree_delete "file:/mnt/target/"
                  if embedded<>""
                    if keep_emb<>"yes" or (file_query "file:
                      console "Building the embedded system.
                      embedded_install c "file:/mnt/target/"
                      file_tree_create "file:/fullpliant/arc
                      console "Recording the embedded system
                      execute "tar -zc -f "+(file_os_name "f
                      file_tree_delete "file:/mnt/target/"
                  goto_backward
                else
                  [Failed to build the target system archive
                  [Error message is:] ; eol
                  fixed (text status:message)
              button "no"
                goto_backward
            else
              [Only the administrator can do that !]


          button "Make the new system bootable"
            if allowed:"administrator"
              var Str root := c:env:"partition":"root":"devi
              title "Make "+root+" partition bootable"
              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"
                if (root parse "device:/sd" any)
                  lbd := "device:/sda"
                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 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 this_computer:env:"pliant":"system":"medi
                  grub_install "file:/mnt/target/" gbd gbp
                  filesystem_mount root "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 this_computer:env:"pliant":"system":"medi
                if true # this_computer:env:"pliant":"system":"medium"="nfs" or this_computer:env:"pliant":"system":"medium"="cdrom" or this_computer:env:"pliant":"system":"medium"="usb"
                  filesystem_mount root "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 "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
                  filesystem_mount root "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 "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