Active Topics

 


Reply
Thread Tools
Posts: 1,808 | Thanked: 4,272 times | Joined on Feb 2011 @ Germany
#91
Bfff.. lots of things going on in this thread (LIKE

First things first: @Estel, Thanks for pointing me to Backupmenu. I saw that it does "hwclock -s" (set system time from hardware clock).

Then I saw vi_'s post mentioning the same. Thanks to you too. Now I'm charging the N900 so I won't touch it, but I'll try later adding "hwclock -s" to the /recovery.sh.

Second: @Pali: YES, please proceed It's a great feeling to see other (more knowledgeable) people wanting to do the same as I want to do.

This way I don't have to rush things, so I'll patiently wait for your combined results and profit from them (of course if there's anything I can patch I will

In short: thanks to everyone involved in this thread. I start feeling like in the early 90s when I installed Slackware 1.0 (or was it 2.0?).
 

The Following User Says Thank You to reinob For This Useful Post:
Posts: 1,808 | Thanked: 4,272 times | Joined on Feb 2011 @ Germany
#92
UPDATE!

I booted to the recovery console. 'date' shows incorrect date/time, but 'hwclock -r' shows correct time

Did 'hwclock -s' and then exit (poweroff). Booted to Maemo and voilą! date and time are OK!

[EDIT] I've added 'hwclock -s' in recovery.sh, right after loadkmap.

Next in line: keyboard mapping. But I need to do this at home (loadkeys -b and all).

Last edited by reinob; 2011-11-22 at 14:01.
 

The Following 3 Users Say Thank You to reinob For This Useful Post:
Posts: 1,680 | Thanked: 3,685 times | Joined on Jan 2011
#93
GJ bro'ski.

Here is /sbin/preinit.

I have put modprobe fbcon after the first function to be called, 'init_system'.

This calls it even earlier for even more rolling text at boot up. I have not got the balls to try it before 'init_system' as if I ballsax my system I could not face re-flashing this beast again.

Another interesting effect is the display of the green R&D mode text. If you look in the link you can call the display text without actually starting R&D mode. KInda cool if you want it but not rolling fbcon text.
__________________
N900: One of God's own prototypes. A high-powered mutant of some kind never even considered for mass production. Too weird to live, and too rare to die.
 

The Following 4 Users Say Thank You to vi_ For This Useful Post:
Posts: 2,154 | Thanked: 8,464 times | Joined on May 2010
#94
I started fixing and cleaning /sbin/preinit. Now I created deb package getbootstate which should be (in future) replecament for original nokia's.

Source code here: https://code.launchpad.net/~pali/+ju...o_getbootstate

Note that: I did not tested it yet
 

The Following 6 Users Say Thank You to pali For This Useful Post:
Posts: 2,225 | Thanked: 3,822 times | Joined on Jun 2010 @ Florida
#95
Ugh, I'd still rather recode /sbin/preinit personally (reasons mentioned elsewhere, plus the principle of the thing), but I suppose working with you guys on this one will get me more experienced with its workings to the point where I can validly say I can 'clone' it without directly copying.

ANYWAY - rambling aside... I'm happy to jump on to pali's /sbin/preinit for development purposes, although I would love if it still let users start a root shell at the earliest moment possible, like mine more or less does now. I kinda like the idea of an internalized menu, but I am weary of feature bloat. /sbin/preinit is horribly delicate, so the more complex it gets the more likely it'll be that one missed error will screw up the boot process, etc. So we MAY want, if we're going to add a menu fancier than
Code:
Press any key to get shell...
[5/4/3/2/1]
to add the extra functions in separate scripts, which are only called from within /sbin/prenit, and only AFTER some user-generated action.

(I suspect people won't want to, in the long run, to add the fbcon loading and shell prompt where I have it in my version, within init_system(), so I won't push for that too much myself unless enough other people think having such an extremely-early fallback is a good idea.)
 

The Following 3 Users Say Thank You to Mentalist Traceur For This Useful Post:
Posts: 2,225 | Thanked: 3,822 times | Joined on Jun 2010 @ Florida
#96
Originally Posted by vi_ View Post
I have put modprobe fbcon after the first function to be called, 'init_system'.

This calls it even earlier for even more rolling text at boot up. I have not got the balls to try it before 'init_system' as if I ballsax my system I could not face re-flashing this beast again.
If you look at my code when I first showed how to add fbcon and a press-key-to-get-shell prompt on page two or three of this thread, you can see it's almost at the very beginning of init_system() for me, I have it right after
Code:
mount -t proc none /proc
mount -t sysfs none /sys
mount -t tmpfs none -o size=512K /tmp

mkdir /tmp/dev
Not much earlier to go than that. However, if you think none of those directories/filesystems are needed for busybox-power to run a shell properly from framebuffer console, then I'm willing to risk making it the VERY FIRST THING (TM) executed in the script, and see what happens.

Originally Posted by vi
Another interesting effect is the display of the green R&D mode text. If you look in the link you can call the display text without actually starting R&D mode. KInda cool if you want it but not rolling fbcon text.
Oh, I thought the tech savvy people who would care already knew this, since I always think of myself a newb in these matters. Otherwise I would've reported that months ago.

Last edited by Mentalist Traceur; 2011-11-23 at 07:16. Reason: Typo: "pare" = page
 

The Following 3 Users Say Thank You to Mentalist Traceur For This Useful Post:
Posts: 2,225 | Thanked: 3,822 times | Joined on Jun 2010 @ Florida
#97
I do like my code so far though for a simple shell prompt, and if someone just wrote some if/then checks to see if the kernel was a power kernel version with fbcon built-in as a loadable module, and that the required command line tools and files were all available where indicated in the code, then it could be stuck inside the /sbin/preinit on pali's repo.

Code:
        modprobe fbcon
        printf "Press any key to get a shell.../n"
        for q in 4 3 2 1 0
        do
         printf "$q"
         if (read -n 1 -t 1)
         then
          printf "\b\b"
          insmod $MODULE_PATH/led-class.ko
          insmod $MODULE_PATH/leds-lp5523.ko
          insmod $MODULE_PATH/omap_wdt.ko
          insmod $MODULE_PATH/twl4030_wdt.ko
          sleep 1
          for p in /sys/bus/platform/devices/*_wdt/misc:*; do
           n=`basename $p | sed "s/.*://"`
           rm -f /dev/$n
           mknod /dev/$n c `cat $p/dev | sed "s/:/ /g"`
          done
          for i in 1 2 3 4 5 6; do
           echo 25 > /sys/class/leds/lp5523\:kb$i/brightness
          done
          watchdog -t 20 /dev/watchdog
          watchdog -t 20 /dev/twl4030_wdt
          loadkmap < /etc/nokia-n900.kmap
          sh
          killall watchdog
          break
         fi
         printf "\b"
        done
In the long term, we'd probably want a settings option somewhere (maybe even CAL area if/when that's reverse-engineered properly) since if this is going to be a replacement package for getbootstate we'd probably want there to be some way to enable the shell and/or possibly-built-in-menu as a settings option. That way, the feature can be built-in to /sbin/preinit so that it's there as a safety option, but doesn't have to run by default.

P.S. Pali, I subscribed myself to that launchpad branch of open source getbootstate you have.
 

The Following 4 Users Say Thank You to Mentalist Traceur For This Useful Post:
Posts: 1,808 | Thanked: 4,272 times | Joined on Feb 2011 @ Germany
#98
@Mentalist Traceur and @Pali and @others,

Perhaps a simple solution would be to store a config file in / or /etc (/preinit.cfg or so) where one could set the option of FBCON (FBCON=early, FBCON=normal, FBCON=no) plus another option for EARLY_CONSOLE=(yes,no,ask) [ "ask" would enable @Mentalist Traceur's timed selection).

Another option would be "BOOTMENU", either empty or pointing to a file (/bootmenu.sh), so that preinit would only check that option and if non-empty and file exists and file is executable (so that it's easily disabled) then it would run it.

This way preinit (stock or Pali's) would only need a few extra lines but the added functionallity would be implemented elsewhere (and easily enabled/disabled).

As long as the new preinit throughly checks things one could almost guarantee that there would be no reboot loops (at least caused by preinit).

For the long term I would go for a full runlevel implementation, so that you can have your single-user, multi-user-no-X, multi-user-networking, etc.

BTW /sbin/init is an ELF binary. Is the source code available?
 

The Following User Says Thank You to reinob For This Useful Post:
Estel's Avatar
Posts: 5,028 | Thanked: 8,613 times | Joined on Mar 2011
#99
Originally Posted by Mentalist Traceur View Post
(I suspect people won't want to, in the long run, to add the fbcon loading and shell prompt where I have it in my version, within init_system(), so I won't push for that too much myself unless enough other people think having such an extremely-early fallback is a good idea.)
Why should it happen later? Isn't it "the earlier, the better"? any drawbacks of loading it so early?
__________________
N900's aluminum backcover / body replacement
-
N900's HDMI-Out
-
Camera cover MOD
-
Measure battery's real capacity on-device
-
TrueCrypt 7.1 | ereswap | bnf
-
Hardware's mods research is costly. To support my work, please consider donating. Thank You!
 
Posts: 1,680 | Thanked: 3,685 times | Joined on Jan 2011
#100
Maybe even::

Code:
If camera slide open
          load fbcon
          present menu

else 
          boot normaly
?
__________________
N900: One of God's own prototypes. A high-powered mutant of some kind never even considered for mass production. Too weird to live, and too rare to die.

Last edited by vi_; 2011-11-23 at 09:53.
 

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

Tags
console, console-mode, framebuffer, recovery, recovery-mode


 
Forum Jump


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