From rob at landley.net Thu May 4 04:14:31 2017 From: rob at landley.net (Rob Landley) Date: Wed, 3 May 2017 23:14:31 -0500 Subject: [mkroot] Hello world. Message-ID: <30cd1d29-3c7e-7c23-6f4c-7e7e60927268@landley.net> The repository is at https://github.com/landley/mkroot and has a README covering the basics. Rob From rob at landley.net Thu May 4 04:19:34 2017 From: rob at landley.net (Rob Landley) Date: Wed, 3 May 2017 23:19:34 -0500 Subject: [mkroot] So mkroot sort of works now. Message-ID: The project doesn't have a web page yet, I should do one of those. And work on what portion of aboriginal's faq and about pages to move over. (Then again the first busybox FAQ is material I wrote entirely myself, and I still haven't moved that stuff over into the toybox faq yet, so don't hold your breath. :) I also note I've been blogging about mkroot at https://landley.net/notes.html but I'm about a month behind in editing and posting those entries. (When I compose them they trail off in mid sentence and the html tags don't match up, and the links are mostly [TODO: link purple thing] so I have to go back and edit them a lot before posting to seem as coherent as they do. :) Again there's a README covering the basics. Poke me if you care, or if something doesn't work right. Rob From rob at landley.net Mon May 8 23:42:53 2017 From: rob at landley.net (Rob Landley) Date: Mon, 8 May 2017 18:42:53 -0500 Subject: [mkroot] Fwd: Re: About mkroot compiling In-Reply-To: <167b0989-c6f3-f5ec-7509-6aedf486ce5d@landley.net> References: <167b0989-c6f3-f5ec-7509-6aedf486ce5d@landley.net> Message-ID: <2ef8911e-496b-6718-0300-e59d4538a28c@landley.net> And permission to forward answers to the list granted. :) On 05/07/2017 02:24 AM, tgrauss wrote: > Hello, > > I am part of the tinkerphone smartphone community (we are trying to > build a free smartphone : http://www.tinkerphones.org). > I am trying to build a small Linux with the qtmoko stack to be embedded > in the 512MB of Flash we have on the gta04a5 phone. The CPU is a Cortex > A8 which is an armv7-a I just checked in simple armv7l kernel support last night. :) > Thanks to your mkroot tool and explanations, I was able to build > crosscompilers :) Well, it is strange that there is no armv7-a > toolchain, but a armv7l. It seems to be the same from what I can find on > internet... Yup, armv7l. > Nevertheless, I tried with a simple system first and typed the > following: > CROSS_COMPILE=~/mcm/output/armv7l-linux-musleabihf-cross/bin/armv7l-linux-musleabihf- > ./mkroot.sh kernel > > And the system compiles fine up to when it tried to compile the Linux > kernel where there is an error message: > linux-4.11.tar.gz confirmed > Unknown $TARGET That would be the "I just checked in armv7l support last night" part. :) Coming up with kernel configurations that run under qemu for the various architectures is time consuming. The main build is architecture-agnostic (it builds whatever your cross compiler outputs), but the kernel cares about architecture, so module/kernel has a big if/else staircase of recognized architectures and sets stuff for each one. > So, based on your website, I tried to force the ARCH variable, but with > the same error. > > Do you know what is happening here? Yeah, it had armv5 but not armv7. And the armv5 that was checked in booted to a shell prompt but didn't have the emulated network card or hard drives working (drivers weren't configured right). And the armv7 support is -M versatilepb when armv7 needs -M vexpress (do "qemu-system-arm -M ?" to see the list), except the one I actually got _working_ was -M virt. I'm writing blog entries about it and trying to get https://landley.net/notes-2017.html caught up to current. > I have another questions also: > - With your script, what is the best way to specify other fine compile > tuning parameters? Like the type of fpu: vfpv3 or the "-mthumb" option > and others? Personally I hardwire those into the cross compilers I build so it's producing the right output for the target without flags. That said, most packages honor the $CFLAGS environment variable, and some do $LDFLAGS as well. > Thank you > > Best regards > > Thierry GRAUSS > Rob From rob at landley.net Mon May 8 23:43:29 2017 From: rob at landley.net (Rob Landley) Date: Mon, 8 May 2017 18:43:29 -0500 Subject: [mkroot] Fwd: Re: About mkroot compiling In-Reply-To: References: Message-ID: <7e7cf707-0fa5-7877-9c9d-6591b1cb8ac7@landley.net> On 05/08/2017 06:56 AM, Thierry GRAUSS wrote: > Hello, > > Thank you for you answer. The $TARGET issue is gone :) But I have other > problems: > I did a git pull, then a ./clean.sh and launched again the build > process as before. > The problem is now that it does not find bc while compiling the kernel. > CHK include/generated/timeconst.h > CC kernel/bounds.s > /bin/sh: 1: bc: not found > Kbuild:67: recipe for target 'include/generated/timeconst.h' failed > make[1]: *** [include/generated/timeconst.h] Error 127 > make[1]: *** Waiting for unfinished jobs.... > Makefile:1047: recipe for target 'prepare0' failed > make: *** [prepare0] Error 2 Ah, sorry. I added that to toybox's airlock step a week or two back and haven't cut a toybox release since then. Try: cd download git clone git://github.com/landley/toybox Then run mkroot again. (I have to cut a toybox release before I can cut a mkroot release because the current code depends on newer toybox than the previous release had.) Rob From scsijon at lamiaworks.com.au Fri May 12 11:33:48 2017 From: scsijon at lamiaworks.com.au (scsijon) Date: Fri, 12 May 2017 21:33:48 +1000 Subject: [mkroot] Fwd: ?create a chrootable self-compiling toolchain with mkroot? In-Reply-To: References: Message-ID: Lets try again, sorry rob, sent it as a reply to mkroot-requests instead of mkroot, but got no error message back??? ------------------------------------------------------------------------- I wonder how much work it would be to create an independant chrootable self-compiling toolchain with mkroot? Use LFS (and the like) to work out the rest, but set it up with a mkroot base. It's supprising what can only (maybe)set up their own Linux 'versions' nowadays. Thoughts please... thanks scsijon From phil at pricom.com.au Fri May 19 17:50:00 2017 From: phil at pricom.com.au (Philip Rhoades) Date: Sat, 20 May 2017 03:50:00 +1000 Subject: [mkroot] aboriginal / mkroot as a basis for a container? Message-ID: <585adcb00b47f46d2b37e45aa595b1fb@pricom.com.au> Rob, I use Fedora for routine work but got interested in Alpine because of the reduction in container size - is it possible / sensible to try and make an even smaller, faster system with mkroot? Thanks, Phil. -- Philip Rhoades PO Box 896 Cowra NSW 2794 Australia E-mail: phil at pricom.com.au From rob at landley.net Fri May 19 18:34:50 2017 From: rob at landley.net (Rob Landley) Date: Fri, 19 May 2017 13:34:50 -0500 Subject: [mkroot] aboriginal / mkroot as a basis for a container? In-Reply-To: <585adcb00b47f46d2b37e45aa595b1fb@pricom.com.au> References: <585adcb00b47f46d2b37e45aa595b1fb@pricom.com.au> Message-ID: <3815b8a9-8ac0-fa39-d74b-226933b21f45@landley.net> On 05/19/2017 12:50 PM, Philip Rhoades wrote: > Rob, > > I use Fedora for routine work but got interested in Alpine because of > the reduction in container size - is it possible / sensible to try and > make an even smaller, faster system with mkroot? Yes, but it's really a question of what you want the container to do. Way back when lxc had a busybox container, with just busybox defconfig in it. The mkroot build is aiming at one of those based on toybox instead of busybox (but still uses bits of busybox at the moment because the past year $DAYJOB has been _really_ distracting so I'm not as far as I wanted to be with toybox yet). Other than that, there's an init script and a couple /etc files. There's really not much there. (Sorta the point. :) Alpine is a distro. It has a package management system that can download and install more stuff. If you want more stuff in mkroot, you build it from source. :) Rob From phil at pricom.com.au Fri May 19 19:01:28 2017 From: phil at pricom.com.au (Philip Rhoades) Date: Sat, 20 May 2017 05:01:28 +1000 Subject: [mkroot] aboriginal / mkroot as a basis for a container? In-Reply-To: <3815b8a9-8ac0-fa39-d74b-226933b21f45@landley.net> References: <585adcb00b47f46d2b37e45aa595b1fb@pricom.com.au> <3815b8a9-8ac0-fa39-d74b-226933b21f45@landley.net> Message-ID: Rob, On 2017-05-20 04:34, Rob Landley wrote: > On 05/19/2017 12:50 PM, Philip Rhoades wrote: >> Rob, >> >> I use Fedora for routine work but got interested in Alpine because of >> the reduction in container size - is it possible / sensible to try and >> make an even smaller, faster system with mkroot? > > Yes, but it's really a question of what you want the container to do. Well I went off on a tangent while I was moving stuff off a Digital Ocean VM to my own server - which might temporary - but this was for a number of small domains in: plain HTML, Ruby on Rails and Jekyll frameworks. I am containerising the framworks. > Way back when lxc had a busybox container, with just busybox defconfig > in it. The mkroot build is aiming at one of those based on toybox > instead of busybox (but still uses bits of busybox at the moment > because > the past year $DAYJOB has been _really_ distracting so I'm not as far > as > I wanted to be with toybox yet). Right. > Other than that, there's an init script and a couple /etc files. > There's > really not much there. (Sorta the point. :) > > Alpine is a distro. It has a package management system that can > download > and install more stuff. If you want more stuff in mkroot, you build it > from source. :) That's OK - it could be a really interesting exercise and a very useful tool once built . . Of course I am interested in the whole Android self-hosting thing too . . Thanks, Phil. -- Philip Rhoades PO Box 896 Cowra NSW 2794 Australia E-mail: phil at pricom.com.au From phil at pricom.com.au Fri May 19 19:06:54 2017 From: phil at pricom.com.au (Philip Rhoades) Date: Sat, 20 May 2017 05:06:54 +1000 Subject: [mkroot] Rust Message-ID: <3df4618ab0651635717c93a0cb50b0f5@cryonics.org.au> Rob, Have you had a look at Rust?: https://blog.rust-lang.org/2016/05/13/rustup.html I got interested in it because of my (great) interest in the SAFE network. Phil. -- Philip Rhoades PO Box 896 Cowra NSW 2794 Australia E-mail: phil at pricom.com.au From rob at landley.net Fri May 19 22:23:13 2017 From: rob at landley.net (Rob Landley) Date: Fri, 19 May 2017 17:23:13 -0500 Subject: [mkroot] Rust In-Reply-To: <3df4618ab0651635717c93a0cb50b0f5@cryonics.org.au> References: <3df4618ab0651635717c93a0cb50b0f5@cryonics.org.au> Message-ID: <9e4f7cc5-2205-4fe2-f14c-6984aba59656@landley.net> On 05/19/2017 02:06 PM, Philip Rhoades wrote: > Rob, > > Have you had a look at Rust?: > > https://blog.rust-lang.org/2016/05/13/rustup.html > > I got interested in it because of my (great) interest in the SAFE network. > > Phil. Yes I have. (I met @edunham at LCA and follow her on twitter.) And I've looked at swift, and go, and a half-dozen other attempts at replacing C over the years. (I was in the debug team for IBM's port of JavaOS to PowerPC in 1997. I suspect lua would have become huge if it had shipped posix bindings by default, but it didn't so it's a niche.) I like C. C is a good language for what it does. Chefs play with knives and fire, you can microwave a boxed dinner because a chef prepared it for you. There's a _reason_ the python, perl, and php interpreters were all written in C. The big problem C had is the C++ people's marketing strategy was "we include the whole of C, and are thus just as good a language as C, the same way a mud pie contains an entire glass of water and is thus just as good a beverage, QED". C is a simple language. The programs you write with it aren't, but the language itself is 30-ish keywords, some algebra, function call syntax, and a standard library. The C++ guys have been livid that the portable assembly language they hijacked remains as popular as their offshoot, so they took over compiler development and have tried to turn it into the same minefield of special case behavior (everything is "undefined") that C++ is, when all of those undefined behaviors boil down to "if you do the obvious thing the optimizer makes a mistake and disabling the broken optimizer isn't considered a reasonable solution because C++". I may have strong feelings about this. :) I lump them all in with lua and ruby as things certain programs are written in. Rust's ties to mozilla are a huge downside for it. They've been trying to wean themselves off of that, but _without_ a sponsor (like Google for Go or Apple for Swift) they're sort of a less interesting lua. Rob From scsijon at lamiaworks.com.au Sat May 20 03:41:12 2017 From: scsijon at lamiaworks.com.au (scsijon) Date: Sat, 20 May 2017 13:41:12 +1000 Subject: [mkroot] aboriginal / mkroot as a basis for a container? Message-ID: If you want to play with containers, (he may hate me for this) but BarryK has been playing with that and called his build Easy Linux, http://barryk.org/easy/how-easy-works.htm may be of assistance and it can be downloaded from http://distro.ibiblio.org/quirky/quirky6/amd64/releases/easy-0.2/. It's a couple of build types back though, he's gone on to other ideas since. From phil at pricom.com.au Sat May 20 06:12:30 2017 From: phil at pricom.com.au (Philip Rhoades) Date: Sat, 20 May 2017 16:12:30 +1000 Subject: [mkroot] aboriginal / mkroot as a basis for a container? In-Reply-To: References: Message-ID: <79e26a7b7a1686ce56c1497414638455@pricom.com.au> scsijon, On 2017-05-20 13:41, scsijon wrote: > If you want to play with containers, (he may hate me for this) but > BarryK has been playing with that and called his build Easy Linux, > http://barryk.org/easy/how-easy-works.htm may be of assistance and it > can be downloaded from > http://distro.ibiblio.org/quirky/quirky6/amd64/releases/easy-0.2/. > It's a couple of build types back though, he's gone on to other ideas > since. Thanks! I will check it out . . Phil. -- Philip Rhoades PO Box 896 Cowra NSW 2794 Australia E-mail: phil at pricom.com.au From rob at landley.net Sat May 20 19:36:36 2017 From: rob at landley.net (Rob Landley) Date: Sat, 20 May 2017 14:36:36 -0500 Subject: [mkroot] aboriginal / mkroot as a basis for a container? In-Reply-To: References: Message-ID: <4e5abfa5-37a3-a824-6e06-7a90f0e2c8ef@landley.net> On 05/19/2017 10:41 PM, scsijon wrote: > If you want to play with containers, (he may hate me for this) but At LCA I attended a tutorial on how container technology is implemented under the covers, the git repo of which is: https://github.com/fewbytes/rubber-docker I have a todo item to build better container technology into toybox based on that, but Android already has minijail... > BarryK has been playing with that and called his build Easy Linux, > http://barryk.org/easy/how-easy-works.htm may be of assistance and it > can be downloaded from > http://distro.ibiblio.org/quirky/quirky6/amd64/releases/easy-0.2/. It's > a couple of build types back though, he's gone on to other ideas since. I'm not annoyed, just amused. :) Everybody who works through Linux From Scratch creates a build script to automate it, then turns it into a distro briefly, then loses interest unless they can figure out something more to do with it. I have literally seen over a _hundred_ of these since I first did it myself in 2001, and my direction that kept me going through multiple reboots (http://landley.net/aboriginal/history.html) was replacing all the gnu packages with busybox (starting about 13 years ago): http://lists.busybox.net/pipermail/busybox/2004-May/045630.html My goal was to see how _simple_ I could get the result (and disentangle the FSF's inappropriate claims from Linux). And then after that worked (whenever aboriginal linux's 1.0 release was, 2013-ish I think) the toybox/android stuff started to build on top of that work. Others had their own angles, from http://www.staticramlinux.com/ to https://github.com/sabotage-linux/sabotage which still weren't enough to sustain them. The point of mkroot is that by adding musl-cross-make as a dependency I figured out how to jettison 80% of the complexity of Aboriginal Linux while still accomplishing that project's goals (from https://landley.net/aboriginal/about.html), and this forms a _much_ better basis for both a toybox test environment (you need an emulator with a known canned system to properly test ifconfig, ps, insmod...) and to eventually take apart the Android Open Source Project and rebuild it as a series of orthogonal layers. Layer 0 would be the Android NDK, layer 1 would be mkroot (once busybox is cleaned out and it's pure toybox), then build Android's init in that. I.E. I have goals I'm working towards. I also plan it to exemplify https://www.youtube.com/watch?v=Sk9TatW9ino when I'm done. (I'm aware that's maybe 1/3 of the proper tutorial on that topic; I need to make it a podcast series or something). My 2008 presentation had a warning about accidentally creating your own distribution, starting at slide 78: https://speakerdeck.com/landley/developing-for-non-x86-targets-using-qemu?slide=78 If you're _going_ to create a distro, you need to understand the scope of the resulting responsibilities (package management is a red queen's race that _will_ eat multiple developers' full time just to stay in place), and have a purpose your distro serves which isn't already better fulfilled by existing distros. Otherwise it'll be abandoned after a year or two and join the pile. Rob From rob at landley.net Sat May 27 17:01:13 2017 From: rob at landley.net (Rob Landley) Date: Sat, 27 May 2017 12:01:13 -0500 Subject: [mkroot] [landley/mkroot] "./mkroot.sh dropbear" fails (#4) In-Reply-To: References: Message-ID: <44afaede-9d05-0c02-cb34-6d4f18e47cb5@landley.net> On 05/25/2017 01:40 PM, kt97679 wrote: > When I try to run > > ./mkroot.sh dropbear > > build fails with the following error: > module/dropbear: line 34: strip: command not found > If I understand correctly this happens because toybox doesn't contain > strip command. Ah. The toybox "make install_airlock" doesn't symlink to the host strip because the build should be using the target-prefixed strip. (Same reason it doesn't install the host readelf and thus: http://lkml.iu.edu/hypermail/linux/kernel/1705.2/04194.html But if you're _not_ cross compiling then it needs the host version of both tools! Hmmm... possibly it should only use the airlock step when it's cross compiling? Build works with following diff: > > diff --git a/module/dropbear b/module/dropbear > index 7cdf596..115bf0b 100755 > --- a/module/dropbear > +++ b/module/dropbear > @@ -31,7 +31,7 @@ CFLAGS="-I $ZLIB -Os" LDFLAGS="--static -L $ZLIB" ./configure \ > --host=${CROSS_BASE%-} && > sed -i 's@/usr/bin/dbclient at ssh@' options.h && > make -j $(nproc) PROGRAMS="dropbear dbclient dropbearkey dropbearconvert scp" MULTI=1 SCPPROGRESS=1 && > -${CROSS_COMPILE}strip dropbearmulti && > +/usr/bin/strip dropbearmulti && Wrong fix, but I checked in a different one. Thanks for the heads up. Rob From rob at landley.net Sun May 28 05:11:17 2017 From: rob at landley.net (Rob Landley) Date: Sun, 28 May 2017 00:11:17 -0500 Subject: [mkroot] Working towards a release on the 1st. Message-ID: <600fded2-8e97-74cb-eee6-946352dc2a2f@landley.net> Rather a lot of patches went in over the past week. I've been updating the README to describe them. The i686 and x86-64 QEMU targets now have all the hardware native building under emulation needs (date's set right, hard drive images work, it exits the emulator when you shut down, and there's a virtual network card for distcc calling out to the cross compiler on the host). The QEMU guys broke the i486 target in qemu commit b2a575a1c652 (versions before that can boot an i486 kernel, ones after try to run a BIOS image with i686 instructions in it). Rich tagged a musl-cross-make release (the one I've been testing against), but hasn't put toolchain binaries up anywhere yet. Rob From rob at landley.net Wed May 31 14:49:46 2017 From: rob at landley.net (Rob Landley) Date: Wed, 31 May 2017 09:49:46 -0500 Subject: [mkroot] [landley/mkroot] "/bin/sh: 1: bc: not found" when building the kernel (#5) In-Reply-To: References: Message-ID: <631f7fc2-1324-c8d4-1918-901691a237c1@landley.net> On 05/30/2017 08:31 PM, Simon Ding wrote: > The command is: > > ./cross.sh armv5l ./mkroot.sh kernel > > It goes wrong with the following prompt: > > /bin/sh: 1: bc: not found > Kbuild:67: recipe for target 'include/generated/timeconst.h' failed > make[1]: *** [include/generated/timeconst.h] Error 127 > Makefile:1047: recipe for target 'prepare0' failed > make: *** [prepare0] Error 2 You need the new version of toybox. Currently the commit is in git: https://github.com/landley/toybox/commit/9be140ebb29f92be2b3924eb1442b38a9e062966 The next toybox release is scheduled for the 1st (thursday), I can update the download line once there's a tarball URL. In the meantime, you can go: cd download git clone https://github.com/landley/toybox Then it should use the git directory instead of the tarball. Rob