Posted by
user8446 on
May 31, 2019; 2:16am
URL: https://itus.accessinnov.com/FIRMWARE-Itus-Networks-Shield-Firmware-Upgrade-WIP-tp1726p1755.html
This is Roadrunnere42's post... it was causing a redirect on the thread so I had to delete it....
Hi
I tried following what you said about running the new gatewayimage but i can't get it to work. I don't have a dev device called mmcblk01 in the dev folder, can you confirm the device name?
Roadrunnere42
mount /dev/mmcblk01 /overlay
then on your PC
scp ~/Downloads/ItusgatewayImage root@10.10.10.10:/overlay
As an alternative, I've loaded gkermit on the image so you could use minicom to console transfer.
Back to the Shield. Switch the Front-switch to Gateway (Outer) mode
umount /overlay
reboot -f
LuCI - Lua Configuration Interface
On Sat, 25 May 2019 at 20:58, Grommish [via Itus Networks Owners Forum] <[hidden email]> wrote:
For anyone who is decent with bash scripting, I'm trying to do the following, but it keeps returning empty in the init script.
CUR_FS=$(blkid /dev/mmcblk1p3 | awk -F= '{print $3}');
echo "[DEBUG] Shield is in ${SHIELD_MODE} Mode - Using /dev/${MNT_POINT} as ${CUR_FS}" > /dev/kmsg
When I run the command on the box in the shell itself, I get the following:
root@OpenWrt:/# $(blkid /dev/mmcblk1p3 | awk -F= '{print $3}');
/bin/ash: "f2fs": not found
"f2fs" is what it SHOULD report, so that's right (although any suggestions on stripping those double-quotes would be very helpful)
However, what appears in the kernel log:
[ 34.828073] [DEBUG] Shield is in Gateway Mode - Using /dev/mmcblk1p3 as
Eventually, I'll be replacing the hardcoded mmcblk1p3 with another variable that's set by reading the GPIO settings.
GPIO=0
GPIO16=1
GPIO17=2
GPIO=16
echo $GPIO > /sys/class/gpio/export
echo in > /sys/class/gpio/gpio$GPIO/direction
GPIO16=$(cat /sys/class/gpio/gpio${GPIO}/value)
echo $GPIO > /sys/class/gpio/unexport
GPIO=17
echo $GPIO > /sys/class/gpio/export
echo in > /sys/class/gpio/gpio$GPIO/direction
GPIO17=$(cat /sys/class/gpio/gpio${GPIO}/value)
echo $GPIO > /sys/class/gpio/unexport
if [ $GPIO16 -eq 0 ]; then
# Gateway Mode
SHIELD_MODE="Gateway"
MNT_POINT="mmcblk1p3"
else
if [ $GPIO17 -eq 0 ]; then
# Bridge Mode
SHIELD_MODE="Bridge"
MNT_POINT="mmcblk1p4"
else
# Router Mode
SHIELD_MODE="Router"
MNT_POINT="mmcblk1p2"
fi
fi
This allows us to read the Front-switch state and load the config files as appropriate (and/or just load the appropriate mmcblk for the mode)
Getting there! My next steps are to ensure the file system is correct (which is why I really need to get the awk command working), format the block if it isn't setup for f2fs, and copy a seed tgz package to the mount point to get things started. This should let anyone who is coming from the stock Itus images to easily convert over.
Anyway, I know the couple people who are actually following this are away on travel or other things, but maybe they can spot the error I'm having.
Cheers!
Running the latest OpenWrt stable release