Insert a package into freetz

vasila

Neuer User
Mitglied seit
7 Mai 2008
Beiträge
102
Punkte für Reaktionen
0
Punkte
16
Hello,



I devellop a package that i want to integrate in freetz.

I follow this:

http://74.125.79.132/translate_c?hl=...NfscxYf40X9iag

and this sample (with demopackageb):

http://www.ip-phone-forum.de/showthread.php?t=177052

and this:
http://translate.google.com/translat...late.google.pt


However, the package is not in any http server (it is in my computer), how can i integrate the package ??


A solution is to make an http server in my PC... But, I want just to put the package in the freetz directory structure.

For now, I just want to place the "start", "Stop" and "restart" button in the freetz webpage working correctelly. The rc.package and package.cgi are in the correct place but all the buttoms are enabled and i do not get the state (running, Stopped) :(

Thanks in advance
Best regards
 
I think a single post will be enough. Why do you post this twice? If anyone is interested in helping you or ist able to, he/she will do this for sure.

regards.
 
Hello.


Yes, i know it. I'm sorry for that.
However, my objective now is different. In the other post i want just to embedd one file.... This, is done :)

Now i want to integrate a package... Because, i think it is different I post a new thread.

Best regards
 
I don't understand your questions? Do you want us to integrate a new package developed by you into Freetz?

Regards
Oliver
 
All translation links are down, therefore I can not understand the topic of your question. But I can give you tips to the final part of your posting #1.
1. Packages under FREETZ should be registrated correctly
2. You need a daemon, which shold be a real daemon with all corresponding rules (pid, etc.), if you will see "running" or "stoped" status.
3. The typical solution in FREETZ with these buttons is to use THE SAME value names both for cgi and for java-script. AFAIK you can find this information in demopackage and in WIKI.
4. We do not have a crystal ball to show between the lines of your code. The information "it does not work" is very sparse for us.

Best regards,
 
Hello,


You have right. It is impossible to understand my question with the information I provide.

Let me try to explain better what I want.

I will use one FritzBox in a students project. Each student will develop a program and has an executable in it USB pen drive. The program must communicate with some dedicated hardware (actuation hardware, also developed by the students) using a USB-RS232 converter also connected to the FritzBox.

What I need:
To integrate in Freetz WebInterface the buttons to start, stop and restart the application, and a Webpage to make some configuration (e.g. RS232 baud rate).

What I try:
I develop the "package" you find in attach (using demopackageb from here ).

What I get:
The better I can is this you can see in these images:
The package is in the service list, but all corresponding buttons are enable
screenshotyoc.jpg


The problem is the file rc.projecto in line 5, that has an call to a configuration file which d'ont exist. And I cannot put it in image puting it on /freetz/make/projecto/files/root/mod/etc/conf :(:(:(
My first question:
Put files in /freetz/make/projecto/files/root/mod/etc/conf and make freetz, i cannot get access to the Freetz WebInterface.

In the packages Web Page, my package "projecto" is missing:
screenshot1k.png



Thanks all of you
Best Regards
 

Anhänge

  • projecto.zip
    4.8 KB · Aufrufe: 7
First hint:
Putting files into "/freetz/make/projecto/files/<whatsoever>" will only work the first time you build your firmware. Afterwards there will be a file named ".projecto" in "/freetz/packages/" and also a directory with the name of your package. So if you intend to change the package after the first run, you will have to modify the files in "packages/projecto" (which is non-permanent) or delete the .projecto file and the directory to get it copied from the files in make/projecto (you may also use your makefile for this, if you integrated "projecto-clean").

Joerg
 
Joerg,

Thanks.....
CAn you help me, in the explained problem?
Thank you.
Best regards
 
Hi,

just realised I misunderstood your problem. I thought the files added to make/... werer not in the image.
But a short look into your attachment showed, there are much more things missing. I will not be able to write your package, but point to some hints:
To get the general idea of the freetz packages I would strongly recomend to take an existing one as your starting point! E.g. your rc.projecto misses all requirements to an rc-file in freetz. Please try this (translated) page for some information. In short:
The minimal requiremnts for an rc-file of a package are:
* rc script: etc/init.d/rc.<package name> [start|stop|load|unload|restart|status]
If the package is configarable, you will need:
* Default configuration is in: etc/default.<package name>/<package name>.cfg
* Optional: cgi script for the web-GUI: usr/lib/cgi-bin/<package name>.cgi
* Optional: Extra cgi scripts in usr/lib/cgi-bin/<package name>/

The rc-file will have to register the cgi and then you will see it in the GUI. Maybe you can take my "polipo" package (which has a very simply interface) and its rc-file as template to see about the registration and so on.

Jörg
 
Jorg,


Thanks for your detailed replay.
I will try and i give you feedback in next few days.
Best regards
 
