LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
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 09-16-2013, 02:33 PM   #1
Lennie
Member
 
Registered: Aug 2012
Location: Sweden
Distribution: LFS, built with pacman
Posts: 374

Rep: Reputation: 85
booting 7.4: it skips rc S and goes directly to runlevel 3


I tried to boot lfs-7.4 for the first time. It boots the kernel, and when it's time to hand over to initscripts it's like it skips 'rc S' and goes directly to 'rc 3'.

I have run diff on all files in /etc/init.d, and the only difference between lfs-7.3 and lfs-7.4 are small differences in mountfs and mountvirtfs. I copied those from 7.3 to test with the exact same scripts, but no difference. /etc/inittab is also the exact same.

Here are the links in /etc/rc.d/rcS.d
Code:
/media/lfs-7.4-test/etc/rc.d/rcS.d
└─$ ls -l
total 0
lrwxrwxrwx 1 root root 21 Sep  5 20:51 S00mountvirtfs -> ../init.d/mountvirtfs
lrwxrwxrwx 1 root root 17 Sep  5 20:51 S05modules -> ../init.d/modules
lrwxrwxrwx 1 root root 18 Sep  5 20:51 S08localnet -> ../init.d/localnet
lrwxrwxrwx 1 root root 14 Sep  5 20:51 S10udev -> ../init.d/udev
lrwxrwxrwx 1 root root 14 Sep  5 20:51 S20swap -> ../init.d/swap
lrwxrwxrwx 1 root root 17 Sep  5 20:51 S30checkfs -> ../init.d/checkfs
lrwxrwxrwx 1 root root 17 Sep  5 20:51 S40mountfs -> ../init.d/mountfs
lrwxrwxrwx 1 root root 17 Sep  5 20:51 S45cleanfs -> ../init.d/cleanfs
lrwxrwxrwx 1 root root 20 Sep  5 20:51 S50udev_retry -> ../init.d/udev_retry
lrwxrwxrwx 1 root root 17 Sep  5 20:51 S70console -> ../init.d/console
lrwxrwxrwx 1 root root 16 Sep  5 20:51 S90sysctl -> ../init.d/sysctl
The files in /etc/rc.d/init.d
Code:
/media/lfs-7.4-test/etc/rc.d/init.d
└─$ ls -l
total 116
-rwxr-xr-- 1 root root  4503 Sep  5 20:51 checkfs
-rwxr-xr-- 1 root root  3169 Sep  5 20:51 cleanfs
-rwxr-xr-- 1 root root  3423 Sep  5 20:51 console
-rwxr-xr-x 1 root root  1018 Sep 13 17:00 fcron
-rw-r--r-- 1 root root 19338 Sep  5 20:51 functions
-rwxr-xr-- 1 root root   813 Sep  5 20:51 halt
-rwxr-xr-- 1 root root  1569 Sep  5 20:51 localnet
-rwxr-xr-- 1 root root  2160 Sep  5 20:51 modules
-rwxr-xr-- 1 root root  2409 Sep 16 20:13 mountfs
-rwxr-xr-- 1 root root  2004 Sep 16 20:14 mountvirtfs
-rwxr-xr-- 1 root root  1983 Sep  5 20:51 network
-rwxr-xr-- 1 root root  6149 Sep  5 20:51 rc
-rwxr-xr-- 1 root root   900 Sep  5 20:51 reboot
-rwxr-xr-- 1 root root  1462 Sep  5 20:51 sendsignals
-rwxr-xr-- 1 root root  1405 Sep  5 20:51 setclock
-rwxr-xr-- 1 root root  1369 Sep  5 20:51 swap
-rwxr-xr-- 1 root root  1299 Sep  5 20:51 sysctl
-rwxr-xr-- 1 root root  1793 Sep  5 20:51 sysklogd
-rwxr-xr-- 1 root root   882 Sep  5 20:51 template
-rwxr-xr-- 1 root root  2400 Sep  5 20:51 udev
-rwxr-xr-- 1 root root  2077 Sep  5 20:51 udev_retry
/etc/inittab
Code:
id:3:initdefault:

si::sysinit:/etc/rc.d/init.d/rc S

l0:0:wait:/etc/rc.d/init.d/rc 0
l1:S1:wait:/etc/rc.d/init.d/rc 1
l2:2:wait:/etc/rc.d/init.d/rc 2
l3:3:wait:/etc/rc.d/init.d/rc 3
l4:4:wait:/etc/rc.d/init.d/rc 4
l5:5:wait:/etc/rc.d/init.d/rc 5
l6:6:wait:/etc/rc.d/init.d/rc 6

ca:12345:ctrlaltdel:/sbin/shutdown -t1 -a -r now

su:S016:once:/sbin/sulogin

1:2345:respawn:/sbin/agetty --noclear tty1 9600
2:2345:respawn:/sbin/agetty tty2 9600
3:2345:respawn:/sbin/agetty tty3 9600
4:2345:respawn:/sbin/agetty tty4 9600
5:2345:respawn:/sbin/agetty tty5 9600
6:2345:respawn:/sbin/agetty tty6 9600
rc.site and the other files in /etc/sysconfig are the same as in 7.3.

