0
0
mirror of https://github.com/Doodle3D/doodle3d-firmware.git synced 2024-07-13 19:00:43 +02:00

Add package configuration options (not used yet)i; test code/scripts for postinstall/preremove; update TODO; add support for eclipse ShellEd plugin.

This commit is contained in:
Wouter R 2013-05-03 01:09:46 +02:00
parent 3840a8798d
commit 21e5ddb51b
7 changed files with 124 additions and 16 deletions

View File

@ -13,5 +13,6 @@
</buildSpec>
<natures>
<nature>org.eclipse.koneki.ldt.nature</nature>
<nature>net.sourceforge.shelled.core.nature</nature>
</natures>
</projectDescription>

View File

@ -7,6 +7,31 @@
bool "Enable development aids"
default n
help
Enable development features (currently a script to copy and zip all relevant code for updating the git repository).
Enable development features (currently a script to copy and zip all relevant
code for updating the git repository, and two shell aliases for convenience,
see /root/.profile).
config WIFIBOX_AP_SSID
depends on PACKAGE_wifibox
string "AP mode SSID"
default "d3d-ap"
help
The SSID the device will use when switching into access point mode.
Note: the Lua scripts do not actually use this yet.
config WIFIBOX_INIT_PRIORITY
depends on PACKAGE_wifibox
int "Init-script priority"
default "18"
help
The priority given to the auto-wifi init-script.
config WIFIBOX_WIRELESS_DEVICE
depends on PACKAGE_wifibox
string "Physical wireless device name"
default "radio0"
help
The wireless device name used in the UCI wireless configuration ('radio0'
on the supported TP-Link devices with a recent OpenWRT version).
#endmenu

View File

@ -100,5 +100,10 @@ endif
$(LN) -s /usr/share/lua/autowifi/ext/autowifi_init $(1)/etc/rc.d/S18autowifi_init
endef
define Package/wifibox/postinst
#!/bin/sh
touch /.postinst-was-here
endef
$(eval $(call BuildPackage,wifibox))

33
post-install.sh Normal file
View File

@ -0,0 +1,33 @@
#!/bin/sh
##############
# MAIN CODE #
############
if [ ! -f /etc/banner.default ]; then
mv /etc/banner /etc/banner.default
cat <<-'EOM' > /etc/banner
........D o o d l e 3 D
.......________ _____ _____ v $(PACKAGE_VERSION)
....../ / / |__ / __/ / - /___ __
...../ / / /--// _|-// - | . /- /
..../________/__//__/__//____/___/_-_\
...
..A cad in a box.
.
EOM
fi
grep '^# DO NOT MODIFY.*wifibox package.$' /root/.profile >/dev/null 2>&1
if [ $? -eq 1 ]; then
cat <<-EOM >> /root/.profile
# DO NOT MODIFY - this block of lines has been added by the wifibox package.
alias wfcfr='/usr/share/lua/autowifi/ext/wfcf'
alias encore='ulimit -c unlimited'
EOM
fi
#3. make sure the radio0 interface is enabled in /etc/config/wireless (preferably through uci)
#4. make sure the wlan net is in the lan zone in /etc/config/dnsmasq (and make sure wlan net exists?)

8
pre-remove.sh Normal file
View File

@ -0,0 +1,8 @@
#!/bin/sh
#if [ -f /etc/banner.default ]; then
# mv /etc/banner.default /etc/banner
#fi
# emit message stating that /root/.profile is not changed back and
# neither are wlan zone and radio0 enabled state

View File

@ -1,6 +1,56 @@
- write a shellscript to automate tasks like swapping out /www and packaging modified code for git merging
# TODO
- finish postinst and prerm/postrm scripts
- preliminary test with postinst does not seem to work (i.e. touch a file in the device root does not result in a file being there)
- add more config options to package; candidates:
reconf.WWW_RENAME_NAME, wifihelper.{AP_ADDRESS, AP_NETMASK, (NET)}
about bridging this to lua: have some Makefile stage create a ini/lua file with k/v's and have lua read out that file?
- write a shellscript to automate tasks like swapping out /www and packaging modified code for git merging
- do things right and copy (not link) the init script to init.d
(and enable it automatically, which links to it from rc.d with the proper start priority?)
- add dependency on either wr703n or mr3020 (and probably comment it out to avoid being to conservative...)
- add/link general OpenWrt build instructions for OSX to installation page on wiki.
- see if updating works when a new version is 'released' (probably needs a real feed)
# TODO for autowifi.js
- escape text where necessary (e.g. in getKnown, '<unknown SSID>' is currently interpreted as html...)
- why is $.trim() required in string comparison? do we need to strip newlines in the parse functions?
- add hidden field in html to remember encryption (so we know whether or not a passphrase should be entered)
- instead of showing alerts on missing ssid/phrase in connect, disable the button until contraints have been satisfied
(this is also cleaner in case no networks are present)
- use json for communication?
# Logos
Check http://geon.github.io/Programming/2012/04/25/ascii-art-signatures-in-the-wild/ for inspiration
D o o d l e 3 D
-------- ____ .--- v 1.0.1
| | | | __ | __|.--.| ._| .---..-.-.
| | | ||--|| _| |--|| . || . |\ /
|________||__||__| |__||____||___|/_._\
D o o d l e 3 D
-------- ____ .---- v 1.0.1
| | | |--.| __|-.| ._|---.-.-.
| | | |--|| _|--|| . | . |_ _/
|________|__||__||__||____|___|_._\
....D o o d l e 3 D
...________ _____ _____ v 1.0.1
../ / / |__ / __/ / - /___ __
./ ' ' /--// _|-// - | . /- /
/________/__//__/__//____/___/_-_\
# Shelled bugs/annoyances
+ scripts are only allowed to be created in src folder? (nothing else shown, root greys out 'Finish')
+ text inside heredoc is highlighted
+ only one space allowed at start of line...makes it impossible to draw ascii art
plus: I think it breaks my spaces/tabs occasionally but that could have been something else
- errors after creating new script file (mentioning lua...maybe a conflict?)

View File

@ -1,17 +1,3 @@
/*
* TODO
* - finish network creation
* - finish auto operation
* - call auto op from init script
* - in AP mode, route all addresses to the autowifi page
* - escape text where necessary (e.g. in getKnown, '<unknown SSID>' is currently interpreted as html...)
* - why is $.trim() required in string comparison? do we need to strip newlines in the parse functions?
* - add hidden field to remember encryption (so we know whether or not a passphrase should be entered)
* - instead of showing alerts on missing ssid/phrase in connect, disable the button until contraints have been satisfied
* (this is also cleaner in case no networks are present)
* - use json for communication
*/
animSpeed = 200;
cgiPath = "asdasd/cgi-bin/wfcf";