#---------------------------------------------------------------------------- # build_util-linux.txt - how to build the util-linux binaries and create folder and packages # # Creation : 2009-08-16 holbru # Last update: $Id$ # # !!! this is not a script but an step-by-step howto !!! #------------------------------------------------------------------------------ exit 1 ### download the source code from the internet, e.g. # http://www.kernel.org/pub/linux/utils/util-linux/ # ftp://ftp.infradead.org/pub/util-linux/ # util-linux-2.12r.tar.bz2 ### extract file in a temporary location tar -xjvf util-linux-2.12r.tar.bz2 cd util-linux-2.12r ### build export CFLAGS='-O2 -march=i486' export CXXFLAGS="${CFLAGS}" ./configure --prefix=/usr \ --build=i486-pc-linux-gnu \ --host=i486-pc-linux-gnu make HAVE_KILL=yes HAVE_SLN=yes make HAVE_KILL=yes HAVE_SLN=yes DESTDIR=/public/util-linux install KILL kommt von Procps SLN kommt von GNU LibC # strip files/binarys strip -R .note -R .comment /public/util-linux/{sbin/*,bin/*{usr/{sbin/*,bin/*}} cd /usr/sbin ln -s rdev {ramsize,rootflags,vidmode} cd /sbin ln -s swapon swapoff # copy files cp *** /lib/util-linux/bin_**_util-linux_2_12r/*** 2010-11-13 Switch to util-linux-ng ### download the source code from the internet, e.g. # http://www.kernel.org/pub/linux/utils/util-linux-ng/ # http://www.kernel.org/pub/linux/utils/util-linux-ng/v2.18/util-linux-ng-2.18.tar.bz2 ### extract file in a temporary location tar -xjvf util-linux-ng-2.18.tar.bz2 cd util-linux-ng-2.18 ### build export CFLAGS='-O2 -march=i486' export CXXFLAGS="${CFLAGS}" ./configure --prefix=/usr \ --build=i486-pc-linux-gnu \ --host=i486-pc-linux-gnu \ --enable-arch \ --enable-partx \ --enable-write make HAVE_KILL=yes HAVE_SLN=yes make HAVE_KILL=yes HAVE_SLN=yes DESTDIR=/tmp/util-linux-ng-2.18 install strip -R .note -R .comment /tmp/util-linux-ng-2.18/{sbin/*,bin/*,usr/sbin/*,usr/bin/*,lib/*.so.*} KILL kommt von Procps SLN kommt von GNU LibC 2010-12-16 util-linux-ng-2.18 neu gebaut ohne libblkid, libuuid, libmount, uuidd und fsck, um das Formatieren von logischen lvm-Laufwerken zu ermoeglichen: cd /usr/src/util-linux-ng-2.18 mkdir -p build cd build export CFLAGS='-O2 -march=i486' export CXXFLAGS="${CFLAGS}" ../configure --prefix=/usr \ --build=i486-pc-linux-gnu \ --host=i486-pc-linux-gnu \ --enable-arch \ --enable-partx \ --enable-write \ --disable-libblkid \ --disable-libuuid \ --disable-libmount \ --disable-uuidd \ --disable-fsck make HAVE_KILL=yes HAVE_SLN=yes make HAVE_KILL=yes HAVE_SLN=yes DESTDIR=/tmp/util-linux-ng-2.18 install strip -R .note -R .comment /tmp/util-linux-ng-2.18/{sbin/*,bin/*,usr/sbin/*,usr/bin/*,lib/*.so.*} Achtung! Vorher muessen die e2fsprogs mit den Libs gebaut werden, denn es werden einige Programme gegen diese gelinkt: /tmp/util-linux-ng-2.18/bin/mount libblkid.so.1 => /lib/libblkid.so.1 (0x4001a000) libc.so.6 => /lib/libc.so.6 (0x40025000) libuuid.so.1 => /lib/libuuid.so.1 (0x40136000) /lib/ld-linux.so.2 (0x40000000) /tmp/util-linux-ng-2.18/bin/umount libblkid.so.1 => /lib/libblkid.so.1 (0x4001a000) libc.so.6 => /lib/libc.so.6 (0x40025000) libuuid.so.1 => /lib/libuuid.so.1 (0x40136000) /lib/ld-linux.so.2 (0x40000000) /tmp/util-linux-ng-2.18/sbin/mkswap libuuid.so.1 => /lib/libuuid.so.1 (0x4001a000) libc.so.6 => /lib/libc.so.6 (0x4001f000) /lib/ld-linux.so.2 (0x40000000) /tmp/util-linux-ng-2.18/sbin/swapoff libblkid.so.1 => /lib/libblkid.so.1 (0x4001a000) libc.so.6 => /lib/libc.so.6 (0x40025000) libuuid.so.1 => /lib/libuuid.so.1 (0x40136000) /lib/ld-linux.so.2 (0x40000000) /tmp/util-linux-ng-2.18/sbin/swapon libblkid.so.1 => /lib/libblkid.so.1 (0x4001a000) libc.so.6 => /lib/libc.so.6 (0x40025000) libuuid.so.1 => /lib/libuuid.so.1 (0x40136000) /lib/ld-linux.so.2 (0x40000000) # 2011-12-11 # util-linux-2.20.1 export CFLAGS='-O2 -march=i486' export CXXFLAGS="${CFLAGS}" ./configure --prefix=/usr \ --build=i486-pc-linux-gnu \ --host=i486-pc-linux-gnu \ --enable-arch \ --enable-partx \ --enable-write configure: WARNING: openat() function not found; do not build lsblk configure: WARNING: openat() function not found; do not build switch_root configure: WARNING: fallocate syscall not found; do not build fallocate configure: WARNING: unshare syscall not found; do not build unshare openat() was added to Linux in kernel 2.6.16. The unshare() system call was added to Linux in kernel 2.6.16. fallocate() is available on Linux since kernel 2.6.23. Support is provided by glibc since version 2.10. make HAVE_KILL=yes HAVE_SLN=yes make HAVE_KILL=yes HAVE_SLN=yes DESTDIR=/public/util-linux/2.20.1 install fdopendir() is available in glibc since version 2.4. # 2012-02-01 # util-linux-2.19.1 # 2012-05-27 rebuild with e2fsporgs 1.42.3 # 2012-08-15 rebuild with e2fsporgs 1.42.5 mkdir -p build & cd build export CFLAGS='-O2 -march=i486' export CXXFLAGS="${CFLAGS}" ../configure \ --build=i486-pc-linux-gnu \ --host=i486-pc-linux-gnu \ --prefix=/usr \ --enable-arch \ --enable-partx \ --enable-write \ --disable-libblkid \ --disable-libuuid \ --disable-libmount \ --disable-uuidd \ --disable-fsck make HAVE_KILL=yes HAVE_SLN=yes make HAVE_KILL=yes HAVE_SLN=yes DESTDIR=/public/utils/util-linux/2.19.1 install # 2012-12-19 -> util-linux-2.21.2 LibC-2.8 # The FHS recommends using the /var/lib/hwclock directory instead of the usual # /etc directory as the location for the adjtime file. To make the hwclock #program FHS-compliant, run the following: sed -i -e 's@etc/adjtime@var/lib/hwclock/adjtime@g' \ $(grep -rl '/etc/adjtime' .) mkdir -pv /var/lib/hwclock # upstream patches # from SuSE util-linux-2.21.2-7.2.src.rpm # 241372 - remove legacy warnings from fdisk Patch1: util-linux-2.12r-fdisk_remove_bogus_warnings.patch Patch2: util-linux-2.20-libmount-deps.patch Patch4: mount-new-allow-sloppy-for-non-root.patch Patch5: libmount-don-t-use-nosuid-noexec-nodev-for-cifs-user.patch # Patches 6-10: bcn#767208 (taken from upstream Patch6: mount-new-improve-error-messages.patch Patch7: libmount-add-special-MNT_ERR-codes.patch Patch8: mount-new-use-MNT_ERR-for-error-messages.patch Patch9: libmount-add-MNT_ERR_LOOPDEV.patch Patch10: mount-new-add-loopdev-specific-error-message.patch # disable encryption Patch11: util-linux-2.21.2-noenc.diff Patch12: util-linux-2.21.2-noenc-suse.diff Patch13: login-close-tty-before-vhangup.patch # hack for boot.localfs Patch20: util-linux-HACK-boot.localfs.diff patch -Np1 -i ../ export CFLAGS='-O2 -march=i486' export CXXFLAGS="${CFLAGS}" autoreconf -fi mkdir -p build-o && cd build-o ../configure \ --build=i486-pc-linux-gnu \ --host=i486-pc-linux-gnu \ --enable-ddate \ --enable-write # # # 2013-07-19 - LIbC-2.11.3 # from SuSE util-linux-2.23.1-4.3.src.rpm # 2013-07-29 rebuild with ld-2.22 # 241372 - remove legacy warnings from fdisk Patch1: util-linux-2.23.1-fdisk_remove_bogus_warnings.patch Patch2: util-linux-2.23.1-eject-fpie.patch # PATCH-FIX-UPSTREAM eject-scsi-check-host_status-and-driver_status.patch bnc358033 anick Patch5: eject-scsi-check-host_status-and-driver_status.patch # disable encryption Patch12: util-linux-2.23.1-noenc-suse.diff # hack for boot.localfs Patch20: util-linux-HACK-boot.localfs.diff patch -Np1 -i ../ export CFLAGS='-O2 -march=i486' export CXXFLAGS="${CFLAGS}" autoreconf -fi mkdir -p build-ld && cd build-ld ../configure \ --build=i486-pc-linux-gnu \ --host=i486-pc-linux-gnu \ --enable-write \ --disable-su \ --disable-sulogin \ --disable-login \ --without-user \ --without-udev \ --enable-deprecated-mount make make DESTDIR=/public/utils/util-linux/2.23.1-ld install # strip files/binarys for filename in `find /public/utils/util-linux/2.23.1-ld/{sbin/*,bin/*,usr/sbin/*,usr/bin/*,lib/*.so.*} -type f` do echo $filename strip -R .note -R .comment "$filename" done cd /usr/sbin ln -sf swapon swapoff #UsrMerge bin_files="dmesg findmnt lsblk more mount mountpoint umount" sbin_files="agetty blkid blockdev cfdisk chcpu ctrlaltdel fdisk findfs fsck.cramfs fsck.minix fsfreeze fstrim hwclock losetup mkfs mkfs.bfs mkfs.cramfs mkfs.minix mkswap pivot_root raw sfdisk swaplabel swapoff swapon switch_root wipefs" cd /bin for _fname in ${bin_files} do rm -f ${_fname} ln -sf ../usr/bin/${_fname} done cd /sbin for _fname in ${sbin_files} do rm -f ${_fname} ln -sf ../usr/sbin/${_fname} done #EndUsrMerge chmod 4755 /usr/bin/mount /usr/bin/umount chmod 2755 /usr/bin/wall /usr/bin/write cd /usr/bin ln -sf setarch i386 ln -sf setarch linux32 ln -sf setarch linux64 cd /lib ln -sf libblkid.so.1.1.0 libblkid.so.1 ln -sf libmount.so.1.1.0 libmount.so.1 ln -sf libuuid.so.1.3.0 libuuid.so.1 # check for new place from adjtime if [ ! -f var/lib/hwclock/adjtime ] then mv /etc/adjtime /var/lib/hwclock/adjtime # create symlink for compability cd /etc ln -sf ../var/lib/hwclock/adjtime fi # 2015-06-08 -> util-linux-2.26.2 # build with rpm Suse # util-linux-2.26.2-1.1.src.rpm # util-linux-eis.spec # first step, replace only the existings files # 2016-02-19 -> util-linux-2.26.2 # build with rpm suse # util-linux-2.26.2-1.1.src.rpm # util-linux-eis.spec # rebuild with all pam utils # hbfl # 2017-10-09 -> util-linux-2.28 # build with rpm suse # util-linux-2.28-12.6.1.src.rpm # hbfl # 2019-10-12 -> util-linux-2.34 # build with rpm suse # util-linux-2.34-3.3.src.rpm # hbfl # 2020-04-06 -> util-linux-2.34 # rebuild with rpm suse -> gcc-9.2.1 -> glibc-2.31 # util-linux-2.34-4.4.src.rpm # hbfl # 2021-06-06 -> util-linux-2.36.2 # build with rpm suse -> gcc-10 -> glibc-2.33 # util-linux-2.36.2-2.1.src.rpm # hbfl # 2023-04-18 -> util-linux-2.38.1 # build with rpm suse -> gcc-12 -> glibc-2.37 # util-linux-2.38.1-12.1.src.rpm # util-linux-systemd-2.38.1-12.1.src.rpm # hbfl # 2024-07-12 -> util-linux-2.40.1 # build with rpm suse # util-linux-2.40.1-4.1.src.rpm # util-linux-systemd-2.40.1-4.1.src.rpm # hbfl # 2025-03-16 -> util-linux-2.40.4 # build with rpm suse -> gcc-14 -> glibc-2.41 # util-linux-2.40.4-4.2.src.rpm # hbfl # 2025-04-24 -> util-linux-systemd-2.40.4 # build with rpm suse -> gcc-14 -> glibc-2.41 # util-linux-systemd-2.40.4-4.2.src.rpm # spec file anpassen fsck #--------------------------------------------------------------------------- create folder Um die Folder im Hauptverszeichnis zu erstellen gibt es das Script 'util-linux-folder.sh' unter util-linux/_ADMIN/ mit util-linux-folder.sh -v 2.12r -w create wird die folder Struktur fuer die lib Version 2.12r erstellt nun koennen die files aus dem compilat eingefuegt werden. mit util-linux-folder.sh -v 2.12r -w add wird ein svn add auf die erzeugten Folder durchgefuehrt. mit util-linux-folder.sh -v 2.12r -w list wird fuer jeden Folder die files-list.txt erzeugt, add muss zwingend vorher ausgefuehrt worden sein mit util-linux-folder.sh -v 2.12r -w ci erfolgt der commit der erzeugten Folder In den eis und eis_dev Foldern muessen keine Anpassungen vorgenommen werden. Diese Anpassungen erfolgen beim packen der packages durch mktarball.sh mit den _do_ Scripten unter _ADMIN automatisch. In den Pack-Scripten unter _ADMIN muss dann noch die Pfadangabe geaendert werden, auf den soeben erzeugten Pfad und ein commit ausgefuehrt werden. Nach dem checkout auf eisler koennen nun die packages erzeugt werden. die wichtigsten Parameter fuer mktarball.sh sind dann -setdate now -setversion ${version} mktarball.sh - home -setdate now -setversion [version angeben] util-linux util-linux-dev duch die Angabe von -home werden die packages in die Folder Struktur /home/user/public_html/packages/ kopiert und koennen von da direkt auf Pack-Eis geladen werden. wichtig ist noch, dass unbedingt die 'lib' Version zuerst gebaut werden muss, da fuer die 'dev' Version Informationen aus der 'lib' Info Datei gelesen werden.