Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Readers > Amazon Kindle > Kindle Developer's Corner

Notices

Reply
 
Thread Tools Search this Thread
Old 09-02-2012, 11:29 PM   #46
twobob
( ͡° ͜ʖ ͡°){ʇlnɐɟ ƃǝs}Tır
twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.
 
twobob's Avatar
 
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:
Originally Posted by knc1 View Post
But most of this stuff is just what falls off the end of the truck while racing around the learning curve(s).
Spot on mate.

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.
twobob is offline   Reply With Quote
Old 09-03-2012, 07:14 AM   #47
knc1
Going Viral
knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.
 
knc1's Avatar
 
Posts: 17,212
Karma: 18210809
Join Date: Feb 2012
Location: Central Texas
Device: No K1, PW2, KV, KOA
Quote:
Originally Posted by twobob View Post
hmm, this is true but JUST MAYBE I can convince it otherwise with some aliases, it's worth a pop. I'll give it a go now.
Twelve hours too late (you already know that this works) but with a few hours sleep, I can say why it works.

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.
knc1 is offline   Reply With Quote
Advert
Old 09-03-2012, 08:42 AM   #48
twobob
( ͡° ͜ʖ ͡°){ʇlnɐɟ ƃǝs}Tır
twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.
 
twobob's Avatar
 
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:
Originally Posted by knc1 View Post
Nice job.
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.
twobob is offline   Reply With Quote
Old 09-03-2012, 08:51 AM   #49
twobob
( ͡° ͜ʖ ͡°){ʇlnɐɟ ƃǝs}Tır
twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.
 
twobob's Avatar
 
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.
Attached Thumbnails
Click image for larger version

Name:	LXTerminal_052.png
Views:	362
Size:	167.1 KB
ID:	91752   Click image for larger version

Name:	Selection_053.png
Views:	300
Size:	10.1 KB
ID:	91753   Click image for larger version

Name:	Selection_054.png
Views:	285
Size:	14.4 KB
ID:	91754  

Last edited by twobob; 09-03-2012 at 09:11 AM.
twobob is offline   Reply With Quote
Old 09-03-2012, 09:34 AM   #50
twobob
( ͡° ͜ʖ ͡°){ʇlnɐɟ ƃǝs}Tır
twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.
 
twobob's Avatar
 
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:
Code:
CPU: ARMv6-compatible processor revision 3 (ARMv6TEJ), 
Machine: Amazon MX35 Luigi Board
ATAGS:rev16:str="SP1B000000000000"
Memory policy: ECC disabled, Data cache writeback
On node 0 totalpages: 65536
  DMA zone: 48 pages used for memmap
  DMA zone: 0 pages reserved
  DMA zone: 6096 pages, LIFO batch:0
  Normal zone: 464 pages used for memmap
  Normal zone: 58928 pages, LIFO batch:15
  Movable zone: 0 pages used for memmap
