cat > version-check.sh << "EOF" #!/bin/bash # Simple script to list version numbers of critical development tools export LC_ALL=C bash --version | head -n1 | cut -d" " -f2-4 MYSH=$(readlink -f /bin/sh) echo"/bin/sh -> $MYSH" echo$MYSH | grep -q bash || echo"ERROR: /bin/sh does not point to bash" unset MYSH
echo -n "Binutils: "; ld --version | head -n1 | cut -d" " -f3- bison --version | head -n1
if [ -h /usr/bin/yacc ]; then echo"/usr/bin/yacc -> `readlink -f /usr/bin/yacc`"; elif [ -x /usr/bin/yacc ]; then echo yacc is `/usr/bin/yacc --version | head -n1` else echo"yacc not found" fi
echo -n "Coreutils: "; chown --version | head -n1 | cut -d")" -f2 diff --version | head -n1 find --version | head -n1 gawk --version | head -n1
if [ -h /usr/bin/awk ]; then echo"/usr/bin/awk -> `readlink -f /usr/bin/awk`"; elif [ -x /usr/bin/awk ]; then echo awk is `/usr/bin/awk --version | head -n1` else echo"awk not found" fi
gcc --version | head -n1 g++ --version | head -n1 grep --version | head -n1 gzip --version | head -n1 cat /proc/version m4 --version | head -n1 make --version | head -n1 patch --version | head -n1 echo Perl `perl -V:version` python3 --version sed --version | head -n1 tar --version | head -n1 makeinfo --version | head -n1 # texinfo version xz --version | head -n1
mkdir -pv $LFS/{etc,var} $LFS/usr/{bin,lib,sbin} for i in bin lib sbin; do ln -sv usr/$i$LFS/$i done case $(uname -m) in x86_64) mkdir -pv $LFS/lib64 ;; esac mkdir -pv $LFS/tools
tar xf zlib-1.2.13.tar.xz pushd zlib-1.2.13 ./configure --prefix=/usr make make check make install rm -fv /usr/lib/libz.a popd rm -rf zlib-1.2.13
Bzip2-1.0.8
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
tar xf bzip2-1.0.8.tar.gz pushd bzip2-1.0.8 patch -Np1 -i ../bzip2-1.0.8-install_docs-1.patch sed -i 's@\(ln -s -f \)$(PREFIX)/bin/@\1@' Makefile sed -i "s@(PREFIX)/man@(PREFIX)/share/man@g" Makefile make -f Makefile-libbz2_so make clean make make PREFIX=/usr install cp -av libbz2.so.* /usr/lib ln -sv libbz2.so.1.0.8 /usr/lib/libbz2.so cp -v bzip2-shared /usr/bin/bzip2 for i in /usr/bin/{bzcat,bunzip2}; do ln -sfv bzip2 $i done rm -fv /usr/lib/libbz2.a popd rm -rf bzip2-1.0.8
Xz-5.4.1
1 2 3 4 5 6 7 8 9 10
tar xf xz-5.4.1.tar.xz pushd xz-5.4.1 ./configure --prefix=/usr \ --disable-static \ --docdir=/usr/share/doc/xz-5.4.1 make make check make install popd rm -rf xz-5.4.1
Zstd-1.5.4
1 2 3 4 5 6 7 8
tar xf zstd-1.5.4.tar.gz pushd zstd-1.5.4 make prefix=/usr make check make prefix=/usr install rm -v /usr/lib/libzstd.a popd rm -rf zstd-1.5.4
File-5.44
1 2 3 4 5 6 7 8
tar xf file-5.44.tar.gz pushd file-5.44 ./configure --prefix=/usr make make check make install popd rm -rf file-5.44
Readline-8.2
1 2 3 4 5 6 7 8 9 10 11 12 13 14
tar xf readline-8.2.tar.gz pushd readline-8.2 sed -i '/MV.*old/d' Makefile.in sed -i '/{OLDSUFF}/c:' support/shlib-install patch -Np1 -i ../readline-8.2-upstream_fix-1.patch ./configure --prefix=/usr \ --disable-static \ --with-curses \ --docdir=/usr/share/doc/readline-8.2 make SHLIB_LIBS="-lncursesw" make SHLIB_LIBS="-lncursesw" install install -v -m644 doc/*.{ps,pdf,html,dvi} /usr/share/doc/readline-8.2 popd rm -rf readline-8.2
M4-1.4.19
1 2 3 4 5 6 7 8
tar xf m4-1.4.19.tar.xz pushd m4-1.4.19 ./configure --prefix=/usr make make check make install popd rm -rf m4-1.4.19
Bc-6.2.4
1 2 3 4 5 6 7 8
tar xf bc-6.2.4.tar.xz pushd bc-6.2.4 CC=gcc ./configure --prefix=/usr -G -O3 -r make make test make install popd rm -rf bc-6.2.4
Flex-2.6.4
1 2 3 4 5 6 7 8 9 10 11
tar xf flex-2.6.4.tar.gz pushd flex-2.6.4 ./configure --prefix=/usr \ --docdir=/usr/share/doc/flex-2.6.4 \ --disable-static make make check make install ln -sv flex /usr/bin/lex popd rm -rf flex-2.6.4
tar xf gmp-6.2.1.tar.xz pushd gmp-6.2.1 ./configure --prefix=/usr \ --enable-cxx \ --disable-static \ --docdir=/usr/share/doc/gmp-6.2.1 make make html make check 2>&1 | tee gmp-check-log awk '/# PASS:/{total+=$3} ; END{print total}' gmp-check-log make install make install-html popd rm -rf gmp-6.2.1
MPFR-4.2.0
Note: 测试至关重要
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
tar xf mpfr-4.2.0.tar.xz pushd mpfr-4.2.0 sed -e 's/+01,234,567/+1,234,567 /' \ -e 's/13.10Pd/13Pd/' \ -i tests/tsprintf.c ./configure --prefix=/usr \ --disable-static \ --enable-thread-safe \ --docdir=/usr/share/doc/mpfr-4.2.0 make make html make check make install make install-html popd rm -rf mpfr-4.2.0
MPC-1.3.1
1 2 3 4 5 6 7 8 9 10 11 12
tar xf mpc-1.3.1.tar.gz pushd mpc-1.3.1 ./configure --prefix=/usr \ --disable-static \ --docdir=/usr/share/doc/mpc-1.3.1 make make html make check make install make install-html popd rm -rf mpc-1.3.1
Attr-2.5.1
1 2 3 4 5 6 7 8 9 10 11
tar xf attr-2.5.1.tar.gz pushd attr-2.5.1 ./configure --prefix=/usr \ --disable-static \ --sysconfdir=/etc \ --docdir=/usr/share/doc/attr-2.5.1 make make check make install popd rm -rf attr-2.5.1
Acl-2.3.1
1 2 3 4 5 6 7 8 9
tar xf acl-2.3.1.tar.xz pushd acl-2.3.1 ./configure --prefix=/usr \ --disable-static \ --docdir=/usr/share/doc/acl-2.3.1 make make install popd rm -rf acl-2.3.1
Libcap-2.67
1 2 3 4 5 6 7 8
tar xf libcap-2.67.tar.xz pushd libcap-2.67 sed -i '/install -m.*STA/d' libcap/Makefile make prefix=/usr lib=lib make test make prefix=/usr lib=lib install popd rm -rf libcap-2.67
tar xf sed-4.9.tar.xz pushd sed-4.9 ./configure --prefix=/usr make make html chown -Rv tester . su tester -c "PATH=$PATH make check" make install install -d -m755 /usr/share/doc/sed-4.9 install -m644 doc/sed.html /usr/share/doc/sed-4.9 popd rm -rf sed-4.9
Psmisc-23.6
1 2 3 4 5 6 7
tar xf psmisc-23.6.tar.xz pushd psmisc-23.6 ./configure --prefix=/usr make make install popd rm -rf psmisc-23.6
Gettext-0.21.1
1 2 3 4 5 6 7 8 9 10 11
tar xf gettext-0.21.1.tar.xz pushd gettext-0.21.1 ./configure --prefix=/usr \ --disable-static \ --docdir=/usr/share/doc/gettext-0.21.1 make make check make install chmod -v 0755 /usr/lib/preloadable_libintl.so popd rm -rf gettext-0.21.1
Bison-3.8.2
1 2 3 4 5 6 7 8
tar xf bison-3.8.2.tar.xz pushd bison-3.8.2 ./configure --prefix=/usr --docdir=/usr/share/doc/bison-3.8.2 make make check make install popd rm -rf bison-3.8.2
Grep-3.8
1 2 3 4 5 6 7 8 9
tar xf grep-3.8.tar.xz pushd grep-3.8 sed -i "s/echo/#echo/" src/egrep.sh ./configure --prefix=/usr make make check make install popd rm -rf grep-3.8
tar xf bash-5.2.15.tar.gz pushd bash-5.2.15 ./configure --prefix=/usr \ --without-bash-malloc \ --with-installed-readline \ --docdir=/usr/share/doc/bash-5.2.15 make chown -Rv tester .
su -s /usr/bin/expect tester << EOF set timeout -1 spawn make tests expect eof lassign [wait] _ _ _ value exit $value EOF
make install
popd rm -rf bash-5.2.15
1
exec /usr/bin/bash --login
Libtool-2.4.7
1 2 3 4 5 6 7 8 9
tar xf libtool-2.4.7.tar.xz pushd libtool-2.4.7 ./configure --prefix=/usr make make -k check TESTSUITEFLAGS=-j8 make install rm -fv /usr/lib/libltdl.a popd rm -rf libtool-2.4.7
GDBM-1.23
1 2 3 4 5 6 7 8 9 10
tar xf gdbm-1.23.tar.gz pushd gdbm-1.23 ./configure --prefix=/usr \ --disable-static \ --enable-libgdbm-compat make make check make install popd rm -rf gdbm-1.23
Gperf-3.1
1 2 3 4 5 6 7 8
tar xf gperf-3.1.tar.gz pushd gperf-3.1 ./configure --prefix=/usr --docdir=/usr/share/doc/gperf-3.1 make make -j1 check make install popd rm -rf gperf-3.1
Expat-2.5.0
1 2 3 4 5 6 7 8 9 10 11
tar xf expat-2.5.0.tar.xz pushd expat-2.5.0 ./configure --prefix=/usr \ --disable-static \ --docdir=/usr/share/doc/expat-2.5.0 make make check make install install -v -m644 doc/*.{html,css} /usr/share/doc/expat-2.5.0 popd rm -rf expat-2.5.0
Inetutils-2.4
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
tar xf inetutils-2.4.tar.xz pushd inetutils-2.4 ./configure --prefix=/usr \ --bindir=/usr/bin \ --localstatedir=/var \ --disable-logger \ --disable-whois \ --disable-rcp \ --disable-rexec \ --disable-rlogin \ --disable-rsh \ --disable-servers make make check make install mv -v /usr/{,s}bin/ifconfig popd rm -rf inetutils-2.4
Less-608
1 2 3 4 5 6 7
tar xf less-608.tar.gz pushd less-608 ./configure --prefix=/usr --sysconfdir=/etc make make install popd rm -rf less-608
tar xf perl-5.36.0.tar.xz pushd perl-5.36.0 export BUILD_ZLIB=False export BUILD_BZIP2=0 sh Configure -des \ -Dprefix=/usr \ -Dvendorprefix=/usr \ -Dprivlib=/usr/lib/perl5/5.36/core_perl \ -Darchlib=/usr/lib/perl5/5.36/core_perl \ -Dsitelib=/usr/lib/perl5/5.36/site_perl \ -Dsitearch=/usr/lib/perl5/5.36/site_perl \ -Dvendorlib=/usr/lib/perl5/5.36/vendor_perl \ -Dvendorarch=/usr/lib/perl5/5.36/vendor_perl \ -Dman1dir=/usr/share/man/man1 \ -Dman3dir=/usr/share/man/man3 \ -Dpager="/usr/bin/less -isR" \ -Duseshrplib \ -Dusethreads make make test make install unset BUILD_ZLIB BUILD_BZIP2 popd rm -rf perl-5.36.0
XML::Parser-2.46
1 2 3 4 5 6 7 8
tar xf XML-Parser-2.46.tar.gz pushd XML-Parser-2.46 perl Makefile.PL make make test make install popd rm -rf XML-Parser-2.46
Intltool-0.51.0
1 2 3 4 5 6 7 8 9 10
tar xf intltool-0.51.0.tar.gz pushd intltool-0.51.0 sed -i 's:\\\${:\\\$\\{:' intltool-update.in ./configure --prefix=/usr make make check make install install -v -Dm644 doc/I18N-HOWTO /usr/share/doc/intltool-0.51.0/I18N-HOWTO popd rm -rf intltool-0.51.0
Autoconf-2.71
1 2 3 4 5 6 7 8 9 10 11
tar xf autoconf-2.71.tar.xz pushd autoconf-2.71 sed -e 's/SECONDS|/&SHLVL|/' \ -e '/BASH_ARGV=/a\ /^SHLVL=/ d' \ -i.orig tests/local.at ./configure --prefix=/usr make make check TESTSUITEFLAGS=-j8 make install popd rm -rf autoconf-2.71
Automake-1.16.5
1 2 3 4 5 6 7 8
tar xf automake-1.16.5.tar.xz pushd automake-1.16.5 ./configure --prefix=/usr --docdir=/usr/share/doc/automake-1.16.5 make make -j4 check make install popd rm -rf automake-1.16.5
OpenSSL-3.0.8
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
tar xf openssl-3.0.8.tar.gz pushd openssl-3.0.8 ./config --prefix=/usr \ --openssldir=/etc/ssl \ --libdir=lib \ shared \ zlib-dynamic make make test sed -i '/INSTALL_LIBS/s/libcrypto.a libssl.a//' Makefile make MANSUFFIX=ssl install mv -v /usr/share/doc/openssl /usr/share/doc/openssl-3.0.8 cp -vfr doc/* /usr/share/doc/openssl-3.0.8 popd rm -rf openssl-3.0.8
Kmod-30
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
tar xf kmod-30.tar.xz pushd kmod-30 ./configure --prefix=/usr \ --sysconfdir=/etc \ --with-openssl \ --with-xz \ --with-zstd \ --with-zlib make make install
for target in depmod insmod modinfo modprobe rmmod; do ln -sfv ../bin/kmod /usr/sbin/$target done
ln -sfv kmod /usr/bin/lsmod popd rm -rf kmod-30
Elfutils-0.188 中的 Libelf
1 2 3 4 5 6 7 8 9 10 11 12
tar xf elfutils-0.188.tar.bz2 pushd elfutils-0.188 ./configure --prefix=/usr \ --disable-debuginfod \ --enable-libdebuginfod=dummy make make check make -C libelf install install -vm644 config/libelf.pc /usr/lib/pkgconfig rm /usr/lib/libelf.a popd rm -rf elfutils-0.188
Libffi-3.4.4
1 2 3 4 5 6 7 8 9 10
tar xf libffi-3.4.4.tar.gz pushd libffi-3.4.4 ./configure --prefix=/usr \ --disable-static \ --with-gcc-arch=native make make check make install popd rm -rf libffi-3.4.4
tar xf coreutils-9.1.tar.xz pushd coreutils-9.1 patch -Np1 -i ../coreutils-9.1-i18n-1.patch autoreconf -fiv FORCE_UNSAFE_CONFIGURE=1 ./configure \ --prefix=/usr \ --enable-no-install-program=kill,uptime make make NON_ROOT_USERNAME=tester check-root echo"dummy:x:102:tester" >> /etc/group chown -Rv tester . su tester -c "PATH=$PATH make RUN_EXPENSIVE_TESTS=yes check" sed -i '/dummy/d' /etc/group make install mv -v /usr/bin/chroot /usr/sbin mv -v /usr/share/man/man1/chroot.1 /usr/share/man/man8/chroot.8 sed -i 's/"1"/"8"/' /usr/share/man/man8/chroot.8 popd rm -rf coreutils-9.1
Check-0.15.2
1 2 3 4 5 6 7 8
tar xf check-0.15.2.tar.gz pushd check-0.15.2 ./configure --prefix=/usr --disable-static make make check make docdir=/usr/share/doc/check-0.15.2 install popd rm -rf check-0.15.2
Diffutils-3.9
1 2 3 4 5 6 7 8
tar xf diffutils-3.9.tar.xz pushd diffutils-3.9 ./configure --prefix=/usr make make check make install popd rm -rf diffutils-3.9
Gawk-5.2.1
1 2 3 4 5 6 7 8 9 10 11
tar xf gawk-5.2.1.tar.xz pushd gawk-5.2.1 sed -i 's/extras//' Makefile.in ./configure --prefix=/usr make make check make LN='ln -f' install mkdir -pv /usr/share/doc/gawk-5.2.1 cp -v doc/{awkforai.txt,*.{eps,pdf,jpg}} /usr/share/doc/gawk-5.2.1 popd rm -rf gawk-5.2.1
Findutils-4.9.0
1 2 3 4 5 6 7 8 9 10 11 12
tar xf findutils-4.9.0.tar.xz pushd findutils-4.9.0 case $(uname -m) in i?86) TIME_T_32_BIT_OK=yes ./configure --prefix=/usr --localstatedir=/var/lib/locate ;; x86_64) ./configure --prefix=/usr --localstatedir=/var/lib/locate ;; esac make chown -Rv tester . su tester -c "PATH=$PATH make check" make install popd rm -rf findutils-4.9.0
Groff-1.22.4
1 2 3 4 5 6 7
tar xf groff-1.22.4.tar.gz pushd groff-1.22.4 PAGE=A4 ./configure --prefix=/usr make make install popd rm -rf groff-1.22.4
GRUB-2.06
1 2 3 4 5 6 7 8 9 10 11 12 13
tar xf grub-2.06.tar.xz pushd grub-2.06 unset {C,CPP,CXX,LD}FLAGS patch -Np1 -i ../grub-2.06-upstream_fixes-1.patch ./configure --prefix=/usr \ --sysconfdir=/etc \ --disable-efiemu \ --disable-werror make make install mv -v /etc/bash_completion.d/grub /usr/share/bash-completion/completions popd rm -rf grub-2.06
Gzip-1.12
1 2 3 4 5 6 7 8
tar xf gzip-1.12.tar.xz pushd gzip-1.12 ./configure --prefix=/usr make make check make install popd rm -rf gzip-1.12
IPRoute2-6.1.0
1 2 3 4 5 6 7 8 9 10
tar xf iproute2-6.1.0.tar.xz pushd iproute2-6.1.0 sed -i /ARPD/d Makefile rm -fv man/man8/arpd.8 make NETNS_RUN_DIR=/run/netns make SBINDIR=/usr/sbin install mkdir -pv /usr/share/doc/iproute2-6.1.0 cp -v COPYING README* /usr/share/doc/iproute2-6.1.0 popd rm -rf iproute2-6.1.0
Kbd-2.5.1
1 2 3 4 5 6 7 8 9 10 11 12 13
tar xf kbd-2.5.1.tar.xz pushd kbd-2.5.1 patch -Np1 -i ../kbd-2.5.1-backspace-1.patch sed -i '/RESIZECONS_PROGS=/s/yes/no/' configure sed -i 's/resizecons.8 //' docs/man/man8/Makefile.in ./configure --prefix=/usr --disable-vlock make make check make install mkdir -pv /usr/share/doc/kbd-2.5.1 cp -R -v docs/doc/* /usr/share/doc/kbd-2.5.1 popd rm -rf kbd-2.5.1
Libpipeline-1.5.7
1 2 3 4 5 6 7 8
tar xf libpipeline-1.5.7.tar.gz pushd libpipeline-1.5.7 ./configure --prefix=/usr make make check make install popd rm -rf libpipeline-1.5.7
Make-4.4
1 2 3 4 5 6 7 8 9 10 11
tar xf make-4.4.tar.gz pushd make-4.4 sed -e '/ifdef SIGPIPE/,+2 d' \ -e '/undef FATAL_SIG/i FATAL_SIG (SIGPIPE);' \ -i src/main.c ./configure --prefix=/usr make make check make install popd rm -rf make-4.4
Patch-2.7.6
1 2 3 4 5 6 7 8
tar xf patch-2.7.6.tar.xz pushd patch-2.7.6 ./configure --prefix=/usr make make check make install popd rm -rf patch-2.7.6
Tar-1.34
1 2 3 4 5 6 7 8 9 10
tar xf tar-1.34.tar.xz pushd tar-1.34 FORCE_UNSAFE_CONFIGURE=1 \ ./configure --prefix=/usr make make check make install make -C doc install-html docdir=/usr/share/doc/tar-1.34 popd rm -rf tar-1.34
Texinfo-7.0.2
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
tar xf texinfo-7.0.2.tar.xz pushd texinfo-7.0.2 ./configure --prefix=/usr make make check make install make TEXMF=/usr/share/texmf install-tex pushd /usr/share/info rm -v dir for f in * do install-info $fdir 2>/dev/null done popd popd rm -rf texinfo-7.0.2
tar xf vim-9.0.1273.tar.xz pushd vim-9.0.1273 echo'#define SYS_VIMRC_FILE "/etc/vimrc"' >> src/feature.h ./configure --prefix=/usr make chown -Rv tester . su tester -c "LANG=en_US.UTF-8 make -j1 test" &> vim-test.log make install ln -sv vim /usr/bin/vi for L in /usr/share/man/{,*/}man1/vim.1; do ln -sv vim.1 $(dirname$L)/vi.1 done ln -sv ../vim/vim90/doc /usr/share/doc/vim-9.0.1273 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 popd rm -rf vim-9.0.1273
Eudev-3.2.11
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
tar xf eudev-3.2.11.tar.gz pushd eudev-3.2.11 sed -i '/udevdir/a udev_dir=${udevdir}' src/udev/udev.pc.in ./configure --prefix=/usr \ --bindir=/usr/sbin \ --sysconfdir=/etc \ --enable-manpages \ --disable-static make mkdir -pv /usr/lib/udev/rules.d mkdir -pv /etc/udev/rules.d make check make install tar -xvf ../udev-lfs-20171102.tar.xz make -f udev-lfs-20171102/Makefile.lfs install udevadm hwdb --update popd rm -rf eudev-3.2.11
Man-DB-2.11.2
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
tar xf man-db-2.11.2.tar.xz pushd man-db-2.11.2 ./configure --prefix=/usr \ --docdir=/usr/share/doc/man-db-2.11.2 \ --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= make make check make install popd rm -rf man-db-2.11.2
Procps-ng-4.0.2
1 2 3 4 5 6 7 8 9 10 11
tar xf procps-ng-4.0.2.tar.xz pushd procps-ng-4.0.2 ./configure --prefix=/usr \ --docdir=/usr/share/doc/procps-ng-4.0.2 \ --disable-static \ --disable-kill make make check make install popd rm -rf procps-ng-4.0.2
tar xf sysklogd-1.5.1.tar.gz pushd sysklogd-1.5.1 sed -i '/Error loading kernel symbols/{n;n;d}' ksym_mod.c sed -i 's/union wait/int/' syslogd.c make make BINDIR=/sbin install
cat > /etc/syslog.conf << "EOF" # Begin /etc/syslog.conf
cat > /etc/inputrc << "EOF" # Begin /etc/inputrc # Modified by Chris Lynn <[email protected]>
# Allow the command prompt to wrap to the next line set horizontal-scroll-mode Off
# Enable 8-bit input set meta-flag On set input-meta On
# Turns off 8th bit stripping set convert-meta Off
# Keep the 8th bit for display set output-meta On
# none, visible or audible set bell-style none
# All of the following map the escape sequence of the value # contained in the 1st argument to the readline specific functions "\eOd": backward-word "\eOc": forward-word
# for linux console "\e[1~": beginning-of-line "\e[4~": end-of-line "\e[5~": beginning-of-history "\e[6~": end-of-history "\e[3~": delete-char "\e[2~": quoted-insert
# for xterm "\eOH": beginning-of-line "\eOF": end-of-line
# for Konsole "\e[H": beginning-of-line "\e[F": end-of-line
# End /etc/inputrc EOF
创建 /etc/shells 文件
1 2 3 4 5 6 7 8
cat > /etc/shells << "EOF" # Begin /etc/shells
/bin/sh /bin/bash
# End /etc/shells EOF
引导系统
创建 /etc/fstab 文件
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
cat > /etc/fstab << "EOF" # Begin /etc/fstab
# file system mount-point type options dump fsck # order
cd /sources tar xf linux-6.1.11.tar.xz pushd linux-6.1.11 make mrproper make defconfig make menuconfig
按下面代码块中配置项修改内核配置。
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
Processor type and features ---> [*] Build a relocatable kernel [CONFIG_RELOCATABLE] [*] Randomize the address of the kernel image (KASLR) [CONFIG_RANDOMIZE_BASE] General setup ---> [ ] Compile the kernel with warnings as errors [CONFIG_WERROR] < > Enable kernel headers through /sys/kernel/kheaders.tar.xz [CONFIG_IKHEADERS] General architecture-dependent options ---> [*] Stack Protector buffer overflow detection [CONFIG_STACKPROTECTOR] [*] Strong Stack Protector [CONFIG_STACKPROTECTOR_STRONG] Device Drivers ---> Graphics support ---> Frame buffer Devices ---> <*> Support for frame buffer devices ---> Console display driver support ---> [*] Framebuffer Console support [CONFIG_FRAMEBUFFER_CONSOLE] Generic Driver Options ---> [ ] Support for uevent helper [CONFIG_UEVENT_HELPER] [*] Maintain a devtmpfs filesystem to mount at /dev [CONFIG_DEVTMPFS] [*] Automount devtmpfs at /dev, after the kernel mounted the rootfs [CONFIG_DEVTMPFS_MOUNT]
1 2 3 4 5 6 7
Processor type and features ---> [*] Support x2apic [CONFIG_X86_X2APIC] Device Drivers ---> [*] PCI Support ---> [CONFIG_PCI] [*] Message Signaled Interrupts (MSI and MSI-X) [CONFIG_PCI_MSI] [*] IOMMU Hardware Support ---> [CONFIG_IOMMU_SUPPORT] [*] Support for Interrupt Remapping [CONFIG_IRQ_REMAP]