10.1 systemd updates

This commit is contained in:
K D Hedger
2021-04-22 20:34:19 +01:00
parent c660c8b51a
commit 03130e5b3e
11 changed files with 147 additions and 156 deletions

View File

@ -1 +1 @@
../../LFSScripts/PkgVersions
../../../LFSScripts/PkgVersions

View File

@ -12,7 +12,7 @@ VERSION=$linux_version
BUILD=${BUILD:-1}
SECTION="KERNEL"
SUFFIX="LFSPKG"
TARBALL="${TARNAME}-${VERSION}.tar.xz"
TARBALL="${TARNAME}-${VERSION}.$linux_arctype"
KERNELCONFIG=$(pwd)/config-${VERSION}
KERNELSOURCEDIR="${SOURCEARCHIVES}/${SECTION}/${PKGNAME}-${VERSION}_${BUILD}"
PKG="${OUTPUT}/${PKGNAME}"
@ -26,7 +26,6 @@ mkdir -p "$PKG"
#gunzip < /proc/config.gz > ${KERNELCONFIG}
scriptLog "${PKGNAME}-${VERSION}"
#gettar "https://www.kernel.org/pub/linux/kernel/v4.x/${TARBALL}" ${SECTION}
gettar "https://www.kernel.org/pub/linux/kernel/v5.x/${TARBALL}" ${SECTION} ${TARBALL}
pushd "${KERNELSOURCEDIR}"

View File

@ -1 +1 @@
../../LFSScripts/PkgVersions
../../../LFSScripts/PkgVersions

View File

@ -18,8 +18,35 @@ else
ln -s /dev/null /etc/systemd/network/99-default.link
fi
save_lib="ld-2.33.so libc-2.33.so libpthread-2.33.so libthread_db-1.0.so"
cd /lib
for LIB in $save_lib; do
objcopy --only-keep-debug $LIB $LIB.dbg
strip --strip-unneeded $LIB
objcopy --add-gnu-debuglink=$LIB.dbg $LIB
done
save_usrlib="libquadmath.so.0.0.0 libstdc++.so.6.0.28
libitm.so.1.0.0 libatomic.so.1.2.0"
cd /usr/lib
for LIB in $save_usrlib; do
objcopy --only-keep-debug $LIB $LIB.dbg
strip --strip-unneeded $LIB
objcopy --add-gnu-debuglink=$LIB.dbg $LIB
done
unset LIB save_lib save_usrlib
find /usr/lib -type f -name "*.a" -exec strip --strip-debug {} ';'
find /lib /usr/lib -type f -name "*.so*" ! -name \*dbg -exec strip --strip-unneeded {} ';'
find /{bin,sbin}/ /usr/{bin,sbin,libexec}/ -type f -exec strip --strip-all {} ';'
find /usr/lib /usr/libexec -name "*.la" -delete
find /usr -depth -name $(uname -m)-lfs-linux-gnu\* | xargs rm -rf
rm -rf /tools
exit 0

View File

@ -1,4 +1,4 @@
#!/bin/bash
#!/bin/bash -e
. /usr/share/LFSPkg/LFSFunctions
@ -15,86 +15,89 @@ export USESYSTEMD=1
export LANG=en_GB.UTF-8
export USESYSTEMD=1
DEPENDS="linuxheaders-5.2.8
Man-pages-5.02
Glibc-2.30
Zlib-1.2.11
File-5.37
Readline-8.0
M4-1.4.18
Bc-2.1.3
Binutils-2.32
GMP-6.1.2
MPFR-4.0.2
MPC-1.1.0
Shadow-4.7
GCC-9.2.0
Bzip2-1.0.8
Pkg-config-0.29.2
Ncurses-6.1
attr-2.4.48
acl-2.2.53
libcap-2.27
Sed-4.7
Psmisc-23.2
Iana-Etc-2.30
Bison-3.4.1
Flex-2.6.4
Grep-3.3
Bash-5.0
Libtool-2.4.6
GDBM-1.18.1
gperf-3.1
Expat-2.2.7
Inetutils-1.9.4
Perl-5.30.0
XML-Parser-2.44
intltool-0.51.0
Autoconf-2.69
Automake-1.16.1
xz-5.2.4
Kmod-26
Gettext-0.20.1
Libelf-0.177
Libffi-3.2.1
OpenSSL-1.1.1
python3-3.7.4
Ninja-1.9.0
Meson-0.51.1
Coreutils-8.31
Check-0.12.0
Diffutils-3.7
Gawk-5.0.1
Findutils-4.6.0
Groff-1.22.4
GRUB-2.04
Less-551
Gzip-1.10
IPRoute2-5.2.0
Kbd-2.2.0
Libpipeline-1.5.1
Make-4.2.1
Patch-2.7.6
Man-DB-2.8.6.1
Tar-1.32
Texinfo-6.6
Vim-8.1.1846
systemd-241
dbus-1.12.16
Procps-ng-3.3.15
Util-linux-2.34
E2fsprogs-1.45.3
Wget-1.20.3
unzip-6.0
GPM-1.20.7
Links-2.19"
DEPENDS="Man-pages
Iana-Etc
Glibc
Zlib
Bzip2
xz
Zstd
File
Readline
M4
Bc
Flex
tcl
Expect
DejaGNU
Binutils
GMP
MPFR
MPC
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
python3
Ninja
Meson
Coreutils
Check
Diffutils
Gawk
Findutils
Groff
GRUB
Less
Gzip
IPRoute2
Kbd
Libpipeline
Make
Patch
Man-DB
Tar
Texinfo
Vim
systemd
dbus
Procps-ng
Util-linux
E2fsprogs
Wget
unzip
GPM
Links"
if ! lfspkg -B "$DEPENDS";then
exit 100
fi
PKGNAME="system-meta"
VERSION="9.0"
VERSION="10.1"
BUILD=${BUILD:-1}
SECTION="SYSTEM"
SUFFIX="LFSPKG"

