Friday, August 6, 2010
LFS after vacation
Well, here I am and I have forgotten everything. This will be a good test of how well I have written this blog.
Friday, June 25, 2010
No Progress Day 4
Reading some more about kernels today. The only saving feature about this excersize is that I have a toy OS to work with, while maintaining a running OS for normal daily usage.
Try this. Run config again and unmark everything experimental. On those items which have recommendations, I follow the advice.
make
make modules install
A quote from LFS mailing list:
I found another website,
Techfreaks , Driver test page, and what seemed to be a step by step guide through configuring the kernel, Pappy's Kernel Seeds. Nothing I tried was working.
Try this. Run config again and unmark everything experimental. On those items which have recommendations, I follow the advice.
make
make modules install
A quote from LFS mailing list:
Not building a required driver into the kernel is almost certainly the problem here. lsmod on an earlier system and lspci are exactly the right tools to figure out the needed drivers. After that rebuilding the kernel and retrying are the boot will be needed. -- Bruce
I found another website,
Techfreaks , Driver test page, and what seemed to be a step by step guide through configuring the kernel, Pappy's Kernel Seeds. Nothing I tried was working.
Thursday, June 24, 2010
No Progress
Day 3 of a stalled LFS installation. I am going to try using the legacy grub, as some people have suggested.
Once more, try make mrproper
make LANG=nl_NL LC_ALL= menuconfig
(SCSI device support change all M's to stars. )
make (started 13:18)
This will take a long time.
While I was waiting, I found a website called kernelnewbies.org They mentioned something called cpuinfo, which I installed on my Mandriva platform. One of the things a kernel is supposed to do is talk with the hardware, and I figure I should know a little bit about what is inside my computer.
Re-making did not work. I tried running with my Mandriva legacy GRUB. Still kernel panic, although different unkown-block (0,0) instead of (2,0)
Once more, try make mrproper
make LANG=nl_NL LC_ALL= menuconfig
(SCSI device support change all M's to stars. )
make (started 13:18)
This will take a long time.
While I was waiting, I found a website called kernelnewbies.org They mentioned something called cpuinfo, which I installed on my Mandriva platform. One of the things a kernel is supposed to do is talk with the hardware, and I figure I should know a little bit about what is inside my computer.
Re-making did not work. I tried running with my Mandriva legacy GRUB. Still kernel panic, although different unkown-block (0,0) instead of (2,0)
Tuesday, June 22, 2010
Chapter 9 Device Busy
While trying to unmount the lfs partition, using: umount -v $LFS, I get device busy warnings.
Here is an example of how I debugged this, thanks to Holy Scmoly
Note that I have already logged out of the chroot environment.
[root~]# fuser -m /dev/sdb6
[root~]# ps auxw | grep 3184
Clearly, that bash is from the exec command I used and am not sure was necessary. Re-run the fuser command and it should be ok.
[root@ ~]# umount -v $LFS
/dev/sdb6 umounted
Here is an example of how I debugged this, thanks to Holy Scmoly
Note that I have already logged out of the chroot environment.
[root~]# fuser -m /dev/sdb6
/dev/sdb6: 3184c
[root~]# ps auxw | grep 3184
root 3184 0.0 0.1 4024 1820 pts/0 S+ 08:25 0:00 bash
root 32081 0.0 0.0 3224 744 pts/1 S+ 10:36 0:00 grep --color 3184
[root@samwise ~]# kill -9 3184Clearly, that bash is from the exec command I used and am not sure was necessary. Re-run the fuser command and it should be ok.
[root@ ~]# umount -v $LFS
/dev/sdb6 umounted
Chapter 8 revisited
Looking at my notes, I seemed to have skipped this step and ran "make oldconfig" instead. This is due to my lack of familiarity with configuration using menuconfig. I am mostly familiar with the ./configure,make and make install that I had been doing through Chapters 5 and 6.
root#make LANG=nl_NL LC_ALL= menuconfig
Well, a menu appears!
This is nice.
#
# using defaults found in arch/x86/configs/i386_defconfig
#
#
# configuration written to .config
#
*** End of Linux kernel configuration.
*** Execute 'make' to build the kernel or try 'make help'.
Tail end of output of make
root:/sources/linux-2.6.32.8# make modules_install
Did all the other stuff in this section as well, with no errors. Reboot but first unmount everything.
root#make LANG=nl_NL LC_ALL= menuconfig
Well, a menu appears!
This is nice.
#
# using defaults found in arch/x86/configs/i386_defconfig
#
#
# configuration written to .config
#
*** End of Linux kernel configuration.
*** Execute 'make' to build the kernel or try 'make help'.
Tail end of output of make
Root device is (8, 22)
Setup is 11756 bytes (padded to 11776 bytes).
System is 4048 kB
CRC 5ffe0f2f
Kernel: arch/x86/boot/bzImage is ready (#1)
Building modules, stage 2.
MODPOST 2 modules
CC arch/x86/kernel/test_nx.mod.o
LD [M] arch/x86/kernel/test_nx.ko
CC drivers/scsi/scsi_wait_scan.mod.o
LD [M] drivers/scsi/scsi_wait_scan.ko
root:/sources/linux-2.6.32.8# make modules_install
INSTALL arch/x86/kernel/test_nx.ko
INSTALL drivers/scsi/scsi_wait_scan.ko
DEPMOD 2.6.32.8
Did all the other stuff in this section as well, with no errors. Reboot but first unmount everything.
Monday, June 21, 2010
Frustrated
I have reached the end of the LFS document and have a kernel panic. I am searching for the solution. It seems like I have not learned anything. I was stuck in the devices chapter and moved on, but what if this is the cause of the error? I still do not understand the kernel! I do not remember configuring it. I only see the API headers. But no .configure, make and make install stuff. It's frustrating because this is the main reason I started this in the first place.
I'm going to quit for today. Tomorrow, read the FAQ, "How do I compile a kernel or set up modules". Not sure why this is in the FAQ, it should be in the main documentation.
I'm going to quit for today. Tomorrow, read the FAQ, "How do I compile a kernel or set up modules". Not sure why this is in the FAQ, it should be in the main documentation.
Chapter 9 shutdown
Well, I thought I was done and re-booted before reading section 9.3. I had noticed all the "device busy " errors (see next blog entry) when re-starting. Also, it LFS did not boot at all.
logout
umount -v $LFS/dev/pts umount -v $LFS/dev/shm umount -v $LFS/dev umount -v $LFS/proc umount -v $LFS/sys
umount -v $LFS
shutdown -r now
ok, here we go!
Chapter 8.4 Grub
Ok, I have some experience with Grub. floppies....I'll have to look for them.
(google for the right command, here )
root:/sources# fdformat /dev/fd0
I also had to install some dos utilities and do the stuff on my OS and not LFS.
[home]#mkfs -t msdos /dev/fd0
On LFS,
root:/media# mount -t msdos /dev/fd0 /media/floppy
root:/# grub-mkdevicemap --device-map=device.map
root:/# cat device.map
(fd0) /dev/fd0
(hd0) /dev/sda
(hd1) /dev/sdb
Here is where I might run into trouble. I have made a floppy but I cannot verify what is on it. I do not know why.
#fdformat /dev/fd0
#mkfs -t msdos /dev/fd0
#mount -t msdos /dev/fd0 /media/floppy
#cd /media/lfs/tmp
#dd if=floppy.img of=/dev/fd0 bs=1440 count=1
If I check using df, there is something there. Good.
/dev/fd0 1,4M 210K 1,2M 15% /media/floppy
I tried rebooting with this and, although grub loaded, there was no prompt. Moving ahead anyway. So far, on my platform (the computer), I have (from the menu.lst) I believe that grub is installed on the MBR because I do not have Windows on this computer anymore. The boot device is sda (from Mandriva control center)
#title KDE Mandriva Linux (Official)
#root (hd0,0)
#title Gnome Mandriva Linux (Official)
#root (hd1,0)
A weekend has come between Friday and today, Monday. I got side tracked by the floppies.SO, after all the mounting and chroot (see Ch 7)
root:/# grub-install --grub-setup=/bin/true /dev/sda
Generating grub.cfg ...
Found linux image: /boot/vmlinux-2.6.32.8-lfs-6.6
done
I heard some disk access to the floppy drive. 140 .mod files were written to the /boot/grub directory. Just had a look at /boot. It has only 4 entries.
root:/boot# ls -lg
total 5864
-rw-r--r-- 1 root 1740472 Jun 17 16:56 System.map-2.6.32.8
-rw-r--r-- 1 root 67864 Jun 17 16:58 config-2.6.32.8
drwxr-xr-x 2 root 4096 Jun 21 11:40 grub
-rw-r--r-- 1 root 4176864 Jun 17 16:55 vmlinux-2.6.32.8-lfs-6.6
root:/etc/grub.d# ls -l
total 24
-rwxr-xr-x 1 root root 3223 Jun 14 21:20 00_header
-rwxr-xr-x 1 root root 3126 Jun 14 21:20 10_linux
-rwxr-xr-x 1 root root 4409 Jun 14 21:20 30_os-prober
-rwxr-xr-x 1 root root 214 Jun 14 21:20 40_custom
-rw-r--r-- 1 root root 483 Jun 14 21:20 README
I had to run these two commands when I tried, man grub-mkconfig
root:/boot/grub# export LANG=nl_NL
root:/boot/grub# export LC_ALL=POSIX
This fixed the error message, although there was no man page for this. I really want to know what it does because, in the documentation, it is written that an Ubuntu linux was also found on a different partition (UID number is different)
vol_id --uuid /dev/sdb1 is the partition on which I am running Mandriva Gnome. Its uuid does not appear in this list. I wonder if I should put it there?
I found some grib information here. They mention:
root:/etc/grub.d# grub-install -v
grub-install (GNU GRUB 1.97.2)
root:~# blkid shows all uuid paritions on computer
Although it is not mentioned in the documentation, I feel that I need to put in here somewhere my Mandriva KDE and GNOME partitions. Using this link as reference, I put the relevent lines into /etc/grub.d/40_custom. So for 2nd hard disk and first partition (Grub2 is different fromlegacy grub)
root:/boot/grub# grub-mkconfig -o /boot/grub/test_grub.cfg
Looks good.
Section 8.4.3., I have no idea what they are talking about. Well, feeling brave and with some familarity with legacy grub, I tried what they suggested.
But, it seems I made a typo. Instead of initrd, I had written initrf. So, I fixed this and ran
root:/# grub-mkconfig -o /boot/grub/grub.cfg
root:/# grub-setup /dev/sda
root:/# logout
root:/#/sbin/reboot
That's it! Too late to turn back. The logout of chroot, I have yet to figure out. But when I reboot without doing so, there are errors that $LFS is busy.
(google for the right command, here )
root:/sources# fdformat /dev/fd0
I also had to install some dos utilities and do the stuff on my OS and not LFS.
[home]#mkfs -t msdos /dev/fd0
On LFS,
root:/media# mount -t msdos /dev/fd0 /media/floppy
root:/# grub-mkdevicemap --device-map=device.map
root:/# cat device.map
(fd0) /dev/fd0
(hd0) /dev/sda
(hd1) /dev/sdb
Here is where I might run into trouble. I have made a floppy but I cannot verify what is on it. I do not know why.
#fdformat /dev/fd0
#mkfs -t msdos /dev/fd0
#mount -t msdos /dev/fd0 /media/floppy
#cd /media/lfs/tmp
#dd if=floppy.img of=/dev/fd0 bs=1440 count=1
If I check using df, there is something there. Good.
/dev/fd0 1,4M 210K 1,2M 15% /media/floppy
I tried rebooting with this and, although grub loaded, there was no prompt. Moving ahead anyway. So far, on my platform (the computer), I have (from the menu.lst) I believe that grub is installed on the MBR because I do not have Windows on this computer anymore. The boot device is sda (from Mandriva control center)
#title KDE Mandriva Linux (Official)
#root (hd0,0)
#title Gnome Mandriva Linux (Official)
#root (hd1,0)
A weekend has come between Friday and today, Monday. I got side tracked by the floppies.SO, after all the mounting and chroot (see Ch 7)
root:/# grub-install --grub-setup=/bin/true /dev/sda
Installation finished. No error reported.root:/# grub-mkconfig -o /boot/grub/grub.cfg
This is the contents of the device map /boot/grub/device.map.
Check if this is correct or not. If any of the lines is incorrect,
fix it and re-run the script `grub-install'.
(fd0) /dev/fd0
(hd0) /dev/sda
(hd1) /dev/sdb
Generating grub.cfg ...
Found linux image: /boot/vmlinux-2.6.32.8-lfs-6.6
done
I heard some disk access to the floppy drive. 140 .mod files were written to the /boot/grub directory. Just had a look at /boot. It has only 4 entries.
root:/boot# ls -lg
total 5864
-rw-r--r-- 1 root 1740472 Jun 17 16:56 System.map-2.6.32.8
-rw-r--r-- 1 root 67864 Jun 17 16:58 config-2.6.32.8
drwxr-xr-x 2 root 4096 Jun 21 11:40 grub
-rw-r--r-- 1 root 4176864 Jun 17 16:55 vmlinux-2.6.32.8-lfs-6.6
root:/etc/grub.d# ls -l
total 24
-rwxr-xr-x 1 root root 3223 Jun 14 21:20 00_header
-rwxr-xr-x 1 root root 3126 Jun 14 21:20 10_linux
-rwxr-xr-x 1 root root 4409 Jun 14 21:20 30_os-prober
-rwxr-xr-x 1 root root 214 Jun 14 21:20 40_custom
-rw-r--r-- 1 root root 483 Jun 14 21:20 README
I had to run these two commands when I tried, man grub-mkconfig
root:/boot/grub# export LANG=nl_NL
root:/boot/grub# export LC_ALL=POSIX
This fixed the error message, although there was no man page for this. I really want to know what it does because, in the documentation, it is written that an Ubuntu linux was also found on a different partition (UID number is different)
vol_id --uuid /dev/sdb1 is the partition on which I am running Mandriva Gnome. Its uuid does not appear in this list. I wonder if I should put it there?
I found some grib information here. They mention:
Note the term 'installation' can mean two things. Installation of the grub software onto a host (to allow preparation and configuration of the bootloader), and installation of a bootloader onto a target ( placing the loader at the start of a disk/partition to make GRUB really work when the machine boots). To help differentiate these, the term 'write' will be used when possible to describe the second kind of installation.
root:/etc/grub.d# grub-install -v
grub-install (GNU GRUB 1.97.2)
root:~# blkid shows all uuid paritions on computer
Although it is not mentioned in the documentation, I feel that I need to put in here somewhere my Mandriva KDE and GNOME partitions. Using this link as reference, I put the relevent lines into /etc/grub.d/40_custom. So for 2nd hard disk and first partition (Grub2 is different fromlegacy grub)
menuentry "Mandriva-Gnome" {For a simple test, I changed the name of the cfg.
insmod ext3
set root=(hd1,1)
linux (hd1,1)/boot/vmlinuz
initrd (hd1,1)/boot/initrd.img
}
root:/boot/grub# grub-mkconfig -o /boot/grub/test_grub.cfg
Looks good.
Section 8.4.3., I have no idea what they are talking about. Well, feeling brave and with some familarity with legacy grub, I tried what they suggested.
- /sbin/reboot Turns off the computer and starts again.
- When graphical menu appears, press ESC key (on my computer) to exit graphics mode. A window appears for me to confirm, press yes.
- I see a grub console.
- Type root (hd1,5) , noting that grub2 will use 6.
- Type kernel /boot/grub/core.img
- Type boot
But, it seems I made a typo. Instead of initrd, I had written initrf. So, I fixed this and ran
root:/# grub-mkconfig -o /boot/grub/grub.cfg
root:/# grub-setup /dev/sda
root:/# logout
root:/#/sbin/reboot
That's it! Too late to turn back. The logout of chroot, I have yet to figure out. But when I reboot without doing so, there are errors that $LFS is busy.
Thursday, June 17, 2010
Chapter 8 The Kernel!
I hope this goes better than Chapter 7. I wonder how much of the network stuff could have been left out until the system setup was ok.
root:/sources/linux-2.6.32.8# echo $LANG
Therefore,
make LANG=nl_NL.ISO-8859-1@euro LC_ALL=menuconfig
And I get...
#make oldconfig
Press enter for everything, choose Athlon/Duron (#12 in list ) as processor
WIFI I said no to, touchscreen, no. I have no idea really what all the commands were. That's annoying.
#make
Output at end
root:/sources/linux-2.6.32.8# make modules_install
root:/sources/linux-2.6.32.8# cp -v arch/x86/boot/bzImage /boot/vmlinux-2.6.32.8-lfs-6.6
root:/sources/linux-2.6.32.8# cp -v System.map /boot/System.map-2.6.32.8
root:/sources/linux-2.6.32.8# cp -v .config /boot/config-2.6.32.8
(saved a copy of this on home partition)
root:/sources/linux-2.6.32.8# install -d /usr/share/doc/linux-2.6.32.8
root:/sources/linux-2.6.32.8# cp -r Documentation/* /usr/share/doc/linux-2.6.32.8
root:/sources# chown -R 0:0 linux-2.6.32.8
Also configured the module boot order, although at this point I really have no clue.
cat > /etc/fstab << "EOF"
# Begin /etc/fstab
# file system mount-point type options dump fsck
# order
/dev/sdb6 / ext3 defaults 1 1
/dev/sdb5 swap swap pri=1 0 0
proc /proc proc defaults 0 0
sysfs /sys sysfs defaults 0 0
devpts /dev/pts devpts gid=4,mode=620 0 0
tmpfs /dev/shm tmpfs defaults 0 0
# End /etc/fstab
EOFThis is interesting.
Filesystems with MS-DOS or Windows origin (i.e.: vfat, ntfs, smbfs, cifs, iso9660, udf) need the “iocharset” mount option in order for non-ASCII characters in file names to be interpreted properly.I guess that this will help the spaces prolem in Windows.
root:/sources/linux-2.6.32.8# echo $LANG
nl_NL.ISO-8859-1@euro
Therefore,
make LANG=nl_NL.ISO-8859-1@euro LC_ALL=menuconfig
And I get...
*** You have not yet configured your kernel!That's encouraging. But I notice that I have not run any configure.
*** (missing kernel config file ".config")
***
*** Please run some configurator (e.g. "make oldconfig" or
*** "make menuconfig" or "make xconfig").
#make oldconfig
Press enter for everything, choose Athlon/Duron (#12 in list ) as processor
WIFI I said no to, touchscreen, no. I have no idea really what all the commands were. That's annoying.
#make
Output at end
Root device is (8, 22)I do not know if this is necessary, so feeling reckless,
Setup is 11756 bytes (padded to 11776 bytes).
System is 4068 kB
CRC 94875ed3
Kernel: arch/x86/boot/bzImage is ready (#1)
Building modules, stage 2.
MODPOST 2 modules
CC arch/x86/kernel/test_nx.mod.o
LD [M] arch/x86/kernel/test_nx.ko
CC drivers/scsi/scsi_wait_scan.mod.o
LD [M] drivers/scsi/scsi_wait_scan.ko
root:/sources/linux-2.6.32.8# make modules_install
INSTALL arch/x86/kernel/test_nx.koNext,
INSTALL drivers/scsi/scsi_wait_scan.ko
DEPMOD 2.6.32.8
root:/sources/linux-2.6.32.8# cp -v arch/x86/boot/bzImage /boot/vmlinux-2.6.32.8-lfs-6.6
root:/sources/linux-2.6.32.8# cp -v System.map /boot/System.map-2.6.32.8
root:/sources/linux-2.6.32.8# cp -v .config /boot/config-2.6.32.8
(saved a copy of this on home partition)
root:/sources/linux-2.6.32.8# install -d /usr/share/doc/linux-2.6.32.8
root:/sources/linux-2.6.32.8# cp -r Documentation/* /usr/share/doc/linux-2.6.32.8
root:/sources# chown -R 0:0 linux-2.6.32.8
Also configured the module boot order, although at this point I really have no clue.
Chapter 7.13 Network Script
I do not know if any of this is right, but this is what I entered. Specifically, I do NOT want it to be turned on at boot, because it might be wrong.
root:/etc/sysconfig/network-devices# cat > ifconfig.eth0/ipv4 << "EOF"
> ONBOOT=no
> SERVICE=ipv4-static
> IP=192.168.1.1
> GATEWAY=192.168.1.2
> PREFIX=24
> BROADCAST=192.168.1.255
> EOF
root:/etc/sysconfig/network-devices# cat > /etc/resolv.conf << "EOF"
> # Begin /etc/resolv.conf
> nameserver 10.0.0.138
> # End /etc/resolv.conf
> EOF
root:/etc/sysconfig/network-devices# cat > ifconfig.eth0/ipv4 << "EOF"
> ONBOOT=no
> SERVICE=ipv4-static
> IP=192.168.1.1
> GATEWAY=192.168.1.2
> PREFIX=24
> BROADCAST=192.168.1.255
> EOF
root:/etc/sysconfig/network-devices# cat > /etc/resolv.conf << "EOF"
> # Begin /etc/resolv.conf
> nameserver 10.0.0.138
> # End /etc/resolv.conf
> EOF
7.11-12-13 Configuring the localnet Script
Ok, this looks like another thing I want to learn. The meaning of network.So, what is the name of my computer. Does it have to be the same as my current OS? Use hostname to find it.
root:/etc/sysconfig# hostname
nameofmycomputer
root:/etc/sysconfig# more network
HOSTNAME=nameofmycomputer
Now, try this
root:/etc/sysconfig# IP_address rose.lfs.org rose_lfs
outputs bash: IP_address: command not found
Ok, just do the cat command in the documentation. I chose the 192.168.1.1 because I want to work with apache eventually and this will help me understand that. 192.168.1.1 rose.lfs.org rose_lfs
root:/etc# more hosts
root:/sys/class/net# ls -l
Try, LW
The mailing list I was reading did not come up with a solution, alas. I am going to skip it. This is the output of the for command:
udev_rules_new: rules use 11472 bytes tokens (956 * 12 bytes), 7523 bytes buffer
udev_rules_new: temporary index used 7620 bytes (381 * 20 bytes)
udev_device_new_from_syspath: device 0x8c25100 has devpath '/class/net/eth0'
udev_device_new_from_syspath: device 0x8c34c50 has devpath '/class/net'
udevadm_test: UDEV_LOG=6
udevadm_test: DEVPATH=/class/net/eth0
udevadm_test: PHYSDEVPATH=/devices/pci0000:00/0000:00:0e.0
udevadm_test: PHYSDEVBUS=pci
udevadm_test: PHYSDEVDRIVER=8139too
udevadm_test: INTERFACE=/sys/class/net/eth0
udevadm_test: IFINDEX=2
udevadm_test: ACTION=add
udevadm_test: SUBSYSTEM=net
udevadm_test: MATCHADDR=00:30:1b:1e:b8:88
udevadm_test: MATCHIFTYPE=1
udevadm_test: MATCHDEVID=0x0
udevadm_test: COMMENT=net device ()
On my regular OS, there is a file: /etc/udev/rules.d/70-persistent-cd.rules
# more /etc/udev/rules.d/70-persistent-net.rules
root:/etc/sysconfig# hostname
nameofmycomputer
echo "HOSTNAME=nameofmycomputer; /etc/sysconfig/networkroot:/etc/sysconfig# more network
HOSTNAME=nameofmycomputer
Now, try this
root:/etc/sysconfig# IP_address rose.lfs.org rose_lfs
outputs bash: IP_address: command not found
Ok, just do the cat command in the documentation. I chose the 192.168.1.1 because I want to work with apache eventually and this will help me understand that. 192.168.1.1 rose.lfs.org rose_lfs
root:/etc# more hosts
# Begin /etc/hosts (network card version)I have only one network card.
127.0.0.1 localhost
192.168.1.1 rose.lfs.org rose_lfs
# End /etc/hosts (network card version)
root:/sys/class/net# ls -l
total 0Running the for NIC loop does not give me the 70-persistent-net.rules file.
drwxr-xr-x 4 root root 0 Jun 17 12:47 eth0
drwxr-xr-x 4 root root 0 Jun 17 12:47 lo
Try, LW
$INTERFACE=eth0 udevadm test --action=add eth0
unable to open device '/syseth0' oops, try this. (from the lfs mailing list)
$INTERFACE=/sys/class/net/eth0 udevadm test --action=add /sys/class/net/eth0
The mailing list I was reading did not come up with a solution, alas. I am going to skip it. This is the output of the for command:
udev_rules_new: rules use 11472 bytes tokens (956 * 12 bytes), 7523 bytes buffer
udev_rules_new: temporary index used 7620 bytes (381 * 20 bytes)
udev_device_new_from_syspath: device 0x8c25100 has devpath '/class/net/eth0'
udev_device_new_from_syspath: device 0x8c34c50 has devpath '/class/net'
udevadm_test: UDEV_LOG=6
udevadm_test: DEVPATH=/class/net/eth0
udevadm_test: PHYSDEVPATH=/devices/pci0000:00/0000:00:0e.0
udevadm_test: PHYSDEVBUS=pci
udevadm_test: PHYSDEVDRIVER=8139too
udevadm_test: INTERFACE=/sys/class/net/eth0
udevadm_test: IFINDEX=2
udevadm_test: ACTION=add
udevadm_test: SUBSYSTEM=net
udevadm_test: MATCHADDR=00:30:1b:1e:b8:88
udevadm_test: MATCHIFTYPE=1
udevadm_test: MATCHDEVID=0x0
udevadm_test: COMMENT=net device ()
On my regular OS, there is a file: /etc/udev/rules.d/70-persistent-cd.rules
# more /etc/udev/rules.d/70-persistent-net.rules
# This file was automatically generated by the /lib/udev/write_net_rules
# program run by the persistent-net-generator.rules rules file.
#
# You can modify it, as long as you keep each rule on a single line.
# PCI device 0x10ec:0x8139 (8139too)
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:30:1b:1e:b8:88", ATTR{type}=="1", KERNEL=="eth*", N
AME="eth0"
Linux 7.10 Getting lost, Come back here id device trouble.
The command udevadm test /sys/block/sdb,
gave a lot of output.Some of which is the product information. That's good.
"Note that it is not necessary to create the rules files or symlinks at this time, because you have bind-mounted the host's
This is comforting. I thought they had forgotten about me. This is the first reference back to the LFS since the dev chapter. I am not sure that it is a good idea to do all this explaining before he system is set up, since I do not know what they are talking about anyway.
At the moment, my computer has 1 internal cd player, a USB hub to which my printer, an external hard drive, and camera are connected (sporadically).
gave a lot of output.Some of which is the product information. That's good.
"Note that it is not necessary to create the rules files or symlinks at this time, because you have bind-mounted the host's
/dev directory into the LFS system, and we assume the symlinks exist on the host. The rules and symlinks will be created the first time you boot your LFS system."This is comforting. I thought they had forgotten about me. This is the first reference back to the LFS since the dev chapter. I am not sure that it is a good idea to do all this explaining before he system is set up, since I do not know what they are talking about anyway.
At the moment, my computer has 1 internal cd player, a USB hub to which my printer, an external hard drive, and camera are connected (sporadically).
Wednesday, June 16, 2010
Chapter 7.9. Device and Module Handling on an LFS System
root:/# modinfo
root:/# ls -l sys/bus
Maybe some day it will make sense. What I do not understand is how they got there. I only looked after I had typed modprobe which is the same time as the time stamp on the files. I am going to try and log out of chroot environment and log in again to see if they are still there. So they are permanent. It must have been something I did today because I just started this morning.
I do not understand what I have to do in this chapter.
I'll try the reading recomendations.
Userspace Implementation: This is a useful defintion. "A device file is how a user program can access a specific hardware device or function." I never thought of the "hda" in /dev/hda as a file, but apparently it is and it "represents the first IDE drive of the system". Although I am used to seeing it with a number as well. The way Linux (or unix) is sold is via this "everything is a file concept. I made a listing of the /dev directory and saved a copy. One of the lines for LFS is this one, /dev/sdb6
brw-rw---- 1 root daemon 8, 22 Jun 17 10:24 sdb6
I notice the b at the beginning and the word daemon as the group. This determines the properties of the file? Name has to match type of device, and are listed in Device List
Wow, I remember having this problem years ago (probably with kernel 2.4) "If the user rearranges the USB topology, perhaps adding a USB hub in order to support more USB devices in the system, the USB probing order of the printers might change the next time the computer is booted, reversing the assignment of the different minor number to the two printers"
There is too much to understand in this article, so I am going to move on. If something does not work, I'll have to come back.
Usage: modinfo [-0][-F field][-k kernelversion][-b basedir] module...
Prints out the information about one or more module(s).
If a fieldname is given, just print out that field (or nothing if not found).
Otherwise, print all information out in a readable form
If -0 is given, separate with nul, not newline.
If -b is given, use an image of the module tree.
root:/# ls -l sys/bus
total 0Each of thos directories has the same set of files i.e. Ac97
drwxr-xr-x 4 root root 0 Jun 17 10:05 ac97
drwxr-xr-x 4 root root 0 Jun 17 10:05 acpi
drwxr-xr-x 4 root root 0 Jun 17 10:05 gameport
drwxr-xr-x 4 root root 0 Jun 17 10:05 i2c
drwxr-xr-x 4 root root 0 Jun 17 10:05 isa
drwxr-xr-x 5 root root 0 Jun 17 10:05 pci
drwxr-xr-x 4 root root 0 Jun 17 10:05 pci_express
drwxr-xr-x 4 root root 0 Jun 17 10:05 platform
drwxr-xr-x 4 root root 0 Jun 17 10:05 pnp
drwxr-xr-x 4 root root 0 Jun 17 10:05 scsi
drwxr-xr-x 4 root root 0 Jun 17 10:05 serio
drwxr-xr-x 4 root root 0 Jun 17 10:05 spi
drwxr-xr-x 4 root root 0 Jun 17 10:05 usb
drwxr-xr-x 4 root root 0 Jun 17 10:05 virtio
drwxr-xr-x 2 root root 0 Jun 17 10:07 devicesUnder these directories, there are more. I have cat'd the entire list to a file. (ls -l sys/bus/*/*/* > sys_bus_before.list)
drwxr-xr-x 2 root root 0 Jun 17 10:07 drivers
-rw-r--r-- 1 root root 4096 Jun 17 10:07 drivers_autoprobe
--w------- 1 root root 4096 Jun 17 10:07 drivers_probe
--w------- 1 root root 4096 Jun 17 10:07 uevent
Maybe some day it will make sense. What I do not understand is how they got there. I only looked after I had typed modprobe which is the same time as the time stamp on the files. I am going to try and log out of chroot environment and log in again to see if they are still there. So they are permanent. It must have been something I did today because I just started this morning.
I do not understand what I have to do in this chapter.
I'll try the reading recomendations.
Userspace Implementation: This is a useful defintion. "A device file is how a user program can access a specific hardware device or function." I never thought of the "hda" in /dev/hda as a file, but apparently it is and it "represents the first IDE drive of the system". Although I am used to seeing it with a number as well. The way Linux (or unix) is sold is via this "everything is a file concept. I made a listing of the /dev directory and saved a copy. One of the lines for LFS is this one, /dev/sdb6
brw-rw---- 1 root daemon 8, 22 Jun 17 10:24 sdb6
I notice the b at the beginning and the word daemon as the group. This determines the properties of the file? Name has to match type of device, and are listed in Device List
Wow, I remember having this problem years ago (probably with kernel 2.4) "If the user rearranges the USB topology, perhaps adding a USB hub in order to support more USB devices in the system, the USB probing order of the printers might change the next time the computer is booted, reversing the assignment of the different minor number to the two printers"
There is too much to understand in this article, so I am going to move on. If something does not work, I'll have to come back.
Chapter 7.8 Bash Shell Startup
On first reading, this is a bit confusing, login and interactive environments
"An interactive login shell is started after a successful login, using /bin/login, by reading the
My question involves visualization. How do I know that a login shell has started? Is it that I am allowed entry to the command line? Or, is the command line part of the "shell". I think it is useful to think of it as opening a door to a house and entering, then one can do some stuff (like run some comand line commands) and then leave.
I have always associated a shell with an xterm but they are not one and the same. One can run multiple shells in one xterm, for example. Although I do not like to do this (hence my tangent in Chapter 6 regarding the color of the lfs window).
" A non-interactive shell is usually present when a shell script is running. It is non-interactive because it is processing a script and not waiting for user input between commands." So, maybe the non-interactive shell is like the shell of a car (or a sea shell? can that be its origin?). The act of driving will be the script.
Back to the text, we are creating the profile file here. This is read just after log in and sets all sorts of variables (environment)
root:/etc# LC_ALL=en_US.iso88591 locale charmap
ISO-8859-1
root:/etc# LC_ALL=nl_NL.iso88591 locale charmap
ISO-8859-1
This is what I chose.
Since I have some experience with the profile file, I might add some more comments at a later time.
"An interactive login shell is started after a successful login, using /bin/login, by reading the
/etc/passwd file" My question involves visualization. How do I know that a login shell has started? Is it that I am allowed entry to the command line? Or, is the command line part of the "shell". I think it is useful to think of it as opening a door to a house and entering, then one can do some stuff (like run some comand line commands) and then leave.
I have always associated a shell with an xterm but they are not one and the same. One can run multiple shells in one xterm, for example. Although I do not like to do this (hence my tangent in Chapter 6 regarding the color of the lfs window).
" A non-interactive shell is usually present when a shell script is running. It is non-interactive because it is processing a script and not waiting for user input between commands." So, maybe the non-interactive shell is like the shell of a car (or a sea shell? can that be its origin?). The act of driving will be the script.
Back to the text, we are creating the profile file here. This is read just after log in and sets all sorts of variables (environment)
root:/etc# LC_ALL=en_US.iso88591 locale charmap
ISO-8859-1
root:/etc# LC_ALL=nl_NL.iso88591 locale charmap
ISO-8859-1
This is what I chose.
root:/etc# more profile
# Begin /etc/profile
export LANG=nl_NL.ISO-8859-1@euro
# End /etc/profile
Since I have some experience with the profile file, I might add some more comments at a later time.
Chapter 7.7. Creating the /etc/inputrc File
"Most people do not need user-specific keyboard mappings so the command below creates a global/etc/inputrcused by everyone who logs in. If you later decide you need to override the defaults on a per-user basis, you can create a.inputrcfile in the user's home directory with the modified mappings."
This is not true in my house. I prefer the American keyboard but my kids have learned the Dutch keyboard so it would be handy to have user dependent settings.
Chapter 7.6 Sysklog
Notice the difference between sysklogd and syslogd !
Reading the "man syslogd". This caught my eye. "Syslogd reacts to a set of signals. You may easily send a signal to syslogd using the following:
kill -SIGNAL `cat /var/run/syslogd.pid`
My biggest problem with syslogs is that they are very difficult for me to read. Recent apps are beginning to at least provide some sort of sorting according to the day. I would like keywords like: sound or video to be available because these are errors I have had in the past.
Ah, after some searching, this command is here: /sbin/syslogd
root:/#file /sbin/syslogd
/sbin/syslogd: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.18, stripped
I cannot look at it.
root:/# ls -l /sbin/syslogd
-r-x------ 1 root root 31508 Jun 15 12:57 /sbin/syslogd
Wait, I am confused. They are talking about sysklogd, with a "k". Which is:
root:/# find / -name sysklogd
/etc/rc.d/init.d/sysklogd
/sources/lfs-bootscripts-20100124/contrib/lsb-v3/init.d/sysklogd
/sources/lfs-bootscripts-20100124/lfs/init.d/sysklogd
Here's a directory listing of init.d:
I still do not know what to do with this. Read on.
Reading the "man syslogd". This caught my eye. "Syslogd reacts to a set of signals. You may easily send a signal to syslogd using the following:
kill -SIGNAL `cat /var/run/syslogd.pid`
My biggest problem with syslogs is that they are very difficult for me to read. Recent apps are beginning to at least provide some sort of sorting according to the day. I would like keywords like: sound or video to be available because these are errors I have had in the past.
Ah, after some searching, this command is here: /sbin/syslogd
root:/#file /sbin/syslogd
/sbin/syslogd: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.18, stripped
I cannot look at it.
root:/# ls -l /sbin/syslogd
-r-x------ 1 root root 31508 Jun 15 12:57 /sbin/syslogd
Wait, I am confused. They are talking about sysklogd, with a "k". Which is:
root:/# find / -name sysklogd
/etc/rc.d/init.d/sysklogd
/sources/lfs-bootscripts-20100124/contrib/lsb-v3/init.d/sysklogd
/sources/lfs-bootscripts-20100124/lfs/init.d/sysklogd
Here's a directory listing of init.d:
root:/etc/rc.d/init.d# ls -lrt
total 100
-rwxr-xr-- 1 root root 982 Jun 16 11:36 udev_retry
-rwxr-xr-- 1 root root 2229 Jun 16 11:36 udev
-rwxr-xr-- 1 root root 654 Jun 16 11:36 template
-rwxr-xr-- 1 root root 978 Jun 16 11:36 sysklogd
-rwxr-xr-- 1 root root 767 Jun 16 11:36 sysctl
-rwxr-xr-- 1 root root 825 Jun 16 11:36 swap
-rwxr-xr-- 1 root root 834 Jun 16 11:36 setclock
-rwxr-xr-- 1 root root 866 Jun 16 11:36 sendsignals
-rwxr-xr-- 1 root root 531 Jun 16 11:36 reboot
-rwxr-xr-- 1 root root 2261 Jun 16 11:36 rc
-rwxr-xr-- 1 root root 1356 Jun 16 11:36 network
-rwxr-xr-- 1 root root 841 Jun 16 11:36 mountkernfs
-rwxr-xr-- 1 root root 1242 Jun 16 11:36 mountfs
-rwxr-xr-- 1 root root 1637 Jun 16 11:36 modules
-rwxr-xr-- 1 root root 978 Jun 16 11:36 localnet
-rwxr-xr-- 1 root root 483 Jun 16 11:36 halt
-rw-r--r-- 1 root root 16747 Jun 16 11:36 functions
-rwxr-xr-- 1 root root 1286 Jun 16 11:36 consolelog
-rwxr-xr-- 1 root root 2531 Jun 16 11:36 console
-rwxr-xr-- 1 root root 2293 Jun 16 11:36 cleanfs
-rwxr-xr-- 1 root root 3758 Jun 16 11:36 checkfs
I still do not know what to do with this. Read on.
Chapter 7 Commands to run before beginning.
I hope the laborious part is over. It just occurred to me that I should make another backup.
As root,
export LFS=/media/lfs
mount -v -t ext3 /dev/sdb6 $LFS (see note below)
The order of mount and chroot may or may not be important. I still do not understand what happens to LFS after chroot.
where $LFS is /media/lfs
After chroot, the output of the command mount is:
As root,
export LFS=/media/lfs
mount -v -t ext3 /dev/sdb6 $LFS (see note below)
The order of mount and chroot may or may not be important. I still do not understand what happens to LFS after chroot.
mount -v --bind /dev $LFS/dev
mount -vt devpts devpts $LFS/dev/pts mount -vt tmpfs shm $LFS/dev/shm mount -vt proc proc $LFS/proc mount -vt sysfs sysfs $LFS/sys
chroot "$LFS" /usr/bin/env -i \
HOME=/root TERM="$TERM" PS1='\u:\w\$ ' \
PATH=/bin:/usr/bin:/sbin:/usr/sbin \
/bin/bash --loginNote, if you get the error,
chroot: cannot run command `/usr/bin/env': No such file or directory
It just means that you forgot to mount the partition.
Relevent output of the command mount, executed before the chroot
/dev/sdb6 on /media/lfs type ext3 (rw)
/dev on /media/lfs/dev type none (rw,bind)
devpts on /media/lfs/dev/pts type devpts (rw)
shm on /media/lfs/dev/shm type tmpfs (rw)
proc on /media/lfs/proc type proc (rw)
sysfs on /media/lfs/sys type sysfs (rw)
where $LFS is /media/lfs
After chroot, the output of the command mount is:
root:/# mount
sysfs on /sys type sysfs (rw)I am assuming that there is a reason for which the devpts and shm are not in the list. Maybe they are a subdirectory. Chapter 6.2.2 in the manual describes this and I do not really understand it so I will move on.
proc on /proc type proc (rw)
/dev on /dev type none (rw,bind)
Chapter 7.5 Console
I am curious about console because I use it a lot. Recently, however, on another linux session, I messed up the fonts and could not find the ones I liked. Also, knowing how to make this permanent is important to me.
"This section discusses how to configure the console and consolelog bootscripts that set up the keyboard map, console font and console kernel log level." Since I am in Europe, the euro symbol is important (€,had to look that up, thank you Wikipedia!). So I will do this section, even though I normally use an American keyboard.
Looking at the examples, I chose the German one and replaced de with nl for Netherlands.
root:/etc/sysconfig# cat > /etc/sysconfig/console << "EOF"
> # Begin /etc/sysconfig/console
>
> KEYMAP="nl-latin1"
> KEYMAP_CORRECTIONS="euro2"
> FONT="lat0-16 -m 8859-15"
> # End /etc/sysconfig/console
> EOF
There is a note about this not being relevent in the X window system, but in console mode only (not even xterm mode I guess).
"This section discusses how to configure the console and consolelog bootscripts that set up the keyboard map, console font and console kernel log level." Since I am in Europe, the euro symbol is important (€,had to look that up, thank you Wikipedia!). So I will do this section, even though I normally use an American keyboard.
Looking at the examples, I chose the German one and replaced de with nl for Netherlands.
root:/etc/sysconfig# cat > /etc/sysconfig/console << "EOF"
> # Begin /etc/sysconfig/console
>
> KEYMAP="nl-latin1"
> KEYMAP_CORRECTIONS="euro2"
> FONT="lat0-16 -m 8859-15"
> # End /etc/sysconfig/console
> EOF
There is a note about this not being relevent in the X window system, but in console mode only (not even xterm mode I guess).
Chapter 7.4 Setclock
Just reading the text here, about setclock script.
# hwclock --localtime --show
Wed Jun 16 11:55:40 2010 -0.313826 seconds
This is the time I see on my computer. I guess that starting from scratch means that all these details that usually take for granted, need to be set.
# hwclock --localtime --show
Wed Jun 16 11:55:40 2010 -0.313826 seconds
This is the time I see on my computer. I guess that starting from scratch means that all these details that usually take for granted, need to be set.
Chapter 7.2 LFS-Bootscripts-20100124
Here we go.
Just out of curiosity, what is in the /etc/sysconfig directory? Since kernel modules is the topic I am most interested in understanding. Modules is empty except for a "Begin /etc/sysconfig/modules" commented message.
root:~# ls -lrt /etc/sysconfig/
total 16
-rw-r--r-- 1 root root 408 Jun 16 11:36 rc
drwxr-xr-x 3 root root 4096 Jun 16 11:36 network-devices
-rw-r--r-- 1 root root 559 Jun 16 11:36 modules
-rw-r--r-- 1 root root 1037 Jun 16 11:36 createfiles
I have read about runlevels before, and used them usually when I have messed up the linux and had to do some repairs (such as I was able).
root:/etc/rc.d# ls -lrt
Just out of curiosity, what is in the /etc/sysconfig directory? Since kernel modules is the topic I am most interested in understanding. Modules is empty except for a "Begin /etc/sysconfig/modules" commented message.
root:~# ls -lrt /etc/sysconfig/
total 16
-rw-r--r-- 1 root root 408 Jun 16 11:36 rc
drwxr-xr-x 3 root root 4096 Jun 16 11:36 network-devices
-rw-r--r-- 1 root root 559 Jun 16 11:36 modules
-rw-r--r-- 1 root root 1037 Jun 16 11:36 createfiles
I have read about runlevels before, and used them usually when I have messed up the linux and had to do some repairs (such as I was able).
root:/etc/rc.d# ls -lrt
total 36
drwxr-xr-x 2 root root 4096 Jun 16 11:36 rc6.d
drwxr-xr-x 2 root root 4096 Jun 16 11:36 rc5.d
drwxr-xr-x 2 root root 4096 Jun 16 11:36 rc4.d
drwxr-xr-x 2 root root 4096 Jun 16 11:36 rc3.d
drwxr-xr-x 2 root root 4096 Jun 16 11:36 rc2.d
drwxr-xr-x 2 root root 4096 Jun 16 11:36 rc1.d
drwxr-xr-x 2 root root 4096 Jun 16 11:36 rc0.d
drwxr-xr-x 2 root root 4096 Jun 16 11:36 init.d
drwxr-xr-x 2 root root 4096 Jun 16 11:36 rcsysinit.d
Subscribe to:
Posts (Atom)
