From rob at landley.net Thu Nov 17 15:29:37 2016 From: rob at landley.net (Rob Landley) Date: Thu, 17 Nov 2016 09:29:37 -0600 Subject: [Aboriginal] Uploaded some of the mkroot.sh stuff. Message-ID: In my copious free time I've been doing a new simple-as-possible root filesystem builder, at http://github.com/landley/mkroot which is probably going to replace this project (for me at least). Not necessarily entirely useful yet ("make airlock" is only in toybox git, last release called it "make install_airlock" and I think it had some rough edges, also native building against glibc breaks in the shared library copying near the end). But it should give you an idea. Backstory: 2/3 of the complexity of aboriginal linux is building toolchains, I will never ship a GPLv3 binary in a hobbyist context so I stopped updating my package versions at the last gplv2 releases, and earlier this year 4 different kernel architectures stopped building with my old last gplv2 toolchain in the space of 2 releases (4.3 and 4.4 I think). I've been too busy behind the scenes with the http://j-core.org stuff to try heroic efforts to keep the old toolchain on life support, which meant I couldn't upgrade the kernel anymore. Which is a problem. And thus the project got mothballed for a while. Meanwhile http://github.com/richfelker/musl-cross-make from the musl-libc.org maintainer is now capable of building _native_ compilers, not just cross compilers. (And he's said he's willing to host cross and native toolchain binaries once we reach a good stopping point, which is good considering they're using current GPLv3 gcc/binutils versions so I won't do it. Attached are the scripts I used to build the last round of toolchains, basically extract one layer above musl-cross-make and ../i686.sh then TYPE=static ../sh2.sh then TYPE=native ../sh2.sh. Yeah, they could use serious cleanup, but they show the basic build theory I'm using.) Hence the reboot of a new very simple root filesystem builder. I moved "make airlock" into toybox's makefile, and this is still building busybox for the ~dozen things (most prominently the shell) that I need busybox for, until I can replace those. It leaves libc to the toolchain (so no uclibc option unless you use a toolchain out of buildroot or something), and the basic build is self-contained in a single file (mkroot.sh can work standalone in its own directory). There are a number of things aboriginal did that the new one doesn't yet (environment variable sanitization, download mirrors, applying patches to extracted tarballs, multiple output filesystem formats, multiple simultaneous parallel target builds, and so on). But there may be simpler/better ways to do all those things it's doing. (For example: environment variable sanitization is basically env -i PATH="$PATH" CROSS_COMPILE="$CROSS_COMPILE". Yeah that disables distcc but we're not building huge amounts of stuff, and you can always _not_ do it...) So, just a heads up with what I've been working on. It would be nice to have more time/energy to throw at it, but this is at best third on my process scheduler right now, not counting crisis du jour. My current vague plan is that next toybox release I should have a synchronized mkroot.sh release too, and then maybe it should have a website or something. (Inherit this mailing list or start a new one? Dunno...) Rob -------------- next part -------------- A non-text attachment was scrubbed... Name: mcm-sh.tar.gz Type: application/gzip Size: 1225 bytes Desc: not available URL: From rob at landley.net Tue Nov 29 22:28:26 2016 From: rob at landley.net (Rob Landley) Date: Tue, 29 Nov 2016 16:28:26 -0600 Subject: [Aboriginal] [landley/aboriginal] cross-compile for ARM based embedded system running busybox (#4) In-Reply-To: References: Message-ID: <30caa2da-1b12-e214-e880-aa0020f9f5c0@landley.net> On 11/29/2016 03:24 PM, erdosnew wrote: > hi, i found about aboriginal through busybox, > https://busybox.net/FAQ.html#build Hello. > i've got an ARM-based system running busybox. and i'm trying to learn > how to compile simple programs for it. the examples i use were from > busybox-tiny utilities (i.e. Dropbear SMTP, ntpclient). > > i downloaded prebuilt compiler for arm to my linux machine > (http://landley.net/aboriginal/downloads/binaries/cross-compiler-armv6l.tar.gz) > and unzipped into a working directory. Use armv5l, it's backwards compatibleand the system image works. The armv6l target won't boot under qemu due to kernel version skew. (The kernel needed a patch I stopped forward porting.) > what i'm not sure is how to cross compile the program on my linux machine. > i navigated to directory containing 'ntpclient' and run the following: > > CROSS_COMPILE="$PWD/cross-compiler-armv5l/bin/armv6l-" v5 vs v6 doesn't match? > CROSS_COMPILE="$CROSS_COMPILE" make You could should need to set it to itself, you can just do: CROSS_COMPILE="$PWD/cross-compiler-armv6l/bin/armv6l-" make > but the resulted 'ntpclient' executable seems still is for linux instead > of 'arm' (it won't run on my embedded system). I dunno what ntpclient package you're trying to build. In theory if it's listening to CROSS_COMPILE the build should die if you point it at a nonexistent file. So possibly that package doesn't know about the CROSS_COMPILE variable? > need some pointers on how to use aborginal Prebuilt Binaries. These days I'm migrating to http://github.com/richfelker/musl-cross-make toolchains, but haven't had time to work on this recently. ($DAYJOB is in frantic deadline mode, I'm a week into a 2-week stay in san francisco, then I head to san diego for 2 weeks, then I get back to austin long enough to start a road trip to visit family for christmas...) Rob