CPU0: D VIPT write-back cache
CPU0: I cache: 16384 bytes, associativity 4, 32 byte lines, 128 sets
CPU0: D cache: 16384 bytes, associativity 4, 32 byte lines, 128 sets
Built 1 zonelists in Zone order, mobility grouping on.  Total pages: 65024
Kernel command line: console=ttymxc0,115200 mem=256M panic=10 root=/dev/mmcblk0p1 ro ip=none quiet lpj=2555904
MXC IRQ initialized
PID hash table entries: 1024 (order: 10, 4096 bytes)
MXC GPT timer initialized, rate = 16000000
Dentry cache hash table entries: 32768 (order: 5, 131072 bytes)
Inode-cache hash table entries: 16384 (order: 4, 65536 bytes)
Memory: 256MB = 256MB total
Memory: 255796KB available (3036K code, 276K data, 620K init)
Calibrating delay loop (skipped)... 511.18 BogoMIPS preset
Mount-cache hash table entries: 512
CPU: Testing write buffer coherency: ok
net_namespace: 492 bytes
NET: Registered protocol family 16
L2X0 cache controller enabled
CPU is i.MX35 Revision 2.0
Board ID and Serial Number driver for Lab126 boards version 1.0
MX35 Board id - SP1B000000000000
MX35 Reset Control and Status Register: 0x26400000
MXC GPIO hardware
mxc_pwm_device registered
Using SDMA I.API
MXC DMA API initialized
MXC PWM Initialized
CSPI: mxc_spi-0 probed
CSPI: mxc_spi-1 probed
MXC I2C driver
MXC I2C driver
clk: Unable to get requested clock: dfm_clk
PMIC Light driver loading...
Registering the PMIC Protocol Driver
mc13892 Rev 2.1 FinVer 2 detected
usbdr_early_portsc1_read: 0
PMIC ADC start probe
PMIC Light successfully loaded
mc13892 Rev 2.1 FinVer 2 detected
MC13892 regulator successfully probed
Device spi1.0 probed
NET: Registered protocol family 2
IP route cache hash table entries: 2048 (order: 1, 8192 bytes)
TCP established hash table entries: 8192 (order: 4, 65536 bytes)
TCP bind hash table entries: 8192 (order: 3, 32768 bytes)
TCP: Hash tables configured (established 8192 bind 8192)
TCP reno registered
NET: Registered protocol family 1
Initializing MX35 DVFS on MC13892 Finid: 2
Power Button Debounce Settings: 0x401000
MX35 Luigi working points: 2
Initializing Luigi WiFi 
Initializing MX35 Luigi/Shasta Accessory Port
No Accessory Found
Luigi/Freescale MX35 CPUFREQ driver
usb: Host 2 host (serial) registered
usb: DR gadget (utmi) registered
NetWinder Floating Point Emulator V0.97 (double precision)
msgmni has been set to 499
io scheduler noop registered
io scheduler anticipatory registered
io scheduler deadline registered
io scheduler cfq registered (default)
Amazon MX35 Luigi Power Button Driver
Serial: MXC Internal UART driver
mxcintuart.0: ttymxc0 at MMIO 0x43f90000 (irq = 45) is a Freescale MXC
console [ttymxc0] enabled
mxcintuart.1: ttymxc1 at MMIO 0x43f94000 (irq = 32) is a Freescale MXC
mxcintuart.2: ttymxc2 at MMIO 0x5000c000 (irq = 18) is a Freescale MXC
loop: module loaded
mc13892 rtc probe start
pmic_rtc pmic_rtc.1: rtc core: registered pmic_rtc as rtc0
mc13892 rtc probe succeed
i2c /dev entries driver
MXC WatchDog Driver 2.0
MXC Watchdog # 0 Timer: initial timeout 127 sec
MXC Watchdog: Started 10000 millisecond watchdog refresh
PMIC Character device: successfully loaded
mxsdhci: MXC Secure Digital Host Controller Interface driver
mxsdhci: MXC SDHCI Controller Driver. 
mmc0: Using 8-bit bus width
mmc0: SDHCI detect irq 65 irq 7 INTERNAL DMA
mxsdhci: MXC SDHCI Controller Driver. 
mmc1: SDHCI detect irq 66 irq 8 INTERNAL DMA
mxsdhci: MXC SDHCI Controller Driver. 
emmc: I def:mmcpartinfo:vendor=samsung, mode=open-ended, host=mmc0:
mmc2: SDHCI detect irq 140 irq 9 INTERNAL DMA
mmc0: Using block addressing
ext_csd: 0x3
mmc0: new high speed MMC card at address 0001
mmcblk0: mmc0:0001 M4G1EM 3907584KiB 
 mmcblk0:<6>Registered led device: pmic_ledsr
Registered led device: pmic_ledsg
 p1 p2 p3 p4
Registered led device: pmic_ledsb
Advanced Linux Sound Architecture Driver Version 1.0.16.
ASoC version 0.13.2
wm8960: WM8960 Audio Codec 0.1
DMA Sound Buffers Allocated:UseIram=1 buf->addr=10001000 buf->area=d0820000 size=65536
DMA Sound Buffers Allocated:UseIram=1 buf->addr=8fa80000 buf->area=fde01000 size=65536
asoc: WM8960 <-> imx-i2s-1-0 mapping ok
ALSA device list:
  #0: mx35luigi (WM8960)
