Linux From ScratchThis Forum is for the discussion of LFS.
LFS is a project that provides you with the steps necessary to build your own custom Linux system.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I'm not sure if this is the best place for this, but here is my question:
I'm going to try to build LFS for RPi2. I'm trying to choose between compiling it on RPi2, or try cross compiling using my other computer (x86_64 machine). My understanding on cross compiling is still weak, and I've never done it before.
I understand that compiling LFS on RPi2 would be slow, and hence cross compiling would be faster. What is the risk with cross compiling (from looking at the CLFS book it doesn't look to be that different)? Is it in general better (recommended) to compile natively, if time is not an issue?
Any guidance on this would be appreciated. Also, my apology if this topic has been covered already...
My understanding of cross compiling is also weak. I did it some years ago (I forget the details now), it was quite a performance, but I followed the instructions and it all worked in the end.
I have had my RPi and RPi2 compile their own stuff. It does take time, so I just let it run overnight.
Everything went fine, and it was oddly satisfying to have a "slow", but capable machine, look after itself.
Distribution: Void, Linux From Scratch, Slackware64
Posts: 3,157
Rep:
I tried LFS on a pi2 some time ago and it compiled fine, I compliled on the pi and let it run overnight, but although uclib complied it was missing too musch stuff to be of any real use and I could never get gclib to compile, now I must admit I just use raspberian on the pi as it is just running a web and email server
Many thanks for the input. I will build it on my RPi2. I assume Raspbian is fine as a host system, or do you have a better suggestion for the host? I was also wondering, what was the SBU for RPi2 (with/without -j4 flag)?
Also, would GPIO work 'out of the box' or are there something special I have to do? I'll Google kernel config specifically for RPi2 (it must be posted somewhere), but in terms of libraries or additional packages specific to Raspberry Pi's.
I have not started building yet, but I still have (silly) lingering questions...
Raspberry Pi foundation has posted the kernel source on git (https://github.com/raspberrypi/linux), but I'm wondering when do I ever need to recompile their kernel? They have compiled the kernel and have it available for us in firmware/boot git repo. I assume they have their kernel tailored for Raspberry Pi... (or did you start from the official kernel from kernel.org?)
I'm also reading PiLFS project (http://www.intestinate.com/pilfs/guide.html). In Section 10, it talks about custom bootscripts. If I'm building systemd, I assume I don't need these, can someone confirm this?
I did an install of 7.8-Systemd. I compiled everything on Rpi2, which went faster than I expected, and didn't notice anything wrong along the way. However, rebooting revealed many systemd-related errors and each time dropping me on emergency mode. I tried Googling but nobody have problems with systemd (since mostly everyone uses raspbian with systemd pre-loaded). I spent the whole night trying to fix, but I wasn't getting anywhere, so now I am ditching systemd.
I am currently building Sysvinit version. I have a few references (ie PiLFS and Slackware-ARM) so I'm hopeful it might work out.
Although I abandoned systemd, I would be interested in knowing if anyone succeeded getting LFS systemd to work on Raspberry Pi (so that I know it is doable).
So the LFS build on RPi2 succeeded. I've been going through BLFS, and mostly trouble free. One thing that I've been trying lately and can't seem to get is a (modern) web browser. Dillo works, but I need something for modern web pages. I tried:
1. Webkit-2.4.9 (both gtk2 and gtk3 ports): The build went fine, but when I tried to use it (either Midori or surf), it crashes with the error message "Bus error" (no detail is given).
2. Chromium (v48): I installed all the dependencies, but when I tried building it (using gyp / ninja), it complained about not having a proper sysroot environment. Since I'm not cross-compiling, I shouldn't need sysroot environment. I also had hard time finding the build script for raspbian
3. Webkit-2.8.5: The build was successful (although it took me two full days of compiling, even with -j4). I tried MiniBrowser and it seems to work. It seems that the only web browser that is compatible with this version of webkit seems to be epiphany, which will bring in some gnome-desktop crap that I don't care about
Has anyone successfully built and used any of the three options (I'm especially interested in #2).
Update on my quest to build a modern web browser on RPi2 (still on LFS 7.8)
1. Webkitgtk-2.10.9 (I see now that Webkit-2.12.0 is released, ugh): It compiled and works. The earlier version (2.8.5) didn't like certain sites (like gmail), but seems well now. Midori has a flag to build with webkit2gtk (very well hidden), and it seems to work. I have not tried Epiphany, as I don't want to build all of its dependencies. Build time for webkitgtk was about 1 1/2 days (Midori was ~ 1 hr?)
2. Chromium-48: It compiled fine, but when I tried to run it, it complained about ICU package. I have version 55.1 as per BLFS 7.8. Maybe I need to upgrade it, or change the GYP flag to not use system icu. Not sure, every time I change something, it's another couple of days lost on compilation, so it's hard. Build time was 2 1/2 days + 1 full day of linking (needs heavy swap usage)
Alternative is QT5WebEngine, but I don't really want to invest too much more time on it, as Webkit2gtk is now working.
I just thought of firefox, which I haven't tried. Not sure why I haven't done it yet, but I will try that next!
With all of these, the bottleneck will be the RAM on RPi. With only 1GB, it's hard to do heavy web surfing. I had Gmail, Google map, and a couple of other pages open and it already started dipping into my swap. I'm hoping Rpi4 will have at least 2GB of RAM!
Edit: Googling Linux issues for Rpi is very frustrating. If I search, for example, "how to build package on Rpi?", majority of the cases the option is "Easy! run > apt-get --install package" because mostly everyone uses Raspbian (for good reasons, I guess).
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.