14 ms·
Major Proposed Changes to Linux From Scratch
- darren0 6y agoI can't recommend Linux From Scratch enough. If you want to understand the composition of the Linux user space, this is one of the best exercises to follow.
- MuffinFlavored 6y agoi feel like linux from scratch is kind of overkill 1. format a disk a bootable active partition with ext4 1. download the kernel, make defconfig && make 1. copy the kernel to the partition with syslinux mbr.bin and probably extlinux.conf (probably copy modules too) 1. copy busybox over 1. voila
- Nbox9 6y agoI think the purpose of LFS is to serve as an educational tool. In that way having more verbose steps teaches more.
- Bnshsysjab 6y agoYeah but that doesn’t teach much about core components in real systems, such as systemd, the init process, how dependencies work etc. I’m not saying you won’t learn, but I learnt a heap by avoiding systemd using gentoo. I eventually gave in when it became clear that it was no longer a viable option for various reasons, but the knowledge I learnt was mostly relevant. That being said, every time I try and do something remotely advanced with network manager I fail. I can no longer have static ips, or customise DNS on a DHCP controlled connection without google
- core-questions 6y agoYeah, the basic use case of simple wired network connectivity has gotten extremely complicated, especially in Ubuntu 18+, where you configure Netplan with YAML to render templates or...something.. that configures NetworkManager or not NetworkManager to do whatever to finally run `ip` to set the address. I miss just editing /etc/network/interfaces and /etc/resolv.conf by hand. I get that that sucks for laptops, but why can't the rest of us just have an exceedingly simple and pleasant setup?
- akersten 6y agoUgh, this resonates with me so much. I recently tried to fix some kind of mundane network issue (had a Fedora machine configured for a static IP and wanted to use DHCP instead), and the absolute mess of tooling that is the Linux networking landscape baffled me. How could it get this bad? As far as I could tell, there were at least 4 competing ecosystems (NetworkManager, the 'ip' tool, /etc/network/interfaces, /etc/sysconfig/network-scripts) all extant at the same time. Does 'ip' tool update one of those files? How do I tell systemd to re-load the configuration? Is NetworkManager running or not? Does it matter? Does NM update these files, or do something magical to the interface? Are these even the right files? The best answer at which I could arrive is "who knows?" Every time I attempted to change the network interface settings, it only stuck around until the machine rebooted. Something was resetting it back to a static IP, and I had no tools to tell me what. Why did distro maintainers ever allow things to become this confusing? Why do we have so many tools and config files for the same thing? In the end I reinstalled a fresh copy of Fedora on the machine and set the DHCP configuration in the setup wizard. It's that bad. My experience tells me to anticipate a comment along the lines of "Hey, those programs and config files are all actually the same tool, and you must have just been configuring it wrong." If that's the case - it's an even stronger point that this chaos has reached a critical mass, where parts of the same networking configuration tool are so disjoint that they don't visibly interoperate at all.
- throwaway8941 6y agoI'm almost positive your problems were caused by NetworkManager. I usually disable and blacklist it everywhere (or wipe entirely if the distribution dependency tree allows it), and my systems never behave in this unpredictable way. It tries to be helpful and rewrites network configuration files to align them with its own configuration.
- ac29 6y ago/etc/network/interfaces & /etc/sysconfig/network-scripts aren't part of NetworkManager (the directories don't even exist on my machine). You should probably check out `systemctl list-units` to see what is actually enabled and running on your machine.
- yjftsjthsd-h 6y agoThat doesn't teach you how to handle libraries and the magical pain of dependencies. It's an excellent start, and I would happily encourage doing that first before LFS, but it builds an extremely restricted system to the point of not really resembling any real system that you're going to find in the wild. In particular, a pure busybox system can't be self-hosting.
- pwdisswordfish2 6y agoWhat sort of system and resources do you need to compile the kernel? For example, "disk" space and memory? How long does compilation take (depends on system resources)?
- Jaruzel 6y agoIs this documented properly somewhere, so that I can give it a go? I've tried and failed with LFS so many times, I can't count - I tend to just run out of time, and by the time i go back to it, I've totally lost where in the process I was.
- InitEnabler 6y agoYes it does, can confirm at least the toolchain (Major step 1), and gcc for major step 2. I'm actually working on getting aarch64 working as of right now. If it successful I'd prolly like to submit a lfs hint.
- MuffinFlavored 6y agoI don't like giving my real name out online but I have a GitHub repo that does this automatically as a CI/CD job and a single shell script. It's really neat. Reach out to me (my username @ gmail.com) and I'll share it with you/
- amiga_500 6y agoAgreed. This got me started on a love affair that is still going strong, around 20 years later.
- lathiat 6y agoAgreed. I learnt a lot doing this in the 2000s.
- jake_morrison 6y agoI find Linux From Scratch a bit masochistic. Embedded Linux development is equally educational while actually being useful. There are good frameworks like Buildroot: https://buildroot.org/ https://buildroot.org/
- pfranz 6y agoI think a bit of masochism is the point. I did it once to fill in all of the gaps and cement all the dependencies when putting together a system. That kind of knowledge helps when you're trying to do server maintenance but try and keep the system up or do crazier things but be fairly confident certain parts won't be affected. I can't see myself using a LFS system in production.
- jake_morrison 6y agoI ran Gentoo for a few years, and it was a great balance of being low level and customizable but practical for day to day use. When you have set things up from scratch, you can fix it when it breaks. The Gentoo install disk helped me recover many a server. I got tired of the endless compilation, though.
- JoshTriplett 6y agoExactly. I've been through a similar exercise of assembling a system more-or-less from scratch, and I found it quite useful as a learning experience. It's not about using the resulting system long-term, it's about seeing how one is put together.
- thom_nic 6y agoI agree, for a couple reasons. One, while you usually have to deal with a cross toolchain (usually intel-> ARM) it's easier to build and debug on a target board versus booting and rebooting your PC to see if you did everything right. Also the I've used debootstrap to build a Debian distro for ARM with a custom kernel (for an Olimex board target or Beaglebone.) That's very hands-off and not nearly the same "depth" as LFS. The next step was taking the same kernel and building a busybox-based rootfs. Then I had to make my own PID 1 and do init work to bring up services such as networking on boot which was very educational, yet busybox provides most of the "lego bricks" that you're not left writing too much from scratch. Building to an embedded target also allows one to punt on the most annoying and complex parts of a desktop linux distro, such as the desktop environment, audio/video drivers, UEFI bootloader, etc. Building a semi-custom (e.g. Arch or Debian/debootstrap, Buildroot or OpenEmbedded) headless distro was what I'd call a "shallow dive" or gentle introduction to more of Linux's inner workings without having to understand every bit in order to get a running system.
- hprotagonist 6y agoLFS, or gentoo from a stage 1 tarball, is something that is extremely valuable to do. Once. Once is usually enough.
- pfranz 6y agoOnce is generally enough. I did it awhile back and have tried to reference LFS for major changes that have been adopted since I last did it like EFI and LUKS. I'm glad to see it getting updates.
- IgorPartola 6y agoI ran Gentoo in college for a couple of years. Oh god the compilation.
- _rtld_global_ro 6y agogentoo is too addictive, unless you want `emerge` as part of your routine
- hprotagonist 6y agoi already use emacs, what’s one more thing?
- boomboomsubban 6y agoAs someone who tried running Gentoo in the past, I could never find a decent resource for helping me figure out what make flags I wanted to set. It was far more confusing than FreeBSD, which at least provided rudimentary descriptions for each flag before compiling. I may have been missing something obvious though.
- TeeMassive 6y agoI'm 30 and I can't believe I didn't do this pilgrimage yet. When will this be ready?
- mvanveen 6y agoI'm almost 31 and I said the same thing to myself this weekend. Ironically coincident with this announcement, I ended up going through LFS and managed to get a kernel compiled using an entirely bootstrapped toolchain. About halfway through I noticed the development version they're discussing, which is available here: http://www.linuxfromscratch.org/lfs/view/development/ http://www.linuxfromscratch.org/lfs/view/development/ I believe this version is likely able to be run-through but please keep in mind it looks like it's been changing every few days! To the point of other commentators mentioning it can get a little tedious, especially in chapter 6- I think the new revised edition they're working on could help with that somewhat as it looks like avoiding the /tools buildout will help minimize the number of packages that need to get rebuilt.
- tdsamardzhiev 6y agoWe can start a study group. "Uncles doing LFS"
- kgraves 6y agoIs there a reputable startup / company that employs Linux kernel developers?
- sfoley 6y agoRed Hat?
- person_of_color 6y agoGoogle?
- yjftsjthsd-h 6y agoDepends a bit on your ideas of "reputable"; IIRC, hardware OEMs tend to employ devs to implement hardware support for their boards, but a rather lot of those have a poor reputation in terms of code quality - i.e., "We've successfully shipped the device with kernel 5.1.0 (current when we started); time to forget about that and implement the next board! What do you mean, upstreaming? That sounds like extra work. Bug fixes? Don't be absurd!".
- btgeekboy 6y agoYou could look a the commit logs and see if there’s any email domains that pique your interest.
- purerandomness 6y agoSuSE
- pengaru 6y agoIntel?
- jiggunjer 6y agoSamsung
- NikolaeVarius 6y agoAmazon
- freedomben 6y agoIf you're not ready for the LFS plunge, install and configure an Arch Linux system with a graphical desktop environment. I learned more about Linux in that 8 (non-consecutive) hours than I had in the couple of years preceding. Then study for the RHCSA and RHCE v7 (v8 is all Ansible now). Arch Linux and RHCSA and RHCE taught me a ton about Linux and made me super comfortable with my Linux desktops and servers.
- R0b0t1 6y agohttps://knowyourmeme.com/memes/install-gentoo https://knowyourmeme.com/memes/install-gentoo Goes even deeper than arch. The desktop profiles make it almost set-and-forget now.
- yjftsjthsd-h 6y agoI'd say Arch, then Gentoo, then LFS. Arch provide you with usable binary packages and leaves you to know what to install and how to configure it. Gentoo makes you actually build those packages from source and gives you more control over how the process works. Then LFS takes away even what portage was doing for you and makes you do the build process yourself by hand from scratch.
- t-writescode 6y agohttps://xkcd.com/456/ https://xkcd.com/456/
- znpy 6y agoIt's kinda sad that no one recommends Slackware Linux anymore. Back in the day there we used to say: "when you know slackware you know Linux. When you know red hat all you know is red hat". Effectively when I got into slackware my computer wasn't 100% working all of the time but I learned a lot. I then moved on and years later I got rhcsa certified and that's very worth it too. Not sure about arch, I never really used that, but I can vouch for slackware, Gentoo and the RedHat/centos/rhcsa thing.
- Ericson2314 6y agoWe really need to fix GCC so that the libraries and compiler can be built separately (like Clang).
- photon12 6y agoLots of comments so far about using Linux From Scratch to learn about the userspace/kernelspace interaction, and while that's all feasible you can do this on basically any distro. This week I've been iteratively rebuilding the kernel and glibc and the vDSO on my Ubuntu Server 20.04 install and learning a ton about the interactions, while also having the Ubuntu apt repositories to fall back on for when I want to switch from "learning mode" to "just get this task done mode."
- baddox 6y agoAfter seeing this headline I was just thinking it would be a lot of fun to dive back into Linux 15 years after I was last a desktop Linux user. It would be fun to try Linux From Scratch, or Gentoo if that’s still a thing. Then I realized I don’t even own any normal PC hardware that I could do that with without some wrangling (I could probably technically get it working on my old Intel iMac or my Synology NAS, but that’s not really the challenge I’m looking for). It’s wild to think that 15-20 years ago I was obsessed with Linux and spending my free time trying to get graphics drivers and dual monitors to work, and now I barely even have any traditional PC hardware.
- seabrookmx 6y ago> I barely even have any traditional PC hardware Can you elaborate? Are you using a Macbook or something instead?
- BossingAround 6y agoProbably tablets, phone, or something similar..?
- aembleton 6y agoCouldn't you try it in a virtual machine? Do you have any hardware that can run Virtualbox?
- deleted 6y ago[deleted]
- vbsteven 6y agoThis brings me back to my years of running Gentoo as my daily driver. All fun and games until you update your system over the weekend and spend the rest of the weekend fixing broken networking. But it is all worth it if your goal is learning the ins and outs of an OS and how it all fits together. It was fun booting to a graphical desktop in a few seconds, opening activity monitor and seeing < 70mb memory used. This was with XFCE around 2010. Now it is 2020 and Task Manager on my daily Windows 10 machine shows 27gb memory used.
- aembleton 6y ago27GB? Or 2.7GB?
- justaj 6y agoEvery time I read comments about Gentoo it's either about systems unexpectedly getting broken after an update, which supposedly requires considerable amount of effort to fix, or I read about how extremely stable Gentoo systems are and require almost no maintenance. It seems like there's some dissonance here and I'm not sure where this comes from.
- bananaface 6y agoI think 90% of the difference is explained by package load. The more moving parts, the less stable the machine. If you run 10 packages from stable repos, Gentoo will be stable. If you run 900 packages from wherever they were available (more realistic IMO) then it's much more likely to break.
- pizza234 6y ago
- Tainnor 6y agoI have tried LFS before because I thought it would teach me more about Linux (been a desktop Linux user since 2006, having tried a number of distributions, including Arch, and more recently back on Ubuntu, but never dug deep into internals). However, I found I didn't really learn much and was just blindly executing steps. It's fun for a while to watch the magic, but maybe there is some better way to consume the material? I found that I wasn't really getting enough context around what was happening to appreciate what was being done and why at every stage. Maybe someone can suggest something?
- samvher 6y agoInteresting - my experience was that I learned a lot from it not so much by blindly executing the steps, but by things not working the way they were supposed to. This forced me to dive into the details and understand what was going on. (This is probably 15 years ago though - maybe the instructions have gotten better :) )
- ExcavateGrandMa 6y agoAm glad to have taught them something before they thrown me out \o/ Tools to empower robbery... AND ACT LIKE PIONEER :D I swear what you do... SINCERELY!
- ExcavateGrandMa 6y agoWhat I retain from all of this... I salute the fact he did work on the hint I gave on their "weirdly handled" irc chat on freenode... (you may be able to find some logs...). And they succeeded! I'm very happy that now the public is gonna have the clean way to produce an operating system with Gnu tools & Linux. While I was very kind sharing with them they didn't appreciate I wasn't giving solution "directly" and clearly thrown stuff to me like I'm a noob speaking too much of thing I don't master... well, it was very surprising to me to end in this situation... I even asked bdubbs itself to support me with that... he thrown me that "he doesn't handle irc chat only book writing...". I was kind of meh I just left their chat... The result of this weird context pushed me into this view: THEY ARE BUILDING GNU/LINUX SINCE 20years! and 20 years later they are still waiting information to drops from sky... and then acts like pioneerrs... This went far the edges limits! go in hell NOOBS!