nf_conntrack version 0.5.0 (4096 buckets, 16384 max)
ip_tables: (C) 2000-2006 Netfilter Core Team
TCP cubic registered
NET: Registered protocol family 17
NET: Registered protocol family 15
RPC: Registered udp transport module.
RPC: Registered tcp transport module.
mxc_rtc mxc_rtc.0: rtc core: registered mxc_rtc as rtc1
mmc1: queuing CIS tuple 0x01 length 3
mmc1: queuing CIS tuple 0x1a length 5
mmc1: queuing CIS tuple 0x1b length 8
mmc1: queuing CIS tuple 0x14 length 0
mmc1: queuing CIS tuple 0x80 length 1
mmc1: queuing CIS tuple 0x81 length 1
mmc1: queuing CIS tuple 0x82 length 1
mmc1: new SDIO card at address 0001
mxc_rtc: saved=0x0 boot=0x8
boot: C def:bcut:batterycut=1,version=s061168:
Real Time clock Driver v1.0 
kernel: W perf:kernel:kernel_loaded=1.54 seconds:
boot globals: I reserved 4096 bytes at 0x8FFFF000
boot globals: I warm restart flag not set (0x00000100)
boot globals: I invalid, clearing
boot globals: I setting kernel_boot_flag = 64
boot globals: I setting warm restart to 0x646C6F63
Static Power Management for Freescale i.MX35
VFP support v0.3: implementor 41 architecture 1 part 20 variant b rev 3
pmic_rtc pmic_rtc.1: setting system clock to 1970-01-01 00:00:08 UTC (8)
Freeing init memory: 620K
mxc_keyb: I def:drv::Keypad driver loaded
input: mxckpd as /devices/virtual/input/input0
kjournald starting.  Commit interval 5 seconds
EXT3-fs: mounted filesystem with ordered data mode.
kjournald starting.  Commit interval 5 seconds
EXT3 FS on mmcblk0p2, internal journal
EXT3-fs: recovery complete.
EXT3-fs: mounted filesystem with ordered data mode.
eink_fb: I ipu_controller_type:def:Detected broadsheet controller
eink_fb: I bs_cmd_ld_img_upd_data_which:def:temp=24C:from pmic
eink_fb: I bs_cmd_ld_img_upd_data_which:def:temp=24C:from pmic
eink_fb: I bs_cmd_ld_img_upd_data_which:def:temp=24C:from pmic
eink_fb: I EINKFB_PROBE:def:fb0 using 708K of RAM for framebuffer
eink_fb: I bs_cmd_ld_img_upd_data_which:def:temp=25C:from pmic
eink_fb: I bs_cmd_ld_img_upd_data_which:def:temp=25C:from pmic
mwan: I mwan_init:init:mario WAN hardware driver 1.2.0
ARC USBOTG Device Controller driver (10/08/2009)
kernel: I perf:usb:usb_gadget_loaded=18.05 seconds:
g_file_storage gadget: File-backed Storage Gadget, version: 7 August 2007
g_file_storage gadget: Number of LUNs=1
fsl-usb2-udc: bind to driver g_file_storage 
fuse init (API version 7.9)
mxc_keyb: I def:drv::Keypad driver loaded
input: mxckpd as /devices/virtual/input/input1
fiveway: I def:probe0::Starting...
fiveway: I def:probe_done::GPIOs and IRQs have been set up
input: fiveway as /devices/virtual/input/input2
fiveway: I def:drv::Fiveway driver loaded
volume: I def:probe0::Starting...
volume: I def:probe_done::GPIOs and IRQs have been set up
input: volume as /devices/virtual/input/input3
volume: I def:drv::Volume key driver loaded
No USB/Charger found ... entering low power idle
Charger: Turning on CPUFreq
ar6000: Shasta Atheros Ar6000 WiFi Driver
ar6000_probe: initializing!
kernel: I perf:wifi:wifi_driver_loaded=37.48 seconds:
AR6000 Reg Code = 0x40000060
Accessory port enable
mxc_keyb: I def:unlocked1:status=unlocked:
fiveway: I def:unlock1:status=unlocked:
No Accessory Found
usbcore: registered new interface driver usbfs
usbcore: registered new interface driver hub
usbcore: registered new device driver usb
fsl-ehci fsl-ehci.0: Freescale On-Chip EHCI Host Controller
fsl-ehci fsl-ehci.0: new USB bus registered, assigned bus number 1
fsl-ehci fsl-ehci.0: irq 35, io mem 0x53ff4400
fsl-ehci fsl-ehci.0: USB 2.0 started, EHCI 1.00, driver 10 Dec 2004
usb usb1: configuration #1 chosen from 1 choice
hub 1-0:1.0: USB hub found
hub 1-0:1.0: 1 port detected
usb 1-1: new full speed USB device using fsl-ehci and address 2
usb 1-1: configuration #1 chosen from 1 choice
usbcore: registered new interface driver usbserial
usbserial: USB Serial Driver core
usbserial: USB Serial support registered for GSM modem (1-port)
option 1-1:1.0: GSM modem (1-port) converter detected
usb 1-1: GSM modem (1-port) converter now attached to ttyUSB0
option 1-1:1.1: GSM modem (1-port) converter detected
usb 1-1: GSM modem (1-port) converter now attached to ttyUSB1
usbcore: registered new interface driver option
option: USB Driver for GSM modems: v0.7.2
EXT3 FS on mmcblk0p1, internal journal
mwan: I init_modem_type:smt:type=3:setting modem type
PPP generic driver version 2.4.2
Enter LPM

