The Following 9 Users Say Thank You to iDont For This Useful Post: | ||
|
2011-07-07
, 08:15
|
|
Moderator |
Posts: 7,109 |
Thanked: 8,820 times |
Joined on Oct 2007
@ Vancouver, BC, Canada
|
#82
|
It really should install a signal handler that exits the shell cleanly, but a simpler
workaround without patching the source would be something like:
Code:$ echo "trap exit SIGHUP SIGINT SIGTERM" >> /home/user/.profile
The Following 4 Users Say Thank You to qole For This Useful Post: | ||
|
2011-07-07
, 13:01
|
Posts: 268 |
Thanked: 1,053 times |
Joined on May 2010
@ The Netherlands
|
#83
|
Hi iDont, is it possible to fix Bug 5317? I thought for sure that your Busybox 1.18 would fix it, but it still doesn't save my history if I press on the X instead of typing "exit". I even rebooted just to be sure!
EDIT AGAIN: Even just applying this workaround would be nice...
[..] But since you're patching the source anyway...
CONFIG_FEATURE_EDITING_HISTORY=100
The Following 2 Users Say Thank You to iDont For This Useful Post: | ||
|
2011-07-07
, 14:28
|
Posts: 2,225 |
Thanked: 3,822 times |
Joined on Jun 2010
@ Florida
|
#84
|
|
2011-07-07
, 22:55
|
|
Moderator |
Posts: 7,109 |
Thanked: 8,820 times |
Joined on Oct 2007
@ Vancouver, BC, Canada
|
#85
|
trap exit SIGHUP
|
2011-07-08
, 00:32
|
Posts: 2,802 |
Thanked: 4,491 times |
Joined on Nov 2007
|
#86
|
Even Maemo's stock BusyBox handled shell history well, until bug 4174 appeared, that is. As you can read there, it changes BusyBox' shell history saving behaviour from writing out the history directly after executing a command, to saving the history upon shell exit. This, however, introduces new problems (e.g. bug 5317 you've mentioned).
It's a tradeoff we have to make here. Either we keep the proper upstream shell history handling and have a (little?) bit more wear on the eMMC and a resulting (small?) increase of power usage
or we go Nokia's way of saving shell history only upon shell exit, but then we'll have problems with concurrent shells etcetera.
Some averaged numbers (/guesses) on how much wear upstream shell history handling actually creates on our eMMC's would be great, but I guess those are pretty hard to quantify.
On the one hand I'm used to the shell being slightly 'wrong' in behavior since my main shell experience soure is the N900. On the other hand, if Nokia chose to go with "standard" behavior for Maemo 6 (I'm not calling Harmattan 'MeeGo' in casual conversation), that must mean even the Nokia folk think it's better to keep standard shell behavior.
I think I'd be satisfied if iDont just added the workaround to the post-install script.
line="trap exit SIGHUP" if ! grep -F -q "$line" /etc/profile; then echo "$line" >> /etc/profile fi
The Following 4 Users Say Thank You to lma For This Useful Post: | ||
|
2011-07-08
, 01:59
|
Posts: 2,225 |
Thanked: 3,822 times |
Joined on Jun 2010
@ Florida
|
#87
|
There's no standard sadly (POSIX typically avoids the issue), but busybox's handling of history is rather unique AFAIK. Other POSIXy shells like bash or ksh keep their history in memory and write it out at exit (they pretty much have to since they implement fc and that will be extremely broken with mixed histories)
|
2011-07-08
, 18:25
|
Posts: 268 |
Thanked: 1,053 times |
Joined on May 2010
@ The Netherlands
|
#88
|
I think I'd be satisfied if iDont just added the workaround to the post-install script. It looks like you only need to check to see if there's a trap exit line in /home/user/.profile and if not, drop in
Code:
That will keep the save-on-exit patch and workaround the missing save-on-SIGHUP code.Code:trap exit SIGHUP
It depends on how you use it obviously. We're talking about one eraseblock cycle every time you press enter which I guess adds up to a not-insignificant amount, but probably not enough to kill your flash by itself within the device's expected lifetime.
Fair enough. But I still think my suggestion is realistically feasible... Find whatever place in the source the paths to the history files are kept in the "original" source (where it writes history upon every enter), and edit those paths to place "/tmp" in front of them. And then add the code from the Nokia patch that makes them write the history out at exit (but don't override the former like the patch would), and change that code to pull data from the "/tmp/[whatever]" and put that into the standard [whatever] ash history upon every shell close. That way history accumulates from all the concurrent shells in the order the commands happen across the board, and is saved on every shell close (with the above patch/workaround by you guys, even when you hit the above X.)
CONFIG_ASH_HIST_BUFFER=y CONFIG_ASH_HIST_BUFFER_PATH="/tmp/.shellhistory"
The Following 2 Users Say Thank You to iDont For This Useful Post: | ||
|
2011-07-08
, 23:05
|
Posts: 2,802 |
Thanked: 4,491 times |
Joined on Nov 2007
|
#89
|
This patch should remove any problems introduced by Nokia's patch (e.g. with concurrent shells)
please review the patch
The Following 4 Users Say Thank You to lma For This Useful Post: | ||
|
2011-07-09
, 00:29
|
|
Posts: 323 |
Thanked: 189 times |
Joined on Oct 2010
@ Brazil
|
#90
|
I think I'd be satisfied if iDont just added the workaround to the post-install script. It looks like you only need to check to see if there's a trap exit line in /home/user/.profile and if not, drop in
That will keep the save-on-exit patch and workaround the missing save-on-SIGHUP code.Code:trap exit SIGHUP
It's a shame though that each version of any package has to be voted up separately (i.e. I would love to get 1.18.5power2 in Maemo's extras; it supports installation in the SDK and has a less scary warning during first-time installation). Ah well, let's get 1.18.5power1 in extras first, as it already had 6 thumbs up currently.
About the new problem. I actually do think this is something very specific. If I can trust these stats, then only two installations I'm aware of have failed out of >10000. One of those has been confirmed to be not caused by busybox-power failing, and the other is not confirmed yet. I haven't received a reply from awett yet, so I can't comment any further on the problem he encountered.
Anyway, for what I know, there are currently no pit-falls in the (un)installation scripts. Be assured, a lot of care has been put into them to prevent broken installations
--
On other news: I just received an approval for a garage page for busybox-power, so a proper bugtracker and more are on their way .
Also, I want to check if there is any interest in getting busybox-power working on the N8xx/N770. If you are interested in this, leave a message here (I'll move this message to the first/second post later, so it will not go unnoticed)
Last edited by iDont; 2011-07-05 at 18:25. Reason: Fix grammatical error