Hot answers tagged

11

In old versions of bash you had to quote variables after <<<. That was fixed in 4.4. In older versions, the variable would be split on IFS and the resulting words joined on space before being stored in the temporary file that makes up that <<< redirection. In 4.2 and before, when redirecting builtins like read or command, that splitting ...


8

The correct virtual link is: ln -s /tools/lib/crt*.o /tools/lib/gcc/i686-lfs-linux-gnu/4.8.2/


7

do I need to have a swap partition for each distro or can LFS use the swap partition I already have? As goldilock says, unless you are hibernating (suspend to disk), yes. Otherwise no, because you could overwrite swap of a hibernated system - either it's saved state or the part that was used as regular swap at suspend time. If so, would the swap ...


7

Short answer: You can use the same swap partition as the data in swap is not preserved from one boot to the next. It is totally normal to have multiple linux installations on a disk with a single swap. There is one exception/caveat I know of, however: if you use hibernate (aka, 'suspend to disk'), hibernate uses your swap space for storage. If you then ...


6

su - username runs the login shell of username as an interactive shell. su username command arguments runs command arguments non-interactively under the account username. You command su lfs - -c "source ~/.bash_profile" means run - -c "source ~/.bash_profile" as the user lfs non-interactively. Now the shell sees the option - and says, I am to run as an ...


5

Correct. As the Dragon Book explains, you must first build a host binary that builds for the target, and then you use that to build a target binary that builds for the target.


5

I was also trying to build LFS system on my system. I am using Ubuntu 14.04. I got the same message during version-check. I went ahead with chapter 5 and during installing gcc, make failed with error. Checking few online help and mailing lists, I found that I had to point to the place where the libraries existed i.e. /usr/lib which I found out from this ...


5

Make is simply for convenience. You can build software without it, it is just more difficult. When you run make to build something, it shows you the commands it is running. You can run those commands manually and get the same effect. $ echo "int main() {}" > test.c $ make test cc test.c -o test Which created a file called test. I can get the same ...


5

You need to chroot so the compiled programs can be placed and linked to correct places and files. You want to compile a program and install it's files in /usr/share/program/somefiles instead of /mnt/lfs/usr/share/program/somefiles so it can find those files when the new system is running. Also, in chroot, you can make sure your new system doesn't link to ...


4

The errors you're getting are all listed in the LFS book as known and safe to ignore. Run make check again after the failure and it should complete without errors. The reason it doesn't fail the second time is because it skips tests that have already been run (even the failed ones).


4

I don't know whether the previous answer I submitted is correct or not. I decided to continue doing LFS-7.5 in Linux Mint, where user lfs was present in the sudoers file. After finishing Chapter 5, I again got an error at Chapter 6.7 make mrproper. So, I deleted all folder under $LFS except $LFS/sources and started from the beginning. After finishing the ...


4

