Skip navigation

Mounting portal using SMB protocol

Example of mounting string:

mount -t cifs //<yor_ip>/test/web /home/web -o user=user

For mounting the portal while STB get started, it is necessary to add the mounting string in the script ./test.sh

  Example of test.sh file (there is only part of file):
if [ -n "$upd_ver" ]; then
    echo "The update number version: $upd_ver"
    img_version_now=`fw_printenv Image_Version 2>/dev/null`
    img_version_now=${img_version_now#Image_Version=}
    if [ "$upd_ver" -eq "$img_version_now" ]; then
        echo "The number version's equal"
    else
        # We need update
        /usr/bin/update_img.sh $upd_ver $upd_url $upd_mode
    fi
fi
 
############### Mounting of portal from SMB #####################################
 
mount -t cifs //<yor_ip>/test/web /home/web -o user=user
 
#################################################################################
 
if [ "$PORTAL_1$PORTAL_2$PORTAL_DHCP" ]; then
    echo "Loading start page..."
    /usr/share/qt-4.6.0/stbapp -qws -display directfb file:///home/web/index.html
else
    echo "Error loading portal. Service Page"
    /usr/share/qt-4.6.0/stbapp -qws -display directfb /home/web/services.html
fi

Mounting portal using NFS protocol

Put files of the portal to the server in NFS share directory.

String of mounting (for example):

mount -o nolock <your_IP>:/srv/test/web /home/web

To mount the portal while STB is starting, it is required to add next string in the script ./test.sh

  Example of test.sh file (there is only part of file):
if [ -n "$upd_ver" ]; then
    echo "The update number version: $upd_ver"
    img_version_now=`fw_printenv Image_Version 2>/dev/null`
    img_version_now=${img_version_now#Image_Version=}
    if [ "$upd_ver" -eq "$img_version_now" ]; then
        echo "The number version's equal"
    else
        # We need update
        /usr/bin/update_img.sh $upd_ver $upd_url $upd_mode
    fi
fi
 
############### Mounting of portal from SMB #####################################
 
mount -t cifs //<yor_ip>/test/web /home/web -o user=user
 
#################################################################################
 
if [ "$PORTAL_1$PORTAL_2$PORTAL_DHCP" ]; then
    echo "Loading start page..."
    /usr/share/qt-4.6.0/stbapp -qws -display directfb file:///home/web/index.html
else
    echo "Error loading portal. Service Page"
    /usr/share/qt-4.6.0/stbapp -qws -display directfb /home/web/services.html
fi

Loading Rootfs from DHCP

Example based on OS Ubuntu Server 12.04 LTS x86.

Packages: nfs-kernel-server , isc-dhcp-server , openbsd-inetd , tftpd , tftp

More detailed information about firmware loading from DHCP: DHCP server configuration. Loading and updating STB software

  Example of dhcp.conf file:
option ntp-servers 10.1.1.1;
	option domain-name-servers 10.1.1.1;
	authoritative;
	option subnet-mask 255.255.255.0;
	default-lease-time 600;
	max-lease-time 7200;
	allow bootp;
 
 
#############################################################
# Option for Infomir
#############################################################
	option space Infomir;
	option Infomir.autostart         code 1 = text;
	option Infomir.bootargs          code 2 = text;
	option Infomir.mcip              code 3 = ip-address;
	option Infomir.mcport            code 4 = integer 16;
	option Infomir.oppubfile         code 9 = text;
	option Infomir.mcip_img          code 10 = ip-address;
	option Infomir.mcport_img        code 11 = integer 16;
	option Infomir.mcip_mng          code 12 = ip-address;
	option Infomir.mcport_mng        code 13 = integer 16;
	option Infomir.ip_log            code 14 = ip-address;
	option Infomir.port_log          code 15 = integer 16;
	option Infomir.logo_x            code 16 = integer 16;
	option Infomir.logo_y            code 17 = integer 16;
	option Infomir.bg_color          code 18 = integer 32;
	option Infomir.fg_color          code 19 = integer 32;
	option Infomir.VerNumber         code 20 = text;
	option Infomir.DateTime          code 21 = text;
	option Infomir.portal_dhcp       code 22 = text;
	option Infomir.timezone          code 23 = text;
	option Infomir.update_url        code 24 = text;
	option Infomir.update_sboot      code 25 = text;
	option Infomir.update_ver        code 26 = text;
	option Infomir.update_mode       code 27 = text;
	option Infomir.update_sboot_ver  code 28 = text;
 
 
############################## BOOT MAG250 ################################################
###### kernel loading from tftp with rootfs, which is mounted from NFS
 
	class "MAG250_boot" {
	match if (( option vendor-class-identifier="InfomirMAG250boot"));
	filename "mag250/uImage_mag250"; //kernel location
	next-server 10.1.1.1;
	option root-path "10.1.1.1:/srv/mag250"; //rootfs location 
	option ntp-servers 10.1.1.1;
	vendor-option-space Infomir;
	}
 
############################## NETWORK ####################################
 
	subnet 10.1.1.0 netmask 255.255.255.0 {
        option subnet-mask 255.255.255.0;
        next-server 10.1.1.1;
        pool { 
	range 10.1.1.10 10.1.1.254;
        next-server 10.1.1.1;
        option ntp-servers 10.1.1.1;
        	}
	}

Embedded portal loading on STB from shell/console

  • Connect to STB via SSH
  • Stop the stbapp main process:
killall stbapp

Start the embedded portal manually:

. /test.sh

or

/usr/share/qt-4.6.0/stbapp -qws -display directfb /home/web/services.html

Portal loading from shell/console, files are available from HTTP

  • Connect to STB via SSH
  • Run next command:
killall stbapp
/usr/share/qt-4.6.0/stbapp -qws -display directfb http://your_ip/you_portal/index.html

How to enable debug in Embedded portal

For version lower than 0.2.16 - it is necessary to make changes in file /home/web/vars.js

: var debug=0

change to var debug=1

For version 0.2.18 and higher - it is necessary to set the environment variable debug=1

(1 - enabled, 0 or empty value - disabled)

Need Help

Dave is an expert on the MAG STB and the author of this article.

Was this article helpful?

Yes No

Sorry to hear that.
How can we improve this article?

We use cookies in order to optimise our website, provide you with the best possible user experience and help us promote our products. Please read our Cookie Policy to find out how we use cookies and how you can control cookies.
By using this website or closing this message, you acknowledge our Privacy Policy and agree to our use of cookies as described in our Cookie Policy.