Re: [Announce] Enhanced BusyBox package
Quote:
Quote:
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. Quote:
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 ;) Quote:
-- 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) |
Re: [Announce] Enhanced BusyBox package
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: maybe fix Bug 7014 while you're in there? EDIT AGAIN: Even just applying this workaround would be nice... Quote:
|
Re: [Announce] Enhanced BusyBox package
Quote:
Upstream BusyBox handles shell history perfectly well. 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. Apparantly, Nokia has left out their shell history patch in Harmatten, thus the bug you've mentioned is 'fixed' for Harmatten. Bug 4174, however, is reintroduced there AFAIK. I'd like to stick with what Nokia has decided to do for Maemo 5 in the first place, which is including the shell history patch. 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. However, to give you the freedom to choose yourself, I've compiled the latest busybox-power without shell-hist.patch; click here to find it. That build should suit your shell history needs ;). I'll keep this alternative busybox-power version up-to-date, but I currently don't have any plans to push it to the repositories. Update: Scrap the previous line. Since busybox-power 1.18.5power3, shell-hist.patch has been dropped in favor of a new patch. This new patch fixes all mentioned problems, so there's no need to maintain the special busybox-power build. I can, however, create a new version of it without the new patch if there's any demand for it (drop me a PM). Quote:
Anyhow, thanks for the workaround, I seem to have missed it in the bugreport itself earlier. I'll certainly include it in the next busybox-power release. Quote:
Quote:
|
Re: [Announce] Enhanced BusyBox package
Hmmm... Personally I'm divided. 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. On the other hand it's possible they changed up something else, and as a result stock shell history saving behavior is only better in combination...
Does busybox normally keep track of what *time* every command is entered? The easiest way I can imagine to get the best of both worlds if it doesn't already keep track of time-stamps is to write to history as is 'normal' upsteam, by command, but write to a file in /tmp, thus keeping the actual history for all currently running shells in RAM and not actually written. Then you can write all the lines in the /tmp shell history into the existing shell history file, while clearing the /tmp-located file, when any of the shells are closed/exit-ed. Honestly though, I think in the long term if we don't patch the shell to work as desired without the extra flash writes, the better choice is the default upstream behavior, not current N900 behavior (although I'm sticking with what's in the repository for now, since I'm used to it enough to not personally mind it). I'm confident if we get ourselves motivated enough, we could figure out how to do the former though (either the way I suggested above, using a /tmp history file as a middle-man, or through more low-level code-voodoo, which would be more efficient, but meh), instead of having to resort to chosing which one gets the repository spot. Which, actually, is already decently nice - thank you iDont for committing to maintaining both. |
Re: [Announce] Enhanced BusyBox package
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:
trap exit SIGHUP |
Re: [Announce] Enhanced BusyBox package
Quote:
Quote:
Quote:
Quote:
Quote:
Quote:
Code:
line="trap exit SIGHUP" |
Re: [Announce] Enhanced BusyBox package
Quote:
Busybox is coded in C, right? iDont, where do you keep the latest source for this package (my apologies if you mentioned it in this thread already. If you have just say so and I'll go look)? If I get the time I'll take a look at the source see if I can improvise a shitty patch to do the above. (I probably can't, but I can always get my own hopes up before realizing I can't do it.) - Edit - NVM - it's right there in the second post. |
Re: [Announce] Enhanced BusyBox package
Quote:
Why wouldn't you want to trap SIGINT and SIGTERM too, by the way? I'm asking this because I went with the original workaround, which did include those signals as well. Quote:
Quote:
It seems to be working great here, i.e. not different from upstream BusyBox. I've tried out various combinations of multiple shell instances with multiple users (root and user), all without error. To test out the patch: place it in busybox-power's debian/patches folder, add the filename of the patch to debian/patches/series, remove shell-hist.patch from the same file (important), and finally add: Code:
CONFIG_ASH_HIST_BUFFER=y The temporary location for .ash_history can be changed if you want. With the above config entries, the buffer history file will be written to /tmp/.shellhistory/[subdir based on user]/.ash_history This patch should remove any problems introduced by Nokia's patch (e.g. with concurrent shells), and avoid wear on the eMMC. People with more advanced C knowledge, please review the patch and notify me of any mistakes/enhancements. I'm sure some things could be done better than how I did them. Also, I'm always a little bit hesitant to push 'invasive' code into production environments, so positive feedback is greatly appreciated too. Edit: this patch is obsolete. A newer version of it has been merged upstream. |
Re: [Announce] Enhanced BusyBox package
Quote:
Quote:
|
Re: [Announce] Enhanced BusyBox package
Quote:
BUT I may be happy just with editing my .profile to remove the trap sighup as looks like everybody seems to prefer that it remember and I'm the only one that do not like it much. On the PC I think it's essential, but on my phone, not much. Thanks! |
Re: [Announce] Enhanced BusyBox package
Quote:
Quote:
So you're right about Nokia's patch not introducing the problem. However, it doesn't fix it either. Regarding your comments on my patch: Quote:
Quote:
Quote:
Quote:
Thanks for the review. I'll create an v2 when I've got the time for it (probably later today). Quote:
Just an idea: you could add something like: Code:
trap 'echo -e "filebox\nping\npowertop\netcetera" > /home/user/.ash_history' 0 |
Re: [Announce] Enhanced BusyBox package
Quote:
Quote:
(Yeah, I know the system is wide open anyway) |
Re: [Announce] Enhanced BusyBox package
Quote:
|
Re: [Announce] Enhanced BusyBox package
Alright, here is V2 of the patch. Changes that went into this new version:
- Fixes for lma's bullets - Histcopy() is now a static bool. Warning messages are changed too - Fix in exitshell() - there are cases wherein tmphistory doesn't exist at this point, so check for its existence - Cleanups in code and CONFIG entries Again, reviews are highly appreciated. I'll provide a precompiled deb in a minute too. Please let me know if you discover any issues with it. Update: Attached a new version (V3) of the patch. A more elaborate post will be created later; I'm currently occupied with other stuff. Precompiled deb can be found here. Edit: this patch is obsolete. A newer version of it has been merged upstream. --- To clear out possible confusion about the whole issue, and to summarize what this patch is all about: There are two problems: Problem 1: BusyBox writes out the shell history after each command, which produces wear on the eMMC. Problem 2: The default, old BusyBox (1.10.2) had a problem with history contamination Events:
|
Re: [Announce] Enhanced BusyBox package
I bet that patch will be useful upstream, too...
|
Re: [Announce] Enhanced BusyBox package
Great work. We can expect this to hit repos ASAP (in fact, when sending anything into them will be possible), right?
Quote:
|
Re: [Announce] Enhanced BusyBox package
I believe I 'may' have found a bug or something. If I try to cat a file that contains a windblows newline character '^M' I lose everything preceeding that character. I.e. if I try to cat a file containing:
Code:
aaaaaaaaaa^Mbbbbbbbbb^Mccccccccccc^Mdddddddd It makes sed/awk/grep'ing my way to victory really hard! edit: yay for 'dos2unix'! |
Re: [Announce] Enhanced BusyBox package
Quote:
At this moment, it seems that there is no upstream interest in the patch. Please refer to the thread over at BusyBox' mailing list for more on this. Quote:
Quote:
Code:
Nokia-N900:~# echo 'aaaaaaaaaa^Mbbbbbbbbb^Mccccccccccc^Mdddddddd' > testfile && cat testfile Quote:
|
Re: [Announce] Enhanced BusyBox package
Quote:
That's normal. ^M is carriage return (aka CR, ASCII 13, '\r'), not newline (LF, ASCII 10, '\n'). Your terminal simply interprets it correctly and moves the output cursor to the beginning of the current line. |
Re: [Announce] Enhanced BusyBox package
Code:
curl -A "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.3) Gecko/20070309 Firefox/2.0.0.3" http://www.metoffice.gov.uk/weather/uk/surface_pressure.html | sed -e 's#<[^>]*>##g' | grep "chilly" However the above example DOES NOT display the afore mentioned text, it only displays the characters FOLLOWING the last '^M' ion the line. I have checked this by stripping out the yucky '^M's and having it work. Just so ya know. |
Re: [Announce] Enhanced BusyBox package
Quote:
Code:
copy_file(tmphistory, storedhistory, 11); /* 11 = force copy & preserve permissions */ Code:
if (access(CONFIG_ASH_HIST_BUFFER_PATH, R_OK == -1)) Code:
tmphistory = concat_path_file(CONFIG_ASH_HIST_BUFFER_PATH, Code:
close(open(storedhistory, O_WRONLY | O_CREAT, 0644)); Code:
if (access(tmphistory, R_OK | W_OK) == -1) |
Re: [Announce] Enhanced BusyBox package
Quote:
You could add a "tr '\r' '\n'" to the pipeline to translate those into LFs, or "tr -d '\r'" to simply remove them. |
Re: [Announce] Enhanced BusyBox package
I've just pushed some commits to busybox-power's GIT repository, including one to include and enable a new version of the shell history patch (albeit a bit later than intended). I'm pretty confident about this one, with the patch being modified several times already. As said before, if no issues are found with the new version of the patch, it will be included in the next busybox-power release. You can find the patch here. Corrections etc. are highly appreciated.
For those who haven't read previous pages of this thread: with the mentioned patch, BusyBox' history issues with using multiple shell instances are gone. Quote:
|
Re: [Announce] Enhanced BusyBox package
I've got some great news: busybox-power is now available in Maemo's extras repository! A huge thanks goes out to all the people who have voted my package up :)
In other news, busybox-power 1.18.5power3 will be released in a week or so. As it will have some nice features over 1.18.5power2, I won't push the latter into extras-testing, but push the upcoming new busybox-power version directly into there. Update: busybox-power 1.18.5power3 has just been pushed to extras-devel. I especially want to thank lma for providing me multiple times with feedback. I'll promote this new version to -testing tomorrow. If I may quote myself: Quote:
|
Re: [Announce] Enhanced BusyBox package
Wooo @ Extras-Devel and -testing for the new BusyBox power. What with the glorious shell history tweeks and all. I was actually surprised when opening a second terminal session on my N900 earlier today, to find the commands I had JUST typed in the first one, all in my history already. So... right.... Lack of words....
|
Re: [Announce] Enhanced BusyBox package
Question to anyone using my /sbin/preinit script modification for getting an optional command-line at boot: do you have any issues with it ever since this last version of busybox-power came out?
Mine randomly started segfaulting on me, right at the moment the "sh" line is supposed to run, and I only noticed it a few days ago, but the only thing that changed since I last saw it working was busybox-power and my fiddling around with the R&D mode CAL area (I'm writing a small command-line program in C to change the R&D mode flags from on-device, based on qwerty12's gui program for the same purpose - but I've tried resetting the R&D mode flags using qwerty's program [which I know doesn't mess up the R&D flags, since I used his tool all this time], and rebooting, and I still see a segmentation fault in the console right at the moment the "sh" command runs in my /sbin/preinit modification.) So, anyone getting the same behavior, or is it just me? |
Re: [Announce] Enhanced BusyBox package
Mentalist Traceur: I'm experiencing those segfaults as well. It most likely does that because either root's directory is still RO or /tmp isn't available in that stage of the boot process yet.
I wanted to reply to your PM earlier, but I hadn't had access to the internet prior to today. I'm currently outide the country, so I can't dig into the issue yet. I'll be back home in a little over a week or so. |
Re: [Announce] Enhanced BusyBox package
Quote:
The /tmp directory is mounted just before my boot-shell code executes in /sbin/preinit if you use my exact code. I don't think root file system is read-only either, because I've edited /sbin/preinit when inside the shell launched by /sbin/preinit... (Though I think the boot process errors out right after the file save, probably something to do with it trying to execute the file's code but then having the file changed right under it.) Whether or not everything in the root file system is mounted though, or any parts haven't been 'made' yet (if there's anything that's in /tmp or anywhere else that's needed for the current busybox-power but that gets dynamically made/remade/updated later in the boot process). So, in other words, way out of my league, but there is a "mount tmpfs [...] /tmp" line right before my code in /sbin/preinit. Either way, your latest reply to me by PM today is promising because it suggests this problem won't be relevant as soon as you implement history buffering inside busybox itself instead of the original 'use a temporary file' method. |
Re: [Announce] Enhanced BusyBox package
BusyBox 1.19 has been released a little over a week ago. It contains about 9 months of much appreciated hard work by the BusyBox developers & other contributors. It sure makes a great update :)
Busybox-power has been updated accordingly: 1.19.0power1 just got pushed to Maemo's extras-devel. I'm letting it settle there for a few days before promoting it to extras-testing because of the size of the update. Head over to http://busybox.net/ if you want to find out more about the changes that went into BusyBox 1.19. Changes specific to busybox-power include fixing the issue discovered by Mentalist Traceur in the posts above, busybox being split in busybox and busybox_root (see bug #700), and the activation of a few new applets. I'd like to point out one particularly interesting new feature of BusyBox 1.19: Reverse history search. Whilst already common in other shells, searching your shell history by pressing Ctrl-R is now available in BusyBox' shells too. Enjoy the new release! |
Re: [Announce] Enhanced BusyBox package
Hello.
Does v1.19.0power1 lack ipv6 support? |
Re: [Announce] Enhanced BusyBox package
Quote:
I apparently forgot to enable ipv6 support in the config file of busybox_root. Expect a fixed v1.19.0power2 to hit the repositories soon ;) |
Re: [Announce] Enhanced BusyBox package
I had a bug upgrading from busybox 1.18.5power3 to 1.19.0power2 (missed update to 1.19.0power1). History got stuck, not saving any changes, after the updates. I deleted /root/.ash_history and /home/user/.ash_history and the problem seems to be solved, just thought I'd throw out a heads-up to that effect.
|
Re: [Announce] Enhanced BusyBox package
Quote:
I remember experiencing something similar to this too during development, but I can't seem to reproduce it now by:
I'm also having an issue with swapoff with the busybox-power 1.19.0 series, which seems to be the result of a parsing error of the options passed to it. However, busybox-power doesn't touch (i.e. patch or otherwise modify) swapoff.c and getopt32.c of BusyBox. If possible, I'd like to receive some confirmation from another busybox-power user (one or two confirmations will suffice) whether swapoff works or not for him/her. If not, I'll dig deeper in this. Update: it seems like something broke upstream: swapoff fails with the same message using vanilla source on my laptop too. Second update: Fixed in busybox-power 1.19.0power3 by applying the hotfixes that'll eventually make up BusyBox 1.19.1. |
Re: [Announce] Enhanced BusyBox package
Quote:
|
Re: [Announce] Enhanced BusyBox package
This might be relevant - I THINK I had two xterms open when updating busybox, so I suppose that could have something to do with it.
|
Re: [Announce] Enhanced BusyBox package
i got a bug since i update to your latest update....my device fails to reboot properly...
if i use TC & choose "auto-reboot after saving setting" the device shutdown not reboot...when i run the reboot command on x-term it also fails to reboot properly....it just shutdown my device.... i suspected if it not this it might be related to kernel power v48 aswell... |
Re: [Announce] Enhanced BusyBox package
I got no problems with manual reboot, using bot latest busybox-power and kp48.
Ho ever, other strange problems is showing up, which may be related to busybox-power *or* kp48. Could You guys please open xterm, gain root via "root", then leafpad /usr/bin/whateveronescript_in_that_location ... then try "save as"? In my case, it result in spontaneous reboot all the time. Furthermore, calling upon leafpad after "sudo gainroot" - instead of "root" and trying to "save as" result in leafpad crashing with "Segmentation fault" output in xterm (this time, without rebooting N900). As odd it may sound, I'm pretty sure that this started after busybox power "big update" OR KP48. Most likely the latter, but I'm reporting here "just in case". Also, it's possible that people with R&D mode enabled, won't experience this problem - it may be some watchdog reaction. Mentalist, I'm looking at You ;) |
Re: [Announce] Enhanced BusyBox package
Quote:
http://talk.maemo.org/showthread.php?t=71127 http://talk.maemo.org/showthread.php?t=72002 May I ask if you have the PS3 Sixaxis installed too? May seem random, but I'm just curious. |
Re: [Announce] Enhanced BusyBox package
Quote:
Quote:
Quote:
I must add that I haven't tried your scenario with a pre-KP48 kernel |
Re: [Announce] Enhanced BusyBox package
No PS3 sixaxis here, but it's now 99% sure, that it's kp48 related. Thanks for quick answers and tracing!
|
All times are GMT. The time now is 10:38. |
vBulletin® Version 3.8.8