LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
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-25-2010, 11:29 AM   #1
jimmy_page_89
Member
 
Registered: Sep 2010
Location: Turin (Italy)
Distribution: Slackware 14.2
Posts: 51

Rep: Reputation: 4
LFS 6.7 - Problem, populating /dev with a BSD-style init


Hello everybody,
i'm building an LFS 6.7 with a BDS-style init
i follow the hint, with a little modification of the rc.sysinit:
Code:
#!/bin/sh

# Starting /etc/rc.d/rc.sysinit

PATH=/sbin:/usr/sbin:/bin:/usr/bin

echo "Mounting root device read-only..."
/bin/mount -n -o remount,ro /

echo "Starting udev..."
mount -n -t sysfs sysfs /sys
mount -n -t proc proc /proc
mount -n -t tmpfs tmpfs /dev
echo > /proc/sys/kernel/hotplug
cp -ar /lib/udev/devices/* /dev
udevd --daemon
#udevtrigger
#udevsettle

echo "Initializing swap partitions..."
/sbin/swapon -a

/sbin/fsck -A -a -C
if [ $? -gt 1 ]; then
  echo
  echo "ERROR:"
  echo "Your filesystem has been severely damaged. You can probably correct this"
  echo "problem by running e2fsck manually (eg. with the -v and -y options). After"
  echo "you logout, the system will reboot"
  echo
  PS1="(Repair filesystem)# "
  export PS1
  /sbin/sulogin
  /bin/umount -a -r
  /sbin/reboot -f
fi

echo "Remounting root device read-write..."
/bin/mount -n -v -o remount,rw /

echo "" >/etc/mtab
/bin/mount -f -o remount,rw /

echo "Recording existing mounts in /etc/mtab..."
mount -f /proc
mount -f /sys

echo "Mounting other local filesystems..."
/bin/mount -a -v -tnonfs

echo "Setting up loopback networking..."
/sbin/ifconfig lo 127.0.0.1
/sbin/route add -net 127.0.0.0 netmask 255.0.0.0 lo

echo "Setting up hostname..."
/bin/hostname `cat /etc/HOSTNAME |cut -d . -f1`
/bin/domainname `cat /etc/HOSTNAME |cut -d . -f2-`

if [ -f "/tmp/random-seed" ]; then
  echo "Initializing random number generator..."
  /bin/cat /tmp/random-seed >/dev/urandom
  rm -f /tmp/random-seed
fi

echo "Loading keymap..."
/usr/bin/loadkeys -d

echo "Configuring RTC..."
echo 1024 > /proc/sys/dev/rtc/max-user-freq

echo "Setting system time from hardware clock..."
/sbin/hwclock --hctosys --utc

echo "Starting system and kernel log daemons..."
/usr/sbin/syslogd
/usr/sbin/klogd -c3

echo "Updating module dependencies..."
/sbin/depmod -a
at the "swapon -a", it can't found /dev/hda2 (my swap partition)
because into /dev there isn't hda2 (and hda1 also, my root partition)
how can i solve this?

Thanks
 
Old 09-25-2010, 03:16 PM   #2
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405
Hi,

Never tried a LFS with BSD-style init, but one thing doesn't look correct when using a modern kernel and udev: Shouldn't hda1 and hda2 be sda1 and sda2?

I don't see them mentioned in your posted code nor in the hint, /etc/fstab related?

Check the output of the dmesg command to see how the partitions are recognized.

Hope this helps.
 
Old 09-25-2010, 04:02 PM   #3
jimmy_page_89
Member
 
Registered: Sep 2010
Location: Turin (Italy)
Distribution: Slackware 14.2
Posts: 51

Original Poster
Rep: Reputation: 4
when i see the graphical boot, kernel recognize partitions as hda{1,2}
but, in every case, in /dev i can't se hd* and sd*
every node of the hard disk wasn't create..

Thanks
 
Old 09-26-2010, 03:52 AM   #4
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405
Hi,

A few questions:

- Did you have a working LFS before you changed to BSD init style?
- How far does the boot process go and what error message is produced (if it doesn't finish that is).

Also:

If I look at the standard /etc/rc.d/init.d/udev script I see some differences that you might want to look into.

Quote:
echo "Mounting root device read-only..."
/bin/mount -n -o remount,ro /

echo "Starting udev..."
mount -n -t sysfs sysfs /sys
mount -n -t proc proc /proc # Is this one needed here?
mount -n -t tmpfs tmpfs /dev # Shouldn't this be: mount -n -t tmpfs tmpfs /dev -o mode=755
echo > /proc/sys/kernel/hotplug
cp -ar /lib/udev/devices/* /dev shouldn't this be: cp -a /lib/udev/devices/null /dev
udevd --daemon # Add full path to udev: /sbin/udevd --daemon
#udevtrigger # Why is this commented out? /sbin/udevadm trigger --action=add
#udevsettle # Commented out? /sbin/udevadm settle
When do you load your modules? This should be done before the udev part runs. I think proc should already be available to load the modules. I.e:
- first kernel based FS is mounted,
- then modules are loaded,
- then udev is populated.

Hope this gets you going again.
 
  


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
LFS live-cd: /dev/mapper/lfs-cd ran out of space bucovaina78 Linux From Scratch 0 10-12-2009 12:00 PM
e.g., BSD style (Slackware) vs. SystemV style startup scripts haertig Slackware 5 01-03-2009 11:52 PM
6.2 Boot Failure: Populating /dev with device nodes gpenguin Linux From Scratch 3 03-12-2007 05:52 PM
How to use the BSD style init scripts in /etc/rc.d jmbrink26 Slackware 8 09-06-2006 10:32 AM
populating /dev class_struggle Linux - Newbie 3 07-25-2004 07:39 PM

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

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