LinuxQuestions.org
Review your favorite Linux distribution.
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 07-27-2022, 09:09 PM   #1
oranos
LQ Newbie
 
Registered: Jul 2022
Posts: 8

Rep: Reputation: 1
Using OpenRC as an init system in an LFS build. Anyone know enough about it to advise me on configuring it?


I just finished Chapter 7 of version 11.1 of the (stable version) of the book. I was going to move on to Chapter 8. But this is where both versions of the book install the init system. So I wasn't sure if, given that I was planning to use Open RC as the init system, I should install it here. I'm assuming for the rest of the post that Open RC should be installed at the end of Chapter 8(since both systemd and sysvinit init systems are installed at this point), but let me know if I should wait until after the build is finished before doing any of this.

I read through the Arch Wiki article on Open RC here, the manual here, and the project's Github files here, and this is how I think I'm supposed to proceed through Chapter 8.

1. Continue as the book says, and install SysVInit. Based on what I understand about how Open RC works, and the package info on the Gentoo website here, SysVInit is one of Open RC's dependencies, and so it should be installed. Complete Chapter 8 as normal.

2. According to the Open RC github documentation, it uses meson for builds and installs. The way I was going to do this was to install git, pull the meson git repo, then use that to build Open RC.

Git has cURL as a dependency, so I think I would cd into the $LFS/sources directory, and in the chrooted envrionment, do the following (I'm fairly certain some of these are wrong, so I could use some pointers):

Code:
// Getting cURL

wget https://curl.se/download/curl-7.81.0.tar.xz
tar -xvf curl-7.81.0.tar.xz
cd curl-7.81.0
./configure --prefix=/usr                           \
            --disable-static                        \
            --with-openssl                          \
            --enable-threaded-resolver              \
            --with-ca-path=/etc/ssl/certs 
make
make install
cd ../. 

Downloading the git tarball

wget https://www.kernel.org/pub/software/scm/git/git-2.35.1.tar.xz
tar -xvf git-2.35.1.tar.xz
cd git-2.35.1.tar.xz

./configure --prefix=/usr \
            --with-gitconfig=/etc/gitconfig \
            --with-python=python3
make
make install
cd ../.

Downloading/building meson

git clone https://github.com/mesonbuild/meson.git
cd meson 
ninja
cd ../.

Building Open RC

git clone https://github.com/OpenRC/openrc
meson openrc && cd openrc
meson compile
meson test
Here's the thing: I don't know quite how meson works. Does it take care of dependencies? For example, the Gentoo package page for Open RC lists Linux-PAM as a dependency, which hasn't been installed on the LFS system. If all the steps until now work (and that's a big "if") is Open RC broken, or did meson take care of it?

3. Now OpenRC has to be configured. And this is the part where I need some guidance, because I'm not entirely sure how to do this.

Just as an example: I was planning on using dhcpcd for network configuration. How do I tell it to do that? I somehow suspect just getting the dhcpcd tarball, installing it, and typing "rc-update service add dhcpcd" isn't going to cut it.

4. What changes in the kernel configuration? The Arch wiki has this sentence:

Quote:
If using init=/usr/bin/openrc-init in your kernel parameters, you will need to manually enable getty services, otherwise you will be left with no interactive TTYs[
Is there a particular reason why I can't just leave it as init=/sbin/init? Is there something else about configuring the kernel when using Open RC that I'm just missing here?
 
Old 07-29-2022, 05:34 AM   #2
Keith Hedger
Senior Member
 
Registered: Jun 2010
Location: Wiltshire, UK
Distribution: Linux From Scratch, Slackware64, Partedmagic
Posts: 3,137

Rep: Reputation: 855Reputation: 855Reputation: 855Reputation: 855Reputation: 855Reputation: 855Reputation: 855
meson/ninja is just a build system so no it wont take care of dependencies you will have to do that.
as for the rest havn't used openrc so cant help there.
 
Old 07-29-2022, 05:52 AM   #3
hazel
LQ Guru
 
Registered: Mar 2016
Location: Harrow, UK
Distribution: LFS, AntiX, Slackware
Posts: 7,499
Blog Entries: 19

Rep: Reputation: 4410Reputation: 4410Reputation: 4410Reputation: 4410Reputation: 4410Reputation: 4410Reputation: 4410Reputation: 4410Reputation: 4410Reputation: 4410Reputation: 4410
It should be possible to build OpenRC without PAM support. Here is a discussion of the topic on github.

Meson works like a configure script so presumably it will determine if you have PAM installed and make decisions accordingly.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
New build of LFS I'm experimenting with. (OpenRC+ZFS+B/LFS) ReaperX7 Linux From Scratch 26 07-19-2015 09:17 PM
LXer: Manjaro OpenRC 0.8.13 - reinventing init without systemd LXer Syndicated Linux News 0 05-31-2015 09:12 PM
LFS with OpenRC? ReaperX7 Linux From Scratch 5 08-13-2013 08:29 PM
SysVinit vs OpenRC vs systemd vs other init system cristi92b Linux - Newbie 2 01-07-2013 03:02 AM

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

All times are GMT -5. The time now is 07:45 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