LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 03-06-2022, 07:27 PM   #1
Carmazum
LQ Newbie
 
Registered: Mar 2022
Posts: 2

Rep: Reputation: 0
Question Do I need to know how to program in C to work with Linux From Scratch?


Hello, how are you?

I have this little dream/ambition to create my own Linux Distro. I do know how to work with Shell Scripting (Bash), but I have never touched a single line of C. Also, if it's not too much trouble, do you have any tips on how to get started with this challenging task?

I have searched everywhere for the answer to my question, but I have not been very successful. In advance, a thousand apologies if this is a silly question or if this is the wrong place to ask; I am new to this forum.

Thank you in advance, my friends. I wish you all the best!
 
Old 03-06-2022, 07:43 PM   #2
frankbell
LQ Guru
 
Registered: Jan 2006
Location: Virginia, USA
Distribution: Slackware, Ubuntu MATE, Mageia, and whatever VMs I happen to be playing with
Posts: 19,317
Blog Entries: 28

Rep: Reputation: 6140Reputation: 6140Reputation: 6140Reputation: 6140Reputation: 6140Reputation: 6140Reputation: 6140Reputation: 6140Reputation: 6140Reputation: 6140Reputation: 6140
I played with LFS a few years ago, and, based on my experience, no (I learned a lot, also). You do need (or will quickly acquire) familiarity with the command line, but you don't need to be a coder.
 
1 members found this post helpful.
Old 03-06-2022, 07:44 PM   #3
Skaperen
Senior Member
 
Registered: May 2009
Location: center of singularity
Distribution: Xubuntu, Ubuntu, Slackware, Amazon Linux, OpenBSD, LFS (on Sparc_32 and i386)
Posts: 2,684
Blog Entries: 31

Rep: Reputation: 176Reputation: 176
the short answer is "no". the long answer is, the more you know, in everything, the more it helps.
 
1 members found this post helpful.
Old 03-07-2022, 01:04 AM   #4
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,830

Rep: Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308
Quote:
Originally Posted by Carmazum View Post

I have this little dream/ambition to create my own Linux Distro.
The very first thing you need to do is to specify this distro. What do you want to achieve exactly? And probably you need to look around if that was already made by somebody.
Quote:
Originally Posted by Carmazum View Post
I do know how to work with Shell Scripting (Bash), but I have never touched a single line of C. Also, if it's not too much trouble, do you have any tips on how to get started with this challenging task?
To create a full distro you need to know how can you build it, release it, how will you update it, how will you apply vulnerability fixes (just to name a few). How do you want to manage the installed/available packages, what hardware will be supported .....

I guess shell scripting is quite useful, but not enough for this task.
 
1 members found this post helpful.
Old 03-07-2022, 01:31 AM   #5
Debian6to11
Member
 
Registered: Jan 2022
Location: Limassol, Cyprus
Distribution: Debian
Posts: 382
Blog Entries: 1

Rep: Reputation: 71
To answer the question in the title, no.

I know nothing of C and managed to install LFS11 (LFS11.1 is out now) without any problems. It is basically copying more or less.

And there is a dedicated forum for LFS for future reference (see Linux Distributions > Linux From Scratch subforum).
 
1 members found this post helpful.
Old 03-07-2022, 05:51 AM   #6
hazel
LQ Guru
 
Registered: Mar 2016
Location: Harrow, UK
Distribution: LFS, AntiX, Slackware
Posts: 7,569
Blog Entries: 19

Rep: Reputation: 4451Reputation: 4451Reputation: 4451Reputation: 4451Reputation: 4451Reputation: 4451Reputation: 4451Reputation: 4451Reputation: 4451Reputation: 4451Reputation: 4451
No, you don't need to know anything about C. But you do need to know some other things. I would suggest the following as basic requirements:

