Re: [FIRMWARE] Itus Networks Shield Firmware Upgrade *WIP*
Posted by
Roadrunnere42 on
May 21, 2019; 7:07am
URL: https://itus.accessinnov.com/FIRMWARE-Itus-Networks-Shield-Firmware-Upgrade-WIP-tp1726p1747.html
Hi
Here's the code that Itus used to determine the switch position if that helps.
Putting only one image and then adjusting the the config files does make sense but i have to ask why didn't Itus do that?
I will send you the tgz files.
Roadrunnere42
######################################################################
###### Function To Determine Shields Operating Mode (All Modes) ######
######################################################################
determine_shield_mode () {
if [ `df -h | grep mmcblk* | awk '{ print substr( $0, 6, 14 ) }'` ]; then
disk_partition=`df -h | grep mmcblk* | awk '{ print substr( $0, 6, 14 ) }'`
if [ $disk_partition = mmcblk0p2 ]; then
shield_mode=Router
elif [ $disk_partition = mmcblk0p3 ]; then
shield_mode=Gateway
elif [ $disk_partition = mmcblk0p4 ]; then
shield_mode=Bridge
else
echo -e "Unable to Determine the Shields Operation Mode (Router, Bridge, Gateway) -- \e[31m**SCRIPT FAILED**\e[39m (determine_shield_mode)" >> $script_log_file
fi
else
echo -e "Unable to Determine the Shields Operation Mode (Router, Bridge, Gateway) -- \e[31m**SCRIPT FAILED**\e[39m (determine_shield_mode)" >> $script_log_file
fi
}
On Mon, 20 May 2019 at 20:06, Grommish [via Itus Networks Owners Forum] <
[hidden email]> wrote:
Ok.. I need some feedback.
First, I got the front "M" LED working, 3 colors, 3 modes.. Yay..
Second, I found a way to read the Mode switch position, which means I can read the switch, and set the LED.
Of course, this also means I can read the switch and load a given configuration once booted.
So the question is, should we continue to split the firmware into 3 image files? I mean, the box has the rootfs that the Image itself gets loaded into at boot.
root@OpenWrt:/# df -h
Filesystem Size Used Available Use% Mounted on
rootfs 460.0M 32.1M 427.9M 7% /
tmpfs 474.6M 72.0K 474.5M 0% /tmp
tmpfs 512.0K 0 512.0K 0% /dev
/dev/mmcblk1p1 1022.0M 497.4M 524.6M 49% /overlay
/dev/mmcblk1p4 820.6M 892.0K 777.3M 0% /overlay2
rootfs is the image file that is loaded, and is 460MB
mmcblk1p1 (where the images and uboot is stored) is 1GB in size
Each of the /extroot partitions are 820MB (x3)
Nothing in the image file survives a reboot, that is what the extroot is for. But, the image and everything is can hold (like the plugins, apps, etc) can be HUGE and the configs, rules, etc are held in /extroot.
If I can read the front-panel switch and determine the "mode", couldn't we just put the config files for each mode side-by-side (or defined by a env variable set at boot) and just load the config files based on it?
Also, Road, can you re-send me those tgz files you made for me when you get a chance? I had to blow up my Linux install before I moved them off :( Good news is that most of the time I spent on the OpenWrt image was in figuring out how things work, so rebuilding what I lost (as far as progress) was easy.