What's new

Custom firmware build for R7800 v. 1.0.2.33SF

  • SNBForums Code of Conduct

    SNBForums is a community for everyone, no matter what their level of experience.

    Please be tolerant and patient of others, especially newcomers. We are all here to share and learn!

    The rules are simple: Be patient, be nice, be helpful or be gone!

Hi,

So far so good de custom FW from Voxel, Internet page loading quickly and fast. TOP
@Voxel; maybe is it possible to turn Out/On DHCP in the logfile, Every day I find in the logs DHCP to 192.168.24.xxx

DHCP Out/On
View attachment 9896


Thanks


PS: One golden rule in live; Netgear build the hardware, Voxel build the software


Greetz Carolus

It is problematic. CGI processor is included into GPL in binary form. So I cannot change it. But its modification is needed to implement your request...

Voxel.
 
Hey Voxel.
I had some shell scripts that used "cd /opt/somedir" to set the working directory. now that kind of shell scripts dont work anymore. any idea why ?

example:
Code:
 #!/bin/sh
cd /opt/var/log/
touch test2.txt
but when i execute the script from shell the file test2.txt is created in the same directory with the script i execute, not in the "/opt/var/log/" .
this is the error i see in the shell: "can't cd to /opt/var/log/"

but if i execute "cd /opt/var/log/" directly in the shell it's working without any error.

this used to work, but i reinstalled entware on a different usb stick and now it dont work anymore.

any idea why CD in the shell scripts don't work anymore?
 
this used to work, but i reinstalled entware on a different usb stick and now it dont work anymore.

any idea why CD in the shell scripts don't work anymore?

Looks as /opt just does not exist at the moment of script execution. Just try to add debug printouts to your script. Something like:
Code:
#!/bin/sh

pwd > /tmp/script.log

cd /opt/var/log/

pwd >> /tmp/script.log
ls  /opt/ >> /tmp/script.log
ls  / >> /tmp/script.log

touch test2.txt

Voxel.
 
Code:
/root
/root
bin
etc
home
leafp2p
lib
rcagent
remote
root
sbin
share
test.sh
test2.sh
tmp
usr
var
version
www
xagent
bin
cloud_version
default_language_version
dev
etc
firmware_region
firmware_time
firmware_version
hardware_version
hipplay
home
hw_id
lib
mnt
module_name
opt
overlay
proc
rom
root
sbin
sys
tmp
usr
var
www
this is the script.log
as you can see the /opt/ is there.

i think it's time for a firmware update :) I'm on 1.0.2.15SF ... it was stable for 7 months until 1 month ago when strange things started to happen.
 
Code:
/root
/root
bin
etc
home
leafp2p
lib
rcagent
remote
root
sbin
share
test.sh
test2.sh
tmp
usr
var
version
www
xagent
bin
cloud_version
default_language_version
dev
etc
firmware_region
firmware_time
firmware_version
hardware_version
hipplay
home
hw_id
lib
mnt
module_name
opt
overlay
proc
rom
root
sbin
sys
tmp
usr
var
www
this is the script.log
as you can see the /opt/ is there.

i think it's time for a firmware update :) I'm on 1.0.2.15SF ... it was stable for 7 months until 1 month ago when strange things started to happen.

Yes, time to update. Latest is not less stable.

Regarding your script. It fails to change dir to /opt/var/log Better to remove other printouts and add instead "ls /opt/var/" and "ls /opt/var/log/"

Well, forum robot blocks my attempt to write the command "ls mines l". Just add above "minus l" into ls command argument.

Voxel.
 
1) i have also tried what you suggested.
Code:
/opt
/opt
drwxr-xr-x    2 root     root         4096 Jun  2 15:53 lock
drwxr-xr-x    2 root     root         4096 Jun  2 15:53 log
drwxr-xr-x    2 root     root         4096 Jun 15 08:39 opkg-lists
drwxr-xr-x    2 root     root         4096 Jun  2 15:53 run
as you can see the /opt/var/log/ exist.

2) i have installed 1.0.2.33SF , i reinstalled the entware using the latest version that i found on your site.

when i try to execute CD in a shell script ... the same problem. i don't really understand what has happened. the only thing i made different from my last install was to format my USB stick from the router itself (not from linux computer) using command "mkfs.ext3 –L optware /dev/sda1"

first time i have used Windows to format the usb stick not Linux. https://www.myopenrouter.com/comment/40168#comment-40168

now, when i type "fdisk -l" i see
Code:
Disk /dev/sda: 7.4 GiB, 7900397568 bytes, 15430464 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x022f8b2a

Device     Boot Start      End  Sectors  Size Id Type
/dev/sda1  *     2048 15430463 15428416  7.4G  7 HPFS/NTFS/exFAT
strange that type is not "ext3".
maybe the format of the stick didn't work correctly ? is it still NTFS ? :)

seems majority of the entware programs are running fine
 
1) i have also tried what you suggested.
Code:
/opt
/opt
drwxr-xr-x    2 root     root         4096 Jun  2 15:53 lock
drwxr-xr-x    2 root     root         4096 Jun  2 15:53 log
drwxr-xr-x    2 root     root         4096 Jun 15 08:39 opkg-lists
drwxr-xr-x    2 root     root         4096 Jun  2 15:53 run
as you can see the /opt/var/log/ exist.

2) i have installed 1.0.2.33SF , i reinstalled the entware using the latest version that i found on your site.

when i try to execute CD in a shell script ... the same problem. i don't really understand what has happened. the only thing i made different from my last install was to format my USB stick from the router itself (not from linux computer) using command "mkfs.ext3 –L optware /dev/sda1"

first time i have used Windows to format the usb stick not Linux. https://www.myopenrouter.com/comment/40168#comment-40168

now, when i type "fdisk -l" i see
Code:
Disk /dev/sda: 7.4 GiB, 7900397568 bytes, 15430464 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x022f8b2a

Device     Boot Start      End  Sectors  Size Id Type
/dev/sda1  *     2048 15430463 15428416  7.4G  7 HPFS/NTFS/exFAT
strange that type is not "ext3".
maybe the format of the stick didn't work correctly ? is it still NTFS ? :)

seems majority of the entware programs are running fine

Try to do all from the scratch. BTW, why do you use ext3 but not ext4? The last is more advanced and reliable. IMO something is wrong with permissions. I guess your script is executed with not-root privileges, right? And it fails. And when you run it from console, you run it as a root. Maybe spoiled filesystem, or it is really mounted as not Linux partition or whatever else. I would suggest to delete partition, create it again as a Linux (fdisk) and then format it by mkfs.ext4.

Voxel.
 
IMO something is wrong with permissions. I guess your script is executed with not-root privileges, right? And it fails. And when you run it from console, you run it as a root. Maybe spoiled filesystem, or it is really mounted as not Linux partition or whatever else. I would suggest to delete partition, create it again as a Linux (fdisk) and then format it by mkfs.ext4.
the purpose of the script is to be usable as cron job. i used to have 5 cron scripts that worked perfect for 6 months and after moving entware to another USB stick they stop working anymore.
By trial and error tests I determined that they don't work because CD command don't work anymore in script. But it seems CD command works perfectly from the shell. So I had to replace the relative links with absolute links to make all my old scripts work again with cron.

1) I have executed the script from shell using:
cd "/opt/somedir"
./test.sh"
logged as root
2) I have also executed "test.sh" using cron, and I have checked (with htop) cron service is launched by root user.
my entware/dropbear user config uses symlinks to router users (the files in opt/etc/ are symlinks to /etc/) . so my root user is the root of the router NOT the root of entware (alternative installation).

Both metods are not working!

So until today I have tested this:
- tried with old entware (december 2016)
- tried new entware version (june 2017)
- tried with USB stick, tried with esata SSD
- tried format EXT2 and EXT3 (to both usb stick and esata ssd)
- tried old firmare 1.0.2.15SF
- tried new firmware 1.0.2.33SF
- reseted router settings from software and manually reconfigured them (like 3-4 times before and after upgraded the firmware), visually checked nvram ("nvram show") from the shell to see I found something strange.

IT'S NOT WORKING and now the entware drive is Linux type for sure:
"fdisk -l"
Code:
Disk /dev/sda: 55.9 GiB, 60022480896 bytes, 117231408 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0xe3897863

