Deployment and Imaging Group

 View Only
  • 1.  Custom LinuxPE and site servers

    Posted Apr 28, 2015 04:37 AM

    Hi

    I have two LinuxPE on my main smp server that I have rebuilt the kernel and rootfs and changed the pxelinux.cfg

    So the changed files are:

    C:\Program Files\Altiris\Altiris Agent\Agents\Deployment\SBS\Images\Linux-serial-38400\x86PC\linux
    C:\Program Files\Altiris\Altiris Agent\Agents\Deployment\SBS\Images\Linux-serial-38400\x86PC\rootfs.gz
    C:\Program Files\Altiris\Altiris Agent\Agents\Deployment\SBS\Images\Linux-serial-38400\x86PC\pxelinux.cfg\default

    The changes are done after the LinuxPE is created but we have 3 site servers that do not get the changed files.

    I know I have to edit the pxelinux.cfg\default file on each server as it contains the pxe server ip.

    And the kernel is not specific for any smp/siteserver so that would be enough to copy that.

    But do I need to rebuild the rootfs.gz on all 3 site servers or is enough to copy the one created on smp server to the siteservers?

    Is there a way to do this copying automaticly to all site server?

    Is there any risk of my changes will be lost even is I do not rebuild the linuxPE's?

    //Micke

     

     



  • 2.  RE: Custom LinuxPE and site servers
    Best Answer

    Posted May 18, 2015 01:52 AM

    I have figured it out, linux and rootfs.gz can be copied to all site servers without any modification but to get linux pe to use the correct pxe host the pxelinux.cfg\default needs to be updated individualy on all site servers.

    And I found a way to use the same rootfs.gz on other altiris installations, 

    Edit etc/rc.agent

    vim etc/rc.agent

    Find the section

    cp /tmp/.aex-agent-install-config.xml $AGENT_INSTALL_DIR/

    Before that line add the following text:

    ​for x in `cat /proc/cmdline`; do echo "$x"|grep 'NS_SERVER'&&eval export $x; done
    for x in `cat /proc/cmdline`; do echo "$x"|grep 'PXE_SERVER'&&eval export $x; done
    if [ "$NS_SERVER" != "" ];then
            cat /tmp/.aex-agent-install-config.xml|sed s:\<NSName\>.*\</NSName\>:\<NSName\>$NS_SERVER\</NSName\>:g >/tmp/.aex-agent-install-config.xml.new
            mv /tmp/.aex-agent-install-config.xml.new /tmp/.aex-agent-install-config.xml
    elif [ "$PXE_SERVER" != "" ];then
            cat /tmp/.aex-agent-install-config.xml|sed s:\<NSName\>.*\</NSName\>:\<NSName\>$NS_SERVER\</NSName\>:g >/tmp/.aex-agent-install-config.xml.new
            mv /tmp/.aex-agent-install-config.xml.new /tmp/.aex-agent-install-config.xml
    fi

    And on the siteservers add the following text last in the "append initrd" line in pxelinux.cfg\default file:

    NS_SERVER=[your nsserver hostname/ip]

    To edit your rootfs you can follow the following guide:

    1.Copy rootfs.gz from to you Linux build environment.

    C:\Program Files\Altiris\Altiris Agent\Agents\Deployment\SBS\Images\Linux-serial-115200\x86PC\

    2.Run the following commands:

    mkdir rootfs_mount
    gunzip rootfs.gz
    mount -o loop rootfs rootfs_mount

    3. Do your changes to your roosfs.

    4.Then run the following commands to create the new rootfs.gz

    cd ..
    umount rootfs_mount
    fsck.ext2 -fpcv rootfs
    gzip -9 rootfs