Fog v1.2.0 - How to stop client "Disk surface Test" results window closing ?

  • Hi everyone, I’m hoping somebody can point me in the right direction please ?

    I have Fog 1.2.0 (stable release version) installed on my new server and it is working beautifully - kudos and thanks to all of the developers.

    I had modified the init.gz image on my old server which was running Fog 0.32 so that when I used the Basic Tasks > Advanced > Disk Surface Scan functionality I could make the client sit and wait for a keypress. In this way I was able to leave a group of client machines testing their hdd’s, go off and do something else and come back later to look at the results and hence know if I needed to swap a faulty hdd out before re-imaging.

    Previously I’d just added a line: read -p “Any key to continue…” at the end of the relevant script file, but in Fog 1.2.0 the relevant files have changed and I’m at a loss as to what file to edit now and how to get to it within the boot image ?

    Kind Regards,

  • Hi Tom,

    Thanks for the update I’d forgotten that init_32 would also need to be amended.

    One thing though, on my box (Ubuntu 12.04 LTS alternate + added desktop + Webmin) there is no /var/www/fog/html folder, hence i’d gone to /var/www/fog/service/ipxe

    My original posting worked, at least for init.xz anyway. The test laptop was happily sitting there waiting for a keypress when I woke up this morning. Perhaps the filepath has changed between the latest and stable releases of Fog ? Anyway I’m a happy bunny.

    Would it be possible to add this change to the next version please ? It doesn’t make any sense for badblocks to write test results to the screen and then allow a reboot before you’ve had a chance to see them does it ?

    Kind Regards,

  • Senior Developer

    To help out:
    [code]cd /var/www/fog/html
    mkdir mountdir
    xz -d init.xz
    mount -o loop init mountdir
    Add the line after line 50:
    For vi:
    [code]vi mountdir/bin/fog.surfacetest
    read -p “Any key to continue…”;

    Copy the file so you can fix init_32.xz as well:
    [code]cp mountdir/bin/fog.surfacetest ./[/code]
    Unmount the mountdir and recompress the init:
    [code]umount mountdir
    xz -C crc32 -9 -z init

    Run these commands to fix init_32.xz as well:
    [code]xz -d init_32.xz
    mount -o loop init_32 mountdir
    cp ./fog.surfacetest mountdir/bin/fog.surfacetest
    umount mountdir
    xz -C crc32 -9 -z init_32
    rm -rf mountdir

    You should be all set.

  • Apologies - the first line should read cd /var/www/fog/service/ipxe

    The fog.surfacetest file can be found within /var/www/fog/service/ipxe/mountdir/bin

    Should have made better notes as I was doing this ! :oops:

  • Solved I think… In case anyone else is wondering the same thing…

    I happened on an earlier forum post from ‘G0dzilla’ here where somebody was trying to get Clam AV working.


    Using the information within I realised that i needed to modify /var/www/fog/service/ipxe/init.xz - it needs to be decompressed and temporarily mounted first to allow the fog.surfacetest file to be edited and then compressed again afterwards.

    So basically:

    cd /var/www/html/fog/service/ipxe
    xz -d init.xz
    mkdir mountdir
    mount -o loop init mountdir
    cd mountdir
    Edit the fog.surfacetest file to add a line: read -p “Any key to continue…”; just before the script would normally end
    Save the file changes
    cd …
    umount mountdir
    xz -z -9 -C crc32 init
    rmdir mountdir

    That’s it I hope - just testing now.

    Thanks for the inspiration G0dzilla !

    Kind Regards,