[yocto] poky-tiny, boot and filesystems

r10kindsofpeople r10kindsofpeople at gmail.com
Wed Dec 18 11:19:16 PST 2013


Rudi,

>From a first view, my problem is that my embedded Yocto-Linux device takes
too long from the application of power to the time that it is first able to
a) signal the user that the device is waking up and b) respond to events
from I/O (Ethernet and CAN).  (40+ seconds prior to shifting to poky-tiny,
not counting BIOS delays)

>From another view, my problem is a lack of understanding about the
processes involved during that time, and how the poky-tiny distro is
intended to be applied to resolve the 'first view' problem.

Yes, poky-tiny produces an image that is both smaller and starts fewer
services.  It also uses tiny-init which I believe is neither SysV init nor
systemd.

Outside of the scope of poky-tiny, I need some way to boot my hardware, and
the poky-tiny guides seem to stop once they're able to boot qemu.  If I
simply create an ext2 boot partition on my sdcard and copy the
poky-tiny.ext2 image to it, nothing boots.  If I also install grub to that
partition and provide a grub.cfg, I can boot.  (The selection of grub as my
boot loader may be my first mistake ?)  In that grub.cfg are two critical
lines:
1) linux /boot/bzImage root=/dev/mmcblk0p1
and
2) initrd /boot/core-image-minimal-crownbay.cpio.gz

If I just do 1), I can boot quickly, but I can't do much else because the
file system is mounted read-only.  I _want_ most of the file system to be
read-only, but need to be able to start the network and do some other
'normal' tasks that require write access to some areas of the file system.
 Once my user space application is running, my app will use another (USB)
device for persistent data storage.

If I also do 2), more works and I can start the network, but of course the
system takes a bit longer while it's loading the ramdisk.  If this is the
expected and optimal mode of operation, then I'm done.  But am I wrong in
thinking that the contents of the .cpio.gz file replaces all of what is in
the .ext2 image once it is loaded?  I'm confused by the fact that files I
added to the tiny-init recipe end up in both the .ext2 file image (just
stage 1) and the resulting file system after both 1) & 2).  It's not that
the recipe doesn't work, or that the system is not functional in the end,
but a question of whether there's a duplication of effort involved or if
there's just a better way to do it for my specific requirements.

I understand that these questions stray well beyond the scope of this
mailing list, but at the same time, any references to the poky-tiny distro
probably won't be understood outside it.

Thanks,

John


On Wed, Dec 18, 2013 at 12:18 PM, Rudolf Streif <rstreif at linuxfoundation.org
> wrote:

> John,
>
> What is your actual problem? You appended the tiny-init recipe and your
> changes do or do not get put into the rootfs? If you could post your recipe
> then folks can look at it.
>
> As far as boot time is concerned, you need to distinguish boot loader and
> kernel boot from user space. It looks as if you are trying to optimize your
> user space boot time by using an image that starts less services. What
> services you need of course depends on your application. To optimize user
> space boot process you may also want to investigate systemd instead of SysV
> init.
>
> Rudi
>
>
> On Wed, Dec 18, 2013 at 8:26 AM, r10kindsofpeople <
> r10kindsofpeople at gmail.com> wrote:
>
>> I've been beating my head for a few days now, and would love a little
>> guidance.  Acknowledging that there are multiple ways to skin the cat, my
>> immediate goal is to reduce the boot time, presumably using poky-tiny.
>>
>> I have poky-tiny building for my hardware under dora.
>> I have it booting on crownbay hardware by copying the .ext2 image onto
>> the sdcard, installing grub, copying the .cpio.gz file on to the card, and
>> using grub to load the kernel image and initrd the filesystem.
>>
>> I'm wondering if that last bit about initrd is the 'best' option, or if I
>> should be overlaying a write-able filesystem on top of the original .ext2
>> file system?  How?
>>
>> And I'm pretty sure I've not got something right...I figured out how to
>> .bbappend the tiny-init recipe and get my own edits into 'init' and
>> 'rc.local', but it appears those files and changes made it into both the
>> ext2 file system and the .cpio.gz initrd file system.  On one hand, I'm
>> grateful since it works, but 'both' seems to point at me getting something
>> wrong.
>>
>> Any links to clear tutorials would be greatly appreciated.  There's a
>> wealth of information available on this topic, but none that seems
>> comprehensive (that I've found), and as I've said, each seems to take a
>> different approach, leaving out a step or two along the way.
>>
>> John
>>
>>
>>
>> _______________________________________________
>> yocto mailing list
>> yocto at yoctoproject.org
>> https://lists.yoctoproject.org/listinfo/yocto
>>
>>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.yoctoproject.org/pipermail/yocto/attachments/20131218/7110ddc1/attachment.html>


More information about the yocto mailing list