LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Linux From Scratch
User Name
Password
Linux From Scratch This 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


Reply
  Search this Thread
Old 12-30-2015, 09:52 AM   #1
kcirick
Member
 
Registered: Dec 2006
Distribution: Slackware 14.1; LFS 7.9-Systemd; Debian Jessie
Posts: 169

Rep: Reputation: 55
Building LFS on Raspberry Pi 2


Hello,

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...
 
Old 12-30-2015, 12:16 PM   #2
tredegar
LQ 5k Club
 
Registered: May 2003
Location: London, UK
Distribution: Fedora38
Posts: 6,147

Rep: Reputation: 435Reputation: 435Reputation: 435Reputation: 435Reputation: 435
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.

Have fun.
 
Old 12-30-2015, 05:16 PM   #3
Keith Hedger
Senior Member
 
Registered: Jun 2010
Location: Wiltshire, UK
Distribution: Void, Linux From Scratch, Slackware64
Posts: 3,157

Rep: Reputation: 857Reputation: 857Reputation: 857Reputation: 857Reputation: 857Reputation: 857Reputation: 857
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
 
Old 12-31-2015, 08:58 AM   #4
kcirick
Member
 
Registered: Dec 2006
Distribution: Slackware 14.1; LFS 7.9-Systemd; Debian Jessie
Posts: 169

Original Poster
Rep: Reputation: 55
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.
 
Old 01-04-2016, 07:11 PM   #5
kcirick
Member
 
Registered: Dec 2006
Distribution: Slackware 14.1; LFS 7.9-Systemd; Debian Jessie
Posts: 169

Original Poster
Rep: Reputation: 55
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?
 
Old 02-09-2016, 08:08 PM   #6
kcirick
Member
 
Registered: Dec 2006
Distribution: Slackware 14.1; LFS 7.9-Systemd; Debian Jessie
Posts: 169

Original Poster
Rep: Reputation: 55
Just an update on my quest to have LFS on RPi2.

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).
 
Old 02-23-2016, 09:18 AM   #7
kcirick
Member
 
Registered: Dec 2006
Distribution: Slackware 14.1; LFS 7.9-Systemd; Debian Jessie
Posts: 169

Original Poster
Rep: Reputation: 55
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).
 
Old 03-24-2016, 08:40 AM   #8
kcirick
Member
 
Registered: Dec 2006
Distribution: Slackware 14.1; LFS 7.9-Systemd; Debian Jessie
Posts: 169

Original Poster
Rep: Reputation: 55
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).

Last edited by kcirick; 03-24-2016 at 12:50 PM.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Error building crosstools-ng on LFS for raspberry pi - custom kernel error Keith Hedger Linux From Scratch 0 01-15-2013 05:44 PM
Problem ssh'ing into Cross LFS on Raspberry Pi Keith Hedger Linux From Scratch 5 01-05-2013 05:43 AM
Issues compiling GCC v4.7.1 while building LFS for ARM (Raspberry Pi) jvilla1983 Linux From Scratch 7 12-25-2012 02:03 PM
[SOLVED] Which version of book to use for BLFS??? (LFS-6.7 used for building LFS) rkmv Linux From Scratch 3 02-21-2012 05:32 PM
Error Building Raspberry Pi markjuggles Linux - Embedded & Single-board computer 8 12-07-2011 09:16 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Linux From Scratch

All times are GMT -5. The time now is 10:45 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration