Notices


Reply
Thread Tools
Posts: 1,994 | Thanked: 3,342 times | Joined on Jun 2010 @ N900: Battery low. N950: torx 4 re-used once and fine; SIM port torn apart
#1
I'm trying to see what can be done with /bootmenu.sh (which is started by /sbin/preinit if the keyboard of N900 is opened during startup).

I have never before written a shell script, so I have to proceed cautiously, and need all the advice I can get.

I can print text (and set its size, color, align) on screen with /usr/bin/text2screen, and use sleep 3 to give a human time to see it.

I can print date (hours, minutes, seconds), but instead of current date it prints:
01/01/70
09:30:04
Therefore, it seems, that something needs to be done to make it aware of current date and time. What is it that needs to be done? How can it be done?

EDIT: putting /sbin/hwclock -s before printing out date didn't help.

LCD screen is apparently already up and running; and USB, too, because before executing bootmenu.sh the bootloader shows USB icon in the corner of the screen to indicate that USB charger is plugged into the device; and keyboard, I suppose, because bootloader should check, whether 'u' is pressed or not, and enter (or not enter) flashing mode, before starting bootmenu.sh.

Potentially, it would be possible to use bootmenu.sh to execute one of (user chooses by pressing key on keyboard) simple shell scripts, like:

clock (how to make the device aware of current time?),

stopwatch (how to make the device aware of current time? some code would be needed to calculate the difference between start time and current time),

flashlight (initialize the LEDs of camera and turn them on),

mirror (initialize the front camera and somehow put its image to screen (does gst-launch work here?)),

etc.

And then, when the user stops one of the shell scripts, he is returned to menu of possible choices.

It would be single tasking at first...

but potentially, it could be used to start your own desktop environment, because when bootmenu.sh is executed, there is no sign of hildon anywhere - only the shell with minimum number of devices started.

Last edited by Wikiwide; 2010-10-11 at 01:56. Reason: EDIT: putting /sbin/hwclock -s didn't help.
 

The Following User Says Thank You to Wikiwide For This Useful Post:
Reply


 
Forum Jump


All times are GMT. The time now is 17:25.