diff options
author | William Harrington <kb0iic@berzerkula.org> | 2021-04-20 10:27:12 -0500 |
---|---|---|
committer | William Harrington <kb0iic@berzerkula.org> | 2021-04-20 10:27:12 -0500 |
commit | bb184e13b4806c56e095a1a33c4fc3ea281bdd29 (patch) | |
tree | 35768bdb2283e474004376603b4cab44be2ceeba | |
parent | 057e88552151997d0ffb6f0fd306f5c9830a596e (diff) |
Adjust for systemd specific builds.
-rw-r--r-- | chapter10/fstab.sh | 5 | ||||
-rw-r--r-- | chapter8/d-bus.sh | 20 | ||||
-rw-r--r-- | chapter8/man-db.sh | 4 | ||||
-rw-r--r-- | chapter8/procps-ng.sh | 4 | ||||
-rw-r--r-- | chapter8/systemd.sh | 46 | ||||
-rw-r--r-- | chapter8/util-linux.sh | 2 | ||||
-rw-r--r-- | chapter9/bashprofile.sh | 10 | ||||
-rw-r--r-- | chapter9/bootscriptconf.sh | 51 | ||||
-rw-r--r-- | chapter9/lfs-bootscripts.sh | 4 | ||||
-rw-r--r-- | chapter9/network.sh | 29 | ||||
-rw-r--r-- | download.sh | 2 | ||||
-rw-r--r-- | essential.sh | 17 | ||||
-rw-r--r-- | insidechroot.sh | 12 | ||||
-rw-r--r-- | packageinstall.sh | 4 | ||||
-rw-r--r-- | packages-systemd.csv | 3 | ||||
-rw-r--r-- | patches-systemd.csv | 1 |
16 files changed, 106 insertions, 108 deletions
diff --git a/chapter10/fstab.sh b/chapter10/fstab.sh index c1668fb..f6de331 100644 --- a/chapter10/fstab.sh +++ b/chapter10/fstab.sh @@ -9,11 +9,6 @@ cat << EOF > /etc/fstab ${LFS_DISK}${LFS_PART} / ${LFS_FS,,} defaults 1 1 ${LFS_SWAP} swap swap pri=1 0 0 -proc /proc proc nosuid,noexec,nodev 0 0 -sysfs /sys sysfs nosuid,noexec,nodev 0 0 -devpts /dev/pts devpts gid=5,mode=620 0 0 -tmpfs /run tmpfs defaults 0 0 -devtmpfs /dev devtmpfs mode=0755,nosuid 0 0 # End /etc/fstab EOF diff --git a/chapter8/d-bus.sh b/chapter8/d-bus.sh new file mode 100644 index 0000000..3ba0536 --- /dev/null +++ b/chapter8/d-bus.sh @@ -0,0 +1,20 @@ +#!/bin/bash +set -e + +./configure --prefix=/usr \ + --sysconfdir=/etc \ + --localstatedir=/var \ + --disable-static \ + --disable-doxygen-docs \ + --disable-xml-docs \ + --docdir=/usr/share/doc/dbus-"${VERSION}" \ + --with-console-auth-dir=/run/console \ + --with-system-pid-file=/run/dbus/pid \ + --with-system-socket=/run/dbus/system_bus_socket && + +make && + +make -j1 install && +mv -v /usr/lib/libdbus-1.so.* /lib && +ln -sfv ../../lib/$(readlink /usr/lib/libdbus-1.so) /usr/lib/libdbus-1.so && +ln -sfv /etc/machine-id /var/lib/dbus diff --git a/chapter8/man-db.sh b/chapter8/man-db.sh index afa8cb0..8076622 100644 --- a/chapter8/man-db.sh +++ b/chapter8/man-db.sh @@ -8,9 +8,7 @@ set -e --enable-cache-owner=bin \ --with-browser=/usr/bin/lynx \ --with-vgrind=/usr/bin/vgrind \ - --with-grap=/usr/bin/grap \ - --with-systemdtmpfilesdir= \ - --with-systemdsystemunitdir= && + --with-grap=/usr/bin/grap && make && diff --git a/chapter8/procps-ng.sh b/chapter8/procps-ng.sh index 85be2d6..630cfe4 100644 --- a/chapter8/procps-ng.sh +++ b/chapter8/procps-ng.sh @@ -6,7 +6,9 @@ set -e --libdir=/usr/lib \ --docdir=/usr/share/doc/procps-ng-"${VERSION}" \ --disable-static \ - --disable-kill && + --disable-kill \ + --with-systemd && + make && diff --git a/chapter8/systemd.sh b/chapter8/systemd.sh new file mode 100644 index 0000000..7b9f562 --- /dev/null +++ b/chapter8/systemd.sh @@ -0,0 +1,46 @@ +#!/bin/bash +set -e + +patch -Np1 -i ../systemd-"${VERSION}"-upstream_fixes-2.patch && +sed '181,$ d' -i src/resolve/meson.build && +sed -i 's/GROUP="render"/GROUP="video"/' rules.d/50-udev-default.rules.in && + +mkdir -v build +cd build || exit 1 + +LANG=en_US.UTF-8 \ +meson --prefix=/usr \ + --sysconfdir=/etc \ + --localstatedir=/var \ + -Dblkid=true \ + -Dbuildtype=release \ + -Ddefault-dnssec=no \ + -Dfirstboot=false \ + -Dinstall-tests=false \ + -Dkmod-path=/bin/kmod \ + -Dldconfig=false \ + -Dmount-path=/bin/mount \ + -Drootprefix= \ + -Drootlibdir=/lib \ + -Dsplit-usr=true \ + -Dsulogin-path=/sbin/sulogin \ + -Dsysusers=false \ + -Dumount-path=/bin/umount \ + -Db_lto=false \ + -Drpmmacrosdir=no \ + -Dhomed=false \ + -Duserdb=false \ + -Dman=false \ + -Dmode=release \ + -Ddocdir=/usr/share/doc/systemd-"${VERSION}" \ + .. && + +LANG=en_US.UTF-8 ninja && + +LANG=en_US.UTF-8 ninja install && +tar -xvf ../../systemd-man-pages-"${VERSION}"-2.tar.xz \ + --strip-components=1 -C /usr/share/man && +rm -rfv /usr/lib/pam.d && +systemd-machine-id-setup && +systemctl preset-all && +systemctl disable systemd-time-wait-sync.service diff --git a/chapter8/util-linux.sh b/chapter8/util-linux.sh index de1a5e4..6e3c0ff 100644 --- a/chapter8/util-linux.sh +++ b/chapter8/util-linux.sh @@ -12,8 +12,6 @@ set -e --disable-pylibmount \ --disable-static \ --without-python \ - --without-systemd \ - --without-systemdsystemunitdir \ runstatedir=/run && make && diff --git a/chapter9/bashprofile.sh b/chapter9/bashprofile.sh deleted file mode 100644 index 7ae73c2..0000000 --- a/chapter9/bashprofile.sh +++ /dev/null @@ -1,10 +0,0 @@ -#!/bin/bash - -cat > /etc/profile << "EOF" -# Begin /etc/profile - -export LANG=en_US -export LC_TIME=POSIX - -# End /etc/profile -EOF diff --git a/chapter9/bootscriptconf.sh b/chapter9/bootscriptconf.sh deleted file mode 100644 index ae9633c..0000000 --- a/chapter9/bootscriptconf.sh +++ /dev/null @@ -1,51 +0,0 @@ -#!/bin/bash - -cat > /etc/inittab << "EOF" -# Begin /etc/inittab - -id:3:initdefault: - -si::sysinit:/etc/rc.d/init.d/rc S - -l0:0:wait:/etc/rc.d/init.d/rc 0 -l1:S1:wait:/etc/rc.d/init.d/rc 1 -l2:2:wait:/etc/rc.d/init.d/rc 2 -l3:3:wait:/etc/rc.d/init.d/rc 3 -l4:4:wait:/etc/rc.d/init.d/rc 4 -l5:5:wait:/etc/rc.d/init.d/rc 5 -l6:6:wait:/etc/rc.d/init.d/rc 6 - -ca:12345:ctrlaltdel:/sbin/shutdown -t1 -a -r now - -su:S016:once:/sbin/sulogin - -1:2345:respawn:/sbin/agetty --noclear tty1 9600 -2:2345:respawn:/sbin/agetty tty2 9600 -3:2345:respawn:/sbin/agetty tty3 9600 -4:2345:respawn:/sbin/agetty tty4 9600 -5:2345:respawn:/sbin/agetty tty5 9600 -6:2345:respawn:/sbin/agetty tty6 9600 - -# End /etc/inittab -EOF - -cat > /etc/sysconfig/clock << "EOF" -# Begin /etc/sysconfig/clock - -UTC=1 - -# Set this to any options you might need to give to hwclock, -# such as machine hardware clock type for Alphas. -CLOCKPARAMS= - -# End /etc/sysconfig/clock -EOF - -#cat > /etc/sysconfig/console << "EOF" -# Begin /etc/sysconfig/console - -#KEYMAP="pl2" -#FONT="lat2a-16 -m 8859-2" - -# End /etc/sysconfig/console -#EOF diff --git a/chapter9/lfs-bootscripts.sh b/chapter9/lfs-bootscripts.sh deleted file mode 100644 index c019094..0000000 --- a/chapter9/lfs-bootscripts.sh +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/bash -set -e - -make -j1 install diff --git a/chapter9/network.sh b/chapter9/network.sh index 05ab2fd..e82e29e 100644 --- a/chapter9/network.sh +++ b/chapter9/network.sh @@ -1,26 +1,19 @@ #!/bin/bash -pushd /etc/sysconfig/ >/dev/null || exit 1 -cat > ifconfig.eth0 << "EOF" -ONBOOT=yes -IFACE=eth0 -SERVICE=ipv4-static -IP=192.168.1.196 -GATEWAY=192.168.1.1 -PREFIX=24 -BROADCAST=192.168.1.255 -EOF -popd >/dev/null || exit 1 - -cat > /etc/resolv.conf << "EOF" -# Begin /etc/resolv.conf +pushd /etc/systemd/network >/dev/null || exit 1 +cat > 10-eth-dhcp.network << "EOF" +[Match] +Name=eth0 -nameserver 192.168.1.10 -domain berzerkula.org -search berzerkula.org +[Network] +DHCP=ipv4 -# End /etc/resolv.conf +[DHCP] +UseDomains=true EOF +popd >/dev/null || exit 1 + +ln -sfv /run/systemd/resolve/resolv.conf /etc/resolv.conf echo "lfs" > /etc/hostname diff --git a/download.sh b/download.sh index fff69f7..f9ff969 100644 --- a/download.sh +++ b/download.sh @@ -2,7 +2,7 @@ # Downlod Packages and Patches -cat packages.csv patches.csv | while read -r line; do +cat packages*.csv patches*.csv | while read -r line; do #NAME="$(echo "$line" | cut -d\, -f1)" VERSION="$(echo "$line" | cut -d\, -f2)" URL="$(echo "$line" | cut -d\, -f3 | sed "s/@/${VERSION}/g")" diff --git a/essential.sh b/essential.sh index 3384917..7cb4937 100644 --- a/essential.sh +++ b/essential.sh @@ -17,6 +17,14 @@ root:x:0:0:root:/root:/bin/bash bin:x:1:1:bin:/dev/null:/bin/false daemon:x:6:6:Daemon User:/dev/null:/bin/false messagebus:x:18:18:D-Bus Message Daemon User:/run/dbus:/bin/false +systemd-bus-proxy:x:72:72:systemd Bus Proxy:/:/bin/false +systemd-journal-gateway:x:73:73:systemd Journal Gateway:/:/bin/false +systemd-journal-remote:x:74:74:systemd Journal Remote:/:/bin/false +systemd-journal-upload:x:75:75:systemd Journal Upload:/:/bin/false +systemd-network:x:76:76:systemd Network Management:/:/bin/false +systemd-resolve:x:77:77:systemd Resolver:/:/bin/false +systemd-timesync:x:78:78:systemd Time Synchronization:/:/bin/false +systemd-coredump:x:79:79:systemd Core Dumper:/:/bin/false uuidd:x:80:80:UUID Generation Daemon User:/dev/null:/bin/false nobody:x:99:99:Unprivileged User:/dev/null:/bin/false EOF' @@ -40,9 +48,18 @@ usb:x:14: cdrom:x:15: adm:x:16: messagebus:x:18: +systemd-journal:x:23: input:x:24: mail:x:34: kvm:x:61: +systemd-bus-proxy:x:72: +systemd-journal-gateway:x:73: +systemd-journal-remote:x:74: +systemd-journal-upload:x:75: +systemd-network:x:76: +systemd-resolve:x:77: +systemd-timesync:x:78: +systemd-coredump:x:79: uuidd:x:80: wheel:x:97: nogroup:x:99: diff --git a/insidechroot.sh b/insidechroot.sh index ac193ae..380cd83 100644 --- a/insidechroot.sh +++ b/insidechroot.sh @@ -31,7 +31,7 @@ elif [[ "${CHAPTER}" -eq 8 ]]; then printf "%b" "\n${IWHT}============ ${IGRN}Building ${IYLW}Chapter 8${IWHT} \ ============${RST}\n" - for package in man-pages iana-etc glibc zlib bzip2 xz zstd file readline m4 bc flex tcl expect dejagnu binutils gmp mpfr mpc isl attr acl libcap shadow gcc pkg-config ncurses sed psmisc gettext bison grep bash libtool gdbm gperf expat inetutils perl xml-parser intltool autoconf automake kmod libelf libffi openssl python ninja meson coreutils check diffutils gawk findutils groff grub less gzip iproute2 kbd libpipeline make patch man-db tar texinfo vim eudev procps-ng util-linux e2fsprogs sysklogd sysvinit; do + for package in man-pages iana-etc glibc zlib bzip2 xz zstd file readline m4 bc flex tcl expect dejagnu binutils gmp mpfr mpc isl attr acl libcap shadow gcc pkg-config ncurses sed psmisc gettext bison grep bash libtool gdbm gperf expat inetutils perl xml-parser intltool autoconf automake kmod libelf libffi openssl python ninja meson coreutils check diffutils gawk findutils groff grub less gzip iproute2 kbd libpipeline make patch man-db tar texinfo vim systemd d-bus procps-ng util-linux e2fsprogs; do source packageinstall.sh 8 $package retval=$? if [[ "${retval}" -ne 0 ]]; then @@ -45,18 +45,8 @@ elif [[ "${CHAPTER}" -eq 9 ]]; then printf "%b" "\n${IWHT}============ ${IGRN}Building ${IYLW}Chapter 9${IWHT} \ ============${RST}\n" - source packageinstall.sh 9 lfs-bootscripts - retval=$? - if [[ "${retval}" -ne 0 ]]; then - exit 1 - fi - printf "%b" "${GRN}Configuring network related files${RST}\n" source chapter9/network.sh - printf "%b" "${GRN}Configuring bootscript related files${RST}\n" - source chapter9/bootscriptconf.sh - printf "%b" "${GRN}Configuring locale settings${RST}\n" - source chapter9/bashprofile.sh printf "%b" "${GRN}Configuring inputrc${RST}\n" source chapter9/inputrc.sh printf "%b" "${GRN}Configuring system shells${RST}\n" diff --git a/packageinstall.sh b/packageinstall.sh index e0516db..5c3afe8 100644 --- a/packageinstall.sh +++ b/packageinstall.sh @@ -3,7 +3,7 @@ CHAPTER="$1" PACKAGE="$2" -if ! grep -q "^${PACKAGE}," packages.csv; then +if ! grep -q "^${PACKAGE}," packages*.csv; then printf "%b" " ${IRED}PACKAGE ${IYLW}${PACKAGE} ${IRED}DOES NOT EXIST!${RST}\n" exit 1 fi @@ -12,7 +12,7 @@ if [[ -f "${LFS}/sources/chapter${CHAPTER}/${PACKAGE}" ]]; then printf "%b" "${GRN}Package ${YLW}${PACKAGE} ${GRN}already built and installed${RST}\n" else - grep -i "^${PACKAGE}," packages.csv | grep -i -v "\.patch;" | while read -r line; do + grep -i "^${PACKAGE}," packages*.csv | grep -i -v "\.patch;" | while read -r line; do VERSION="$(echo "${line}" | cut -d\, -f2)" URL="$(echo "${line}" | cut -d\, -f3 | sed "s/@/${VERSION}/g")" CACHEFILE="$(basename "${URL}")" diff --git a/packages-systemd.csv b/packages-systemd.csv new file mode 100644 index 0000000..9e7e327 --- /dev/null +++ b/packages-systemd.csv @@ -0,0 +1,3 @@ +dbus,1.12.20,https://dbus.freedesktop.org/releases/dbus/dbus-@.tar.gz,dfe8a71f412e0b53be26ed4fbfdc91c4 +systemd,https://github.com/systemd/systemd/archive/v@/systemd-@.tar.gz,b0d6e603b814908acc69db29bbfb023c +systemd-man-pages,http://anduin.linuxfromscratch.org/LFS/systemd-man-pages-@-2.tar.xz,7d8a53105b7a205f2863e360d9a23f95 diff --git a/patches-systemd.csv b/patches-systemd.csv new file mode 100644 index 0000000..61a3b5a --- /dev/null +++ b/patches-systemd.csv @@ -0,0 +1 @@ +systemd,247,http://www.linuxfromscratch.org/patches/lfs/development/systemd-@-upstream_fixes-2.patch,7afe3d13464ae7d20dbe5e6f0fb8ccd3 |