...

flashing):x1=0,x2=600,y1=768,y2=800
unregistered gadget driver 'g_file_storage'
usb0: Ethernet Gadget, version: May Day 2005
usb0: using fsl-usb2-udc, OUT ep1out IN ep1in STATUS ep2in
usb0: MAC ee:99:99:00:00:00
usb0: HOST MAC ee:99:99:00:00:00
usb0: RNDIS ready
fsl-usb2-udc: bind to driver ether 

eink_fb: I bs_cmd_ld_img_upd_data_which:def:temp=25C:from pmic
Charger: Setting CPU Frequeny to 512MHz
Connected to a HIGH speed Host
usb0: full speed config #1: 100 mA, Ethernet Gadget, using CDC Ethernet
battery: I def:avg:Average_mAH_usage=9mAH, time=170seconds:
Accessory port disabled!
mxc_keyb: I def:locked2:status=locked:
fiveway: I def:locked2:status=locked:
eink_fb: I bs_cmd_ld_img_upd_data_which:def:temp=26C:from pmic


Okay nothing there about it... at all...

must be post boot. and not recorded in that log.

need more logs...
twobob is offline   Reply With Quote
Advert
Old 09-03-2012, 10:21 AM   #51
twobob
( ͡° ͜ʖ ͡°){ʇlnɐɟ ƃǝs}Tır
twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.
 
twobob's Avatar
 
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:
Subshells

In UNIX, when a program starts another program (more exactly, when a process starts another process), the new process runs as a subprocess or child process. [1] When a shell starts another shell, the new shell is called a subshell . [2]

[1] This isn't true when the subprocess is exec d from the parent process without a fork first.

[2] When you use the shell's exec command, it does not start a subprocess.

So what? There are some important things to know about it: the child process gets a copy of its parent's environment. Any changes in the environment of the child process aren't passed to its parent. "Still," I hear you say, "so what??"

Shell scripts are run in a subshell (unless you use the source or . commands to start the script). If the script makes changes to the environment of its (sub)shell, the parent shell won't see those changes. If the script uses cd , it doesn't change the current directory in the parent shell. If the script changes the value of the TZ (or any) environment variable , that won't change TZ in the parent shell. The script can set a different umask than the parent shell - no problem.

There are times you might want to start a subshell from your current shell. Maybe you have a special project where you need to work in a different current directory, reset environment variables, set a new home directory, reset some aliases, use a different PATH, whatever. When you end the subshell, the parent shell's environment will be the way it was.
so a simple test would be to type su and try again

