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
- Host: GitHub
- URL: https://github.com/coldnew/coldnew-embedded
- Owner: coldnew
- Created: 2013-10-28T07:49:17.000Z (over 12 years ago)
- Default Branch: master
- Last Pushed: 2014-07-23T13:59:19.000Z (almost 12 years ago)
- Last Synced: 2025-03-05T02:19:06.087Z (over 1 year ago)
- Language: Shell
- Size: 566 KB
- Stars: 4
- Watchers: 4
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.org
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