• Recent
    • Unsolved
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Register
    • Login
    1. Home
    2. Kazso
    3. Topics
    K
    • Profile
    • Following 0
    • Followers 0
    • Topics 2
    • Posts 5
    • Best 1
    • Controversial 0
    • Groups 0

    Topics created by Kazso

    • K

      Solved Wake on LAN not working after deploying with shutdown

      FOG Problems
      • • • Kazso
      3
      0
      Votes
      3
      Posts
      565
      Views

      K

      Thanks for clarifying it.
      The default bzImage kernel already had the network drivers needed for my setup (onboard Realtek NIC). I checked the WoL status of the ethernet adapter with ethtool. It showed:

      Supports Wake-on: pumbg Wake-on: d

      So WoL was supported, but disabled.
      Then I followed this guide to enable WoL on boot: https://wiki.archlinux.org/title/Wake-on-LAN
      I created the /etc/udev/rules.d/81-wol.rules file in init.xz and init_32.xz, and added this rule:

      ACTION=="add", SUBSYSTEM=="net", ATTR{address}!="00:00:00:00:00:00", RUN+="/usr/sbin/ethtool -s $name wol g"

      I use ATTR{address} instead of NAME, so this rule would apply to any network interface (except loopback), regardless of the interface name.
      With this rule in place I can wake up computers after a shutdown task (deploy with shutdown or capture with shutdown).

      TLDR; I only needed to add an udev rule to the pre-built init.xz and init_32.xz (https://github.com/FOGProject/fos/releases/latest) to enable WoL.

    • K

      Adding custom advanced tasks or modifying existing ones?

      FOG Problems
      • • • Kazso
      3
      0
      Votes
      3
      Posts
      2.8k
      Views

      N

      For the custom task to clear itself from Active Tasks you may be able to switch out pxelinux with ipxe. Using the following embedded script to undionly.kpxe will send the mac to a php script on your web server which can delete the task. This method would delete the active task before it has finished though which may not be desirable in your environment.

      -fogboot.ipxe

      [CODE]#!ipxe
      dhcp
      chain http://1.1.1.1/images/boot.php?mac=${net0/mac}&asset=${asset:uristring}
      boot[/CODE]

      -build command
      [CODE]make bin/undionly.kpxe EMBED=fogboot.ipxe[/CODE]

      -sample boot.php
      [CODE]<?php
      $mac = urldecode($_GET[‘mac’]);
      // Do some stuff with the mac here…

      $fogServer = “1.1.1.1”;
      $kernel = “images/bzImage”;
      $kernelOptions = “root=/dev/ram0 rw ramdisk_size=127000 ip=dhcp dns= mode=onlydebug”
      $initrd = “images/init.gz”;

      echo writeIPXE($fogServer, $kernel, $kernelOptions, $initrd);

      function writeIPXE($fogServer, $kernel, $kernelOptions, $initrd){
      $ipxe = <<<DOC
      #!ipxe
      kernel http://$fogServer/$kernel $kernelOptions
      initrd http://$fogServer/$initrd
      boot
      DOC;
      return $ipxe;
      }
      ?>[/CODE]

    • 1 / 1