View File

@ -2,7 +2,10 @@
#©keithhedger Tue 3 Feb 19:40:19 GMT 2015 kdhedger68713@gmail.com
rm -f /usr/bin/xsltproc||true
systemd-machine-id-setup
rm -fv /usr/lib/lib{blkid,uuid,mount}.so*||true
rm -f /usr/lib/tmpfiles.d/systemd-nologin.conf||true
systemctl preset-all
systemctl disable systemd-time-wait-sync.service
#rm -f /usr/bin/xsltproc||true
#rm -fv /usr/lib/lib{blkid,uuid,mount}.so*||true
#rm -f /usr/lib/tmpfiles.d/systemd-nologin.conf||true

View File

@ -4,49 +4,40 @@
trap 'echo -e "$0 ${RED}FAILED${NORMAL} at line ${GREEN}${LINENO}${NORMAL}"' ERR
. ../PkgVersions
PKGNAME="systemd"
TARNAME="$PKGNAME"
VERSION="241"
VERSION=$systemd_version
BUILD=${BUILD:-1}
SECTION="SYSTEM"
SUFFIX="LFSPKG"
TARBALL="${TARNAME}-${VERSION}.tar.gz"
TARBALL="${TARNAME}-${VERSION}.$systemd_arctype"
PKG="${OUTPUT}/${PKGNAME}"
DOWHAT=${1:-"build"}
CWD=$(pwd)
rm -rf "$PKG" || true
mkdir -p "$PKG"
CWD=$(pwd)
scriptLog "${PKGNAME}-${VERSION}"
LANG=${LANG:-"en_GB"}
UPDATEWITHPAM=${UPDATEWITHPAM:-0}
pushd $COMPILEAT 2>/dev/null||true
extractarchive "${SOURCEARCHIVES}/${SECTION}/${TARBALL}"
pushd "${TARNAME}-${VERSION}"
patch -Np1 -i ${SOURCEARCHIVES}/${SECTION}/${PKGNAME}-${VERSION}-networkd_and_rdrand_fixes-1.patch
if [ $UPDATEWITHPAM -eq 1 ];then
sed -i '1506,1508 s/</>/' src/shared/seccomp-util.c
sed -i 's/GROUP="render", //' rules/50-udev-default.rules.in||true
mkdir -p build
cd build
CFLAGS+="-Wno-format-overflow" meson --prefix=/usr --sysconfdir=/etc --localstatedir=/var -Dblkid=true -Dbuildtype=release -Ddefault-dnssec=no -Dfirstboot=false -Dinstall-tests=false -Dldconfig=false -Drootprefix= -Drootlibdir=/lib${LIBDIRSUFFIX} -Dsplit-usr=true -Dsysusers=false -Drpmmacrosdir=no -Db_lto=false -Dgnutls=false ..
else
ln -sf /tools/bin/true /usr/bin/xsltproc
for file in /tools/lib/lib{blkid,mount,uuid}.so*
do
ln -sf $file /usr/lib/
done
tar -xf ${SOURCEARCHIVES}/${SECTION}/${PKGNAME}-man-pages-${VERSION}.tar.xz
sed -i 's/GROUP="render", //' rules/50-udev-default.rules.in
mkdir -p build
cd build
PKG_CONFIG_PATH="/usr/lib/pkgconfig:/tools/lib/pkgconfig" CFLAGS+="-Wno-format-overflow" 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 ..
fi
ninja
DESTDIR=$PKG ninja install
patch -Np1 -i ${SOURCEARCHIVES}/${SECTION}/${TARNAME}-${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 -p build
cd build
export LANG
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-247 ..
ninja $MAKEFLAGS||ninja -j1||exit 100
DESTDIR=$PKG ninja install||exit 100
mkdir -vp $PKG/usr/share/man
tar -xf ${SOURCEARCHIVES}/${SECTION}/${TARNAME}-man-pages-${VERSION}-2.tar.xz --strip-components=1 -C $PKG/usr/share/man
rm -rf $PKG/usr/lib/pam.d
popd
checketc "$PKG"

View File

@ -363,7 +363,7 @@ KEYMAP=$KEYBOARD
# End /etc/sysconfig/console
EOF
else
. SystemDFiles
. LFSScripts/SystemDFiles
fi
cat > etc/shells << EOF
@ -405,7 +405,7 @@ include /etc/ld.so.conf.d/*.conf
EOF
#Set the perms for $LFS will fail for any mounted network tha can't have their perms changed ( eg a samba mount ).
chown -R root:root $LFS/* 2>/dev/null||true
#chown -R root:root $LFS/* 2>/dev/null||true
touch var/log/{btmp,lastlog,wtmp}
chmod -v 664 var/log/lastlog
chmod -v 600 var/log/btmp

View File

@ -31,8 +31,9 @@ export USESYSTEMD
[sudo -E] chown -R $USER:$USER $LFS/LFSPkgBuilds
3)
#cd into the lfsscripts folder
#cd into the LFSScripts folder
cd $LFS/LFSScripts
#Set up config files !!IMPORTANT!!
#You can just press 'Return' to accept the default.
#Run:

View File

@ -32,20 +32,13 @@ export BUILTPACKAGES
export EXTFOLDER
export KERNELVERSION
export USESYSTEMD
###RECOMMENDED####
#or cd into the mounted partition wher you intend to build LFS:
#LFS should point to your mounted LFS partition ( eg LFS=/mnt/LFS ).
cd $LFS
[sudo] git clone https://github.com/KeithDHedger/LFSPkgBuilds.git
Own the files:
[sudo] chown -R $USER:$USER $LFS/LFSPkgBuilds
[sudo] ln -sv LFSPkgBuilds/LFSPkgBuildScripts $LFS/LFSPkgBuildScripts
[sudo] ln -sv LFSPkgBuilds/LFSScripts $LFS/LFSScripts
#Own the files ( If needed ):
[sudo -E] chown -R $USER:$USER $LFS/LFSPkgBuilds
3)
#cd into the SystemDBuild folder
cd ${LFS}//LFSPkgBuilds/LFSScripts/SystemDBuild
#cd into the LFSScripts folder
cd $LFS/LFSScripts
#Set up config files !!IMPORTANT!!
#You can just press 'Return' to accept the default.
@ -104,7 +97,6 @@ fi
10)
#You may/will have to re-own/set perms the various folders etc, so:
[sudo] chown -R $USER:$USER $LFS/LFSPkgBuilds $LFS/LFSSourceArchives/$LFSVERSION $LFS/LFSBuiltPackages/$LFSVERSION
#chmod -R 755 $LFS/LFSSourceArchives/$LFSVERSION $LFS/LFSBuiltPackages/$LFSVERSION
11)
#Create a link from downloaded linux tarball to /LFSSourceArchives/$LFSVERSION/KERNEL to prevent re-downloading source tarball.
@ -150,7 +142,11 @@ lfspkg --setup
#after installing the base system you will probably want to at least set check etc to 1.
15)
#Build main system:
#Remake symlink
cd /LFSPkgBuildScripts/system
ln -snvf ../../../LFSScripts/PkgVersions PkgVersions
#Build main system
cd /LFSPkgBuildScripts/system/system-meta
#LFSSetUp will have created a symlink to your desired init type so use:
@ -180,35 +176,6 @@ Walk the dog
#logout from temporary system:
exit
17)
#optional strip etc see:
#http://www.linuxfromscratch.org/lfs/view/stable/chapter08/strippingagain.html
#Mostly not needed as the package manager does a strip before installing.
cd $LFS
save_lib="ld-2.33.so libc-2.33.so libpthread-2.33.so libthread_db-1.0.so"
cd lib
for LIB in $save_lib
do
sudo objcopy --only-keep-debug $LIB $LIB.dbg
sudo strip --strip-unneeded $LIB
sudo objcopy --add-gnu-debuglink=$LIB.dbg $LIB
done
save_usrlib="libquadmath.so.0.0.0 libstdc++.so.6.0.28 libitm.so.1.0.0 libatomic.so.1.2.0"
cd $LFS/usr/lib
for LIB in $save_usrlib
do
sudo objcopy --only-keep-debug $LIB $LIB.dbg
sudo strip --strip-unneeded $LIB
sudo objcopy --add-gnu-debuglink=$LIB.dbg $LIB
done
unset LIB save_lib save_usrlib
cd $LFS
sudo find usr/lib/ -type f -name "*.a" -exec strip --strip-debug {} ';'
sudo find lib/ usr/lib/ -type f -name "*.so*" ! -name "*dbg" -exec strip --strip-unneeded {} ';'
sudo find bin sbin usr/{bin,sbin,libexec} -type f -exec strip --strip-all {} ';'
18)
#Re-enter the chroot:
cd $LFS/LFSScripts
@ -229,7 +196,7 @@ lfspkg --setup
#Configure and build the kernel:
cd /LFSPkgBuildScripts/kernel
#Optional copy the config for the running kernel, don't do this if running from bootcd, you may have to set KERNELVERSION.
#Optional copy the config for the running kernel, don't do this if running from bootcd, you may have to set KERNELVERSION if you are doing this from chroot.
#gunzip < /proc/config.gz > config-${KERNELVERSION}
./kernel.LFSBuild install