[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*
twobob is offline   Reply With Quote
Old 09-03-2012, 10:26 AM   #52
twobob
( ͡° ͜ʖ ͡°){ʇlnɐɟ ƃǝs}Tır
twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.
 
twobob's Avatar
 
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:
su: unrecognized option `--version'
BusyBox v1.20.2 (2012-09-03 02:06:04 BST) multi-call binary.
Bonus, it's our one - so we can amend the script I think to do more stuff (this is a guess)

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...
twobob is offline   Reply With Quote
Old 09-03-2012, 10:53 AM   #53
twobob
( ͡° ͜ʖ ͡°){ʇlnɐɟ ƃǝs}Tır
twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.
 
twobob's Avatar
 
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:
su: unrecognized option `--version'
BusyBox v1.20.2 (2012-09-03 02:06:04 BST) multi-call binary.
[root@kindle root]# exit
[root@kindle root]# su
[root@kindle root]# su --version
Quote:
su: unrecognized option `--version'
BusyBox v1.7.2 (2011-09-08 21:57:14 PDT) multi-call binary

hmm... so it's the fact that the underlying sh is being attached I think...

does more thinking..
twobob is offline   Reply With Quote
Old 09-03-2012, 11:14 AM   #54
twobob
( ͡° ͜ʖ ͡°){ʇlnɐɟ ƃǝs}Tır
twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.
 
twobob's Avatar
 
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...
twobob is offline   Reply With Quote
Old 09-03-2012, 11:28 AM   #55
knc1
Going Viral
knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.
 
knc1's Avatar
 
Posts: 17,212
Karma: 18210809
Join Date: Feb 2012
Location: Central Texas
Device: No K1, PW2, KV, KOA
Quote:
Originally Posted by twobob View Post
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?
Nice test - -
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.
knc1 is offline   Reply With Quote
Old 09-03-2012, 12:07 PM   #56
knc1
Going Viral
knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.
 
knc1's Avatar
 
Posts: 17,212
Karma: 18210809
Join Date: Feb 2012
Location: Central Texas
Device: No K1, PW2, KV, KOA
Quote:
Originally Posted by twobob View Post
[root@kindle root]# su -s/mnt/us/bin/sh
[root@kindle root]# su --version


[root@kindle root]# exit
[root@kindle root]# su
[root@kindle root]# su --version



hmm... so it's the fact that the underlying sh is being attached I think...

does more thinking..
That may not be a "login" shell - try:
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.)
knc1 is offline   Reply With Quote
Old 09-03-2012, 12:07 PM   #57
twobob
( ͡° ͜ʖ ͡°){ʇlnɐɟ ƃǝs}Tır
twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.
 
twobob's Avatar
 
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!
twobob is offline   Reply With Quote
Old 09-03-2012, 12:11 PM   #58
knc1
Going Viral
knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.
 
knc1's Avatar
 
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.
knc1 is offline   Reply With Quote
Old 09-03-2012, 12:14 PM   #59
twobob
( ͡° ͜ʖ ͡°){ʇlnɐɟ ƃǝs}Tır
twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.
 
twobob's Avatar
 
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.
twobob is offline   Reply With Quote
Old 09-03-2012, 12:28 PM   #60
twobob
( ͡° ͜ʖ ͡°){ʇlnɐɟ ƃǝs}Tır
twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.
 
twobob's Avatar
 
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:
me@dev ~ $ ssh root@k
#################################################
# N O T I C E * N O T I C E * N O T I C E #
#################################################
Rootfs is mounted read-only. Invoke mntroot rw to
switch back to a writable rootfs.
#################################################
[root@kindle root]# su -h
BusyBox v1.20.2 (2012-09-03 02:06:04 BST) multi-call binary.

Usage: su [OPTIONS] [-] [USER]

Run shell under USER (by default, root)

-,-l Clear environment, run shell as login shell
duh. oh yeah. so we:

[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:
su: unrecognized option `--version'
BusyBox v1.20.2 (2012-09-03 02:06:04 BST) multi-call binary.
Happy days.

Now... need to convince ALL subshells to spawn as -l then...
or something. *resumes reading*
Attached Thumbnails
Click image for larger version

Name:	Selection_056.png
Views:	300
Size:	102.3 KB
ID:	91762   Click image for larger version

Name:	Selection_058.png
Views:	301
Size:	104.7 KB
ID:	91763  
twobob is offline   Reply With Quote
Reply

Tags
busybox


Forum Jump

Similar Threads
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


All times are GMT -4. The time now is 07:34 PM.


MobileRead.com is a privately owned, operated and funded community.