Last active
July 24, 2020 22:30
-
-
Save farwydi/502b132bd6b1e8259e9438e88e888b1c to your computer and use it in GitHub Desktop.
SFL
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
apt-get install build-essential texinfo flex bison -y | |
export LFS=/mnt/lfs | |
# DO | |
mkfs.ext4 /dev/disk/by-id/scsi-0DO_Volume_volume-lon1-01 | |
mkdir -pv $LFS | |
mount -o discard,defaults /dev/disk/by-id/scsi-0DO_Volume_volume-lon1-01 $LFS | |
echo /dev/disk/by-id/scsi-0DO_Volume_volume-lon1-01 /mnt/volume_lon1_01 ext4 defaults,nofail,discard 0 0 | sudo tee -a /etc/fstab | |
mkdir -pv $LFS | |
mount -v -t ext4 /dev/<xxx> $LFS | |
#mkdir -pv $LFS | |
#mount -v -t ext4 /dev/<xxx> $LFS | |
#mkdir -v $LFS/usr | |
#mount -v -t ext4 /dev/<yyy> $LFS/usr | |
mkdir -v $LFS/sources | |
chmod -v a+wt $LFS/sources | |
wget http://www.linuxfromscratch.org/lfs/view/stable/wget-list | |
wget --input-file=wget-list --continue --directory-prefix=$LFS/sources | |
wget http://www.linuxfromscratch.org/lfs/view/stable/md5sums | |
pushd $LFS/sources | |
md5sum -c md5sums | |
popd | |
mkdir -v $LFS/tools | |
ln -sv $LFS/tools / | |
groupadd lfs | |
useradd -s /bin/bash -g lfs -m -k /dev/null lfs | |
passwd lfs | |
chown -v lfs $LFS/tools | |
chown -v lfs $LFS/sources | |
su - lfs | |
cat > ~/.bash_profile << "EOF" | |
exec env -i HOME=$HOME TERM=$TERM PS1='\u:\w\$ ' /bin/bash | |
EOF | |
cat > ~/.bashrc << "EOF" | |
set +h | |
umask 022 | |
LFS=/mnt/lfs | |
LC_ALL=POSIX | |
LFS_TGT=$(uname -m)-lfs-linux-gnu | |
PATH=/tools/bin:/bin:/usr/bin | |
export LFS LC_ALL LFS_TGT PATH | |
EOF | |
source ~/.bash_profile | |
export MAKEFLAGS='-j 2' | |
lfs@ubuntu-s-1vcpu-1gb-lon1-01:/mnt/lfs/sources/gcc-9.2.0/build$ history | |
1 cat > ~/.bash_profile << "EOF" | |
2 exec env -i HOME=$HOME TERM=$TERM PS1='\u:\w\$ ' /bin/bash | |
3 EOF | |
4 cat > ~/.bashrc << "EOF" | |
5 set +h | |
6 umask 022 | |
7 LFS=/mnt/lfs | |
8 LC_ALL=POSIX | |
9 LFS_TGT=$(uname -m)-lfs-linux-gnu | |
10 PATH=/tools/bin:/bin:/usr/bin | |
11 export LFS LC_ALL LFS_TGT PATH | |
12 EOF | |
13 source ~/.bash_profile | |
14 ls -la | |
15 cd $LFS | |
16 ls -la | |
17 cd sources/ | |
18 ls | |
19 cd ~ | |
20 pwd | |
21 echo $LFS | |
22 cd $LFS | |
23 cd sources/ | |
24 ls -la | |
25 tar -xf binutils-2.34.tar.xz | |
26 ls | |
27 cd binutils-2.34 | |
28 ls | |
29 mkdir -v build | |
30 cd build | |
31 time ../configure --prefix=/tools --with-sysroot=$LFS --with-lib-path=/tools/lib --target=$LFS_TGT --disable-nls --disable-werror | |
32 cat > version-check.sh << "EOF" | |
33 #!/bin/bash | |
34 # Simple script to list version numbers of critical development tools | |
35 export LC_ALL=C | |
36 bash --version | head -n1 | cut -d" " -f2-4 | |
37 MYSH=$(readlink -f /bin/sh) | |
38 echo "/bin/sh -> $MYSH" | |
39 echo $MYSH | grep -q bash || echo "ERROR: /bin/sh does not point to bash" | |
40 unset MYSH | |
41 echo -n "Binutils: "; ld --version | head -n1 | cut -d" " -f3- | |
42 bison --version | head -n1 | |
43 if [ -h /usr/bin/yacc ]; then | |
44 echo "/usr/bin/yacc -> `readlink -f /usr/bin/yacc`"; | |
45 elif [ -x /usr/bin/yacc ]; then | |
46 echo yacc is `/usr/bin/yacc --version | head -n1` | |
47 else | |
48 echo "yacc not found" | |
49 fi | |
50 bzip2 --version 2>&1 < /dev/null | head -n1 | cut -d" " -f1,6- | |
51 echo -n "Coreutils: "; chown --version | head -n1 | cut -d")" -f2 | |
52 diff --version | head -n1 | |
53 find --version | head -n1 | |
54 gawk --version | head -n1 | |
55 if [ -h /usr/bin/awk ]; then | |
56 echo "/usr/bin/awk -> `readlink -f /usr/bin/awk`"; | |
57 elif [ -x /usr/bin/awk ]; then | |
58 echo awk is `/usr/bin/awk --version | head -n1` | |
59 else | |
60 echo "awk not found" | |
61 fi | |
62 gcc --version | head -n1 | |
63 g++ --version | head -n1 | |
64 ldd --version | head -n1 | cut -d" " -f2- # glibc version | |
65 grep --version | head -n1 | |
66 gzip --version | head -n1 | |
67 cat /proc/version | |
68 m4 --version | head -n1 | |
69 make --version | head -n1 | |
70 patch --version | head -n1 | |
71 echo Perl `perl -V:version` | |
72 python3 --version | |
73 sed --version | head -n1 | |
74 tar --version | head -n1 | |
75 makeinfo --version | head -n1 # texinfo version | |
76 xz --version | head -n1 | |
77 echo 'int main(){}' > dummy.c && g++ -o dummy dummy.c | |
78 if [ -x dummy ] | |
79 then echo "g++ compilation OK"; | |
80 else echo "g++ compilation failed"; fi | |
81 rm -f dummy.c dummy | |
82 EOF | |
83 bash version-check.sh | |
84 pwd | |
85 cd /mnt/lfs/sources/binutils-2.34/build/ | |
86 time ../configure --prefix=/tools --with-sysroot=$LFS --with-lib-path=/tools/lib --target=$LFS_TGT --disable-nls --disable-werror | |
87 ls | |
88 make | |
89 case $(uname -m) in x86_64) mkdir -v /tools/lib && ln -sv lib /tools/lib64 ;; esac | |
90 make install | |
91 cd .. | |
92 cd .. | |
93 ls -la ../tools/ | |
94 ls -la ../tools/bin/ | |
95 tar -xf gcc-9.2.0.tar.xz | |
96 cd gcc-9.2.0 | |
97 tar -xf ../mpfr-4.0.2.tar.xz | |
98 mv -v mpfr-4.0.2 mpfr | |
99 tar -xf ../gmp-6.2.0.tar.xz | |
100 mv -v gmp-6.2.0 gmp | |
101 tar -xf ../mpc-1.1.0.tar.gz | |
102 mv -v mpc-1.1.0 mpc | |
103 for file in gcc/config/{linux,i386/linux{,64}}.h; do cp -uv $file{,.orig}; sed -e 's@/lib\(64\)\?\(32\)\?/ld@/tools&@g' -e 's@/usr@/tools@g' $file.orig > $file; echo ' | |
#undef STANDARD_STARTFILE_PREFIX_1 | |
#undef STANDARD_STARTFILE_PREFIX_2 | |
#define STANDARD_STARTFILE_PREFIX_1 "/tools/lib/" | |
#define STANDARD_STARTFILE_PREFIX_2 ""' >> $file | |
touch $file.orig; done | |
104 case $(uname -m) in x86_64) sed -e '/m64=/s/lib64/lib/' -i.orig gcc/config/i386/t-linux64; ;; esac | |
105 mkdir -v build | |
106 cd build | |
107 ../configure --target=$LFS_TGT --prefix=/tools --with-glibc-version=2.11 --with-sysroot=$LFS | |
--with-newlib --without-headers --with-local-prefix=/tools --with-native-system-header-dir=/tools/include --disable-nls --disable-shared --disable-multilib --disable-decimal-float | |
--disable-threads --disable-libatomic --disable-libgomp --disable-libquadmath --disable-libssp | |
--disable-libvtv --disable-libstdcxx --enable-languages=c,c++ | |
108 time make | |
109 time make | |
110 dmesg | |
111 history |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(lfs chroot) root:/sources/eudev-3.2.9# history | |
363 cc dummy.c -v -Wl,--verbose &> dummy.log | |
364 readelf -l a.out | grep ': /lib' | |
365 grep -o '/usr/lib.*/crt[1in].*succeeded' dummy.log | |
366 grep -B4 '^ /usr/include' dummy.log | |
367 grep 'SEARCH.*/usr/lib' dummy.log |sed 's|; |\n|g' | |
368 grep "/lib.*/libc.so.6 " dummy.log | |
369 grep found dummy.log | |
370 rm -v dummy.c a.out dummy.log | |
371 mkdir -pv /usr/share/gdb/auto-load/usr/lib | |
372 mv -v /usr/lib/*gdb.py /usr/share/gdb/auto-load/usr/lib | |
373 cd .. | |
374 cd .. | |
375 tar -xf pkg-config-0.29.2.tar.gz | |
376 cd pkg-config-0.29.2 | |
377 ./configure --prefix=/usr --with-internal-glib --disable-host-tool --docdir=/usr/share/doc/pkg-config-0.29.2 | |
378 make | |
379 make check | |
380 make install | |
381 cd .. | |
382 rm -rf ncurses-6.2/ | |
383 tar -xf ncurses-6.2.tar.gz | |
384 cd ncurses-6.2 | |
385 sed -i '/LIBTOOL_INSTALL/d' c++/Makefile.in | |
386 ./configure --prefix=/usr --mandir=/usr/share/man --with-shared --without-debug --without-normal --enable-pc-files --enable-widec | |
387 make | |
388 make install | |
389 mv -v /usr/lib/libncursesw.so.6* /lib | |
390 ln -sfv ../../lib/$(readlink /usr/lib/libncursesw.so) /usr/lib/libncursesw.so | |
391 for lib in ncurses form panel menu ; do rm -vf /usr/lib/lib${lib}.so; echo "INPUT(-l${lib}w)" > /usr/lib/lib${lib}.so; ln -sfv ${lib}w.pc /usr/lib/pkgconfig/${lib}.pc; done | |
392 rm -vf /usr/lib/libcursesw.so | |
393 echo "INPUT(-lncursesw)" > /usr/lib/libcursesw.so | |
394 ln -sfv libncurses.so /usr/lib/libcurses.so | |
395 mkdir -v /usr/share/doc/ncurses-6.2 | |
396 cp -v -R doc/* /usr/share/doc/ncurses-6.2 | |
397 cd .. | |
398 tar -xf libcap-2.31.tar.xz | |
399 cd libcap-2.31 | |
400 sed -i '/install.*STA...LIBNAME/d' libcap/Makefile | |
401 make lib=lib | |
402 make test | |
403 make lib=lib install | |
404 chmod -v 755 /lib/libcap.so.2.31 | |
405 cd .. | |
406 rm -rf sed-4.8/ | |
407 tar -xf sed-4.8.tar.xz | |
408 cd sed-4.8 | |
409 sed -i 's/usr/tools/' build-aux/help2man | |
410 sed -i 's/testsuite.panic-tests.sh//' Makefile.in | |
411 ./configure --prefix=/usr --bindir=/bin | |
412 make | |
413 make html | |
414 make check | |
415 make install | |
416 install -d -m755 /usr/share/doc/sed-4.8 | |
417 install -m644 doc/sed.html /usr/share/doc/sed-4.8 | |
418 cd .. | |
419 tar -xf psmisc-23.2.tar.xz | |
420 cd psmisc-23.2 | |
421 ./configure --prefix=/usr | |
422 make | |
423 make install | |
424 mv -v /usr/bin/fuser /bin | |
425 mv -v /usr/bin/killall /bin | |
426 cd .. | |
427 ls -la | |
428 tat -xf iana-etc-2.30.tar.bz2 | |
429 cd iana-etc-2.30.tar.bz2 | |
430 tar -xf iana-etc-2.30.tar.bz2 | |
431 cd iana-etc-2.30 | |
432 make | |
433 make install | |
434 cd .. | |
435 tar -xf bison-3.5.2 | |
436 rm -rf bison-3.5.2/ | |
437 tar -xf bison-3.5.2.tar.xz | |
438 cd bison-3.5.2 | |
439 t | |
440 ./configure --prefix=/usr --docdir=/usr/share/doc/bison-3.5.2 | |
441 make install | |
442 cd .. | |
443 tar -xf flex-2.6.4.tar.gz | |
444 cd flex-2.6.4 | |
445 sed -i "/math.h/a #include <malloc.h>" src/flexdef.h | |
446 HELP2MAN=/tools/bin/true ./configure --prefix=/usr --docdir=/usr/share/doc/flex-2.6.4 | |
447 make | |
448 make check | |
449 make install | |
450 ln -sv flex /usr/bin/lex | |
451 cd .. | |
452 rm -rf grep-3.4/ | |
453 tar -xf grep-3.4.tar.xz | |
454 cd grep-3.4 | |
455 ./configure --prefix=/usr --bindir=/bin | |
456 make | |
457 make check | |
458 make install | |
459 cd ,, | |
460 cd .. | |
461 rm -rf bash-5.0/ | |
462 tar -xf bash-5.0.tar.gz | |
463 cd bash-5.0 | |
464 patch -Np1 -i ../bash-5.0-upstream_fixes-1.patch | |
465 ./configure --prefix=/usr --docdir=/usr/share/doc/bash-5.0 --without-bash-malloc --with-installed-readline | |
466 make | |
467 chown -Rv nobody . | |
468 su nobody -s /bin/bash -c "PATH=$PATH HOME=/home make tests" | |
469 make install | |
470 mv -vf /usr/bin/bash /bin | |
471 exec /bin/bash --login +h | |
472 cd .. | |
473 tar -xf libtool-2.4.6.tar.xz | |
474 cd libtool-2.4.6 | |
475 ./configure --prefix=/usr | |
476 make | |
477 make check | |
478 make install | |
479 cd .. | |
480 tar -xf gdbm-1.18.1.tar.gz | |
481 cd gdbm-1.18.1 | |
482 ./configure --prefix=/usr --disable-static --enable-libgdbm-compat | |
483 make | |
484 make check | |
485 make install | |
486 cd .. | |
487 tar -xf gperf-3.1.tar.gz | |
488 cd gperf-3.1 | |
489 ./configure --prefix=/usr --docdir=/usr/share/doc/gperf-3.1 | |
490 makw | |
491 make | |
492 make -j1 check | |
493 make install | |
494 cd .. | |
495 tar -xf expat-2.2.9.tar.xz | |
496 cd expat-2.2.9 | |
497 sed -i 's|usr/bin/env |bin/|' run.sh.in | |
498 ./configure --prefix=/usr --disable-static --docdir=/usr/share/doc/expat-2.2.9 | |
499 make | |
500 make check | |
501 make install | |
502 install -v -m644 doc/*.{html,png,css} /usr/share/doc/expat-2.2.9 | |
503 cd .. | |
504 tar -xf inetutils-1.9.4.tar.xz | |
505 cd inetutils-1.9.4 | |
506 ./configure --prefix=/usr --localstatedir=/var --disable-logger --disable-whois --disable-rcp --disable-rexec --disable-rlogin --disable-rsh --disable-servers | |
507 make | |
508 make check | |
509 make install | |
510 mv -v /usr/bin/{hostname,ping,ping6,traceroute} /bin | |
511 mv -v /usr/bin/ifconfig /sbin | |
512 cd .. | |
513 rm -rf perl-5.30.1/ | |
514 tar -xf perl-5.30.1.tar.xz | |
515 cd perl-5.30.1 | |
516 echo "127.0.0.1 localhost $(hostname)" > /etc/hosts | |
517 export BUILD_ZLIB=False | |
518 export BUILD_BZIP2=0 | |
519 sh Configure -des -Dprefix=/usr -Dvendorprefix=/usr -Dman1dir=/usr/share/man/man1 -Dman3dir=/usr/share/man/man3 -Dpager="/usr/bin/less -isR" -Duseshrplib -Dusethreads | |
520 make | |
521 make install | |
522 unset BUILD_ZLIB BUILD_BZIP2 | |
523 cd .. | |
524 tar -xf XML-Parser-2.46.tar.gz | |
525 cd XML-Parser-2.46 | |
526 perl Makefile.PL | |
527 make | |
528 make install | |
529 cd .. | |
530 tar -xf intltool-0.51.0.tar.gz | |
531 cd intltool-0.51.0 | |
532 sed -i 's:\\\${:\\\$\\{:' intltool-update.in | |
533 ./configure --prefix=/usr | |
534 make | |
535 make install | |
536 install -v -Dm644 doc/I18N-HOWTO /usr/share/doc/intltool-0.51.0/I18N-HOWTO | |
537 cd .. | |
538 tar -xf autoconf-2.69.tar.xz | |
539 cd autoconf-2.69 | |
540 sed '361 s/{/\\{/' -i bin/autoscan.in | |
541 ./configure --prefix=/usr | |
542 make | |
543 make install | |
544 cd .. | |
545 tar -xf automake-1.16.1.tar.xz | |
546 cd automake-1.16.1 | |
547 ./configure --prefix=/usr --docdir=/usr/share/doc/automake-1.16.1 | |
548 makw | |
549 make | |
550 make -j4 check | |
551 make install | |
552 cd .. | |
553 tar -xf kmod-26.tar.xz | |
554 cd kmod-26 | |
555 ./configure --prefix=/usr --bindir=/bin --sysconfdir=/etc --with-rootlibdir=/lib --with-xz --with-zlib | |
556 make | |
557 make install | |
558 for target in depmod insmod lsmod modinfo modprobe rmmod; do ln -sfv ../bin/kmod /sbin/$target; done | |
559 ln -sfv kmod /bin/lsmod | |
560 cd .. | |
561 rm -rf gettext-0.20.1/ | |
562 tar -xf gettext-0.20.1.tar.xz | |
563 cd gettext-0.20.1 | |
564 ./configure --prefix=/usr --disable-static --docdir=/usr/share/doc/gettext-0.20.1 | |
565 make | |
566 chmod -v 0755 /usr/lib/preloadable_libintl.so | |
567 make check | |
568 make install | |
569 chmod -v 0755 /usr/lib/preloadable_libintl.so | |
570 cd .. | |
571 tar -xf libffi-3.3.tar.gz | |
572 tar -xf elfutils-0.178.tar.bz2 | |
573 cd elfutils-0.178 | |
574 ./configure --prefix=/usr --disable-debuginfod | |
575 make | |
576 make | |
577 make -C libelf install | |
578 install -vm644 config/libelf.pc /usr/lib/pkgconfig | |
579 rm /usr/lib/libelf.a | |
580 cd .. | |
581 cde libffi-3.3 | |
582 cd libffi-3.3 | |
583 ./configure --prefix=/usr --disable-static --with-gcc-arch=native | |
584 make | |
585 make install | |
586 cd .. | |
587 tar -xf openssl-1.1.1d.tar.gz | |
588 cd openssl-1.1.1d | |
589 ./config --prefix=/usr --openssldir=/etc/ssl --libdir=lib shared zlib-dynamic | |
590 make | |
591 sed -i '/INSTALL_LIBS/s/libcrypto.a libssl.a//' Makefile | |
592 make MANSUFFIX=ssl install | |
593 mv -v /usr/share/doc/openssl /usr/share/doc/openssl-1.1.1d | |
594 cp -vfr doc/* /usr/share/doc/openssl-1.1.1d | |
595 cd .. | |
596 rm -rf Python-3.8.1/ | |
597 tar -xf Python-3.8.1.tar.xz | |
598 cd Python-3.8.1 | |
599 ./configure --prefix=/usr --enable-shared --with-system-expat --with-system-ffi --with-ensurepip=yes | |
600 make | |
601 make install | |
602 chmod -v 755 /usr/lib/libpython3.8.so | |
603 chmod -v 755 /usr/lib/libpython3.so | |
604 ln -sfv pip3.8 /usr/bin/pip3 | |
605 install -v -dm755 /usr/share/doc/python-3.8.1/html | |
606 tar --strip-components=1 --no-same-owner --no-same-permissions -C /usr/share/doc/python-3.8.1/html -xvf ../python-3.8.1-docs-html.tar.bz2 | |
607 cd .. | |
608 tar -xf ninja-1.10.0.tar.gz | |
609 cd ninja-1.10.0 | |
610 export NINJAJOBS=4 | |
611 sed -i '/int Guess/a \ | |
int j = 0;\ | |
char* jobs = getenv( "NINJAJOBS" );\ | |
if ( jobs != NULL ) j = atoi( jobs );\ | |
if ( j > 0 ) return j;\ | |
' src/ninja.cc | |
612 python3 configure.py --bootstrap | |
613 ./ninja ninja_test | |
614 ./ninja_test --gtest_filter=-SubprocessTest.SetWithLots | |
615 install -vm755 ninja /usr/bin/ | |
616 install -vDm644 misc/bash-completion /usr/share/bash-completion/completions/ninja | |
617 install -vDm644 misc/zsh-completion /usr/share/zsh/site-functions/_ninja | |
618 cd .. | |
619 tar -xf meson-0.53.1.tar.gz | |
620 cd meson-0.53.1 | |
621 python3 setup.py build | |
622 python3 setup.py install --root=dest | |
623 cp -rv dest/* / | |
624 cd .. | |
625 rm -rf coreutils-8.31/ | |
626 tar -xf coreutils-8.31.tar.xz | |
627 cd coreutils-8.31 | |
628 patch -Np1 -i ../coreutils-8.31-i18n-1.patch | |
629 sed -i '/test.lock/s/^/#/' gnulib-tests/gnulib.mk | |
630 autoreconf -fiv | |
631 FORCE_UNSAFE_CONFIGURE=1 ./configure --prefix=/usr --enable-no-install-program=kill,uptime | |
632 make | |
633 make NON_ROOT_USERNAME=nobody check-root | |
634 echo "dummy:x:1000:nobody" >> /etc/group | |
635 chown -Rv nobody . | |
636 su nobody -s /bin/bash -c "PATH=$PATH make RUN_EXPENSIVE_TESTS=yes check" | |
637 sed -i '/dummy/d' /etc/group | |
638 make install | |
639 mv -v /usr/bin/{cat,chgrp,chmod,chown,cp,date,dd,df,echo} /bin | |
640 mv -v /usr/bin/{false,ln,ls,mkdir,mknod,mv,pwd,rm} /bin | |
641 mv -v /usr/bin/{rmdir,stty,sync,true,uname} /bin | |
642 mv -v /usr/bin/chroot /usr/sbin | |
643 mv -v /usr/share/man/man1/chroot.1 /usr/share/man/man8/chroot.8 | |
644 sed -i s/\"1\"/\"8\"/1 /usr/share/man/man8/chroot.8 | |
645 mv -v /usr/bin/{head,nice,sleep,touch} /bin | |
646 cd .. | |
647 tar -xf check-0.14.0.tar.gz | |
648 cd check-0.14.0 | |
649 ./configure --prefix=/usr | |
650 make | |
651 make check | |
652 make docdir=/usr/share/doc/check-0.14.0 install && sed -i '1 s/tools/usr/' /usr/bin/checkmk | |
653 cd .. | |
654 rm -rf diffutils-3.7/ | |
655 tar -xf diffutils-3.7.tar.xz | |
656 cd diffutils-3.7 | |
657 ./configure --prefix=/usr | |
658 make | |
659 make install | |
660 cd .. | |
661 rm -rf gawk-5.0.1/ | |
662 tar -xf gawk-5.0.1.tar.xz | |
663 cd gawk-5.0.1 | |
664 sed -i 's/extras//' Makefile.in | |
665 ./configure --prefix=/usr | |
666 make | |
667 make install | |
668 mkdir -v /usr/share/doc/gawk-5.0.1 | |
669 cp -v doc/{awkforai.txt,*.{eps,pdf,jpg}} /usr/share/doc/gawk-5.0.1 | |
670 cd .,. | |
671 cd .. | |
672 rm -rf findutils-4.7.0/ | |
673 tar -xf findutils-4.7.0.tar.xz | |
674 cd findutils-4.7.0 | |
675 ./configure --prefix=/usr --localstatedir=/var/lib/locate | |
676 make | |
677 make install | |
678 mv -v /usr/bin/find /bin | |
679 sed -i 's|find:=${BINDIR}|find:=/bin|' /usr/bin/updatedb | |
680 cd | |
681 cd - | |
682 cd .. | |
683 tar -xf groff-1.22.4.tar.gz | |
684 cd groff-1.22.4 | |
685 PAGE=<paper_size> ./configure --prefix=/usr | |
686 PAGE=A4 ./configure --prefix=/usr | |
687 make -j1 | |
688 make install | |
689 cd .. | |
690 ls -la | |
691 ls -la | grep g | |
692 ls -la | grep gr | |
693 tar -xf grub-2.04.tar.xz | |
694 cd grub-2.04 | |
695 ./configure --prefix=/usr --sbindir=/sbin --sysconfdir=/etc --disable-efiemu --disable-werror | |
696 make | |
697 make install | |
698 mv -v /etc/bash_completion.d/grub /usr/share/bash-completion/completions | |
699 cd .. | |
700 tar -xf less-551.tar.gz | |
701 cd less-551 | |
702 ./configure --prefix=/usr --sysconfdir=/etc | |
703 make | |
704 make install | |
705 cd .. | |
706 rm -rf gzip-1.10/ | |
707 tar -xf gzip-1.10.tar.xz | |
708 cd gzip-1.10 | |
709 ./configure --prefix=/usr | |
710 make | |
711 make install | |
712 mv -v /usr/bin/gzip /bin | |
713 cd .. | |
714 tar -xf zstd-1.4.4.tar.gz | |
715 cd zstd-1.4.4 | |
716 make | |
717 make prefix=/usr install | |
718 rm -v /usr/lib/libzstd.a | |
719 mv -v /usr/lib/libzstd.so.* /lib | |
720 ln -sfv ../../lib/$(readlink /usr/lib/libzstd.so) /usr/lib/libzstd.so | |
721 cd .. | |
722 tar -xf iproute2-5.5.0.tar.xz | |
723 cd iproute2-5.5.0 | |
724 sed -i /ARPD/d Makefile | |
725 rm -fv man/man8/arpd.8 | |
726 sed -i 's/.m_ipt.o//' tc/Makefile | |
727 make | |
728 make DOCDIR=/usr/share/doc/iproute2-5.5.0 install | |
729 cd .. | |
730 rm -rf kbd-2.2.0/ | |
731 tar -xf kbd-2.2.0 | |
732 tar -xf kbd-2.2.0.tar.xz | |
733 cd kbd-2.2.0 | |
734 patch -Np1 -i ../kbd-2.2.0-backspace-1.patch | |
735 sed -i 's/\(RESIZECONS_PROGS=\)yes/\1no/g' configure | |
736 sed -i 's/resizecons.8 //' docs/man/man8/Makefile.in | |
737 PKG_CONFIG_PATH=/tools/lib/pkgconfig ./configure --prefix=/usr --disable-vlock | |
738 make | |
739 make install | |
740 mkdir -v /usr/share/doc/kbd-2.2.0 | |
741 cp -R -v docs/doc/* /usr/share/doc/kbd-2.2.0 | |
742 cd .. | |
743 tar -xf libpipeline-1.5.2.tar.gz | |
744 cd libpipeline-1.5.2 | |
745 ./configure --prefix=/usr | |
746 make | |
747 make install | |
748 cd .. | |
749 rm -rf make-4.3/ | |
750 tar -xf make-4.3.tar.gz | |
751 cd make-4.3 | |
752 ./configure --prefix=/usr | |
753 make | |
754 make install | |
755 cd .. | |
756 rm -rf patch-2.7.6/ | |
757 tar -xf patch-2.7.6.tar.xz | |
758 cd patch-2.7.6 | |
759 ./configure --prefix=/usr | |
760 make | |
761 make install | |
762 cd .. | |
763 tar -xf man-db-2.9.0.tar.xz | |
764 cd man-db-2.9.0 | |
765 ./configure --prefix=/usr --docdir=/usr/share/doc/man-db-2.9.0 --sysconfdir=/etc --disable-setuid --enable-cache-owner=bin --with-browser=/usr/bin/lynx --with-vgrind=/usr/bin/vgrind --with-grap=/usr/bin/grap --with-systemdtmpfilesdir= --with-systemdsystemunitdir= | |
766 make | |
767 make install | |
768 cd .. | |
769 rm -rf tar-1.32/ | |
770 tar -xf tar-1.32.tar.xz | |
771 cd tar-1.32 | |
772 FORCE_UNSAFE_CONFIGURE=1 ./configure --prefix=/usr --bindir=/bin | |
773 make | |
774 make install | |
775 make -C doc install-html docdir=/usr/share/doc/tar-1.32 | |
776 cd .. | |
777 rm -rf texinfo-6.7/ | |
778 tar -xf texinfo-6.7.tar.xz | |
779 cd texinfo-6.7 | |
780 ./configure --prefix=/usr --disable-static | |
781 make | |
782 make install | |
783 make TEXMF=/usr/share/texmf install-tex | |
784 pushd /usr/share/info | |
785 rm -v dir | |
786 for f in *; do install-info $f dir 2>/dev/null; done | |
787 popd | |
788 cd .. | |
789 tar -xf vim-8.2.0190.tar.gz | |
790 cd vim-8.2.0190 | |
791 echo '#define SYS_VIMRC_FILE "/etc/vimrc"' >> src/feature.h | |
792 ./configure --prefix=/usr | |
793 make | |
794 chown -Rv nobody . | |
795 su nobody -s /bin/bash -c "LANG=en_US.UTF-8 make -j1 test" &> vim-test.log | |
796 make install | |
797 ln -sv vim /usr/bin/vi | |
798 for L in /usr/share/man/{,*/}man1/vim.1; do ln -sv vim.1 $(dirname $L)/vi.1; done | |
799 ln -sv ../vim/vim82/doc /usr/share/doc/vim-8.2.0190 | |
800 cat > /etc/vimrc << "EOF" | |
" Begin /etc/vimrc | |
" Ensure defaults are set before customizing settings, not after | |
source $VIMRUNTIME/defaults.vim | |
let skip_defaults_vim=1 | |
set nocompatible | |
set backspace=2 | |
set mouse= | |
syntax on | |
if (&term == "xterm") || (&term == "putty") | |
set background=dark | |
endif | |
" End /etc/vimrc | |
EOF | |
801 cd .. | |
802 tar -xf procps-ng-3.3.15.tar.xz | |
803 cd procps-ng-3.3.15 | |
804 ./configure --prefix=/usr --exec-prefix= --libdir=/usr/lib --docdir=/usr/share/doc/procps-ng-3.3.15 --disable-static --disable-kill | |
805 make | |
806 sed -i -r 's|(pmap_initname)\\\$|\1|' testsuite/pmap.test/pmap.exp | |
807 sed -i '/set tty/d' testsuite/pkill.test/pkill.exp | |
808 rm testsuite/pgrep.test/pgrep.exp | |
809 make check | |
810 make install | |
811 mv -v /usr/lib/libprocps.so.* /lib | |
812 ln -sfv ../../lib/$(readlink /usr/lib/libprocps.so) /usr/lib/libprocps.so | |
813 cd .. | |
814 tar -xf util-linux-2.35.1.tar.xz | |
815 cd util-linux-2.35.1 | |
816 mkdir -pv /var/lib/hwclock | |
817 ./configure ADJTIME_PATH=/var/lib/hwclock/adjtime --docdir=/usr/share/doc/util-linux-2.35.1 --disable-chfn-chsh --disable-login --disable-nologin --disable-su --disable-setpriv --disable-runuser --disable-pylibmount --disable-static --without-python --without-systemd --without-systemdsystemunitdir | |
818 make | |
819 make install | |
820 cd .. | |
821 tar -xf e2fsprogs-1.45.5.tar.gz | |
822 cd e2fsprogs-1.45.5 | |
823 mkdir -v build | |
824 cd build | |
825 ../configure --prefix=/usr --bindir=/bin --with-root-prefix="" --enable-elf-shlibs --disable-libblkid --disable-libuuid --disable-uuidd --disable-fsck | |
826 make | |
827 make | |
828 make install | |
829 chmod -v u+w /usr/lib/{libcom_err,libe2p,libext2fs,libss}.a | |
830 gunzip -v /usr/share/info/libext2fs.info.gz | |
831 install-info --dir-file=/usr/share/info/dir /usr/share/info/libext2fs.info | |
832 makeinfo -o doc/com_err.info ../lib/et/com_err.texinfo | |
833 install -v -m644 doc/com_err.info /usr/share/info | |
834 install-info --dir-file=/usr/share/info/dir /usr/share/info/com_err.info | |
835 cd .. | |
836 cd .. | |
837 tar -xf sysklogd-1.5.1.tar.gz | |
838 cd sysklogd-1.5.1 | |
839 sed -i '/Error loading kernel symbols/{n;n;d}' ksym_mod.c | |
840 sed -i 's/union wait/int/' syslogd.c | |
841 make | |
842 make BINDIR=/sbin install | |
843 cat > /etc/syslog.conf << "EOF" | |
# Begin /etc/syslog.conf | |
auth,authpriv.* -/var/log/auth.log | |
*.*;auth,authpriv.none -/var/log/sys.log | |
daemon.* -/var/log/daemon.log | |
kern.* -/var/log/kern.log | |
mail.* -/var/log/mail.log | |
user.* -/var/log/user.log | |
*.emerg * | |
# End /etc/syslog.conf | |
EOF | |
844 cd .. | |
845 tar -xf sysvinit-2.96.tar.xz | |
846 cd sysvinit-2.96 | |
847 patch -Np1 -i ../sysvinit-2.96-consolidated-1.patch | |
848 make | |
849 make install | |
850 cd .. | |
851 tar -xf eudev-3.2.9.tar.gz | |
852 cd eudev-3.2.9 | |
853 ./configure --prefix=/usr --bindir=/sbin --sbindir=/sbin --libdir=/usr/lib --sysconfdir=/etc --libexecdir=/lib --with-rootprefix= --with-rootlibdir=/lib --enable-manpages --disable-static | |
854 make | |
855 mkdir -pv /lib/udev/rules.d | |
856 mkdir -pv /etc/udev/rules.d | |
857 make install | |
858 tar -xvf ../udev-lfs-20171102.tar.xz | |
859 make -f udev-lfs-20171102/Makefile.lfs install | |
860 udevadm hwdb --update | |
861 rm -rf /tmp/* | |
862 history |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
chroot "$LFS" /usr/bin/env -i \ | |
HOME=/root TERM="$TERM" \ | |
PS1='(lfs chroot) \u:\w\$ ' \ | |
PATH=/bin:/usr/bin:/sbin:/usr/sbin \ | |
/bin/bash --login |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 fdisk /dev/sda3 | |
2 export LFS=/mnt/lfs | |
3 mkdir -pv $LFS/{dev,proc,sys,run} | |
4 mknod -m 600 $LFS/dev/console c 5 1 | |
5 mknod -m 666 $LFS/dev/null c 1 3 | |
6 mount -v --bind /dev $LFS/dev | |
7 mount -vt devpts devpts $LFS/dev/pts -o gid=5,mode=620 | |
8 mount -vt proc proc $LFS/proc | |
9 mount -vt sysfs sysfs $LFS/sys | |
10 mount -vt tmpfs tmpfs $LFS/run | |
11 if [ -h $LFS/dev/shm ]; then mkdir -pv $LFS/$(readlink $LFS/dev/shm); fi | |
12 df -Th | |
13 chroot "$LFS" /tools/bin/env -i HOME=/root TERM="$TERM" PS1='(lfs chroot) \u:\w\$ ' PATH=/bin:/usr/bin:/sbin:/usr/sbin:/tools/bin /tools/bin/bash --login +h | |
14 history |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment