What's new

I can't install entware on RT-N66U with firmware 378.51: Read-only file system

  • 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!

decedion

Occasional Visitor
I'm trying to install entware on RT-N66U with firmware 378.51 and usb disk connected but it doesn't install it, it gives errors:
Code:
# entware-setup.sh
 Info:  This script will guide you through the Entware installation.
 Info:  Script modifies only "entware" folder on the chosen drive,
 Info:  no other data will be touched. Existing installation will be
 Info:  replaced with this one. Also some start scripts will be installed,
 Info:  the old ones will be saved on partition where Entware is installed
 Info:  like /tmp/mnt/sda1/jffs_scripts_backup.tgz

 Info:  Looking for available partitions...
[1] --> /tmp/mnt/usb
 =>  Please enter partition number or 0 to exit
[0-1]:
[: bad number
 Info:  selected.

 Info:  Creating /entware folder...
mkdir: can't create directory '/entware': Read-only file system
 Info:  Creating /tmp/opt symlink...
 Info:  Creating /jffs scripts backup...
tar: can't open '/jffs_scripts_backup_2015-03-23_14-59.tgz': Read-only file system
 Info:  Modifying start scripts...
 Info:  Starting Entware deployment....

Connecting to entware.wl500g.info (81.4.122.163:80)
entware_install.sh  100% |****************************************************************************|  1141  0:00:00 ETA
Info: Checking for prerequisites and creating folders...
mkdir: can't create directory '/opt/bin': No such file or directory
mkdir: can't create directory '/opt/etc': No such file or directory
mkdir: can't create directory '/opt/include': No such file or directory
mkdir: can't create directory '/opt/lib': No such file or directory
mkdir: can't create directory '/opt/sbin': No such file or directory
mkdir: can't create directory '/opt/share': No such file or directory
mkdir: can't create directory '/opt/tmp': No such file or directory
mkdir: can't create directory '/opt/usr': No such file or directory
mkdir: can't create directory '/opt/var': No such file or directory
mkdir: can't create directory '/opt/': No such file or directory
mkdir: can't create directory '/opt/': No such file or directory
mkdir: can't create directory '/opt/': No such file or directory
mkdir: can't create directory '/opt/': No such file or directory
Info: Opkg package manager deployment...
./entware_install.sh: cd: line 20: can't cd to /opt/bin
Connecting to entware.wl500g.info (81.4.122.163:80)
opkg  100% |****************************************************************************|  452k  0:00:00 ETA
chmod: /opt/bin/opkg: No such file or directory
./entware_install.sh: cd: line 23: can't cd to /opt/etc
Connecting to entware.wl500g.info (81.4.122.163:80)
opkg.conf  100% |****************************************************************************|  105  0:00:00 ETA
Info: Basic packages installation...
./entware_install.sh: line 27: /opt/bin/opkg: not found
./entware_install.sh: line 28: /opt/bin/opkg: not found
Info: Cleanup...
Info: Congratulations!
Info: If there are no errors above then Entware successfully initialized.
Info: Found a Bug? Please report at https://github.com/Entware/entware/issues
 
Code:
[1] --> /tmp/mnt/usb
=> Please enter partition number or 0 to exit
[0-1]:
[: bad number
Info: selected.

Make sure you enter "1" here to select the disk.
 
Code:
[1] --> /tmp/mnt/usb
=> Please enter partition number or 0 to exit
[0-1]:
[: bad number
Info: selected.

Make sure you enter "1" here to select the disk.

Ok, I'm stupid. I didn't see that evident error. o_O
Anyway, the script should abort in that case, don't you think?
 
Ok, I'm stupid. I didn't see that evident error. o_O
Anyway, the script should abort in that case, don't you think?

No idea, I didn't write it.
 
No idea, I didn't write it.

I've consulted the Entware repository and there isn't any entware-setup.sh script nor reference to it, the problem about number entry is in entware-setup.sh no in entware-install.sh: https://github.com/RMerl/asuswrt-me...rc/router/others/entware.arm/entware-setup.sh

I have rewritten the first part of script to ensure that the value is correct:
Code:
#!/bin/sh

BOLD="\033[1m"
NORM="\033[0m"
INFO="$BOLD Info: $NORM"
ERROR="$BOLD *** Error: $NORM"
WARNING="$BOLD * Warning: $NORM"
INPUT="$BOLD => $NORM"

cd /tmp

if [ ! -d /jffs/scripts ]
then
  echo -e "$ERROR Please \"Enable JFFS partition\" & \"JFFS custom scripts and configs\""
  echo -e "$ERROR from router web UI: www.asusrouter.com/Advanced_System_Content.asp"
  echo -e "$ERROR then reboot router and try again. Exiting..."
  exit 1
fi

i=-1
echo -e $INFO Looking for available  partitions...
for mounted in `/bin/mount | grep -E 'ext2|ext3|ext4' | cut -d" " -f3`
do
  i=`expr $i + 1`
  echo "[$i] -->" $mounted
  eval mounts$i=$mounted
done

if [ $i -lt 0 ]
then
  echo -e "$ERROR No ext2/ext3/ext4 partition available. Exiting..."
  exit 1
fi

echo -en "$INPUT Please enter partition number or <${BOLD}ENTER${NORM}> to exit:"
read -n 1 partitionNumber
echo

if [ -z "$partitionNumber" ]; then
  echo -e $INFO Exiting...
  exit 0
elif [ -z "${partitionNumber#[!0-9]}" ]; then
  echo -e "$ERROR Invalid partition number!  Exiting..."
  exit 1
elif [ $partitionNumber -gt $i ]; then
  echo -e "$ERROR Invalid partition number!  Exiting..."
  exit 1
fi

......

I've tested it in my RT-N66U and it works.
 
Another good practice would abort in case of error in important commands like mkdir, rm, mv, cp,... with '|| exit 1', for example:
Code:
...
echo -e $INFO Creating $entFolder folder...
mkdir $entFolder || exit 1
...
 
Another improvement would use functions to repetitive tasks like display errors, etc... with:
Code:
#!/bin/sh

BOLD="\033[1m"
NORM="\033[0m"
INFO="$BOLD Info: $NORM"
ERROR="$BOLD *** Error: $NORM"
WARNING="$BOLD * Warning: $NORM"
INPUT="$BOLD => $NORM"

eerr () {
  echo -e "$ERROR$*"
}

einfo () {
  echo -e "$INFO$*"
}
.....
einfo This script will guide you through the Entware-Arm installation.
einfo Script modifies only \"entware.arm\" folder on the chosen drive,
.....
echo

if [ ! -d /jffs/scripts ]
then
  eerr "Please \"Enable JFFS partition\" & \"JFFS custom scripts and configs\""
  eerr "from router web UI: www.asusrouter.com/Advanced_System_Content.asp"
......

I hope this help.
Regards.
 

Sign Up For SNBForums Daily Digest

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