[Wylug-help] USB Flash: device numbers, filenames and grub

Towle, William william.towle at echostar.com
Mon Jan 29 15:33:49 GMT 2007


> However, http://en.wikipedia.org/wiki/Initrd says:
> 
>   "Most initial root file systems implement "/linuxrc" as a 
> shell script
>   and thus include a minimal shell (usually /bin/ash) along with some
>   essential user-space utilities (usually the BusyBox toolkit)."
> 
> I'm guessing (not assuming) from what I see in the extracted 
> initrd, that the busybox utilities have configuration and 
> init files similar to those in a normal linux filesystem.

  More or less - though in recent times you'll probably find
busybox is providing 'ash' as well as core[text/shell]utils
components (ie. 'ls' and friends).

  Since busybox can provide a variety of /bin/sh replacements,
I wouldn't assume /bin/sh necessarily gives you its 'ash'
clone. You should be able to chroot into the initrd filesystem
and run busybox by name to see what's compiled in; while you
can tell as much from a simple 'ls' on the filesystem, you'll
get a banner announcing which of the shells it is running, and
will have freedom to dry-run the commands you intend to use:
busybox's utilities (and especially shells) are often less
forgiving over syntax than their non-embedded counterparts.

  Busybox can also supply /sbin/init, for which /etc/inittab
doesn't have to be a real file. In this instance, there is
documentation on what the defaults are. Otherwise, look for
the '::sysinit:' line(s?) and see what that runs (eg.
/etc/init.d/rcS).

  If busybox exists, then it's possible any /linuxrc you
have is a symlink to it, and 'vi' on it won't make any sense
... oh, and busybox 'vi' is infuriatingly minimal, as I've
mentioned before :(


> For example, I can see an /etc/udev/rules.d/ directory in the 
> initrd, including a rules file which seems to assign device 
> names as it might on a normal filesystem.
> 
> Could I do any harm by adding my own rules file to that 
> directory (as Anne does for a normal system), then 
> re-archiving the initrd and trying to boot from it?

  Probably not, bearing the above in mind.

HTH,
  Wills.



More information about the Wylug-help mailing list