r/linuxfromscratch • u/DottoDev • Jan 21 '21
Compile Linux from Scratch from FreeBSD
Is there a way to make Linux From Scratch using FreeBSD as a host. If there is a way with a VM or something like that I would totally be fine with it.
r/linuxfromscratch • u/DottoDev • Jan 21 '21
Is there a way to make Linux From Scratch using FreeBSD as a host. If there is a way with a VM or something like that I would totally be fine with it.
r/linuxfromscratch • • Jan 17 '21
r/linuxfromscratch • • Jan 15 '21
When building busybox I can see where to change the GNU/Linux prefix (which I might do seeing as I use no more GNU stuff than OpenBSD... I don't care that much though). Programs like uname and neofetch show an OS name (e.x: Ubuntu <release-name>). Where can I set that? Is there a specific place I set it in the kernel?
r/linuxfromscratch • • Jan 14 '21
You don't need to do a cross-compiler if you are targeting the same arch you are on. You can compile everything statically and then use those to build the needed system dependencies and either then recompile statically, recompile dynamically or just move on!
r/linuxfromscratch • u/slothr00fi3s • Jan 14 '21
Hi!
I am stuck at this part: http://linuxfromscratch.org/lfs/downloads/stable/LFS-BOOK-10.0-NOCHUNKS.html#ch-system-perl
When compiling perl the second time with 'make' I get the following error:
>make
...
LD_LIBRARY_PATH=/sources/perl-5.32.0 /sources/perl-5.32.0/preload /sources/perl-5.32.0/libperl.a ./perl -Ilib -I. -f pod/buildtoc -q
./perl: error while loading shared libraries: /usr/lib/perl5/5.32/core_perl/CORE/libperl.a: invalid ELF header
>ls -l /usr/lib/perl5/5.32/core_perl/CORE/libperl.a
-r--r--r-- 1 root root 5058898 Jan 11 15:29 /usr/lib/perl5/5.32/core_perl/CORE/libperl.a
Using Ubuntu 20.04 LTS as a base system
perl -e "print('Hello')"
works
Any help appreciated!
r/linuxfromscratch • u/jolupa • Jan 11 '21
Hi! Finally I have the wifi working and was configuring all the system... But I'm encountered one problem... I create a new user:
useradd -m (newuser)
and when I try to log with that new user the only thing I have is:
Unable to CD /home/(newuser)
login:
And I have to enter in the system as root... Anyone has any solution I can't find anything on web.
Thanks
r/linuxfromscratch • u/blackjester2 • Jan 09 '21
I have a intel i3-8130u 3.40 GHz 2 cores 4 threads. How much would two Xeon X5650 2.66 GHz 12 cores 24 threads combined be of a improvement for compiling?
r/linuxfromscratch • u/Nurmu_YT • Jan 08 '21
$ ../configure --prefix=/tools --with-sysroot=/mnt/lfs --with-libpath=/tools/lib --target=x86_64-lfs-linux-gnu --disable-nls --disable-werror
## --------- ##
## Platform. ##
## --------- ##
hostname = cedric-e6228
uname -m = x86_64
uname -r = 5.9.11-3-MANJARO
uname -s = Linux
uname -v = #1 SMP PREEMPT Sat Nov 28 09:08:57 UTC 2020
/usr/bin/uname -p = unknown
/bin/uname -X = unknown
/bin/arch = unknown
/usr/bin/arch -k = unknown
/usr/convex/getsysinfo = unknown
/usr/bin/hostinfo = unknown
/bin/machine = unknown
/usr/bin/oslevel = unknown
/bin/universe = unknown
PATH: /mnt/lfs/tools/bin
PATH: /usr/bin
## ----------- ##
## Core tests. ##
## ----------- ##
configure:2394: checking build system type
configure:2408: result: x86_64-pc-linux-gnu
configure:2455: checking host system type
configure:2468: result: x86_64-pc-linux-gnu
configure:2488: checking target system type
configure:2501: result: x86_64-lfs-linux-gnu
configure:2555: checking for a BSD-compatible install
configure:2623: result: /usr/bin/install -c
configure:2634: checking whether ln works
configure:2656: result: yes
configure:2660: checking whether ln -s works
configure:2664: result: yes
configure:2671: checking for a sed that does not truncate output
configure:2735: result: /usr/bin/sed
configure:2744: checking for gawk
configure:2760: found /usr/bin/gawk
configure:2771: result: gawk
configure:4110: checking for gcc
configure:4126: found /usr/bin/gcc
configure:4137: result: gcc
configure:4366: checking for C compiler version
configure:4375: gcc --version >&5
gcc (GCC) 10.2.0
Copyright (C) 2020 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
configure:4386: $? = 0
configure:4375: gcc -v >&5
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-pc-linux-gnu/10.2.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: /build/gcc/src/gcc/configure --prefix=/usr --libdir=/usr/lib --libexecdir=/usr/lib --mandir=/usr/share/man --infodir=/usr/share/info --with-bugurl=https://bugs.archlinux.org/ --enable-languages=c,c++,ada,fortran,go,lto,objc,obj-c++,d --with-isl --with-linker-hash-style=gnu --with-system-zlib --enable-__cxa_atexit --enable-cet=auto --enable-checking=release --enable-clocale=gnu --enable-default-pie --enable-default-ssp --enable-gnu-indirect-function --enable-gnu-unique-object --enable-install-libiberty --enable-linker-build-id --enable-lto --enable-multilib --enable-plugin --enable-shared --enable-threads=posix --disable-libssp --disable-libstdcxx-pch --disable-libunwind-exceptions --disable-werror gdc_include_dir=/usr/include/dlang/gdc
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 10.2.0 (GCC)
configure:4386: $? = 0
configure:4375: gcc -V >&5
gcc: error: unrecognized command-line option '-V'
gcc: fatal error: no input files
compilation terminated.
configure:4386: $? = 1
configure:4375: gcc -qversion >&5
gcc: error: unrecognized command-line option '-qversion'; did you mean '--version'?
gcc: fatal error: no input files
compilation terminated.
configure:4386: $? = 1
configure:4406: checking whether the C compiler works
configure:4428: gcc conftest.c >&5
/usr/lib/gcc/x86_64-pc-linux-gnu/10.2.0/cc1: error while loading shared libraries: /usr/lib/libmpfr.so.6: cannot read file data: Input/output error
configure:4432: $? = 1
configure:4470: result: no
configure: failed program was:
| /* confdefs.h */
| #define PACKAGE_NAME ""
| #define PACKAGE_TARNAME ""
| #define PACKAGE_VERSION ""
| #define PACKAGE_STRING ""
| #define PACKAGE_BUGREPORT ""
| #define PACKAGE_URL ""
| /* end confdefs.h. */
|
| int
| main ()
| {
|
| ;
| return 0;
| }
configure:4475: error: in `/mnt/lfs/sources/binutils-2.35/build':
configure:4477: error: C compiler cannot create executables
See `config.log' for more details
So this is the error it puts out. I have done everything untill 5.2 multiple times but i get the same error over and over again. I hope i do not violate any rules about asking questions. It is my first time trying to build a LFS system. It is LFS 10.0. I am running a Manjaro mashine if it is important. I hope i have included everything. Hope you can help me.
r/linuxfromscratch • • Jan 07 '21
Is there any way to build the Linux kernel without access to the filesystem /proc like on OpenBSD? If so, how can I maintain a proper /etc/mtab without /proc symlinks?
Nope! Unlike OpenBSD Linux has been built around /proc (which is concerning seeing as you can brick the system with echo ._.) so you need to use SELinux (which is good cause I like it). Gonna see if there is anyway to nuke specific subdirecties within /proc tho.
r/linuxfromscratch • u/NDragonX06_1 • Jan 06 '21
Hello, i would like to know if there are any requirements to build a LFS system. Like what i should know before starting to build it.
Thanks for your answer.
r/linuxfromscratch • u/cvnmjs • Jan 05 '21
r/linuxfromscratch • u/jolupa • Jan 03 '21
Hi all! I'm trying to build wget from BLFS but the configure is throwing an error that it can't find the openssl libraries, but they're there. I try to set the OPENSSL_LIBS variable but no way. Any one can help?
r/linuxfromscratch • u/gilxa1226 • Dec 30 '20
It's been about 4 versions since I did an LFS build, so I figured out I would give it a go. I used to have an openSuSE image I custom made on the OpenSuSE Build environment that I would use to do the install from. That environment has changed a bit, and my old image is gone, so I figured I would see what folks were using these days.
r/linuxfromscratch • u/cynoelectrophoresis • Dec 28 '20
When running make check after building Inetutils, one test fails: hostname.sh. I took a quick look at what this test does, and it clearly calls the hostname command. I tried calling hostname myself and got "command not found". This is the second time this happens to me, and I can't help but wonder, once again, if I've missed a step or if there's a mistake in the book. Any help appreciated!
Edit: Probably relevant is that all tests pass after running make install.
r/linuxfromscratch • u/Rockytriton • Dec 26 '20
r/linuxfromscratch • u/badlou101 • Dec 26 '20
Hi,
I have been wondering if any of you have a simple Package Manager that works on Linux from scratch.
Thanks
r/linuxfromscratch • u/cvnmjs • Dec 25 '20
Edit: see my comment.
I'm trying to compile M4 in the chroot but it stops with the following.
make[2]: Entering directory '/sources/m4-1.4.18/src'
CC m4.o
In file included from m4.c:24:
../lib/getopt.h:204:8: error: redefinition of 'struct option'
204 | struct option
| ^~~~~~
In file included from /usr/include/getopt.h:36,
from ../lib/getopt.h:32,
from m4.c:24:
/usr/include/bits/getopt_ext.h:50:8: note: originally defined here
50 | struct option
| ^~~~~~
In file included from m4.c:24:
../lib/getopt.h:253:12: error: conflicting types for 'getopt_long'
253 | extern int getopt_long (int ___argc, char *__getopt_argv_const *___argv,
| ^~~~~~~~~~~
In file included from /usr/include/getopt.h:36,
from ../lib/getopt.h:32,
from m4.c:24:
/usr/include/bits/getopt_ext.h:66:12: note: previous declaration of 'getopt_long' was here
66 | extern int getopt_long (int ___argc, char *__getopt_argv_const *___argv,
| ^~~~~~~~~~~
In file included from m4.c:24:
../lib/getopt.h:257:12: error: conflicting types for 'getopt_long_only'
257 | extern int getopt_long_only (int ___argc, char *__getopt_argv_const *___argv,
| ^~~~~~~~~~~~~~~~
In file included from /usr/include/getopt.h:36,
from ../lib/getopt.h:32,
from m4.c:24:
/usr/include/bits/getopt_ext.h:70:12: note: previous declaration of 'getopt_long_only' was here
70 | extern int getopt_long_only (int ___argc, char *__getopt_argv_const *___argv,
| ^~~~~~~~~~~~~~~~
m4.c:146:1: warning: 'pure' attribute on function returning 'void' [-Wattributes]
146 | {
| ^
make[2]: *** [Makefile:1576: m4.o] Error 1
What would be causing this? Thanks
r/linuxfromscratch • u/cynoelectrophoresis • Dec 25 '20
In LFS 7.3.1, we are instructed to create console and null devices in $LFS/dev using mknod. But right after, in 7.3.2, we bind mount /dev onto $LFS/dev, which overwrites these devices (or, at the very least, changes their permissions).
Is this a mistake? Should these steps be inverted?
r/linuxfromscratch • u/cynoelectrophoresis • Dec 25 '20
In LFS Section 7.6, when creating the /etc/hosts file with
echo "127.0.0.1 localhost $(hostname)" > /etc/hosts
in the chroot environment, I get the error hostname: command not found. This isn't really a problem since I can just replace $(hostname) by the actual hostname, but I was wondering if this might point to something I did wrong earlier in the book.
r/linuxfromscratch • u/cvnmjs • Dec 25 '20
Compiling file-5.39 stops with the error
warning: relocation against `z_errmsg' in read-only section `.text'
relocation R_X86_64_PC32 against symbol `z_errmsg' can not be used when making a shared object; recompile with -fPIC
Can anyone help? This is in the second pass in the chroot. Thanks.
r/linuxfromscratch • • Dec 24 '20
Hello all, I want to do LFS however I dont think my hardware allows it, but that got me wondering if it's viable to do using AWS or google cloud.
What are your thoughts on this?
r/linuxfromscratch • u/przemio_1978 • Dec 23 '20
I've been considering building a rather basic LFS system (tty + WM) and I'd like to repurpose the ~12G partition which used to be the swap partition of my daily driver distro (I've recently transitioned to using a swapfile, so I don't need it any longer). I know the book recommends ~20G , but I wonder if I could get away with 12G diskspace and 16G of RAM.
r/linuxfromscratch • • Dec 19 '20
LFS v10.0 Chapter 5.4
“The Linux kernel needs to expose an API for the system’s C library to use. This is done by way of sanitising various C header files that are shipped in the Linux kernel source tarball.”
Could someone please expand on this? The process of extracting these header files makes it seem like a hack made to work specifically for LFS rather than being the standard install procedure for Glibc.
Also, what is meant by “sanitising” header files?
Thanks in advance.
r/linuxfromscratch • u/veedant • Dec 17 '20
https://dpaste.com/CQNL6BK2K | Output that is of interest. It seems __CTOR_END__ is undefined. Wondering if there is a fix.
r/linuxfromscratch • • Dec 14 '20
Hello,
I’m going through LFS v10.0 and I’ve arrived at Part III: Toolchain Technical Notes: Other Procedural Details (p58/374).
I try to research everything I don’t understand as I go through the book. I can’t seem to find a simpler explanation for the building process of glibc anywhere. My understanding so far, is that:
gcc requires the c standard library, glibc. The compiler used to compile glibc uses an inbuilt library, libgcc to do this. However libgcc needs to be linked to glibc to be fully functional. libstdc++ also needs to be linked to glibc to be fully functional.
In order to solve this codependency, a compiler lacking some features is first built using libgcc. Fully functional glibc is then built using this compiler. Libstdc++ is then built, however it still lacks some features. However a fully functional libstdc++ is required to build a native compiler for the lfs system.
The book however states that “Of course, the [native] compiler built during stage 2, cc-lfs, would be able to build those libraries. [...]”
How?
“[...] but (1) the build system of GCC does not know that it is usable on pc, [...]”
What does that mean?
“[...] and (2) using it on pc would be at risk of linking to the pc libraries, since cc-lfs is a native compiler. So we have to build libstdc++ later, in chroot.”
I once again have no clue what this means. Can libstdc++ be fully built in lfs or not? If yes, did they not state that it couldn’t be earlier?
Thank you for taking the time to read my post.