davilla / atvusb-creator

Automatically exported from code.google.com/p/atvusb-creator
27 stars 53 forks source link

telnetd rears it ugly head again... /dev/sdb{a,1,2} are not created during startup #322

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
Dunno what you kiddies consider a release, alpha or beta.

But, the installation failed for me with the dreaded "telnetd" starting up
'cause /etc/init.d/rcS couldn't find patchstick.sh -- and that's because
the block i/o special files for the USB key aren't being created during
initialization -- /dev/sdb{a,1,2} are missing -- patchstick.sh is on
/dev/sdb2 and can't of course be found and telnetd is called in
/etc/initi.d/rcS .  

Cause of the dreaded appearance of the telnetd monster is identified.

Why?  Haven't a clue -- that's for you rocket scientists to figure out. I
have no interest in getting that far into the internals of yet another *nix
implementation.

WHO TAUGHT YOU NEWBIES TO CODE?  Have you ever heard of comments?  Oh,
lookup basename -- it does a nice job of stripping
off/all/the/slashes/before/a/filename ;)

I don't know, precisely, how to fix the init process 'cause I don't know
the current means by when devices are auto created in /dev. 

Howevever, unplugging the usb key for a moment and plugging it back in
causes the /dev/sdb* block special files for the USB key to automagicaly
appear..

Here's the cookie crumb trail for you to follow to fix this problem:

1)  Virgin, freshly restored atv (new, as of last week) booted with:
2)  512MB Sandisk cruzer. created using,
3)  atvusb-creator-1.0.b10.zip created on MacBookPro OS/X under 10.5.6
4)  checked to ensure PATCHSTICK partition had all goodies, then
5)  Inserted the key in a powered-down atv (2.2)
6)  Applied power, shortly after, the install failed and telnetd running
7)  telnet to atv and checked on /dev/sdb*:
      $ telnet 10.0.10.102
      Trying 10.0.10.102...
      Connected to 10.0.10.102.
      Escape character is '^]'.

      penbuntu login: root
      Password: ****      <====== "root"
      # ls /dev/sd*
      /dev/sda   /dev/sda1  /dev/sda2  /dev/sda3  /dev/sda4

    Oh, look at that! partition no mounted... Since
    /etc/init.d/rcS calls /usr/sbin/find_run_script.sh to hunt down
    patchstick.sh by means of mounting all the partitions it can
    find in /dev/sd* -- no special files -- no shell script found

8)  Momentarily remove and reinsert USB key, and le voila!:
       # ls /dev/sd*
       /dev/sda   /dev/sda1  /dev/sda2  /dev/sda3  \
       /dev/sda4  /dev/sdb   /dev/sdb1  /dev/sdb2
    There's the pesky buggers!

9)   a quick 
        fsck.hfsplus -f /dev/sdb2
        mount -t hfsplus -o rw,force /dev/sdb2 /mnt/rootfs
        sh /mnt/rootfs/patchstick.sh

10)  The script finishes cleanly, pulling the power and key
     and reapplying power will shortly achieve bliss.

Hope it helps.

And PLEASE comment your shell scripts for us old fossils...I go back to the
days when our guys looked down at our noses at those pussies at berkeley
with their full screen editor, vi...  "ed" was all a real nerd needed ;)

Jan

ps., that's not my real name. of course.  my background in this O/S started
in the same lab that brought you the transistor.

Original issue reported on code.google.com by happilyb...@gmail.com on 11 May 2009 at 8:01

GoogleCodeExporter commented 9 years ago
ooo, nasty :)  sounds like the kernel need a bit more time for your specific 
USB device to enumerate.

add rootdelay=<delay> where <delay> is a time to delay in seconds to the 
"Kernel Flag" string param in 
com.apple.Boot.plist. This will get passed to the linux kernel at boot time. 

"I don't know, precisely, how to fix the init process 'cause I don't know
the current means by when devices are auto created in /dev. "

That would be the busybox mdev which is the replacement for the normal udev. 
But that's not the real 
problem. The real problem is the kernel is booting, the USB device driver gets 
loaded but your USB device is 
slow to enumerate and thus gets missed in /dev creation. Could be an mdev 
issue, I'd have to look into it.

BYW, this is the first time anyone has bothered to try to understand the 
problem. I've never seen it with any of 
my USB devices :) As always, patches are welcome. And I am an old fossil myself 
:)

Original comment by sdavi...@gmail.com on 11 May 2009 at 8:24

GoogleCodeExporter commented 9 years ago
I'm not sure it's time ... when key is pulled and reinserted, the device files 
are
created instantaneously.  the 10 second wait in rcS does squat from what I can 
tell....

Original comment by jcol...@gmail.com on 11 May 2009 at 9:27

GoogleCodeExporter commented 9 years ago
never said anything about changing the 10 second wait in rcS :)

"add rootdelay=<delay> where <delay> is a time to delay in seconds to the 
"Kernel Flag" string param in 
com.apple.Boot.plist. This will get passed to the linux kernel at boot time. "

Original comment by sdavi...@gmail.com on 11 May 2009 at 9:39

GoogleCodeExporter commented 9 years ago
Ok, I was getting the problem of patchstick.sh not being found and landed here. 
 I see all my devs mounted by 
the time telneted in, so I just fsck-ed, mounted, and ran the script.  Seems to 
work fine.  Not sure why it could 
not find the script the first time around.  I did have to plug in ethernet to 
telnet.  I guess the kernel that gets 
loaded does not do wireless?

[This must be a home for old fossils.  I still have my photocopies of v6 
listings from 1975...]

Original comment by ptwi...@gmail.com on 10 Jan 2010 at 1:08

GoogleCodeExporter commented 9 years ago
Wireless drivers are property of Apple which means you've got distribution 
issues 
etc. Not to mention there is no open for a Linux version

Original comment by Sam.Nazarko on 10 Jan 2010 at 1:47