... and some more information:
The projecto.cfg will have to go to "/make/projecto/files/root/etc/default.projecto/projecto.cfg" (you can't directly put it into /mod/etc/conf).
If you build freetz with projecto selected, it will be added to "/etc/static.pkg" and during startup, your config will be build in /mod/etc/conf depending on this default and possible changes you made in the gui, saved in "/var/tmp/flash/projecto.diff".

rc-file and cgi need to be executable (so you may need "chmod +x <file>" on them)

Your rc.projecto might look like this. Note you named your deamon "Projecto", so it will need capital letter or (thats what I would suggest), should be renamed to "projecto":

Code:
#!/bin/sh

DAEMON=Projecto

. /mod/etc/conf/projecto.cfg

start() {
      echo "Start Projecto..."
      touch /var/run/projecto.pid
      if [ "$PROJECTO_COMCHK" = "yes" ]; then
        modprobe $PROJECTO_COMCHK_IF
        sleep 1
	      echo "USB-Serial"
      fi
      
      if [ -x "/var/media/ftp/uStor01/${DAEMON}" ]; then
        echo "Projecto found on USB drive"
			  /var/media/ftp/uStor01/$DAEMON > /dev/null 2>&1
	  	fi
      
      exitval=$?

      if [ "$exitval" -eq 0 ]; then
              echo 'done.'
      else
              echo 'failed.'
              exit $exitval
      fi
}

stop() {
      echo "Stop Projecto..."
      if [ ! -z "$(pidof "$DAEMON")" ]; then
            killall -9 $DAEMON > /dev/null 2>&1
            exitval=$?
      fi
      if [ "$exitval" -eq 0 ]; then
            echo 'done.'
      else
            echo 'failed.'
            exit $exitval
      fi
      sleep 1
      if [ "$PROJECTO_COMCHK" = "yes" ]; then
        rmmod $PROJECTO_COMCHK_IF
        sleep 1
        rmmod usbserial
        sleep 1 
      fi
      rm /var/run/projecto.pid
}

case "$1" in
	""|load)

		modreg cgi 'Projecto' 'Projecto'
		
		if [ "$PROJECTO_ENABLED" != "yes" ]; then
			echo "$DAEMON is disabled" 1>&2
			exit 1;
		fi

		start
		;;
	unload)
		stop
		modunreg cgi 'Projecto'
		;;
	start)
		start
		;;
	stop)
		stop
		;;
	restart)
		stop
		sleep 1
		start
		;;
	status)
		if [ ! -z "$(pidof "$DAEMON")" ]; then
				echo 'running'
			else
				echo 'stopped'
		fi
		;;
	*)
		echo "Usage: $0 [load|unload|start|stop|restart|status]" 1>&2
		exit 1
		;;
esac

exit 0


Joerg
 
Zuletzt bearbeitet:
Hello,


Thanks to Joerg and all of you, my package is running now.

I have another question :-o:-o
Running some student's programs i get:
Code:
./projecto: can't resolve symbol 'bzero'

One solution is d'ont use bzero macro, however, i d'ont want to force this to students.

I'm using the normal libuClib-0.9.29.so that is used in freetz.

Any ideia to solve the problem?

Many thanks

Best regards
 
Zuletzt bearbeitet:
What Freetz version are you using? There were some issues conerning SUSV3_ LEGACY_MACROS in the past weeks. But finally I enabled them again.

Regards
Oliver
 
I'm using the last development version (3366).
If i roll back to some previous version it will work?

Thank you

Best Regards
 
No, the macros are reenabled by oliver some time ago.
 
In 3300 changeset Oliver enable bzero macro, is this right ?
 
It seems to me that you are not using the newest download toolchain/uClibc files in your image.

Regards
Oliver
 
Yes, i'm using the last development version of freetz (3366)....
I try with version 3150 and it works.
Now I want to try with 3299 and 3300 (since, the changes are in 3300)...
Best Regards
 
Do you use a download toolchain? Which? Or do you build your own one?

Regards
Oliver
 
Oliver,

I just download freetz with:
svn co http://svn.freetz.org/trunk/ freetz-trunk
or
svn co http://svn.freetz.org/trunk/ freetz-trunk -r 3150


After that, i do:
make menuconfig

and after:
make

nothing more.

After i just plug an USB with a program and running this program i get the error in 'bzero'.

Note that, for now i give up from runnig my program from freetz webInterface since if d'ont run in telnet it will never run with a script called by the webInterface.

At night, I will give you more information, because I will try version 3299 and 3300.

Best Regards
 
Holen Sie sich 3CX - völlig kostenlos!
Verbinden Sie Ihr Team und Ihre Kunden Telefonie Livechat Videokonferenzen

Gehostet oder selbst-verwaltet. Für bis zu 10 Nutzer dauerhaft kostenlos. Keine Kreditkartendetails erforderlich. Ohne Risiko testen.

3CX
Für diese E-Mail-Adresse besteht bereits ein 3CX-Konto. Sie werden zum Kundenportal weitergeleitet, wo Sie sich anmelden oder Ihr Passwort zurücksetzen können, falls Sie dieses vergessen haben.