Opened 10 years ago

Closed 10 years ago

#3595 closed task (worksforme)

6.9.2. Configuring Glibc

Reported by: Ryan P.C. McQuen Owned by: lfs-book@…
Priority: normal Milestone: 7.6
Component: Book Version: SVN
Severity: normal Keywords: timezone, tzselect, glibc
Cc:

Description

" One way to determine the local time zone is to run the following script:

tzselect " It should be added that this script must be run from '/usr/share/zoneinfo'. Otherwise an error like this will happen:

/usr/bin/tzselect: line 439: /sources/glibc-build/America/Los_Angeles: No such file or directory /usr/bin/tzselect: time zone files are not set up correctly

Attachments (4)

tzselectIssue.txt (9.6 KB ) - added by Ryan P.C. McQuen 10 years ago.
History of commands
sedCommand.png (117.6 KB ) - added by Ryan P.C. McQuen 10 years ago.
sed command for tzselect issue
tzselect (12.9 KB ) - added by Ryan P.C. McQuen 10 years ago.
config.log (34.4 KB ) - added by Ryan P.C. McQuen 10 years ago.

Download all attachments as: .zip

Change History (24)

comment:1 by bdubbs@…, 10 years ago

Do you actually have the TZ data set up properly? It runs from chroot / directory just fine.

comment:2 by Ryan P.C. McQuen, 10 years ago

Yes I do. It worked perfectly from /usr/share/zoneinfo. At this point in the book though you will actually be in the '/sources/glibc-build' directory, which the command will not work from.

Here is what I got running the command from the '/root' directory:

root:~# tzselect /usr/bin/tzselect: line 171: /root/iso3166.tab: No such file or directory /usr/bin/tzselect: time zone files are not set up correctly

So it should be specified in some way ...

Either '/' or '/usr/share/zoneinfo'.

comment:3 by bdubbs@…, 10 years ago

It works fine for me from /sources/glibc-build. You need to trace through the script and see why yours is not working.

It's hard to say that the book is wrong since this is the first problem with this and that command has been in the book for many years.

comment:4 by chris@…, 10 years ago

Perhaps you should verify that you ran that sed command (should be the first command on the Glibc page) that fixes the installation of tzselect - I believe this problem is exactly what happens when you don't use that. What is the result of "grep ':.*TZDIR' /usr/bin/tzselect"?

Version 0, edited 10 years ago by chris@… (next)

comment:5 by Ryan P.C. McQuen, 10 years ago

Did you mean?

grep '^:.*TZDIR' "/usr/bin/tzselect"

If so:

: ${TZDIR=`pwd`}

by Ryan P.C. McQuen, 10 years ago

Attachment: tzselectIssue.txt added

History of commands

comment:6 by Ryan P.C. McQuen, 10 years ago

I've also attached all my bash history/commands for this section.

comment:7 by chris@…, 10 years ago

Yup, that does indicate you didn't use that sed command. This should fix the problem:

sed -i.bak '/^:.*TZDIR/s@`pwd`@/usr/share/zoneinfo@' /usr/bin/tzselect

comment:8 by Ryan P.C. McQuen, 10 years ago

What section is this sed command in? I cannot find it.

comment:9 by chris@…, 10 years ago

It's not anywhere in the book, but it will fix the problem.

comment:10 by Ryan P.C. McQuen, 10 years ago

Is it this one?

sed -i 's/\\$$(pwd)/`pwd`/' timezone/Makefile

If so, I ran it, have it in my .bash_history. See attached photo.

by Ryan P.C. McQuen, 10 years ago

Attachment: sedCommand.png added

sed command for tzselect issue

comment:11 by chris@…, 10 years ago

No...the sed command in the book is the one that's supposed to be run during the Glibc build. The sed command I gave is just to fix the problem after Glibc is already installed, usually due to having missed the command in the book.

Also, that screenshot you gave doesn't indicate anything since you apparently weren't even in the Glibc source dir when you ran that, so it would have had an error if you did use it then. Also, I don't know why it shows you running that immediately after creating /etc/group, since there should be the installation of the Linux headers and Man-pages in between. Either that isn't an actual screenshot of your complete build procedure for Chapter 6 so far, or you're doing something strange to deviate from the book's instructions, in which case you'll need to clarify what that is.

comment:12 by Ryan P.C. McQuen, 10 years ago

I got to that command by pressing 'up' through my history. You'll note the 2 commands in a row that were run, copied verbatim from my shell. Is this the command you said I 'missed'? If so, I did not miss it, and there is some other issue.

cd glibc-2.19
sed -i 's/\\$$(pwd)/`pwd` /' timezone/Makefile

comment:13 by chris@…, 10 years ago

When I asked you to run

grep '^:.*TZDIR' "/usr/bin/tzselect"

the output from that command that you gave is exactly what you get when you don't use that sed command on the Glibc page. Plus, as Bruce said, plenty of people have been using these same instructions for a while, and they are known to work. Try rebuilding Glibc and double-checking your commands, and tzselect should work fine.

comment:14 by Ryan P.C. McQuen, 10 years ago

Could you tell me the exact sed command I missed?

Thank you.

comment:15 by chris@…, 10 years ago

The first one in the Glibc instructions, the one you keep saying you ran. It looks like either you did miss it or mistyped it.

Last edited 10 years ago by chris@… (previous) (diff)

comment:16 by Ryan P.C. McQuen, 10 years ago

This is copied and pasted from my .bash_history:

cd glibc-2.19
sed -i 's/\\$$(pwd)/`pwd` /' timezone/Makefile

Do you see the typo?

comment:17 by chris@…, 10 years ago

There's an extra space in there - compare to what's in the book. Though, I don't think that particular difference should cause an issue, so there's likely a problem somewhere else, but I have no idea where. Just try rebuilding Glibc, paying close attention to the commands, and see if you get the same problem.

comment:18 by chris@…, 10 years ago

Alternately, copy the entire contents of /usr/bin/tzselect and glibc-build/config.log, as they might give hints as to what the problem is.

by Ryan P.C. McQuen, 10 years ago

Attachment: tzselect added

by Ryan P.C. McQuen, 10 years ago

Attachment: config.log added

comment:19 by Ryan P.C. McQuen, 10 years ago

Thank you for your help Chris!

I've attached the requested files. I hope we can get to the bottom of this.

: - )

comment:20 by bdubbs@…, 10 years ago

Resolution: worksforme
Status: newclosed

I'm closing this. Take this to lfs-support. The ticket system is the wrong place to debug individual problems.

Note: See TracTickets for help on using tickets.