LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux From Scratch (https://www.linuxquestions.org/questions/linux-from-scratch-13/)
-   -   LFS - first apparent problem (https://www.linuxquestions.org/questions/linux-from-scratch-13/lfs-first-apparent-problem-73680/)

itsjustme 07-17-2003 06:25 PM

LFS - first apparent problem
 
Host system: slackware 9.0

LFS partition: /dev/hda11 ->> /LFS

Going through the book, I created the user 'lfs'.

When I did 'su - lfs', as instructed, I got:

/dev/tty1: Operation not permitted

but the user did change from slacker@bsslack to lfs@bsslack.

Doesn't appear to be a problem, but just bugs me a little that it showed up.

A side note: I was going to copy and paste from my session, but I did a Ctrl-Alt-F2, logged in, ran startx,
Ctrl-Alt-F1 back to my session to copy the text,
CTRL-Alt-F2 back to the X session -- X is no longer on screen.
I returned to some error messages which I can't get over to this machine to post. I thought you were supposed to be able to jump between terminals with Ctrl-Alt-F1 and F2 and not lose anything from either session.
:scratch:

fancypiper 07-17-2003 06:48 PM

alt-F7 should take you back to your x session from a virtual terminal.

Once out of x alt-F1 through alt-F6 will take you to 6 different virtual terminals. The one you logged into to start x will be busy.

itsjustme 07-17-2003 07:46 PM

Thanks for the help. I remember now about the ALT-F7 thing, but I forgot, since I haven't used it since the first time I read about it.

Unfortunately I couldn't then figure out how to copy the text from the CTRL-ALT-F1 session into the X session, so I simply opened an xterm and entered the stuff from the LFS 4.1 book, chapter 5, section .4 and .5 there.
Here's that:
Code:

[slacker@bsslack ~] $ su -
Password:
Computers are useless.  They can only give you answers.
                -- Pablo Picasso
[root@bsslack ~] $ useradd -s /bin/bash -m lfs
[root@bsslack ~] $ passwd lfs
Changing password for lfs
Enter the new password (minimum of 5, maximum of 127 characters)
Please use a combination of upper and lower case letters and numbers.
New password:
Re-enter new password:
Password changed.
[root@bsslack ~] $ chown lfs /LFS/static
[root@bsslack ~] $ ls -l /LFS
total 24
drwx------    2 root    root        16384 May 12 11:38 lost+found
drwxr-xr-x    2 root    root        4096 Jul 17 16:56 packages
drwxr-xr-x    2 lfs      root        4096 Jul 17 17:59 static
[root@bsslack ~] $ su - lfs
/dev/tty1: Operation not permitted
He who is known as an early riser need not get up until noon.
lfs@bsslack:~$  cat > /.bash_profile << "EOF"
> umask 022
> LFS=/LFS
> LC_ALL=POSIX
> CC="gcc -s"
> export LFS LC_ALL CC
> EOF
-su: /.bash_profile: Permission denied
lfs@bsslack:~$ source ~/.bash_profile
-su: /home/lfs/.bash_profile: No such file or directory
lfs@bsslack:~$

Something is amiss. Apparently it doesn't like the "su - lfs" step or that "cat > ..." thing.

Maybe I just need to vi the .bash_profile and add those lines.

fancypiper 07-17-2003 07:55 PM

Copy everything from /etc/skel to the user/root directory(s) changing ownership afterward.

itsjustme 07-17-2003 08:02 PM

The only thing in /etc/skel is .screenrc , and /home/lfs already has one of those.

I logged in as lfs directly to tty1, rather than try that 'su - lfs', and created the .bash_profile with vi and then ran the source command and that seems to have worked to export those environment variables.

On to chapter 5.6, Installing Bash-2.05a

regards...

Azmeen 07-17-2003 08:05 PM

Quote:

Originally posted by itsjustme
Thanks for the help. I remember now about the ALT-F7 thing, but I forgot, since I haven't used it since the first time I read about it.

Unfortunately I couldn't then figure out how to copy the text from the CTRL-ALT-F1 session into the X session, so I simply opened an xterm and entered the stuff from the LFS 4.1 book, chapter 5, section .4 and .5 there.
Here's that:
Code:

....
lfs@bsslack:~$  cat > /.bash_profile << "EOF"
....

Something is amiss. Apparently it doesn't like the "su - lfs" step or that "cat > ..." thing.

Maybe I just need to vi the .bash_profile and add those lines.

shouldn't it be: cat > ~/.bash_profile << "EOF" instead?

itsjustme 07-17-2003 08:28 PM

Quote:

shouldn't it be: cat > ~/.bash_profile << "EOF" instead?
Possibly there is a typo in the book. The tilde is not present there. This is the printed book I paid for. :rolleyes: Is that supposed to create the file or was it expecting the file to already exist and this stuff was just getting appended? Slackware doesn't automatically create .bash_profile.

Anyway, I think I am past the goof with the .bash_profile.

Now I am in 5.6, Installing Bash-2.05a. It says to make sure I have libcurses.a and libncurses.a. Good, I have those. Then it says to run:

./configure --enable-static-link --prefix=$LFS/static --with-curses

Then it says to run 'make' and then 'make install'.

Uh... I'm still in /home/lfs. Shouldn't this be taking place in /LFS, where LFS is being built? Or, am I in the right place, /home/lfs, for that? The book gives no indication of where I need to be for this.

Over in 5.7 it gets to installing binutils and says to 'mkdir ../binutils-build' and cd to it. But, if I am just following along in the book I am still in /home/lfs and I'm pretty sure I need to be in /LFS. Is that right.

Thanks!

Edit: Hmmmm... Maybe I'm supposed to be in /LFS/static at this point.

Azmeen 07-17-2003 09:14 PM

BTW... what version of the book are you using? I'd suggest the 4.1 version... it worked well for me (the only problems I faced were because of me not reading the instructions properly).

Maybe you should download the book (maybe it has some bugfixes over the printed version).

My method was... not starting X at all, and opening the book with lynx on v-term 2 and doing my operations on v-term 1. It works well, and I guess there's no harm in trying that. It's also convenient because you can easily copy and paste long lines between the two v-terms.

<Edit>Spelling corrections</Edit>

itsjustme 07-17-2003 09:18 PM

Hmmmm...

Of course, that ./configure isn't going to work because there isn't yet a configure file to be found. I guess I am supposed to know already that maybe I need to uncompress the bash-2.05a.tar.bz2 to some directory, apparently the /LFS/static directory.

I can always reformat and reinstall slackware if I screw up because I don't have ESP. :D

Anybody out there have the printed book that they are following through to do an LFS system?? Am I just dense?

:scratch:

itsjustme 07-17-2003 09:21 PM

Quote:

Originally posted by Azmeen
Maybe you should download the book (maybe it has some bugfixes over the printed version).
Maybe that's a good idea. :)

:study:

Edit: It IS the 4.1 printed book. Maybe there was stuff in the previous chapters that said, OK, when you get to 5.6 here's what you have to remember to do from what you read here... :eek:

itsjustme 07-17-2003 09:57 PM

Ok, I know the book says:
All programs compiled in this chapter will be installed under $LFS/static to keep them separate from the programs compiled in the next chapter.

- Ok, does that mean then that I should copy the 'packages' from the CD into the /LFS/static directory and work from there?
- Should I uncompress the packages from their present location into the static directory?
- When I get to installing, say, bzip2, after I uncompress that package, will the 'configure' file from the 'bash' package be overwritten by a new 'configure' file from the bzip2 tar? Or is there just one 'configure' file that works for all packages and it comes out of the bash package?
- When I run 'make' for each package, will that new package have overwritten all the files from the previous package so there is no confusion between packages?
- Should I create a separate directory for each package?

I guess the book is leaving it up to me to know a lot of specific stuff before I get started here.

Thanks...

itsjustme 07-18-2003 09:02 AM

Ok, so it seems the thing that the book is not telling me, that I should automatically know, is that I get the package I am working with, put it in the static directory, un-tar it there, it creates a new directory for that package, I change into that directory and run the ./configure, make, etc... At least that's what it looks like so far with the bash packages.

The book just says, ok, let's install bash. Type in ./configure blah blah...

Of course the second package in the process is going to be binutils, and the book says to manually create a separate directory for that. So, I assume that my assumption ( :eek: ) is not correct for binutils.

Edit:
Another question, in case anybody wants to jump in here and throw some advice/experience at me, the book says to run that './configure....', then 'make', then 'make install'. Before I type in 'make install' and start seeing all sorts of errors, do I need to be root to run 'make install'??

thanks...

itsjustme 07-18-2003 09:29 AM

So.... there's not much activity that happens over here in the LFS forum, eh?

:study: :scratch: :cry: :study: :scratch: :Pengy: :scratch: :cry: :study: ;)

fancypiper 07-18-2003 09:41 AM

I did linux from scratch the easy way, with gentoo. :D

./configure and make can be done as user, but installing must be done for root if it is for system wide use.

Azmeen 07-18-2003 09:42 AM

Quote:

Originally posted by itsjustme
So.... there's not much activity that happens over here in the LFS forum, eh?
LOL! LFSers are shy ya know ;) Well, anyway... if you followed everything by the book (even the version used don't use newer versions even if they exist, IMPORTANT!) you will be fine.

Well anyway, if you setup your $LFS variable and your environments properly, you will heading to a good start.

Bash shouldn't be a problem... but don't use versions other than recommended by the book, there are reasons why 2.05a is chosen. Don't be like me, and find that out when you're halfway through chapter 6 and had to start all over again!

Some apps require you to compile them outside of the source directory... HEED THE WARNING, lest you want a fubar'd system!

If you need more assistance, just give a shoutout. I'll assist whenever I can.


All times are GMT -5. The time now is 11:20 PM.