Netgate Discussion Forum
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Search
    • Register
    • Login

    Specifying System ID on non-Netgate Hardware?

    Scheduled Pinned Locked Moved General pfSense Questions
    19 Posts 4 Posters 1.5k Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • bingo600B
      bingo600 @stephenw10
      last edited by bingo600

      @stephenw10

      He..He
      This is what my Qotom reports

      /root: /bin/kenv -q smbios.system.product
      To be filled by O.E.M.
      /root:
      
      /root:
      /root: sysctl -n hw.model
      Intel(R) Core(TM) i5-5250U CPU @ 1.60GHz
      /root: sysctl -n hw.ncpu
      4
      /root:
      
      /root: /bin/kenv -q smbios.planar.product
      Q3XXG4-P
      /root:
      

      I might make some fun out of

      if (isset($planar_product[0]) && $planar_product[0] == 'Q3XXG4-P') {
      	if (strpos($hw_model, "i5-5250U") !== false) {
      		    return array('name' => 'Q355G4', 'descr' => 'Qotom Q355G4');
      		} else {
      		    return array('name' => 'Q3XXG4', 'descr' => 'Qotom Q3XXG4');
      		}
      		
      	}
      

      Does one have to reroot/reboot to get the above executed ?

      If you find my answer useful - Please give the post a šŸ‘ - "thumbs up"

      pfSense+ 23.05.1 (ZFS)

      QOTOM-Q355G4 Quad Lan.
      CPUĀ  : Core i5 5250U, Ram : 8GB Kingston DDR3LV 1600
      LANĀ  : 4 x Intel 211, DiskĀ  : 240G SAMSUNG MZ7L3240HCHQ SSD

      1 Reply Last reply Reply Quote 0
      • stephenw10S
        stephenw10 Netgate Administrator
        last edited by

        No the change should be immediate. That code gets run everytime the dashboard is generated, among other things.

        1 Reply Last reply Reply Quote 1
        • T
          TheWaterbug @stephenw10
          last edited by TheWaterbug

          @stephenw10 said in Specifying System ID on non-Netgate Hardware?:

          It would be in this function:
          https://github.com/pfsense/pfsense/blob/master/src/etc/inc/system.inc#L2546

          Steve

          Interesting! From that page:

          	$_gb = exec('/bin/kenv -q smbios.system.product 2>/dev/null', $product);
          	$_gb = exec('/bin/kenv -q smbios.system.maker 2>/dev/null', $maker);
          	$_gb = exec('/bin/kenv -q smbios.bios.version 2>/dev/null', $bios);
          

          On my my Protectli FW4C, from Diagnostics > Command Prompt:

          /bin/kenv -q smbios.system.product
          

          returns "FW4C"

          /bin/kenv -q smbios.system.maker
          

          returns "Protectli"

          and

          /bin/kenv -q smbios.system.version
          

          returns "Ver 1.0"

          So it's definitely possible to determine what box this is.

          I don't read code very well, but I don't see how that function falls through to "pfsense" if it doesn't match any known string pattern.

          bingo600B 1 Reply Last reply Reply Quote 0
          • stephenw10S
            stephenw10 Netgate Administrator
            last edited by

            That's what the last line is:
            https://github.com/pfsense/pfsense/blob/master/src/etc/inc/system.inc#L2719

            T 1 Reply Last reply Reply Quote 1
            • bingo600B
              bingo600
              last edited by bingo600

              Well it worked out fine šŸ‘ 😊

              b4e611b9-2d63-441f-b07d-d69d3a1e0442-image.png

              If you find my answer useful - Please give the post a šŸ‘ - "thumbs up"

              pfSense+ 23.05.1 (ZFS)

              QOTOM-Q355G4 Quad Lan.
              CPUĀ  : Core i5 5250U, Ram : 8GB Kingston DDR3LV 1600
              LANĀ  : 4 x Intel 211, DiskĀ  : 240G SAMSUNG MZ7L3240HCHQ SSD

              1 Reply Last reply Reply Quote 1
              • bingo600B
                bingo600 @TheWaterbug
                last edited by bingo600

                @thewaterbug said in Specifying System ID on non-Netgate Hardware?:

                I don't read code very well, but I don't see how that function falls through to "pfsense" if it doesn't match any known string pattern.

                I would try this

                27b20a25-ec23-4985-a6c3-41f706372cb5-image.png

                After the break; , above the case 'apu1':

                Insert the below code

                		case 'FW4C':
                			if ($maker[0] == "Protectli") {
                				return (array('name' => 'FW4C', 'descr' => 'Protectli FW4C'));
                				}
                                                break;
                

                The file to edit is /etc/inc/system.inc

                Make a backup first: I called it system.inc.org

                /etc/inc: ls -l system.* 
                -rw-r--r--  1 root  wheel  84020 Dec 19 15:21 system.inc
                -rw-r--r--  1 root  wheel  83743 Dec 19 15:19 system.inc.org
                /etc/inc:
                

                If you don't know the vi editor, you might not want to do this ....

                Can nano be installed on a pfSense ?

                Well - It seems like there is a "Gui Editor" under diagnostic šŸ‘
                e7d7186b-21ef-4f08-99c3-f018171aeff4-image.png

                You might be able to do it via that one .... I have not tried it ...

                *** Warning ***
                My guess is if you FSCK system.inc up .... The system would NOT be happy !

                Make sure you have made a Config backup, before playing around.
                That way you can always restore from "scratch"

                "Happy hacking"

                /Bingo

                If you find my answer useful - Please give the post a šŸ‘ - "thumbs up"

                pfSense+ 23.05.1 (ZFS)

                QOTOM-Q355G4 Quad Lan.
                CPUĀ  : Core i5 5250U, Ram : 8GB Kingston DDR3LV 1600
                LANĀ  : 4 x Intel 211, DiskĀ  : 240G SAMSUNG MZ7L3240HCHQ SSD

                T 1 Reply Last reply Reply Quote 1
                • stephenw10S
                  stephenw10 Netgate Administrator
                  last edited by

                  Just so you're aware (in case you didn't realise šŸ˜‰ ) it's extremely unlikely this will ever be included upstream. So you would have to add this back after each upgrade. You might want to make it as a patch to make that easier.

                  Steve

                  bingo600B 1 Reply Last reply Reply Quote 0
                  • bingo600B
                    bingo600 @stephenw10
                    last edited by bingo600

                    @stephenw10
                    If this was for me 😊

                    it's extremely unlikely this will ever be included upstream

                    I didn't even consider it a possibility, to get it "upstreamed".

                    Frankly i couldn't care less, if my system reported the "default"

                    b32929d8-3182-4502-9ce5-17f57451e168-image.png

                    VS - The "patched" version.

                    5d1ee539-3079-4f1a-bcff-ce30f176340c-image.png

                    I know what models (HW) that hide behind my firewalls , don't even need to look at the gui.

                    I took it as a fun exercise, to learn a bit about the pfSense "inners" , and learn that php looks somewhat like "C"

                    But it was fun to do (thnx) šŸ‘

                    /Bingo

                    If you find my answer useful - Please give the post a šŸ‘ - "thumbs up"

                    pfSense+ 23.05.1 (ZFS)

                    QOTOM-Q355G4 Quad Lan.
                    CPUĀ  : Core i5 5250U, Ram : 8GB Kingston DDR3LV 1600
                    LANĀ  : 4 x Intel 211, DiskĀ  : 240G SAMSUNG MZ7L3240HCHQ SSD

                    T 1 Reply Last reply Reply Quote 1
                    • T
                      TheWaterbug @bingo600
                      last edited by

                      @bingo600 said in Specifying System ID on non-Netgate Hardware?:

                      case 'FW4C':
                      if ($maker[0] == "Protectli") {
                      return (array('name' => 'FW4C', 'descr' => 'Protectli FW4C'));
                      }
                      break

                      Success!!

                      75c248bc-fb02-4634-98ea-49adb19b30c3-image.png

                      Thanks!

                      bingo600B 1 Reply Last reply Reply Quote 0
                      • bingo600B
                        bingo600 @TheWaterbug
                        last edited by bingo600

                        @thewaterbug
                        Glad you could use it ... I had "fun" too.

                        Remember the "patch/mod" will disappear when you (pfSense) upgrade the system.

                        If you find my answer useful - Please give the post a šŸ‘ - "thumbs up"

                        pfSense+ 23.05.1 (ZFS)

                        QOTOM-Q355G4 Quad Lan.
                        CPUĀ  : Core i5 5250U, Ram : 8GB Kingston DDR3LV 1600
                        LANĀ  : 4 x Intel 211, DiskĀ  : 240G SAMSUNG MZ7L3240HCHQ SSD

                        1 Reply Last reply Reply Quote 0
                        • T
                          TheWaterbug @stephenw10
                          last edited by TheWaterbug

                          @stephenw10 said in Specifying System ID on non-Netgate Hardware?:

                          That's what the last line is:
                          https://github.com/pfsense/pfsense/blob/master/src/etc/inc/system.inc#L2719

                          Interesting. It might be more useful if the fall-through case returned:

                          smbios.system.maker . " " . smbios.system.product
                          

                          or something similar that didn't rely on parsing and matching product-specific strings.

                          bingo600B 1 Reply Last reply Reply Quote 0
                          • T
                            TheWaterbug @bingo600
                            last edited by

                            @bingo600 said in Specifying System ID on non-Netgate Hardware?:

                            I know what models (HW) that hide behind my firewalls , don't even need to look at the gui.
                            /Bingo

                            In most cases I do, too, because I theme each installation differently.

                            But in this particular case I've been swapping in an APU, an SG-1100, an MBT-2220, and a FW4C amongst 2 different locations, and sometimes 3 different units in 1 location all within 20 minutes, as I'm doing some IPSec throughput comparisons among different hardware. Since I'm uploading the same (or derived from the same) config.xml to different hardware, they look the same, and it would be nice to have explicit confirmation of what model I'm looking at.

                            Yes, the CPU info, etc., does tell me that, but having "FW4C" is a much shorter way of identifying this particular box.

                            1 Reply Last reply Reply Quote 0
                            • bingo600B
                              bingo600 @TheWaterbug
                              last edited by

                              @thewaterbug said in Specifying System ID on non-Netgate Hardware?:

                              @stephenw10 said in Specifying System ID on non-Netgate Hardware?:

                              That's what the last line is:
                              https://github.com/pfsense/pfsense/blob/master/src/etc/inc/system.inc#L2719

                              Interesting. It might be more useful if the fall-through case returned:

                              smbios.system.maker . " " . smbios.system.product
                              

                              or something similar that didn't rely on parsing and matching product-specific strings.

                              I like it the way it is right now

                              As can be seen here
                              https://forum.netgate.com/post/1075848

                              My "Box name" would contain : To be filled by O.E.M.

                              Since i got
                              /root: /bin/kenv -q smbios.system.product
                              To be filled by O.E.M.

                              That would really "hurt" my eyes ...

                              If you find my answer useful - Please give the post a šŸ‘ - "thumbs up"

                              pfSense+ 23.05.1 (ZFS)

                              QOTOM-Q355G4 Quad Lan.
                              CPUĀ  : Core i5 5250U, Ram : 8GB Kingston DDR3LV 1600
                              LANĀ  : 4 x Intel 211, DiskĀ  : 240G SAMSUNG MZ7L3240HCHQ SSD

                              1 Reply Last reply Reply Quote 1
                              • stephenw10S
                                stephenw10 Netgate Administrator
                                last edited by

                                Yeah, it returns 'pfSense' there intentionally. Anything else would be uncontrolled if it's not hardware we know about.

                                1 Reply Last reply Reply Quote 0
                                • First post
                                  Last post
                                Copyright 2025 Rubicon Communications LLC (Netgate). All rights reserved.