I have no bootlog, because the rootfs was mounted readonly (it should be remounted in the scripts that were skipped). The messages from the kernel looked normal.
"...used greatest stack..." I think that was the last line from the kernel, and then it said initscript and I think it showed what version it was.
Where it was supposed to say "mounted /run /proc /sys" instead it said entering "runlevel 3", and then stopped with an error because sda7 (the root-partition) was mounted readonly. sda7 is the correct partition.

Does anyone have any idea about what could be causing this? It must be a stupid mistake I did somewhere, because the initscripts are the exact same as the ones working fine in 7.3...
 
Old 09-16-2013, 08:23 PM   #2
ReaperX7
LQ Guru
 
Registered: Jul 2011
Location: California
Distribution: Slackware64-15.0 Multilib
Posts: 6,558
Blog Entries: 15

Rep: Reputation: 2097Reputation: 2097Reputation: 2097Reputation: 2097Reputation: 2097Reputation: 2097Reputation: 2097Reputation: 2097Reputation: 2097Reputation: 2097Reputation: 2097
Just have to ask but did you follow the book EXACTLY during Chapter 7 setting up the boot scripts, directory permissions, and did you attempt any level of customization during the initial compile and setup of your LFS system?

Attempts to customize LFS at all tend to really hurt the system, and, really, if you don't follow the book(s) exactly, you'll often, but not always, end up getting something screwed up, which I did on one of my first build attempts.

As for why it did that? Unless you did any customizations, LFS, by itself, is a rather raw GNU/Linux distribution with very little, so chances are it might have been a customization or an issue with LFS itself. I've had no issues with this myself and my system boots fine.

You MAY want to look into expanding LFS using Beyond Linux from Scratch, especially using (at least) Chapter 3 of BLFS-7.4.

Chapter 3 will really clear up a lot of left-over mundane stuff, as well as give a raw LFS some personality.
 
Old 09-17-2013, 02:14 AM   #3
Lennie
Member
 
Registered: Aug 2012
Location: Sweden
Distribution: LFS, built with pacman
Posts: 374

Original Poster
Rep: Reputation: 85
Of course I've deviated from the book, otherwise there wouldn't be any breakages... I used the same build script that I used for 7.3, updated to the versions in 7.4, and some of them with a few other adjustments. I build packages with pacman, and try different ways to have the install script doing some stuff that can't be put in the packages. But I didn't add any patches or other changes to the actual building of the lfs packages.

I went through chapter 7 when it failed to boot, and made sure those files exist, and are correct. I ran diff on those relevant for early boot, and they are the same as in 7.3.

I have for quite long thought about writing my own initscripts, because I don't like the symlinks and I think the rc file is a mess to follow what it does. I wrote my own initscipts in Slackware, but I don't like how the output look because I didn't know then how to make the colorful output for OK in green or FAIL in red. I think I have learned enough about bash scripting to make it now. If I could just stop being lazy... But it disturbs me that it doesn't work with the initscripts from LFS. It's a sign of something being wrong, and I want to sort it out even if I write my own initscripts.

I checked the log from building sysvinit, and I can't see anything wrong there. No errors, nothing that looks strange. The "error" must be very early. /sbin/init should read /etc/inittab, and there it clearly says it should start with 'rc S'. The file rc is the exact same as the one in 7.3, and all other scripts come later. I couldn't see anything wrong with the output from booting the kernel. Maybe recompiling sysvinit and see if it makes a difference.
 
Old 09-17-2013, 12:52 PM   #4
Lennie
Member
 
Registered: Aug 2012
Location: Sweden
Distribution: LFS, built with pacman
Posts: 374

Original Poster
Rep: Reputation: 85
I found it. I put a lot of echo in the rc scripts, to see how far it came. Where it uses ls (redirected to /dev/null) to find the symlinks for the runlevel that should be started, I showed the output from ls. It couldn't find a shared library...

I recompiled coreutils after I installed acl, but then ls/coreutils became dependent on libcap, which was not installed in my test-system. So I installed it, and then it booted to normal login-prompt. With a few exciting 'FAIL's, of cource, but that was kind of expected...
 
  


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
[SOLVED] Problems after booting directly into runlevel 4, with alsa especially Stephen Morgan Slackware 2 11-04-2012 01:39 AM
booting into runlevel 5, but I have it set for runlevel 3. Help. punt Fedora 13 06-01-2011 04:18 PM
Not able to boot directly in runlevel 1: Bug or New Feature? ChrisAbela Slackware 10 11-16-2009 12:50 PM
[SOLVED] Audio skips when scrolling, skips horribly when watching video with Compiz enabled Kiboney Linux - Newbie 16 06-02-2009 10:19 PM
boots directly to windows, skips linux alfdog Linux - Newbie 8 06-28-2004 09:27 AM

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

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