![]() |
#46 | |
( ͡° ͜ʖ ͡°){ʇlnɐɟ ƃǝs}Tır
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 6,586
Karma: 6299993
Join Date: Jun 2012
Location: uti gratia usura (Yao ying da ying; Mo ying da yieng)
Device: PW-WIFI|K5-3G+WIFI| K4|K3-3G|DXG|K2| Rooted Nook Touch
|
Quote:
Yes Inetd and the like are all running like charms. In fact everything seems to work incredibly well. crazy really when you consider how very unlikely that is. well bedtime. catch you after mate. Shame about losing all the nice front end tools but I have other plans so... yeah. maybe i will sort that qsort_r definition one day myself. and get some FB support for QT ah well. bedtime. |
|
![]() |
![]() |
![]() |
#47 | |
Going Viral
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 17,212
Karma: 18210809
Join Date: Feb 2012
Location: Central Texas
Device: No K1, PW2, KV, KOA
|
Quote:
Alias expansion happens before the search for the command. It has to, once some sleep and thought is applied to the question. ![]() The "typical" use of alias commands is to append options to the command that over-ride the usual defaults. Here, the alias commands are used to prepend the multi-call binary's name. Regardless of how Busybox is configured, it never has itself as its own built-in, so the normal "path search" system is used to find the executable. So with the 1.20 version being found by name from the "path search", it gets called even from within the 1.7 command line shell. This alias usage should work with **any** shell that supports the alias expansion feature, not just ash and bash. One question pops into my mind about this: Does the alias list (which looks like environment settings) get passed to child shells the same as the other environment settings? No need to test for that, it should be obvious with just normal use - something will mis-behave. One maintenance item pops into my mind: When the full sized utility is installed (which would normally replace the busybox sym-link), the installation process will have to sed or awk the .alias list and unset the alias entry. For instance: The new busybox (and alias list for the old busybox) provides swapon / swapoff - - If those are built from the full sources and installed, the swapon=busybox swapon has to come out of the list and be unset from the environment before they can be accessed from the command line. But overall, a slick way of dealing with an executable that normally depends on sym-links (or hard-links) when it is installed on a file-system that does not support either. Nice job. Last edited by knc1; 09-03-2012 at 07:34 AM. |
|
![]() |
![]() |
Advert | |
|
![]() |
#48 |
( ͡° ͜ʖ ͡°){ʇlnɐɟ ƃǝs}Tır
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 6,586
Karma: 6299993
Join Date: Jun 2012
Location: uti gratia usura (Yao ying da ying; Mo ying da yieng)
Device: PW-WIFI|K5-3G+WIFI| K4|K3-3G|DXG|K2| Rooted Nook Touch
|
I was so poorly yesterday, Many thanks for your explanation, whilst I foggily grasped the mechanics enough to figure it was a decent hack; I honestly didn't fully understand why.
It's astounding how just a little bit of positive feedback can make one feel better about burning a day on something that very possibly only one or two people in the world may appreciate (directly). So, fair readers, never be afraid to stroke the pets, they don't bite (mainly) and really do need some attention from time to time. : ) Thanks mate. I will endeavour to do a sub shell test today - just for good measure. I am thinking nc is the simplest test. the native one expects [root@kindle root]# nc BusyBox v1.7.2 (2011-09-08 21:57:14 PDT) multi-call binary Usage: nc [IPADDR PORTNUM] The new one expects [root@kindle root]# /mnt/us/usr/bin/nc BusyBox v1.20.2 (2012-09-03 02:06:04 BST) multi-call binary. Usage: nc [-l] [-p PORT] [IPADDR PORT] AND I foolishly left it out of my alias list (heck, I was tired, I forgive me) but that will prove useful as I create the simple awk/sed script that inserts/strips out the aliases. If a sub shell call to nc somwhere -l -p port dies with a -l or -p syntax error we have our answer. I'll report back on that. Err once I figure out what a subshell is (hah kidding) I am happy to report that my vice like acid in the brain headache has subsided to mere tectonic proportions, which I can handle. Later. |
![]() |
![]() |
![]() |
#49 |
( ͡° ͜ʖ ͡°){ʇlnɐɟ ƃǝs}Tır
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 6,586
Karma: 6299993
Join Date: Jun 2012
Location: uti gratia usura (Yao ying da ying; Mo ying da yieng)
Device: PW-WIFI|K5-3G+WIFI| K4|K3-3G|DXG|K2| Rooted Nook Touch
|
In other news I was CERTAIN the alias list just COULD NOT be this big... something should die horribly... or maybe the ram of the machine would be sucked into oblivion.
The machine hasn't been turned off for weeks so I'm going to bite the bullet and do a full restart (to give me a no-leak base memory reading) and see if something dies. Wish me luck. EDIT: Okay went through fine... about a 90Mb footprint these days at boot? Is that right? anyone? One suprise is highlighted in the picture. Err. why is the new busybox, starting telnetd. in fact. why is the new busybox doing anything at reboot? has my wangle somehow convinced the system to preferentially deal out some of the STARTUP WORK to the new busybox? sounds insanely dangerous and extremely cool. well. it certainly WORKS and I see no actually difference YET in my performance, i.e it hasn't burst into flames...... yet. Last edited by twobob; 09-03-2012 at 09:11 AM. |
![]() |
![]() |
![]() |
#50 |
( ͡° ͜ʖ ͡°){ʇlnɐɟ ƃǝs}Tır
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 6,586
Karma: 6299993
Join Date: Jun 2012
Location: uti gratia usura (Yao ying da ying; Mo ying da yieng)
Device: PW-WIFI|K5-3G+WIFI| K4|K3-3G|DXG|K2| Rooted Nook Touch
|
dmesg bereft of useful data.
[root@kindle root]# dmesg
Spoiler:
Okay nothing there about it... at all... must be post boot. and not recorded in that log. need more logs... |
![]() |
![]() |
Advert | |
|
![]() |
#51 | |
( ͡° ͜ʖ ͡°){ʇlnɐɟ ƃǝs}Tır
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 6,586
Karma: 6299993
Join Date: Jun 2012
Location: uti gratia usura (Yao ying da ying; Mo ying da yieng)
Device: PW-WIFI|K5-3G+WIFI| K4|K3-3G|DXG|K2| Rooted Nook Touch
|
okay so. back to that little mystery later.
Onwards to the test: STATE YOUR ASSUMPTIONS: 1) old netcat will choke on extra -p -l flags 2) new netcat works and in place 3) .alias trick will pass the call to the new nc 4) subshells will be passed through the .alias layer. Okay next - What is a subshell? http://docstore.mik.ua/orelly/unix/upt/ch38_04.htm Quote:
[root@kindle us]# su [root@kindle root]# grep --version grep: unrecognized option `--version' BusyBox v1.7.2 (2011-09-08 21:57:14 PDT) multi-call binary Usage: grep [-HhrilLnqvsoeFABC] PATTERN [FILEs...] Fail *gets out the welding gear and digs around some more* |
|
![]() |
![]() |
![]() |
#52 | |
( ͡° ͜ʖ ͡°){ʇlnɐɟ ƃǝs}Tır
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 6,586
Karma: 6299993
Join Date: Jun 2012
Location: uti gratia usura (Yao ying da ying; Mo ying da yieng)
Device: PW-WIFI|K5-3G+WIFI| K4|K3-3G|DXG|K2| Rooted Nook Touch
|
Okay so first thing to test....
WHICH su is called by default. [root@kindle us]# su --version Quote:
second thing to test... does the internal subshell mechanism call our su to do its work? or something else? This I don't know, but no doubt more endless reading will illuminate me. Or we could just test, yeah let's do that instead. TBC... |
|
![]() |
![]() |
![]() |
#53 | ||
( ͡° ͜ʖ ͡°){ʇlnɐɟ ƃǝs}Tır
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 6,586
Karma: 6299993
Join Date: Jun 2012
Location: uti gratia usura (Yao ying da ying; Mo ying da yieng)
Device: PW-WIFI|K5-3G+WIFI| K4|K3-3G|DXG|K2| Rooted Nook Touch
|
[root@kindle root]# su -s/mnt/us/bin/sh
[root@kindle root]# su --version Quote:
[root@kindle root]# su [root@kindle root]# su --version Quote:
hmm... so it's the fact that the underlying sh is being attached I think... does more thinking.. |
||
![]() |
![]() |
![]() |
#54 |
( ͡° ͜ʖ ͡°){ʇlnɐɟ ƃǝs}Tır
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 6,586
Karma: 6299993
Join Date: Jun 2012
Location: uti gratia usura (Yao ying da ying; Mo ying da yieng)
Device: PW-WIFI|K5-3G+WIFI| K4|K3-3G|DXG|K2| Rooted Nook Touch
|
since this is ash maybe a ENV=blah...
|
![]() |
![]() |
![]() |
#55 | |
Going Viral
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 17,212
Karma: 18210809
Join Date: Feb 2012
Location: Central Texas
Device: No K1, PW2, KV, KOA
|
Quote:
That the existing scripting would run under the new busybox. ![]() ![]() Well, somebody had to try the re-boot function, some time. Nice to know all of this work didn't turn in into a re-brick function. - - - - To answer the little mystery question would really require to break out the initramfs scripting for examination, but .... Somewhere in there, the "old" shell picked up the alias list. And / Or picked up the changes to the PATH environment variable. I would go with "AND" - since both are required to make the shell that is running (old or new) recognize a scripted command as an alias and be able to find the "new" busybox on the PATH. An initramfs script transfers control to the system that was setup with some version of: exec /bin/sh </dev/console >/dev/console ... ... ... or exec /init </dev/console >/dev/console ... ... ... With either a "switch_root" or a "pivot_root" command tossed in for flavor (which includes the basics of an "exec" call). I.E: The command shell running when the regular userspace is first hit from early userspace is "a chained continuation" not a "child continuation". (See the later quoted explanation of a "child" or "sub-shell" process.) So, the question gets promoted to: How did the "chained continuation" pick up the . .alias and the PATH= changes? Answer: From the fixed name initialization files that you mentioned earlier you had to add and/or alter. (The ones you noted a "stock" K3 does not have.) New question: Is this a bad thing? Duh... I don't know. I do know it is what we wanted to happen, sometime later after months of testing. Guess you left some skid marks on that part of the learning curve and maybe bump'd across the in-field a bit. ![]() Why did telnetd get started? Blame that one on lab126 slop. An embedded system under development very often has telnetd running in the image as a development aid. When ready for release - that telnetd may (often is) disabled. How? By removing the init rc.?? script to start it. By removing the iptables port 21 "hole". By removing telnetd from the system image. We know that lab126 did #2 above - we can read the iptables rules. Listing the old busybox features should tell us if they did #3 above. What they evidently did not do was #1 above. And when you provided (unintentionally) access to the new busybox with telnetd included, it started working again. Duh... Add a new input chain rule that does a -j accept for port 21 - then reload the iptable rules. Whoot! You should be able to telnet into the box from **any** network connection (unless you qualify the source in the rule). So much for the "I can't ssh into my K3" problem reports. Who needs it? (ssh, dropbear, etc, etc). Parts above are pure speculation - but it makes a story that hangs together. |
|
![]() |
![]() |
![]() |
#56 | |
Going Viral
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 17,212
Karma: 18210809
Join Date: Feb 2012
Location: Central Texas
Device: No K1, PW2, KV, KOA
|
Quote:
su -l or su - whatever the option is to specify a login shell with bb su. (Some of the fixed name init files are only read by a login shell, others are read by both non-login and login shells.) |
|
![]() |
![]() |
![]() |
#57 |
( ͡° ͜ʖ ͡°){ʇlnɐɟ ƃǝs}Tır
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 6,586
Karma: 6299993
Join Date: Jun 2012
Location: uti gratia usura (Yao ying da ying; Mo ying da yieng)
Device: PW-WIFI|K5-3G+WIFI| K4|K3-3G|DXG|K2| Rooted Nook Touch
|
well. that sounds about spot on to me.
A most illuminating answer that I am going to read three times, with tea, and then go test for good measure. : ) Good fun! |
![]() |
![]() |
![]() |
#58 |
Going Viral
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 17,212
Karma: 18210809
Join Date: Feb 2012
Location: Central Texas
Device: No K1, PW2, KV, KOA
|
A "chained continuation" has the same PID
A "child continuation" has a new PID Can you set your (h)top to display the PPID (parent PID)? Note: We pushed the "submit" button at the same time. There is a new post following the big one, before your reply that concerns testing. Last edited by knc1; 09-03-2012 at 12:19 PM. |
![]() |
![]() |
![]() |
#59 |
( ͡° ͜ʖ ͡°){ʇlnɐɟ ƃǝs}Tır
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 6,586
Karma: 6299993
Join Date: Jun 2012
Location: uti gratia usura (Yao ying da ying; Mo ying da yieng)
Device: PW-WIFI|K5-3G+WIFI| K4|K3-3G|DXG|K2| Rooted Nook Touch
|
yep no probs on the PPID - Ill have a look now.
|
![]() |
![]() |
![]() |
#60 | ||
( ͡° ͜ʖ ͡°){ʇlnɐɟ ƃǝs}Tır
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 6,586
Karma: 6299993
Join Date: Jun 2012
Location: uti gratia usura (Yao ying da ying; Mo ying da yieng)
Device: PW-WIFI|K5-3G+WIFI| K4|K3-3G|DXG|K2| Rooted Nook Touch
|
okay. as usual - you were right.
*looks at picture one * it's a tidied up and pared down view of htop with the noise removed. we can see two sh processes - both mine - one for htop, one for the testing console. a) note knc1's rightness: Quote:
[root@kindle root]# su -l *looks at picture two* ah yes. a child is born, right PPID, new PID. Let's test if the .alias was processed. [root@kindle root]# su --version Quote:
Now... need to convince ALL subshells to spawn as -l then... or something. *resumes reading* |
||
![]() |
![]() |
![]() |
Tags |
busybox |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Kobo runs linux and busybox | billingd | Kobo Reader | 32 | 04-03-2011 10:19 AM |
configuring text to speech | hpratt | Amazon Kindle | 1 | 06-28-2010 01:34 PM |
Configuring? | rachangua | PocketBook | 3 | 05-15-2010 03:33 AM |
Updating Busybox | Adam B. | iRex | 14 | 10-23-2008 10:18 AM |
Cybook source code released (kernel and busybox) | dottedmag | Gen3 Developer's Corner | 14 | 09-12-2008 04:59 AM |