Linux From ScratchThis 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
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
If you have installed LFS a few times and you want to automate your next build you use jhalfs - right? But if you use Matthias Benkmann's excellent package-user management system, you have to build manually - right? Wrong.
I have taken an original script by Firerat and added more flexibility and made it easier to use. I suggest you try it when you want to build LFS 7.1
Everything you need is at:
github.com/JohnBurrell/LFS-BuildScripts - just follow the instructions and if you have any questions, ask them here.
Also you have the opportunity of changing the lfsa script to suit exactly your needs - and have a lot of fun doing it.
Give it a try and let me know how you get on. If you need any help, I'll happily give it, but please don't use the scripts if you are a neophyte. Build manually a few times first.
In chapter02.sh I had to add
export LFS=/mnt/lfs
at the beginning even though echo $LFS would correctly output /mnt/lfs.
In chapter06-asroot.sh I got a weird problem, the command
$ mkdir -v $LFS/{dev,proc,sys}
actually created a directory called "{dev,proc,sys}".
I replaced the above command by three separate commands, no problem.
But still I don't understand why this happens?
Ok, but when I do mkdir {a,b} outside of the script I actually get two directories. So where might my shell be turned into dash without me noticing?
The lfsa script does not contain a dash command.
Hm, in earlier builds I did not have this problem.
So either this link does not matter when not using Johnburrell's script, or the link was changed somehow, maybe an ubuntu update?
In any event, you are of course right, thanks!
I tried this once more on a compliant Debian host.
In chapter05.sh I get an error:
Code:
mkdir: created directory `../gcc-build'
Configuring...success
Building...success
Installing...success
`/mnt/lfs/tools/bin/../lib/gcc/x86_64-lfs-linux-gnu/4.6.2/libgcc_eh.a' -> `libgcc.a'
cp: cannot stat `/mnt/lfs/sources/linux-headers*.*': No such file or directory
If I understand the script correctly, the relevant bit from chapter05.sh is:
Code:
CreateBuildDir () {
BuildDir=${LFS}${builddir05}/$FuncName
if [ ! -e $BuildDir ]; then
install -d $BuildDir
cd $BuildDir
else
cd $BuildDir
fi
}
unpack05 () {
starttime=$( date +%s )
cp ${LFS}${sourcedir}/${Pkg}*.* .
cd `tar vxf ${Pkg}*z* | awk -F\/ 'END{print $1}'`
endtime=$( date +%s )
set +e
unpacktime=$( expr $endtime - $starttime )
set -e
starttime=$( date +%s )
}
So it tries to copy a linux-headers archive instead of the kernel archive.
But why does this happen? The last time I tried, I got beyond this point...
I am using the 7.1 stable book and the most recent version of the build-scripts.
I think this is because the symlink from linux-headers to the linux kernel is not set up.
Indeed, the link is not present. Actually the kernel is not present, either, so it is not surprising id did not create a link.
I must have made a mistake when copying it.
After making sure the kernel is in place, I reran chapter05.sh. I had to delete the book in order to do so. This time it completed succesfully.
That symlink is rather a nasty fudge so I got rid of it. I created a package name and a source name so now the two can be different with out any worries. I also created a command name as well which gets rid of the xz-utils symlink too. So the package name, the source name and the command name can all be different.
This is essential in blfs where such things happen frequently. I'm still playing with the blfs script but it installs x okay and I'm currently testing gnome. There are some querks which I can't iron out at the moment but that's not surprising when the script sets up the installation of over 300 packages.
I'll post the update of lfsa on github when I've tested it and you're welcome to try blfsa when you're ready.
This is great!
Chapter 6 finished successfully.
I will just write some of my experiences here if somebody else wants to try this.
In chapter 6 I got
Code:
su: /bin/bash: Permission denied
but I could avoid it by doing
Code:
chmod 777 /mnt/lfs
before
Code:
./chapter06-chroot.sh
I also got
Code:
ldconfig: /usr/lib/libstdc++.so.6.0.16-gdb.py is not an ELF file - it has
# the wrong magic bytes at the start.
many times. Since I could not find out why this happens, I just ignored it.
Also, I got this kind of error on all the packages:
Code:
install: creating directory `/usr/src/core/vim'
Home directory will be /usr/src/core/vim
create user vim with uid 10053
create group vim with gid 10053
useradd: group '1000' does not exist
useradd: the GROUP= configuration in /etc/default/useradd will be ignored
Configuring...success
Building...success
Installing...success
I ignored that one as well.
Other than the ldconfig and the group error, everything seems fine as far as I can tell.
Quote:
I'll post the update of lfsa on github when I've tested it
Ok, I will test it. Is tere a way I can see the changes from your update?
When I go to "commits" on https://github.com/JohnBurrell/LFS-BuildScripts I seem to get the full code as "new" rather than the changes.
Quote:
you're welcome to try blfsa when you're ready
Sure, I would like to try this.
I already tried to install some blfs packages through the package management, but many of them give permission errors (which don't happen if I install them without package management).
Also, something bad happend when trying to install glib and pkg-config, I need to investigate further.
Don't know why you get permission denied with /bin/bash. I'll investigate further.
You can safely ignore the ldconfig message. That goes away with latest version of glibc.
Also ignore the useradd messages. If you create group 1000 for your own personal username and useradd that name with that group, the message goes away.
I made quite a few changes to lfsa so I decided to post a new version of everything rather than update it. You'll have to replace your version with the new one.
I'll put up the BLFS-BuildScripts today. They seem to be working okay. I went from nothing to installed gnome over the weekend with only a couple of problems.
mkdir: created directory `../glibc-build'
Configuring...successful!
Building...successful!
Installing...successful!
cp: cannot stat `/mnt/lfs/sources/adjusting-*.*': No such file or directory
If I understand correctly, chapter05.sh checks if 'adjusting-*.*' is present and if it is not is should skip it. But for some reason it is not skipped.
Another thing:
Is it possible to call lfsa in such a way that the menuconfig is skipped?
I am about to write a script that automates the process even further. There I have export commands for TZ, PAPPER_SIZE, etc which are then stored in the config file. So it would be nice if the menu did not show anymore.
Are you sure you have the latest version of lfsa? I've just generated chapter05.sh and the word 'adjusting' does not appear anywhere in that script. At the end of glibc, there is this:
and then it goes on to binutilspass2. I don't see the cp command anywhere. The adjusting commands are in chapter06.sh.
Ah, I guess you are building 7.1, are you? I made the changes to lfsa but have only tested them on current_development. May be the commands for 7.1 are different - there must be an 'adjusting' after glibc in there. In current_development this has gone. Is it possible for you to download the current_development book version and sources and try that? If that works, I'll go back and test 7.1 and make the necessary changes.
With regard to the config file, you could change the lfsa script so that it doesn't use dialog. Then it won't display anything - but of course you won't be able to change anything.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.