Contributions Thread

Installation issues, feature requests, help, etc.

Moderators: Curtis8, A_Null

User avatar
Natan
Site Admin
Posts: 1722
Joined: Sun Nov 20, 2005 12:29 am

Postby Natan » Wed Jun 18, 2008 3:30 pm

Sure. My feeling is that some vars should be usable within the APPEND line, asking PING to use what IP/GW/Netmask PXE has retrieved.

mrralan
Posts: 99
Joined: Thu Mar 06, 2008 8:08 pm

Ping Menu Modifications

Postby mrralan » Wed Aug 06, 2008 3:02 pm

Here is a basic structure for a new menu system in PING. It will be less confusing if the menus only offer 1 option and don't show items relating to other options. It's not easy to show menus in text but I will try.



PING MAIN MENU

Imaging

1) Create An Image
2) Restore An Image


Tools

3) Partition & Format
4) Blank Local Admin Password

------------------------------------



If user selects 1 goto... What partition do you want to image? (User is presented with available partitions)
User makes selection then goto... Where do you want to save the image? (User is presented with the local and/or network locations)
User makes selection and process continues.

If user selects 2 goto... What image do you want to restore? (User is presented with available images)
User makes selection then goto... What partition do want to restore to? (User is presented with available partitions to restore)
user makes selection and process continues.

If user selects 3 goto... Partition & Format menu

If user selects 4 goto... Blank Local Admin Password menu


I haven't used Partitioning or Blanking passwords so I am not sure the options but following along the guidelines of selection 1 and 2 would suffice.

mrralan
Posts: 99
Joined: Thu Mar 06, 2008 8:08 pm

Postby mrralan » Fri Aug 15, 2008 1:48 pm

Any input? Anyone?

User avatar
Curtis8
Site Janitor
Posts: 985
Joined: Thu Mar 01, 2007 3:22 pm
Location: Canada
Contact:

Postby Curtis8 » Fri Aug 15, 2008 7:36 pm

I like it. Simple and straight forward.
Curtis

If you can read this, help me by going to the following link (can only go once per day)
http://s13.bitefight.org/c.php?uid=32058

Thank you

jhurd8025
Posts: 92
Joined: Mon Apr 28, 2008 2:50 pm
Location: Dallas, Texas
Contact:

Postby jhurd8025 » Wed Aug 20, 2008 3:59 pm

I would like to say that NFS works flawless with PING

I've had much less trouble than using smb/cifs.

I think it should be an option to use nfs within the network config section.

mrralan
Posts: 99
Joined: Thu Mar 06, 2008 8:08 pm

Postby mrralan » Tue Aug 26, 2008 12:56 pm

Curtis8 wrote:I like it. Simple and straight forward.


It doesn't appear as if anyone else sees any problems with it either.

jhurd8025
Posts: 92
Joined: Mon Apr 28, 2008 2:50 pm
Location: Dallas, Texas
Contact:

Postby jhurd8025 » Mon Sep 01, 2008 8:26 pm

Hey Natan, Here's the code for IPAPPEND.


Code: Select all

