News for hackers. Stuff that matters.
Re:Show HN: Build your Linux from Scratch inside Docker with... by UncleEntity on Tuesday December 12, 2017 @06:49PM (#15910649)
Seems to defeat the purpose of 'from scratch' if all you do is run a script.

I fondly remember building linux from scratch in the early 00's and learning quite a bit about how a system is put together by doing (and troubleshooting) the steps. IIRC bootstrapping the compiler was the trickiest bit since the fedora (or maybe it was still redhat back then) gcc didn't like to play nice with its younger siblings.

Re:Show HN: Build your Linux from Scratch inside Docker with... by digi_owl on Wednesday December 13, 2017 @01:37AM (#15912479)
And these days looking at the LFS books makes one wonder how much crap/complications Freedesktop has crammed into the middle layer in the name of DE userfriendliness....
Re:Show HN: Build your Linux from Scratch inside Docker with... by jiggunjer on Tuesday December 12, 2017 @08:49PM (#15911340)
What's the difference between writing x commands and hitting enter once, vs writing x commands and waiting for each command to finish? This is a good starting point for people who already know Linux and want a lean self-built system.
Re:Show HN: Build your Linux from Scratch inside Docker with... by finnthehuman on Tuesday December 12, 2017 @10:51PM (#15911890)
>What's the difference between writing x commands and hitting enter once, vs writing x commands and waiting for each command to finish?

The point of homework is to do it yourself, not to clone a repo with the answers.

Re:Show HN: Build your Linux from Scratch inside Docker with... by roenxi on Wednesday December 13, 2017 @03:08AM (#15912805)
The secret assumption is that things will break and the builder will learn how things might break and how to fix them.

I've had a lot of fun with LFS, but if everything goes smoothly it is a bit pointless. When builds broke or I missed components there was an opportunity to better my understanding of the system. Experience with multiple failure modes in a safe environment - it counts for a lot.

It also forces you to learn what the dependency graph looks like and a little bit of why, which can be helpful.

Re:Show HN: Build your Linux from Scratch inside Docker with... by UncleEntity on Tuesday December 12, 2017 @09:24PM (#15911519)
Not gonna be all that lean with all the build tools and whatnot. And isn't all that practical without package management.

Linux kernel + busybox + few unit scripts == lean

But, you know, to each their own -- don't get me wrong, I really enjoyed tinkering with LFS back in the day.

Re:Show HN: Build your Linux from Scratch inside Docker with... by m_mueller on Wednesday December 13, 2017 @12:37AM (#15912266)
I don't really get what's different compared to using something like `from debian:jessie`. In what ways is this more lean?
Re:Show HN: Build your Linux from Scratch inside Docker with... by majewsky on Wednesday December 13, 2017 @07:41AM (#15913841)
`FROM debian:jessie` costs 53 MiB. (And by the way, please upgrade to Stretch at the earliest convenience.) `FROM alpine` costs 2 MiB. When you need to send container images across the globe on shitty connections, this matters a lot.
Re:Show HN: Build your Linux from Scratch inside Docker with... by eiskalt on Wednesday December 13, 2017 @10:56AM (#15915015)
Actually, one of the first commands by default when container is run, is to fetch about 330Mb of compressed toolchain.
Re:Show HN: Build your Linux from Scratch inside Docker with... by majewsky on Wednesday December 13, 2017 @05:40PM (#15918386)
I didn't expect myself to ever say this, but: Our Openstack containers are much leaner than that. (Swift ends up at ~95 MiB for example.)
Re:Show HN: Build your Linux from Scratch inside Docker with... by krylon on Wednesday December 13, 2017 @07:02AM (#15913689)
Generally speaking, building an LFS, you can freely choose what software to include or omit, and where there are multiple pieces of software that solve the same problem, you can choose which one to use. (Of course, you are stuck with the work of making all this work, but that is what this is all about: Learning what makes a Linux system tick.)
Re:Show HN: Build your Linux from Scratch inside Docker with... by Xeoncross on Tuesday December 12, 2017 @05:56PM (#15910262)
Interesting invention "Standard Build Units" (SBUs) as a measurement of time to build/compile.

http://www.linuxfromscratch.org/~bdubbs/about.html

Re:Show HN: Build your Linux from Scratch inside Docker with... by zwischenzug on Wednesday December 13, 2017 @05:18AM (#15913321)
I did something similar a few years ago:

https://zwischenzugs.com/2015/01/12/make-your-own-bespoke-do...

it was a great learning experience but take-up was 0 :)

Re:Show HN: Build your Linux from Scratch inside Docker with... by rkagerer on Wednesday December 13, 2017 @03:35AM (#15912914)
Why are the docs at linuxfromscratch.org still based on 4.12 instead of 4.14? Have they just not gotten around to updating, or is 4.12 considered more widely accepted?

I want to deep dive into building Linux from scratch (step by step, not via a magic script) to get intimately familiar with the OS, but wonder if I ought to invest my time in a more recent version.

Re:Show HN: Build your Linux from Scratch inside Docker with... by eiskalt on Wednesday December 13, 2017 @05:37AM (#15913392)
As magic script author, who completed the book step by step, I want to say, you won't get "intimately familiar with the OS" after completion. What you will learn: * needed packages: purpose, how and in which order to build them * really basics of OS configuration * fault intolerance to mistakes

So, why I've built such script? I think it is needed for the next steps, where you actually might want to modify kernel/tools/configuration to gain the knowledge how things are (not-)working.

Re:Show HN: Build your Linux from Scratch inside Docker with... by wila on Wednesday December 13, 2017 @04:42AM (#15913167)
You are talking about kernel versions?

Version 4.12 was from July 2017 until September 2017 (0)

Right now the main line kernel is at 4.14, but it has not changed so much that it really matters for learning Linux.

[0] https://en.wikipedia.org/wiki/Linux_kernel#4.x.y_releases

Re:Show HN: Build your Linux from Scratch inside Docker with... by rkagerer on Friday December 15, 2017 @06:43PM (#15936281)
I am. Do you think the same steps will work with 4.14? (Or at least that any changes I need to make would be straightforward enough for a relative beginner to figure out?)
Re:Show HN: Build your Linux from Scratch inside Docker with... by wila on Sunday December 17, 2017 @06:08PM (#15948194)
It is impossible for me to determine your level, I would expect it to be straightforward enough.

But probably best to stick with the kernel that the doc is written for.

Re:Show HN: Build your Linux from Scratch inside Docker with... by provost on Wednesday December 13, 2017 @05:09AM (#15913285)
So if I'm understanding this correctly, this builds the LFS kernel inside a docker container into an ISO image that can be used with VirtualBox, but cannot be used within a Docker container itself?
Re:Show HN: Build your Linux from Scratch inside Docker with... by eiskalt on Wednesday December 13, 2017 @05:27AM (#15913362)
Yes, that's correct. The goal was to use the whole LFS's system including OS kernel. Docker, AFAIK, uses host's kernel, see info here https://docs.docker.com/get-started/#virtual-machine-diagram

Anyway, it should be possible to build image for docker container if necessary.

Re:Show HN: Build your Linux from Scratch inside Docker with... by jakeogh on Wednesday December 13, 2017 @04:08AM (#15913046)
LFS is a gateway to Gentoo;)
Re:Show HN: Build your Linux from Scratch inside Docker with... by nickstinemates on Wednesday December 13, 2017 @08:52AM (#15914170)
Gentoo is such a great learning platform. Stage 3 installs really educate you on how a linux machine is built. Portage on how system services are built in a modular (or not) way. It creates such a different relationship with the user than most other OS's.
Re:Show HN: Build your Linux from Scratch inside Docker with... by jason_slack on Tuesday December 12, 2017 @09:29PM (#15911559)
This idea is interesting. I recently started a LFS project but quickly ran into I am traveling a lot right now.

Any thoughts on using a virtual machine to practice while I travel? VMWare Fusion?

Re:Show HN: Build your Linux from Scratch inside Docker with... by giancarlostoro on Tuesday December 12, 2017 @11:16PM (#15911980)
I don't see why this wouldn't work?
Re:Show HN: Build your Linux from Scratch inside Docker with... by digi_owl on Wednesday December 13, 2017 @01:39AM (#15912487)
I thought LFS already had an automated variant for the base book. Supposedly the latest Gobolinux was bootstrapped using a variant of it.
Re:Show HN: Build your Linux from Scratch inside Docker with... by throwaway2016a on Tuesday December 12, 2017 @05:42PM (#15910173)
First thought was the website http://www.linuxfromscratch.org/ and book.

Edit: low and behold under "License"...

"This work is based on instructions from Linux from Scratch project and provided with MIT license."

Re:Show HN: Build your Linux from Scratch inside Docker with... by jfoutz on Wednesday December 13, 2017 @12:53AM (#15912336)
My first thought was this old chestnut http://bash.org/?464385
Re:Show HN: Build your Linux from Scratch inside Docker with... by dboreham on Tuesday December 12, 2017 @06:08PM (#15910361)
That's what the article is about.