marcelotk15 / snake-os

Automatically exported from code.google.com/p/snake-os
0 stars 0 forks source link

would like to edit snake gui files on device. #127

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. attempt to edit /usr/share/www/cgi-bin/* files

What is the expected output? What do you see instead?
can't create ***: Read-only file system.
Mounthing writable, the filesystem also has no space. Attempted to delete the 
10k snake logo but did not free up space to edit files on filesystem.

What version of the product are you using? On what operating system?
Lan Server 652 running SNAKE OS V1.3.2 (20101130)

Please provide any additional information below.
This could be user error but would be very helpful if someone could assist.

Original issue reported on code.google.com by g1p...@gmail.com on 27 Jan 2011 at 10:15

GoogleCodeExporter commented 9 years ago
In fact, the project designer didn't leave any space (not a single byte) to the 
partition that includes all the crucial files. To understand that the fact you 
can't edit or delete any files, you need to first know that deleting files 
actually need some extra free space in the partition. Like a few bytes or so, 
because it needs to be renamed and delete...etc, the steps actually require 
some space. So without a single byte, you can not even free up any space! The 
only thing to do is to update the firmware that allocates free space to that 
partition. (I was attempting to do it as well, but gave up when i found this 
out)

Original comment by ted.cho...@gmail.com on 28 Jan 2011 at 6:58

GoogleCodeExporter commented 9 years ago
didnt realize that... so have knocked up a workaround if anyone else wanted 
this.
First would be to copy /usr/share/www onto a usb drive in my case was 
/usb/flash8gb/usr/www

either manually or cron the following script hourly with your naming standards.
5 * * * * /usb/flash8gb/usr/bin/httprst

# cat /usb/flash8gb/usr/bin/httprst
#!/bin/sh
#
PID=$(pgrep -f "/etc/httpd.conf -h /usr/share/www")
if [ ${PID:-empty} = "empty" ] ; then
echo "default http not running"
else
/etc/init.d/httpsvc stop
/etc/init.d/httpsvc mystart
echo "httpsvc mystart is running"
fi

--------

For ease ive also changed the standard httpsvc script to include my web folder. 
After changing /etc/init.d/httpsvc and /etc/cron.d/root dont forget to save 
config or the edit will be lost after next power reset.

# cat /etc/init.d/httpsvc
#!/bin/sh
#

PORT=$(grep "^http_port=" /etc/default/config | cut -d = -f 2)
PARAM="-c /etc/httpd.conf -h /usr/share/www"
KIND="HTTPD"
HOSTNAME=$(grep "^hostname=" /etc/default/config | cut -d = -f 2)

mystart() {
        echo "Starting (my)$KIND service..."
        httpd -c /etc/httpd.conf -h /usb/flash8gb/usr/www -p ${PORT} -r ${HOSTNAME}
}

start() {
        echo "Starting $KIND service..."
        httpd ${PARAM} -p ${PORT} -r ${HOSTNAME}
}

stop() {
        echo "Shutting down $KIND service..."
        pkill -f -9 "httpd ${PARAM}"
}

restart() {
        stop
        sleep 1
        start
}

case "$1" in
  mystart)
        mystart
        ;;
  start)
        start
        ;;
  stop)
        stop
        ;;
  restart)
        restart
        ;;
  reload)
        restart
        ;;
  *)
        echo "Usage: $0 {mystart|start|stop|restart|reload}"
        exit 1
esac

Original comment by g1p...@gmail.com on 3 Feb 2011 at 12:04