An open API service indexing awesome lists of open source software.

https://github.com/coldnew/coldnew-embedded

Another gentoo embedded overlay trying to use busybox as init to boot into tiny linux rootfs
https://github.com/coldnew/coldnew-embedded

Last synced: 12 months ago
JSON representation

Another gentoo embedded overlay trying to use busybox as init to boot into tiny linux rootfs

Awesome Lists containing this project

README

          

* This overlay is deprecated

The original goal of this overlay is used Gentoo to create another
embedded linux distro.

However, since I started to use Yocto, this overlay is deprecated now.

* About this overlay

This is an experimental gentoo overlay which is aim to create a
minimal linux rootfs based on corssdev, the generated rootfs may not
contains the same source in Gentoo. That is to say, this overlay help
you to generate a new embedded distro from gentoo.

DO NOT USE THIS overlay in chroot or native environment to run =emerge=

* How to use

You need to create cross toolchain by =crossdev= first.

: crossdev -t armv7a-hardfloat-linux-gnueabi

Link your =/usr/armv7a-harfloat-linux-gnueabi/etc/make.profile= to
=/usr/local/portage/coldnew-embedded/profiles/default/linux/arm/10.0/imx6/minimal=.

* Use qemu to help cross compile

To use qemu to help cross compile, you can write following qemu-wrapper.

#+BEGIN_SRC c
#include
#include
#include

int mount_target(char *sysroot)
{
// TODO: Check if mount already
char buf[256];
sprintf(buf, "%s/dev/", sysroot);

// mount -o bind /dev ${SYSROOT}/dev
return mount("/dev", buf, NULL, MS_BIND, NULL);
}

int main(int argc, char **argv, char **envp) {

char *newargv[argc + 3];
newargv[0] = argv[0];

// Check if SYSROOT env is defined
char *sysroot = getenv("SYSROOT");
char buf[256];

if (!sysroot) {
printf("SYSROOT not define, fallback to default usage\n");
newargv[1] = "";
newargv[2] = "";
}
else {
newargv[1] = "-L";
newargv[2] = "/usr/armv7a-hardfloat-linux-gnueabi";

// mount what we neet
mount_target(sysroot);
}

memcpy(&newargv[3], &argv[1], sizeof(*argv) * (argc - 1));
newargv[argc + 2] = NULL;

return execve("/usr/bin/qemu-arm", newargv, envp);
}
#+END_SRC