Re: [lfs-support] Help with a linker problem

2012-12-01 Thread Simon Geard
On Fri, 2012-11-30 at 11:17 -0500, Chris Staub wrote:
 First, check how Bash is linked: readelf -l /bin/bash | grep 
 interpret. Of course, this should say that it's looking for the dynamic 
 linker in /lib. Then verify you actually have all the right libraries 
 for Ncurses: ls -la {/usr,}/lib/*ncurses*

Yes, it's using /lib64/ld-linux-x86-64.so.2, and yes, the chapter 6
version of ncurses *is* correctly installed. But that copy of ncurses is
the wide-char version, and bash has managed, somehow, to link to the
non-wide version. My assumption, as I said, is that instead of finding
the linker scripts in /usr/lib which would point it to the wide version,
it's found the non-wide version in /tools instead.

 
 You could also just upload your build scripts for Ncurses, Readline, and 
 Bash.

I don't think there's anything wrong with how those packages have been
built - the scripts are just copy-paste from the book, with the usual
wrapper code for extracting tarballs and cleaning up afterwards. I
suspect the problem is something to do with the linker changes done in
Adjusting the Toolchain, but I can't see anything obvious that I've
missed there either.

Basically, I'm hoping that someone more familiar than me with the
toolchain can tell me how a chapter 6 package (bash) might be linked
against a library not installed in chapter 6 (the non-wide version of
ncurses). The obvious answer is that it's found the version built in
chapter 5, but what could cause that?

Simon.


signature.asc
Description: This is a digitally signed message part
-- 
http://linuxfromscratch.org/mailman/listinfo/lfs-support
FAQ: http://www.linuxfromscratch.org/lfs/faq.html
Unsubscribe: See the above information page


[lfs-support] Not able to boot LFS : ext4 partition

2012-12-01 Thread Sagar Padhye
This is my first attempt to set up a LFS. I have used Version 
SVN-20121122 for this. I have just finished the book with the given 
instructions except following two.
  1. Instead of preparing my LFS partition to be ext2 or ext3, I chose 
it to be ext4.
  2. I didnt install LFS grub, instead I have updated grub of my host 
system (ubuntu 12.10).

My HDD now looks like :
$ sudo fdisk -l /dev/sda
Device Boot  Start End  Blocks   Id  System
/dev/sda12048511925598976   83 
Linux#LFS / ext4
/dev/sda2   *512051589119  194560   83 
Linux  #Ubuntu /boot ext3
/dev/sda35158912056276991 2343936   82  Linux swap / 
Solaris
/dev/sda456279038   312580095   1281505295  Extended
/dev/sda556279040   11682406330272512   83 
Linux   #Ubuntu /  ext4
/dev/sda6   116826112   31258009597876992   83 
Linux  #Shared /home ext4


Part of my LFS kernel config looks like :
CONFIG_EXT3_FS=y
# CONFIG_EXT3_DEFAULTS_TO_ORDERED is not set
CONFIG_EXT3_FS_XATTR=y
CONFIG_EXT3_FS_POSIX_ACL=y
CONFIG_EXT3_FS_SECURITY=y
CONFIG_EXT4_FS=m
CONFIG_EXT4_USE_FOR_EXT23=y
CONFIG_EXT4_FS_XATTR=y
# CONFIG_EXT4_FS_POSIX_ACL is not set
# CONFIG_EXT4_FS_SECURITY is not set
# CONFIG_EXT4_DEBUG is not set
# CONFIG_DEBUG_BLOCK_EXT_DEVT is not set

The EXT4 is compiled as kernel module.

The grub meny entry in ubuntu grub looks like :

When I try to go into LFS, it (I am not sure what do I mean by 'it' - 
grub / kernel :P) goes into panic state.

The points I could extract from error messages is, Somehow system is 
trying to attempt and mount the '/' partition (/dev/sda1) as ext3 which 
is incorrect.

Anyways I took a snap of my error screen when I try to boot LFS and kept 
it at
http://ubuntuone.com/3bLEHLy31YuLisa87A6AFB
and
https://picasaweb.google.com/lh/photo/E7NQ3tPJSxmb7Jq9moYlE9MTjNZETYmyPJy0liipFm0?feat=directlink


-- 
http://linuxfromscratch.org/mailman/listinfo/lfs-support
FAQ: http://www.linuxfromscratch.org/lfs/faq.html
Unsubscribe: See the above information page


Re: [lfs-support] Not able to boot LFS : ext4 partition

2012-12-01 Thread William Harrington


On Dec 1, 2012, at 6:06 AM, Sagar Padhye wrote:


The EXT4 is compiled as kernel module.


That is your problem. To mount the rootfs, the filesystem to mount  
rootfs needs to be built in the kernel and not as a module.


Sincerely,

William Harrington-- 
http://linuxfromscratch.org/mailman/listinfo/lfs-support
FAQ: http://www.linuxfromscratch.org/lfs/faq.html
Unsubscribe: See the above information page


Re: [lfs-support] Not able to boot LFS : ext4 partition

2012-12-01 Thread Fernando de Oliveira
--- Em sáb, 1/12/12, Sagar Padhye escreveu:

 De: Sagar Padhye
 Assunto: [lfs-support] Not able to boot LFS : ext4 partition
 Para: lfs-support
 Data: Sábado, 1 de Dezembro de 2012, 9:06
 This is my first attempt to set up a
 LFS. I have used Version 
 SVN-20121122 for this. I have just finished the book with
 the given 
 instructions except following two.
   1. Instead of preparing my LFS partition to be ext2
 or ext3, I chose 
 it to be ext4.
   2. I didnt install LFS grub, instead I have updated
 grub of my host 
 system (ubuntu 12.10).
 
 My HDD now looks like :
 $ sudo fdisk -l /dev/sda
 Device Boot  Start End  Blocks   Id  System
 /dev/sda12048511925598976   83
 Linux#LFS / ext4
 /dev/sda2   *512051589119  194560   83
 Linux  #Ubuntu /boot ext3
 /dev/sda35158912056276991 2343936   82  Linux swap /
 Solaris
 /dev/sda456279038   312580095   1281505295  Extended
 /dev/sda556279040   11682406330272512   83
 Linux   #Ubuntu /  ext4
 /dev/sda6   116826112   31258009597876992   83
 Linux  #Shared /home ext4
 
 
 Part of my LFS kernel config looks like :
 CONFIG_EXT3_FS=y
 # CONFIG_EXT3_DEFAULTS_TO_ORDERED is not set
 CONFIG_EXT3_FS_XATTR=y
 CONFIG_EXT3_FS_POSIX_ACL=y
 CONFIG_EXT3_FS_SECURITY=y
 CONFIG_EXT4_FS=m
 CONFIG_EXT4_USE_FOR_EXT23=y
 CONFIG_EXT4_FS_XATTR=y
 # CONFIG_EXT4_FS_POSIX_ACL is not set
 # CONFIG_EXT4_FS_SECURITY is not set
 # CONFIG_EXT4_DEBUG is not set
 # CONFIG_DEBUG_BLOCK_EXT_DEVT is not set
 
 The EXT4 is compiled as kernel module.
 
 The grub meny entry in ubuntu grub looks like :

You seem to have forgotten to paste the entry.

It seems that William Harrington have already the right answer, but as I
was sepending some time to write this, I will post it, perhaps it will
help aomeone in the future, or perhaps someone will help me in improving
what I am doing.

I usually do the following (I assume that you are running Ubuntu):

1. I have the directory /boot/grub/old (mkdir -vp /boot/grub/old) in
Ubuntu's partition.

2. cd /boot/grub/

3. Before upgrading Ubuntu's or LFS kernel, make a backup copy of that
good grub.cfg: cp -vau grub.cfg old/grub.cfg-before-`date +%Y.%m.%d`

4. After the kernel upgrade, make a new backup copy: cp -vau grub.cfg
old/grub.cfg-after-`date +%Y.%m.%d`

5. Edit grub.cfg and replace the entry for LFS by (replace kernel
version by the kernel used in LFS):

menuentry GNU/Linux, with Linux kernel version (on /dev/sda1) --class 
gnu-linux --class gnu --class os {
insmod part_msdos
insmod ext2
set root='(hd0,msdos1)'
search --no-floppy --fs-uuid --set=root partition UUID
linux /boot/vmlinuz-kernel version root=/dev/sda1 ro
(the search line is not useful for LFS, as have been told by the
editors, I keep just to remember the form If anytime I change LFS's
boot procedures)

6. Just in case and for future eventual use, backup the good one: cp
-vau grub.cfg old/grub.cfg-good-`date +%Y.%m.%d`

I also make similar replacement for the recovery mode entry.

After doing that many times, I decided a more automatic way of doing
things.

I edited in Ubuntu the file /etc/grub.d/40_custom and
pasted the good entries for LFS after # the 'exec tail' line above.:

# Start LFSversion
 the lines for LFS
# End LFSversion

Instead of doing step 4 above:

5a. When there is a kernel upgrade in Ubuntu I just delete the
automatically generated part corresponding to LFS.

5b. When I upgrade the kernel in LFS, I replace the LFS entry versions
by the new version number, in grub.cfg and in /etc/grub.d/40_custom.

 When I try to go into LFS, it (I am not sure what do I mean
 by 'it' - 
 grub / kernel :P) goes into panic state.
 
 The points I could extract from error messages is, Somehow
 system is 
 trying to attempt and mount the '/' partition (/dev/sda1) as
 ext3 which 
 is incorrect.
 
 Anyways I took a snap of my error screen when I try to boot
 LFS and kept 
 it at
 http://ubuntuone.com/3bLEHLy31YuLisa87A6AFB
 and
 https://picasaweb.google.com/lh/photo/E7NQ3tPJSxmb7Jq9moYlE9MTjNZETYmyPJy0liipFm0?feat=directlink


[]s,
Fernando
-- 
http://linuxfromscratch.org/mailman/listinfo/lfs-support
FAQ: http://www.linuxfromscratch.org/lfs/faq.html
Unsubscribe: See the above information page


Re: [lfs-support] Help with a linker problem

2012-12-01 Thread William Harrington


On Dec 1, 2012, at 4:59 AM, Simon Geard wrote:


Basically, I'm hoping that someone more familiar than me with the
toolchain can tell me how a chapter 6 package (bash) might be linked
against a library not installed in chapter 6 (the non-wide version of
ncurses). The obvious answer is that it's found the version built in
chapter 5, but what could cause that?



You can run strace -f chroot command  and see what is going on.

Also follow this:

http://www.linuxfromscratch.org/lfs/view/stable/chapter06/adjusting.html

Do your results of those commands look good?


Is /lib and /usr/lib linked properly to /lib64 and /usr/lib64 ?


Since you can't chroot anymore with a broken /bin/bash, redo the / 
tools/bin/bash link to /bin/bash as in this section:


http://www.linuxfromscratch.org/lfs/view/stable/chapter06/createfiles.html


Next, do your scripts remove all build and source directories after  
each install in ch5 and ch6?


Have you done a successful build without using scripts? If so, you can  
do it again and check your history with your scripts.

You can upload the scripts somewhere and we can look at them.

Sincerely,

William Harrington-- 
http://linuxfromscratch.org/mailman/listinfo/lfs-support
FAQ: http://www.linuxfromscratch.org/lfs/faq.html
Unsubscribe: See the above information page


Re: [lfs-support] Help with a linker problem

2012-12-01 Thread William Harrington


On Nov 30, 2012, at 5:37 AM, Simon Geard wrote:

/bin/bash: error while loading shared libraries: libncurses.so.5:  
cannot

open shared object file: No such file or directory


Do you also get the same problem when running /bin/more /sbin/cfdisk  
and /usr/bin/cal ?


Those are installed by util-linux which is before bash and after  
ncurses.


You can try psmisc's /usr/bin/pstree and see if it is having issues  
with libncursesw


Then procps utils like /usr/bin/top and /usr/bin/watch

If those are not okay, then something before ncurses is the problem I  
suspect.


Sincerely,

William Harrington-- 
http://linuxfromscratch.org/mailman/listinfo/lfs-support
FAQ: http://www.linuxfromscratch.org/lfs/faq.html
Unsubscribe: See the above information page


Re: [lfs-support] Not able to boot LFS : ext4 partition

2012-12-01 Thread Sagar Padhye

On 12/01/2012 06:30 PM, William Harrington wrote:


On Dec 1, 2012, at 6:06 AM, Sagar Padhye wrote:


The EXT4 is compiled as kernel module.


That is your problem. To mount the rootfs, the filesystem to mount 
rootfs needs to be built in the kernel and not as a module.


Sincerely,

William Harrington



Yup, It worked. Thanks a lot William  Fernando.
-- 
http://linuxfromscratch.org/mailman/listinfo/lfs-support
FAQ: http://www.linuxfromscratch.org/lfs/faq.html
Unsubscribe: See the above information page


Re: [lfs-support] Help with a linker problem

2012-12-01 Thread Ken Moffat
On Sat, Dec 01, 2012 at 11:59:07PM +1300, Simon Geard wrote:
 On Fri, 2012-11-30 at 11:17 -0500, Chris Staub wrote:
  First, check how Bash is linked: readelf -l /bin/bash | grep 
  interpret. Of course, this should say that it's looking for the dynamic 
  linker in /lib. Then verify you actually have all the right libraries 
  for Ncurses: ls -la {/usr,}/lib/*ncurses*
 
 Yes, it's using /lib64/ld-linux-x86-64.so.2, and yes, the chapter 6
 version of ncurses *is* correctly installed. But that copy of ncurses is
 the wide-char version, and bash has managed, somehow, to link to the
 non-wide version. My assumption, as I said, is that instead of finding
 the linker scripts in /usr/lib which would point it to the wide version,
 it's found the non-wide version in /tools instead.
 

 I don't remember seeing anything like this before.

 In the distant past, I've had my own fun and games with ncurses when
I fubar'd some of the moves and symlinks.  So, is your _wide_ version
of libncurses ok ?

 I'm thinking perhaps something went wrong when you moved it to
/lib, so that the /usr/lib/libncursesw.so symlink is pointing to a
non-existent file.

 Looking at my own *logs* from bash, it uses -lcurses so also check
that /usr/lib/libcurses.so is a symlink to libncurses.so.

 If you ran the verification tests when you adjusted the toolchain,
and after installing gcc, then my money is on an error *after* that.
Of course, if you didn't run those checks (the SEARCH_DIR etc) then
all bets are off.

ĸen
-- 
das eine Mal als Tragödie, das andere Mal als Farce
-- 
http://linuxfromscratch.org/mailman/listinfo/lfs-support
FAQ: http://www.linuxfromscratch.org/lfs/faq.html
Unsubscribe: See the above information page


Re: [lfs-support] Help with a linker problem

2012-12-01 Thread Aleksandar Kuktin
On Sat, 01 Dec 2012 23:59:07 +1300
Simon Geard delga...@ihug.co.nz wrote:

 On Fri, 2012-11-30 at 11:17 -0500, Chris Staub wrote:
  First, check how Bash is linked: readelf -l /bin/bash | grep 
  interpret. Of course, this should say that it's looking for the
  dynamic linker in /lib. Then verify you actually have all the right
  libraries for Ncurses: ls -la {/usr,}/lib/*ncurses*
 
 Yes, it's using /lib64/ld-linux-x86-64.so.2, and yes, the chapter 6
 version of ncurses *is* correctly installed. But that copy of ncurses
 is the wide-char version, and bash has managed, somehow, to link to
 the non-wide version. My assumption, as I said, is that instead of
 finding the linker scripts in /usr/lib which would point it to the
 wide version, it's found the non-wide version in /tools instead.

Can you do `ldd /bin/bash'?

-- 
   Fourth law of programming:
   Anything that can go wrong wi
sendmail: segmentation violation - core dumped
-- 
http://linuxfromscratch.org/mailman/listinfo/lfs-support
FAQ: http://www.linuxfromscratch.org/lfs/faq.html
Unsubscribe: See the above information page


Re: [lfs-support] Help with a linker problem

2012-12-01 Thread Aleksandar Kuktin
On Sat, 1 Dec 2012 16:19:38 +0100
Aleksandar Kuktin akuk...@gmail.com wrote:

 On Sat, 01 Dec 2012 23:59:07 +1300
 Simon Geard delga...@ihug.co.nz wrote:
 
  On Fri, 2012-11-30 at 11:17 -0500, Chris Staub wrote:
   First, check how Bash is linked: readelf -l /bin/bash | grep 
   interpret. Of course, this should say that it's looking for the
   dynamic linker in /lib. Then verify you actually have all the
   right libraries for Ncurses: ls -la {/usr,}/lib/*ncurses*
  
  Yes, it's using /lib64/ld-linux-x86-64.so.2, and yes, the chapter 6
  version of ncurses *is* correctly installed. But that copy of
  ncurses is the wide-char version, and bash has managed, somehow, to
  link to the non-wide version. My assumption, as I said, is that
  instead of finding the linker scripts in /usr/lib which would point
  it to the wide version, it's found the non-wide version in /tools
  instead.
 
 Can you do `ldd /bin/bash'?
 

I mean `ldd /path/to/bash/that/is/the/problem/bash'.

Also, there is an easy way to test if the problem is linking with a
library from /tools. Make a symlink.

ln -sv /usr /tools

Then try it again.

-- 
   Fourth law of programming:
   Anything that can go wrong wi
sendmail: segmentation violation - core dumped
-- 
http://linuxfromscratch.org/mailman/listinfo/lfs-support
FAQ: http://www.linuxfromscratch.org/lfs/faq.html
Unsubscribe: See the above information page


Re: [lfs-support] Help with a linker problem

2012-12-01 Thread Aleksandar Kuktin
On Sat, 1 Dec 2012 16:24:08 +0100
Aleksandar Kuktin akuk...@gmail.com wrote:

 I mean `ldd /path/to/bash/that/is/the/problem/bash'.
 
 Also, there is an easy way to test if the problem is linking with a
 library from /tools. Make a symlink.
 
 ln -sv /usr /tools
 
 Then try it again.
 

Or maybe you can upload the offending bash binary.

-- 
   Fourth law of programming:
   Anything that can go wrong wi
sendmail: segmentation violation - core dumped
-- 
http://linuxfromscratch.org/mailman/listinfo/lfs-support
FAQ: http://www.linuxfromscratch.org/lfs/faq.html
Unsubscribe: See the above information page


Re: [lfs-support] Help with a linker problem

2012-12-01 Thread Simon Geard
On Sat, 2012-12-01 at 16:19 +0100, Aleksandar Kuktin wrote:
 Can you do `ldd /bin/bash'?

Oddly, no. I can't use ldd because that's a shell script depending
on /bin/sh working, but if I run:

  /lib/ld-linux-x86-64.so.2 --list /bin/bash

...I get:

/bin/bash: error while loading shared libraries: libncurses.so.5: cannot
open shared object file: No such file or directory

That's kind of surprising, actually, because I'd expect it to just list
all the libraries it's linked to, but flag one of them as unresolved.

But if I run the copy of ld-linux under /tools, I get:

$ /tools/lib/ld-linux-x86-64.so.2 --list /bin/bash
  linux-vdso.so.1 (0x7fffe3db7000)
  libncurses.so.5 = /tools/lib/libncurses.so.5 (0x7f3a543b2000)
  libdl.so.2 = /tools/lib/libdl.so.2 (0x7f3a541ae000)
  libc.so.6 = /tools/lib/libc.so.6 (0x7f3a53e08000)
  /lib64/ld-linux-x86-64.so.2 = /tools/lib/ld-linux-x86-64.so.2
(0x7f3a54602000)


Simon.


signature.asc
Description: This is a digitally signed message part
-- 
http://linuxfromscratch.org/mailman/listinfo/lfs-support
FAQ: http://www.linuxfromscratch.org/lfs/faq.html
Unsubscribe: See the above information page


Re: [lfs-support] Help with a linker problem

2012-12-01 Thread Simon Geard
On Sat, 2012-12-01 at 07:27 -0600, William Harrington wrote:
 
 On Nov 30, 2012, at 5:37 AM, Simon Geard wrote:
 
  /bin/bash: error while loading shared libraries: libncurses.so.5:
  cannot
  open shared object file: No such file or directory
 
 Do you also get the same problem when running /bin/more /sbin/cfdisk
 and /usr/bin/cal ?
 
 
 Those are installed by util-linux which is before bash and after
 ncurses.

No I don't. But build logs show that those are being linked directly to
libncursesw instead of through the linker script.

I think Ken has pointed me in the right direction - bash links not to
libncurses or libncursesw, but to plain-old libcurses, and I seem to
have missed the commands that create the linker script that redirects
that one. I've just fixed it, and kicked off a fresh build to see if it
worked.

Simon.



signature.asc
Description: This is a digitally signed message part
-- 
http://linuxfromscratch.org/mailman/listinfo/lfs-support
FAQ: http://www.linuxfromscratch.org/lfs/faq.html
Unsubscribe: See the above information page


[lfs-support] /dev/pts and /dev/shm not mounted on boot

2012-12-01 Thread dj
Hello all,

Just built two systems, one of HLFS-development and one LFS-7.2.

Not sure what I did wrong, but neither system would successfully mount  
/dev/pts or /dev/shm on bootup - both were complaining about  
nonexistant mount points.  After searching the web for a few hours, I  
came across one lonely half suggestion for a fix... and it works.

In the file /etc/rc.d/init.d/mountfs
I added the following at line 38
(   belowboot_mesg Mounting remaining file systems  )
mkdir /dev/{pts,shm}

It worked.

DJ


This message was sent using IMP, the Internet Messaging Program.

-- 
http://linuxfromscratch.org/mailman/listinfo/lfs-support
FAQ: http://www.linuxfromscratch.org/lfs/faq.html
Unsubscribe: See the above information page


Re: [lfs-support] /dev/pts and /dev/shm not mounted on boot

2012-12-01 Thread Chris Staub
On 12/02/2012 01:02 AM, d...@fluidnetwork.com wrote:
 Hello all,

 Just built two systems, one of HLFS-development and one LFS-7.2.

 Not sure what I did wrong, but neither system would successfully mount
 /dev/pts or /dev/shm on bootup - both were complaining about
 nonexistant mount points.  After searching the web for a few hours, I
 came across one lonely half suggestion for a fix... and it works.

 In the file /etc/rc.d/init.d/mountfs
 I added the following at line 38
  (   belowboot_mesg Mounting remaining file systems  )
  mkdir /dev/{pts,shm}

 It worked.

 DJ

That should not be needed. I believe this points to a problem with Udev, 
as it should create /dev/pts when it starts. Did you deviate from the 
book's instructions in any way?
-- 
http://linuxfromscratch.org/mailman/listinfo/lfs-support
FAQ: http://www.linuxfromscratch.org/lfs/faq.html
Unsubscribe: See the above information page