1) You must be comfortable using the command line.
2) You must understand bash shell constructs such as loops and conditions, and know what common Unix utilities such as grep and echo do, because you will be using them a lot.
3) You must be comfortable with copying, renaming and moving files using commands.
4) You need to understand some basic file concepts such as ownership and permissions, and symbolic links.
5) You need to understand the basic steps in building software (configure, make, make install) and what each step does. You don't need to understand how each stage works internally. The LFS Book has an excellent general chapter on this.

You can build LFS without knowing any of this, simply by blindly obeying the instructions. But you will not learn anything by doing it that way and it won't be much fun either.

Last edited by hazel; 03-07-2022 at 05:53 AM.
 
1 members found this post helpful.
Old 03-07-2022, 10:03 AM   #7
slac-in-the-box
Member
 
Registered: Mar 2010
Location: oregon
Distribution: slackware64-15.0 / slarm64-current
Posts: 780
Blog Entries: 1

Rep: Reputation: 432Reputation: 432Reputation: 432Reputation: 432Reputation: 432
It wouldn't hurt to run through a hello world tutorial in C: it's just as easy as bash, except you run it through a compiler at the end, creating a binary.

When you use other people's c code (why reinvent the wheel), their code is referenced with an "include" command in your script, and their code is stored in an "include directory". As you navigate the linux file system, you notice directories called include, and with just a minimal tadge of c programming, with just a hello world tutorial under your belt, those include directories won't seem like foreign places in the file-system to leave alone, but rather they'll be familiar: oh, that's the directory where the c-programmers store their header files that they reference with includes...

There are other files and directories lurking about within the linux file system that are all part of the C ecosystem. I would link to a hello world tutorial for you, except a book at a shop caught my eye: "Just enough C and C++ Programming", and I went through the tutorial in that book. But I reckon any linux based C tutorial would do, and it's well worth a few hours to not feel like a foreigner when navigating your operating system: especially if you plan on rebuilding it.

Last edited by slac-in-the-box; 03-07-2022 at 10:07 AM. Reason: changed "I" to "eye" :)
 
1 members found this post helpful.
Old 03-07-2022, 10:21 AM   #8
hazel
LQ Guru
 
Registered: Mar 2016
Location: Harrow, UK
Distribution: LFS, AntiX, Slackware
Posts: 7,569
Blog Entries: 19

Rep: Reputation: 4451Reputation: 4451Reputation: 4451Reputation: 4451Reputation: 4451Reputation: 4451Reputation: 4451Reputation: 4451Reputation: 4451Reputation: 4451Reputation: 4451
C is worth learning for its own sake. It's a very powerful language and intimately connected with Linux. The Linux kernel, the GNU utilities and the GNU C compiler are all written in it. But the original question was do you need to understand C in order to do Linux From Scratch and I don't think you do.
 
1 members found this post helpful.
Old 03-07-2022, 08:49 PM   #9
Carmazum
LQ Newbie
 
Registered: Mar 2022
Posts: 2

Original Poster
Rep: Reputation: 0
Thank you very much for your kind answers, Linux-loving comrades! What a nice community!

I don't really plan to do anything serious like Ubuntu, Fedora or other mature system; it will be more of a hobby. Again, thanks a lot for the help!

I hope all your goals and dreams come true!

Last edited by Carmazum; 03-07-2022 at 08:50 PM.
 
Old 03-07-2022, 10:08 PM   #10
Debian6to11
Member
 
Registered: Jan 2022
Location: Limassol, Cyprus
Distribution: Debian
Posts: 382
Blog Entries: 1

Rep: Reputation: 71
Basically what hazel said, though:
2) I do understand loops but not much the case statements, and
5) I learned that from building LFS
And I know my way around file systems and partitions.
Also I am still somewhat confused with many nested brackets.

But I did manage to finish LFS. And so will you if you give it a try.
 
1 members found this post helpful.
  


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
ali aladdin v agp stinks :scratch: :scratch: :scratch: Mr Marmmalade Linux - Hardware 1 07-08-2003 05:11 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 03:08 AM.

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