{
    my $flag = 0;

    my(@Config_Fields) = ("IP", "Netmask", "Gateway", "DHCP_Timeout",
           "Server", "Share", "User", "Passwd", "Directory",
           "Image_To_Restore", "Minimize_Before_Storing",
           "Repart", "After_Completion", "Replace_BIOS",
           "CIFS_Preferred", "Zsplit_Preferred", "No_Shell",
           "AUTO", "Cmd_1", "Cmd_2", "Cmd_3", "Restore_Only");

    if(-e "/etc/ping.conf")
    {
   LOG("  Found a [/etc/ping.conf] file.\n");

   open(DB, "/etc/ping.conf");
   while(<DB>)
   {
       s/^\s*//;
       s/\s*$//;
       next unless($_);
       next if(m/^\#/);
       my(@f) = split(/\=/, $_);
       my $V = "";
       if(defined($f[1]))
       {
      $V = $f[1];
       }
       foreach(2..($#f - 1))
       {
      if(defined($f[$_]))
      {
          $V .= "=$f[$_]";
      }
       }
       foreach($f[0], $V)
       {
      s/^\s*//;
      s/\s*$//;
      s/^\"//;
      s/\"$//;
       }
       foreach(@Config_Fields)
       {
      if(lc($_) eq lc($f[0]))
      {
          $P{$_} = $V;
          $flag = 1;
      }
       }
   }
   close(DB);

   if(-e "/proc/cmdline")
   {
       LOG("  Parsing the [/proc/cmdline] file for arguments possibly\n");
       LOG("    passed to the kernel\n");

       open(DB, "/proc/cmdline");
       while(<DB>)
       {
      s/^\s*//;
      s/\s*$//;
      while(m/\"([^\"]+)\"/)
      {
          my $tmp = $1;
          $tmp =~s/\s/£££/g;
          s/\"([^\"]+)\"/$tmp/;
      }
      my(@Params) = split(/ /, $_);

      foreach my $Param (@Params)
      {
          $Param =~s/£££/ /g;
          my(@fields) = split(/=/, $Param);
          if($#fields > 0)
          {
         my $Key = $fields[0];
         my $Value = join("=", @fields[1..$#fields]);

         if($Key =~ m/IP/i)
         {
            my ($p_ip, undef, $p_gw, $p_netmask) = split(/:/, $Value);
            $P{'IP'} = $p_ip;
            $P{'Netmask'} = $p_netmask;
            $P{'Gateway'} = $p_gw;
            $P{'Server'} = $p_gw;
            $flag = 1;
            next;
         }

         foreach(@Config_Fields)
         {
             if(lc($_) eq lc($Key))
             {
            $P{$_} = $Value;
            $flag = 1;
             }
         }
          }
      }
       }
       close(DB);
   }

   foreach(@Config_Fields)
   {
       if(defined($P{$_}))
       {
      LOG("  Found: [$_] = [".((m/^Passwd$/) ? "xxx":$P{$_})."]\n");
       }
   }
    }

User avatar
Natan
Site Admin
Posts: 1722
Joined: Sun Nov 20, 2005 12:29 am

Postby Natan » Tue Sep 02, 2008 1:44 pm

Thanks, Jon. Seems quite good... I'm going to implement it (look for a third beta 2.01.16).

Natan

jhurd8025
Posts: 92
Joined: Mon Apr 28, 2008 2:50 pm
Location: Dallas, Texas
Contact:

Postby jhurd8025 » Thu Sep 04, 2008 9:32 pm

Hey Natan....


let me know if you decide to include this...


If its too much hassel or interupts other users, then no need. I can put it in myself.

User avatar
Natan
Site Admin
Posts: 1722
Joined: Sun Nov 20, 2005 12:29 am

Postby Natan » Thu Sep 04, 2008 10:44 pm

Hi Jon,
No hassle ; but I didn't understand the purpose.

Natan

User avatar
Curtis8
Site Janitor
Posts: 985
Joined: Thu Mar 01, 2007 3:22 pm
Location: Canada
Contact:

Postby Curtis8 » Fri Sep 05, 2008 4:06 pm

From what I understand, IPAPPEND will take the PXE IP info and give it to PING so it does not need to do dhcp to get a new address.
Curtis

If you can read this, help me by going to the following link (can only go once per day)
http://s13.bitefight.org/c.php?uid=32058

Thank you

User avatar
Natan
Site Admin
Posts: 1722
Joined: Sun Nov 20, 2005 12:29 am

Postby Natan » Fri Sep 05, 2008 4:14 pm

That's the point I don't get ! If a DHCP server worked to give the PXE client an address, why wouldn't it work for the shell too ?

Well, unless you have 2 NICs and you want to be absolutely sure the PING script will connect the even NIC that got a PXE launching, and not the second one.

Natan

jhurd8025
Posts: 92
Joined: Mon Apr 28, 2008 2:50 pm
Location: Dallas, Texas
Contact:

Postby jhurd8025 » Wed Sep 17, 2008 2:07 am

Again this probably isnt needed for anyone else, so you can leave it out...

Our envrioment is 99% static ip's. For SOX reasons we only allows DHCP requests to clients identifing themselves with Host Identifier 'PXECLIENT'. So only upon the pxe request will it get a DHCP ip, anything else would not get a dhcp ip. That includes any windows, linux, or unknown server requesting an ip. With the append, I can pass the IP information automaticaly to the kernel if the kernel can accept the parameters.

User avatar
Natan
Site Admin
Posts: 1722
Joined: Sun Nov 20, 2005 12:29 am

Postby Natan » Wed Sep 17, 2008 11:57 am

Understood.

I suggest you add the IPAPPEND parameter to your pxelinux file, and use the Cmd_1 parameter to connect to the network using the collected IP.

This should have 2 advantages :
- solving your problem
- without forcing you to modify the PING script at each new release.

Regards
Natan

jhurd8025
Posts: 92
Joined: Mon Apr 28, 2008 2:50 pm
Location: Dallas, Texas
Contact:

Postby jhurd8025 » Wed Sep 17, 2008 2:43 pm

good idea!


Return to “PING / General Discussions”

Who is online

Users browsing this forum: No registered users and 2 guests