Upgrade problem



  • Hi!

    I have this error when i try to manualy update pfsense Fatal error: Call to undefined function: unlink_file() in /usr/local/www/system_firmware.php on line 59 on built on Tue Sep 1 17:30:52 UTC 2009
    FreeBSD 7.2-RELEASE-p3 i386



  • @simby:

    Hi!

    I have this error when i try to manualy update pfsense Fatal error: Call to undefined function: unlink_file() in /usr/local/www/system_firmware.php on line 59 on built on Tue Sep 1 17:30:52 UTC 2009
    FreeBSD 7.2-RELEASE-p3 i386

    Same for me  ??? Please tell me thare a quick temp fix for this so i dont haveto reinstall again. Howto tempfix would be much appriciated. Thanks.



  • Right, i was panicing. Gave it a second of thought. I open a old file and edit/save. Works upgrading after altering that. Here the working code for me. Took from the pfSense-Full-Update-1.2.3-20090603-1437 build.

    /* $Id$ /
    /

    system_firmware.php
    Copyright (C) 2008 Scott Ullrich sullrich@gmail.comAll rights reserved.

    originally part of m0n0wall (http://m0n0.ch/wall)
    Copyright (C) 2003-2004 Manuel Kasper mk@neon1.net.
    All rights reserved.

    originally part of m0n0wall (http://m0n0.ch/wall)

    Copyright (C) 2003-2004 Manuel Kasper mk@neon1.net.
    All rights reserved.

    Redistribution and use in source and binary forms, with or without
    modification, are permitted provided that the following conditions are met:

    1. Redistributions of source code must retain the above copyright notice,
      this list of conditions and the following disclaimer.

    2. Redistributions in binary form must reproduce the above copyright
      notice, this list of conditions and the following disclaimer in the
      documentation and/or other materials provided with the distribution.

    THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
    INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
    AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
    AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
    OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
    SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
    INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
    CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
    ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
    POSSIBILITY OF SUCH DAMAGE.
    */

    $d_isfwfile = 1;
    require_once("guiconfig.inc");

    $curcfg = $config['system']['firmware'];

    require_once("xmlrpc_client.inc");

    /* Allow additional execution time 0 = no limit. */
    ini_set('max_execution_time', '3600');
    ini_set('max_input_time', '3600');

    /* if upgrade in progress, alert user */
    if(file_exists($d_firmwarelock_path)) {
    $pgtitle = "System: Firmware: Manual Update";
    include("head.inc");
    echo "\n";
    include("fbegin.inc");
    echo "\n";
    print_info_box("An upgrade is currently in progress.

    The firewall will reboot when the operation is complete.

    <center>");
    echo "</center>

    \n";
    include("fend.inc");
    echo "";
    echo "";
    exit;
    }

    if($_POST['kerneltype']) {
    if($_POST['kerneltype'] == "single")
    system("touch /boot/kernel/pfsense_kernel.txt");
    else
    system("echo {$_POST['kerneltype']} > /boot/kernel/pfsense_kernel.txt");
    }

    /* Handle manual upgrade */
    if ($_POST && !file_exists($d_firmwarelock_path)) {

    unset($input_errors);
    unset($sig_warning);

    if (stristr($_POST['Submit'], "Enable"))
    $mode = "enable";
    else if (stristr($_POST['Submit'], "Disable"))
    $mode = "disable";
    else if (stristr($_POST['Submit'], "Upgrade") || $_POST['sig_override'])
    $mode = "upgrade";
    else if ($_POST['sig_no']) {
    if(file_exists("{$g['upload_path']}/firmware.tgz"))
    unlink("{$g['upload_path']}/firmware.tgz");
    }
    if ($mode) {
    if ($mode == "enable") {
    exec_rc_script("/etc/rc.firmware enable");
    conf_mount_rw();
    touch($d_fwupenabled_path);
    } else if ($mode == "disable") {
    exec_rc_script("/etc/rc.firmware disable");
    conf_mount_ro();
    if (file_exists($d_fwupenabled_path))
    unlink($d_fwupenabled_path);
    } else if ($mode == "upgrade") {
    if (is_uploaded_file($_FILES['ulfile']['tmp_name'])) {
    /* verify firmware image(s) /
    if (!stristr($_FILES['ulfile']['name'], $g['platform']) && !$_POST['sig_override'])
    $input_errors[] = "The uploaded image file is not for this platform ({$g['platform']}).";
    else if (!file_exists($_FILES['ulfile']['tmp_name'])) {
    /
    probably out of memory for the MFS /
    $input_errors[] = "Image upload failed (out of memory?)";
    exec_rc_script("/etc/rc.firmware disable");
    if (file_exists($d_fwupenabled_path))
    unlink($d_fwupenabled_path);
    } else {
    /
    move the image so PHP won't delete it */
    rename($_FILES['ulfile']['tmp_name'], "{$g['upload_path']}/firmware.tgz");

    /* check digital signature */
    $sigchk = verify_digital_signature("{$g['upload_path']}/firmware.tgz");

    if ($sigchk == 1)
    $sig_warning = "The digital signature on this image is invalid.";
    else if ($sigchk == 2)
    $sig_warning = "This image is not digitally signed.";
    else if (($sigchk == 3) || ($sigchk == 4))
    $sig_warning = "There has been an error verifying the signature on this image.";

    if (!verify_gzip_file("{$g['upload_path']}/firmware.tgz")) {
    $input_errors[] = "The image file is corrupt.";
    unlink("{$g['upload_path']}/firmware.tgz");
    }
    }
    }

    run_plugins("/usr/local/pkg/firmware_upgrade");

    /* Check for input errors, firmware locks, warnings, then check for firmware if sig_override is set /
                if (!$input_errors && !file_exists($d_firmwarelock_path) && (!$sig_warning || $_POST['sig_override'])) {
                        if (file_exists("{$g['upload_path']}/firmware.tgz")) {
                                /
    fire up the update script in the background */
                                touch($d_firmwarelock_path);
                                $savemsg = "The firmware is now being updated. The firewall will reboot automatically.";
    if(stristr($_FILES['ulfile']['tmp_name'],"bdiff"))
                                mwexec_bg("/etc/rc.firmware delta_update {$g['upload_path']}/firmware.tgz");
    else
    mwexec_bg("/etc/rc.firmware pfSenseupgrade {$g['upload_path']}/firmware.tgz");
                        } else {
                                $savemsg = "Firmware image missing or other error, please try again.";
                        }
                }
    }
    }
    }

    $pgtitle = "System: Firmware: Manual Update";
    include("head.inc");

    ?>

    "") print_info_box($fwinfo); ?>

    <form action="system_firmware.php" method="post">
    $sig_warning = "" . $sig_warning . "
    This means that the image you uploaded " .
    "is not an official/supported image and may lead to unexpected behavior or security " .
    "compromises. Only install images that come from sources that you trust, and make sure ".
    "that the image has not been tampered with.

    ".
    "Do you want to install this image anyway (on your own risk)?";
    print_info_box($sig_warning);
    ?>

    </form>

    <form action="system_firmware.php" method="post" enctype="multipart/form-data">

    |
    $tab_array = array();
    $tab_array[0] = array("Manual Update", true, "system_firmware.php");
    $tab_array[1] = array("Auto Update", false, "system_firmware_check.php");
    $tab_array[2] = array("Updater Settings", false, "system_firmware_settings.php");
    display_top_tabs($tab_array);
    ?>
    |
    |

    | Invoke Manual Upgrade |
    |   |

    Click "Enable firmware
                  upload" below, then choose the image file ()
      to be uploaded.
    Click "Upgrade firmware"
                  to start the upgrade process.

    Firmware image file:

    if(!file_exists("/boot/kernel/pfsense_kernel.txt")) {
      if($g['platform'] == "pfSense") {
    echo "Please select kernel type: ";
    echo "<select name="kerneltype">"; echo "<option value="SMP">Multiprocessor kernel</option>"; echo "<option value="single">Uniprocessor kernel</option>"; echo "<option value="wrap">Embedded kernel</option>"; echo "<option value="Developers">Developers kernel</option>"; echo "</select>";
    echo "

    ";
    }
    }
      ?>
       
     
        You must reboot the system before you can upgrade the firmware.
     
                      |
    |   | Warning: DO NOT abort the firmware upgrade once it
                        has started. The firewall will reboot automatically after
                        storing the new firmware. The configuration will be maintained. |

    |

    </form>/mk@neon1.net/mk@neon1.net/sullrich@gmail.com



  • I just had the same problem a second ago. I SSH'd into the console and selected #11 to reset the webconfigurator and voila! everything is back up.



  • I changed line 59 to just unlink and then removed /tmp/etc/platform. This worked for me …



  • Hope they fix till next snap  :)


  • Rebel Alliance Developer Netgate



  • hi
    error on upgrade
    Fatal error: Call to undefined function: unlink_file() in /usr/local/www/system_firmware.php on line 59

    http://snapshots.pfsense.org/FreeBSD_RELENG_7_2/pfSense_RELENG_1_2/updates/pfSense-Full-Update-1.2.3-20090925-0005.tgz



  • @hrun:

    hi
    error on upgrade
    Fatal error: Call to undefined function: unlink_file() in /usr/local/www/system_firmware.php on line 59

    http://snapshots.pfsense.org/FreeBSD_RELENG_7_2/pfSense_RELENG_1_2/updates/pfSense-Full-Update-1.2.3-20090925-0005.tgz

    The update file isn't going to fix the problem until it's installed. Manually fix as described previously in this thread, then you can upgrade.


Log in to reply