Device     Boot Start       End   Sectors  Size Id Type
/dev/sda1        2048 117231407 117229360 55.9G 83 Linux
as you can see partition type is Linux now. this is my esata drive.


What i did not tried is to do yet is:
- check if the problem with CD in the scripts is the same if I use router flash memory (no usb/esata connected). so script to be in router flash and also cd command (working directory) to be on router flash.
- remake the partitions of external drives (usb, esata)
- format partions as EXT4

P.S. is there an utility/command to check if router flash disk have errors?
 
i used to have 5 cron scripts that worked perfect for 6 months and after moving entware to another USB stick they stop working anymore.
By trial and error tests I determined that they don't work because CD command don't work anymore in script.

So if it is worked, something is with your new disk, right? BTW, try to redirect stderr output in your script for each of command to your log-file with printouts. What errors this "CD" displays in stderr (not stdout).

so my root user is the root of the router NOT the root of entware

Maybe you also should try not /bin/sh but /opt/bin/sh from Entware.


is there an utility/command to check if router flash disk have errors?

You mean nand-memory of router? Probably no such utility.

Voxel.
 
So if it is worked, something is with your new disk, right?
Maybe is something with the disk, but I have tried installing entware on a 8GB usb stick and a 60GB esata ssd. and both have the same problem with CD. Yesterday when I discovered the USB stick is NTFS I was sure this is the problem. But after that I formatted the esata ssd as ext3 , reinstalled entware, but the problem remain.

And I don't understand what is happening because I did the same things that i did with my former 16GB usb stick that used to work fine.

You mean nand-memory of router? Probably no such utility.
Yes, for checking nand-memory of the router.
One month ago when my 16GB usb stick died, i tried all kind of weird commands and utilities trying to recover the data from the stick. Maybe i screwed something from the nand-memory of the router where the operating system files are.
 
Last edited:
Maybe is something with the disk, but I have tried installing entware on a 8GB usb stick and a 60GB esata ssd. and both have the same problem with CD. Yesterday when I discovered the USB stick is NTFS I was sure this is the problem. But after that I formatted the esata ssd as ext3 , reinstalled entware, but the problem remain.

And I don't understand what is happening because I did the same things that i did with my former 16GB usb stick that used to work fine.


Yes, for checking nand-memory of the router.
One month ago when my 16GB usb stick died, i tried all kind of weird commands and utilities trying to recover the data from the stick. Maybe i screwed something from the nand-memory of the router where the operating system files are.

Try to initialize disk from the scratch with ext4 and try to use "#!/opt/bin/sh" in your script. I have no ideas w/o direct access. Also, printout to stderr would help to understand what "cd" command says.

Voxel.
 
OMG ... i found the problem
I used WinSCP+Notepad++ to create, edit and save my shell scripts, editing directly from my Windows to the router.

Last night i have read this
https://stackoverflow.com/a/35626727/4481831
and then is stoke me ... omg i forgot to set EOL to unix in notepad++

all my script are running perfect now
Code:
cd ../test
cd /root/test
both absolute and relative paths.
so many days lost with this problem
 
OMG ... i found the problem
I used WinSCP+Notepad++ to create, edit and save my shell scripts, editing directly from my Windows to the router.

Last night i have read this
https://stackoverflow.com/a/35626727/4481831
and then is stoke me ... omg i forgot to set EOL to unix in notepad++

all my script are running perfect now
Code:
cd ../test
cd /root/test
both absolute and relative paths.
so many days lost with this problem

Non facit nisi ille qui hoc errore deciperis (Latin) :)

Voxel.
 
Non facit nisi ille qui hoc errore deciperis
No idea about the translation but I think I got the idea. :)

Well if you ask me the people who make software should make everything was is possible to not let peoples make silly mistakes like this one.

In this case when you detect "#!/bin/sh" at the beginning of a file ... is't that clear enough that file is destined for UNIX and you should use unix end of line format when save?
Disappointed by the Notepad++ programmers .
 

Latest threads

Support SNBForums w/ Amazon

If you'd like to support SNBForums, just use this link and buy anything on Amazon. Thanks!

Sign Up For SNBForums Daily Digest

Get an update of what's new every day delivered to your mailbox. Sign up here!

Staff online

Top