[LEDE-DEV] Running init in a chroot LEDE Image

Yousong Zhou yszhou4tech at gmail.com
Tue Aug 8 19:09:59 PDT 2017


On 9 August 2017 at 08:01, Mirko Parthey <mirko.parthey at web.de> wrote:
> On Tue, Aug 08, 2017 at 11:32:23PM +0300, Nicolas Pace wrote:
>> I'm trying to run a rootfs chroot on my desktop computer to easen the
>> development of userspace applications, but as I'm using ubus I need a
>> complete LEDE environment.
>> Using chroot also reduces the turnaround time for code/test cause I can
>> just write code and it instantly is loaded on the image.
>>
>> I donwloaded the image from here:
>> http://ci.libremesh.org/196/x86/generic/Generic/lime_default/lede-17.01
>> .2-lime-default-x86-generic-generic-rootfs.tar.gz
>>
>> Mounted all devices, did chroot... but I somehow need to call init to
>> get ubus running (and all of the other supporting systems).
>>
>> Any suggestion on how to manually call init?
>
> init must be started by the Linux kernel as the first userspace process
> to ensure it is asssigned pid 1 and gets special privileges for
> supervising other processes.
>
> To start another init from a running system, you need some kind of
> virtualization.  I am using qemu/kvm here, managed by virt-manager and
> libvirtd.  This has the advantage of running the LEDE userspace on top
> of the LEDE kernel instead of the host kernel, which may be missing
> some LEDE-specific features.
>
> Regards,
> Mirko
>

./script/qemustart can also be used to quickly start QEMU arm/mips/x86
instances.  It can be as simple as "./script/qemustart x86 64".  Once
up, the guest machine will have typical network settings ready and can
be accessed through network or other methods as provided by QEMU from
host machine.

Regards,
                yousong



More information about the Lede-dev mailing list