DEV Community

sam
sam

Posted on

Linux from scratch day one disaster

So I finally bit the bullet, and decided that I couldn't postpone it any longer I had to build linux from scratch; I thought it was going
to be easy I mean the book was basically a tutorial on how to do just
that but as you can tell from my title there I quickly ran into some
problems;
The first unironically was with the first command I was to run
you see before we could start actually building the system itself,
we had to ensure that the system actually had the tools to do that.
There was a script provided, a bash script where on running it would tell you whether you had all the tools installed; so I spent the rest of my time running the script hitting sudo dnf install(am a fedora
guy bythaway). Everything seemed ok until I hit the last error,
the infamous "Error: yacc is not Bison" I was like yeah I know that
yacc isn't bison; problem was instead of consulting the book, I ran
like a geek to papa Google for answers and after just 7 mins in
I was ready to call it quits; on stack overflow, there were lots of
people like me who had encountered the same problem.
Problem is; either they didn't get good answers at all or the answers
they got didn't help much for my problem, after going about this
for like four hours I was ready to throw in the towel, but I
quickly decided against it. Instead I decided to take a break and come back and hack some more into it after a half an hour.

During my break, I don't know how it came to be maybe I thought
that the script was a bluff or something but I started getting thoughts of abandoning the error and just moving on, but when I came
back to my laptop, I decided to go back to the book; maybe they had the answer and sure enough they did(indirectly).
It reads

Bison-2.7 (/usr/bin/yacc should be a link to bison or a small script that executes bison)

I simply had to jump into /bin and add yacc as a link to bison,
a simple command that cost me 5 hours at that point

ln bison yacc

Anyways I ran that and the script gave me a big ok and I was back
on this wretched path again but then I got to the partition part
and once again I held my breath, there was a lot of stuff to do
and when I ran

cfdisk /dev/sda

down below I got an error screaming at me saying that the system was running blah blah blah which got me worried; was it possible
that I could actually permanently make my rom obsolete ? I still don't know; still I had to make the partition and that is where I
got another problem, they said that 30G was enough but when I looked at their example and actually counted the amount of storage they allocated, it was more than 82G.
I was confused and didn't know what to do, I soon abandoned cfdisk
for GParted; a software from Gnome that came with KDE, and the GUI
actually made things less scary, but still I kept on deleting
and creating new partitions, so I called it quits and finally
decided to consult a master of this craft, the guy from
the

channel kernotex on Youtube

and then begun my handholding, it was great just following what the
guy was doing; I mean copying commands when he did,
he led me well; especially at that part with the wget file
where you were supposed to wget the file first before running the
command

wget --input-file=wget-list-systemd --continue --directory-prefix=$LFS/sources

but I soon realized that I should have followed his tutorial from the start truthfully, and not jumped in after I got tired of the LFS
book especially
not running

sudo ...
instead of running as the root user
it caused me problems when I finally got to actually building the
system at chapter 5, where the lfs user didn't have permisions to
some of the files and so the

make install

command would output permission denied errors. I soon quit, I couldn't continue with a broken system, I deleted the partition, which was not the smartest move out there since when I powered on
my laptop today I realised the user lfs was still there. This is
probably because I didn't actually remove the user; anyways guys
wish me luck as I try it again today.
At least I learned about the

sudo bash command

so that's something. Wish you all luck too as you do the challenge.
Have a nice day y'all

Here's something I read this morning

Luke 11:9-13
9 “So I say to you: Ask and it will be given to you; seek and you will find; knock and the door will be opened to you. 10For everyone who asks receives; the one who seeks finds; and to the one who knocks, the door will be opened.
11 “Which of you fathers, if your son asks for a fish, will give him a snake instead? 12Or if he asks for an egg, will give him a scorpion? 13If you then, though you are evil, know how to give good gifts to your children, how much more will your Father in heaven give the Holy Spirit to those who ask him!”

The Holy Bible, New International Version® NIV®

Copyright © 1973, 1978, 1984, 2011 by Biblica, Inc.®

Used by Permission of Biblica, Inc.® All rights reserved worldwide.

Top comments (0)