Fix, (see also S. Chazelas' answer for background), with sensible output: #!/bin/bash IN="One-XX-X-17.0.0" IFS='-' read -r -a ADDR <<< "$IN" for i in "${ADDR[@]}"; do if [ "$i" = "${i//.}" ] ; then echo "Element:$i" continue fi # split 17.0.0 into NUM IFS='.' read -a array <<< "$i" for element in "${...


4

No, you don't partition a partition. And you can only have 4 primary partitions, one of which can be an extended partition that can contain logical partitions. Personally, I'd leave it alone. When I did my LFS system (18 years ago) I kept it all on one partition. Easy to clone data, etc. off to a new one if really needed, but I'd keep it simple as you can ...


4

The patch is not needed in Section 5.7, it's needed in Section 6.9. There is a note in the general compilation instructions which says: Several of the packages are patched before compilation, but only when the patch is needed to circumvent a problem. A patch is often needed in both this and the next chapter, but sometimes in only one or the other. ...


3

Jimminy Cricket, that hint is Old: CHANGELOG: [2002-06-12] * Initial hint. [2003-09-17] * Changed format to fit new guidelines, added disclaimer about dpkg 1.10. Can you reverse everything you did and try the Use dpkg (.deb) package management on LFS 6.3., which is newer (but not by much): CHANGELOG: [2008-11-05] * Initial hint. I skimmed both ...


3

The way I would solve this problem is by having what is called an "initrd". I don't know how familiar you became with initrd when doing Linux from scratch, but they have a page about initrd here: http://www.linuxfromscratch.org/blfs/view/svn/postlfs/initramfs.html What initrd does is act as a small root filesystem the kernel boots in to after loading the ...


3

This creates a file of installed packages: dpkg --get-selections > package_list cat package_list | grep ^gcc -> OK! cat package_list | grep gmp -> libgmp10:amd64 cat package_list | grep mpfr -> libmpfr4:amd64 cat package_list | grep mpc -> libmpc3:amd64 locate libgmp10 -> /var/lib/dpkg/info/libgmp10:amd64.list locate libmpfr4 -> /...


3

You can only claim to have done something from scratch if you really wrote the software yourself. If you just bundling some software you can give the bundle/distribution a name but that's it. If you expect to receive karma points/get famous/improve your cv by creating a distribution and just giving it your own name you are mistaken. It can even backfire if ...


3

No, of course not. You did not write any of the software, you just compiled it. All the licenses and copyrights that the software was distributed with apply to an LFS system just like any other.


3

Short answer: You don't. Long answer: If you know what you are doing, you certainly can organize the directories in whatever way you want, and give them names in Swahili too. But that means that you'd have to adjust each and every package you install to use this non-standard layout. You will find that some packages' configuration silently ignores the ...


3

Everyone else is up and running save for my installation, which has been set up and run on an external SSD, running on an MSI GL62 laptop, while everyone else is using quite older hardware. Oh blast. It's hard to watch when people with ancient hardware get ahead of you in a project that mainly involves compiling stuff. With my course final this coming ...


3

LFS run it's own kernel. In LXC container or any container based virtualization guest system shares the host's kernel. So LFS can't be run inside a container based VM. Further in absence of dedicated kernel guest suffers several restrictions inside container. Like guest can't load it's own kernel module (i.e. drivers), can't drop cache etc. Another plan ...


3

You should not use sda or sdb. While in practice it is likely that the internal disk will be recognized first and become sda, you don't know for sure. You may also come across a computer with two internal disks, and then sdb will be wrong. To identify your USB drive, use either the UUID or the label of the partition you want to use. It will be something ...


3

The short answer is, yes, you can roll your own Linux distro using Nix and Nixpkgs as a foundation. AFAIK Nix provides infrastructural packages like glibc, gcc, linux kernel, etc. Does that mean one won't need to build these manually, like in LFS? Correct. You should be able to use the existing packages. Nixos itself uses systemd, but I am aware of not-os, ...


2

I have been able to complete LFS, I believe the reason that GRUB was giving the specified error was because I didn't have everything mounted correctly. This script should mount everything as needed: export LFS=/mnt/lfs mkdir -p $LFS mount -v -t ext4 /dev/sda1 $LFS mount -v -t ext4 /dev/sda2 $LFS/home mount -v -t ext4 /dev/sdb1 $LFS/sources /sbin/swapon -v /...


2

I found a fix for this. If you're having the same problem, try this. Before configuring, try this in your gcc folder: ./contrib/download_prerequisites


2

Most of the distros can be used as a base and then customizations can be applied to this base, and written to an ISO. Fedora Fedora offers what's called a a "spin" or "respin". You can check them out here on the spins website: http://spins.fedoraproject.org/ It's pretty straight-forward to "roll your own" versions of Fedora, mixing in your own custom ...


2

After running the second pass of gcc, ldd was pointing that gcc was using the host libraries. I didn't know how to solve it, so I simply ran the second pass of gcc again, but using the gcc binary of the last second pass without passing a CC variable. Then ldd started to show that gcc was using the stuff under /tools. But the binaries of binutils was also ...


Only top voted, non community-wiki answers of a minimum length are eligible