diff --git a/libmount-Fix-regression-when-mounting-with-atime.patch b/libmount-Fix-regression-when-mounting-with-atime.patch new file mode 100644 index 0000000000000000000000000000000000000000..1c9865372a94267f0f09dd914cd3f1ca770bbf20 --- /dev/null +++ b/libmount-Fix-regression-when-mounting-with-atime.patch @@ -0,0 +1,133 @@ +From 2b99ee2526ae61be761b0e31c50e106dbec5e9e4 Mon Sep 17 00:00:00 2001 +From: Filipe Manana +Date: Thu, 17 Aug 2023 10:20:13 +0100 +Subject: [PATCH] libmount: Fix regression when mounting with atime + +A regression was introduced in v2.39 that causes mounting with the atime +option to fail: + + $ mkfs.ext4 -F /dev/sdi + $ mount -o atime /dev/sdi /mnt/sdi + mount: /mnt/sdi: not mount point or bad option. + dmesg(1) may have more information after failed mount system call. + +The failure comes from the mount_setattr(2) call returning -EINVAL. This +is because we pass an invalid value for the attr_clr argument. From a +strace capture we have: + + mount_setattr(4, "", AT_EMPTY_PATH, {attr_set=0, attr_clr=MOUNT_ATTR_NOATIME, propagation=0 /* MS_??? */, userns_fd=0}, 32) = -1 EINVAL (Invalid argument) + +We can't pass MOUNT_ATTR_NOATIME to mount_setattr(2) through the attr_clr +argument because all atime options are exclusive, so in order to set atime +one has to pass MOUNT_ATTR__ATIME to attr_clr and leave attr_set as +MOUNT_ATTR_RELATIME (which is defined as a value of 0). + +This can be read from the man page for mount_setattr(2) and also from the +kernel source: + + $ cat fs/namespace.c + static int build_mount_kattr(const struct mount_attr *attr, size_t usize, + struct mount_kattr *kattr, unsigned int flags) + { + (...) + /* + * Since the MOUNT_ATTR_ values are an enum, not a bitmap, + * users wanting to transition to a different atime setting cannot + * simply specify the atime setting in @attr_set, but must also + * specify MOUNT_ATTR__ATIME in the @attr_clr field. + * So ensure that MOUNT_ATTR__ATIME can't be partially set in + * @attr_clr and that @attr_set can't have any atime bits set if + * MOUNT_ATTR__ATIME isn't set in @attr_clr. + */ + if (attr->attr_clr & MOUNT_ATTR__ATIME) { + if ((attr->attr_clr & MOUNT_ATTR__ATIME) != MOUNT_ATTR__ATIME) + return -EINVAL; + + /* + * Clear all previous time settings as they are mutually + * exclusive. + */ + kattr->attr_clr |= MNT_RELATIME | MNT_NOATIME; + switch (attr->attr_set & MOUNT_ATTR__ATIME) { + case MOUNT_ATTR_RELATIME: + kattr->attr_set |= MNT_RELATIME; + break; + case MOUNT_ATTR_NOATIME: + kattr->attr_set |= MNT_NOATIME; + break; + case MOUNT_ATTR_STRICTATIME: + break; + default: + return -EINVAL; + } + (...) + +So fix this by setting attr_clr MOUNT_ATTR__ATIME if we want to clear any +atime related option. + +Signed-off-by: Filipe Manana +--- + libmount/src/optlist.c | 13 ++++++++++++- + tests/expected/libmount/context-mount-flags | 3 +++ + tests/ts/libmount/context | 9 ++++++++- + 3 files changed, 23 insertions(+), 2 deletions(-) + +diff --git a/libmount/src/optlist.c b/libmount/src/optlist.c +index e93810b47..d0afc94f7 100644 +--- a/libmount/src/optlist.c ++++ b/libmount/src/optlist.c +@@ -875,7 +875,18 @@ int mnt_optlist_get_attrs(struct libmnt_optlist *ls, uint64_t *set, uint64_t *cl + + if (opt->ent->mask & MNT_INVERT) { + DBG(OPTLIST, ul_debugobj(ls, " clr: %s", opt->ent->name)); +- *clr |= x; ++ /* ++ * All atime settings are mutually exclusive so *clr must ++ * have MOUNT_ATTR__ATIME set. ++ * ++ * See the function fs/namespace.c:build_mount_kattr() ++ * in the linux kernel source. ++ */ ++ if (x == MOUNT_ATTR_RELATIME || x == MOUNT_ATTR_NOATIME || ++ x == MOUNT_ATTR_STRICTATIME) ++ *clr |= MOUNT_ATTR__ATIME; ++ else ++ *clr |= x; + } else { + DBG(OPTLIST, ul_debugobj(ls, " set: %s", opt->ent->name)); + *set |= x; +diff --git a/tests/expected/libmount/context-mount-flags b/tests/expected/libmount/context-mount-flags +index 960641863..eb71323dd 100644 +--- a/tests/expected/libmount/context-mount-flags ++++ b/tests/expected/libmount/context-mount-flags +@@ -3,3 +3,6 @@ ro,nosuid,noexec + successfully mounted + rw,nosuid,noexec + successfully umounted ++successfully mounted ++rw,relatime ++successfully umounted +diff --git a/tests/ts/libmount/context b/tests/ts/libmount/context +index f5b47185e..a5d2e81a3 100755 +--- a/tests/ts/libmount/context ++++ b/tests/ts/libmount/context +@@ -116,8 +116,15 @@ $TS_CMD_FINDMNT --kernel --mountpoint $MOUNTPOINT -o VFS-OPTIONS -n >> $TS_OUTPU + + ts_run $TESTPROG --umount $MOUNTPOINT >> $TS_OUTPUT 2>> $TS_ERRLOG + is_mounted $DEVICE && echo "$DEVICE still mounted" >> $TS_OUTPUT 2>> $TS_ERRLOG +-ts_finalize_subtest + ++# Test that the atime option works after the migration to use the new kernel mount APIs. ++ts_run $TESTPROG --mount -o atime $DEVICE $MOUNTPOINT >> $TS_OUTPUT 2>> $TS_ERRLOG ++$TS_CMD_FINDMNT --kernel --mountpoint $MOUNTPOINT -o VFS-OPTIONS -n >> $TS_OUTPUT 2>> $TS_ERRLOG ++is_mounted $DEVICE || echo "$DEVICE not mounted" >> $TS_OUTPUT 2>> $TS_ERRLOG ++ts_run $TESTPROG --umount $MOUNTPOINT >> $TS_OUTPUT 2>> $TS_ERRLOG ++is_mounted $DEVICE && echo "$DEVICE still mounted" >> $TS_OUTPUT 2>> $TS_ERRLOG ++ ++ts_finalize_subtest + + ts_init_subtest "mount-loopdev" + mkdir -p $MOUNTPOINT &> /dev/null +-- +2.40.1 + diff --git a/login-default-motd-file.patch b/login-default-motd-file.patch new file mode 100644 index 0000000000000000000000000000000000000000..3670848498094fae83dfa7452b09e13e0d79e759 --- /dev/null +++ b/login-default-motd-file.patch @@ -0,0 +1,13 @@ +diff --git a/include/pathnames.h b/include/pathnames.h +index 3845d4c33..fac3a0783 100644 +--- a/include/pathnames.h ++++ b/include/pathnames.h +@@ -41,7 +41,7 @@ + #ifndef _PATH_MAILDIR + # define _PATH_MAILDIR "/var/spool/mail" + #endif +-#define _PATH_MOTDFILE "/usr/share/misc/motd:/run/motd:/etc/motd" ++#define _PATH_MOTDFILE "/usr/share/misc/motd:/run/motd:/run/motd.d:/etc/motd:/etc/motd.d" + #ifndef _PATH_NOLOGIN + # define _PATH_NOLOGIN "/etc/nologin" + #endif diff --git a/login-lastlog-create.patch b/login-lastlog-create.patch new file mode 100644 index 0000000000000000000000000000000000000000..e2523d3aaadd1d9cb4a527db65491ac04a3566f5 --- /dev/null +++ b/login-lastlog-create.patch @@ -0,0 +1,12 @@ +diff -up util-linux-2.36/login-utils/login.c.kzak util-linux-2.36/login-utils/login.c +--- util-linux-2.36/login-utils/login.c.kzak 2020-07-23 14:13:26.777030764 +0200 ++++ util-linux-2.36/login-utils/login.c 2020-07-23 14:11:22.793686983 +0200 +@@ -585,7 +585,7 @@ static void log_lastlog(struct login_con + sa.sa_handler = SIG_IGN; + sigaction(SIGXFSZ, &sa, &oldsa_xfsz); + +- fd = open(_PATH_LASTLOG, O_RDWR, 0); ++ fd = open(_PATH_LASTLOG, O_RDWR | O_CREAT, 0); + if (fd < 0) + goto done; + offset = cxt->pwd->pw_uid * sizeof(ll); diff --git a/util-linux-2.38.1-harlink-test.patch b/util-linux-2.38.1-harlink-test.patch deleted file mode 100644 index 29b252399a76e56df05b5748022fac1823538651..0000000000000000000000000000000000000000 --- a/util-linux-2.38.1-harlink-test.patch +++ /dev/null @@ -1,80 +0,0 @@ -From 1b5fc3fe13947baab133bd426f3377e2eb5ccc90 Mon Sep 17 00:00:00 2001 -From: Karel Zak -Date: Wed, 8 Jun 2022 11:50:04 +0200 -Subject: [PATCH] tests: (hardlink) remove runtime depend output - -The Method: field depends on kernel crypto support, otherwise hardlink -falls back to memcpy(). - -Fixes: https://github.com/util-linux/util-linux/issues/1710 -Signed-off-by: Karel Zak ---- - .../expected/hardlink/options-maximum-size-8191 | 2 +- - .../expected/hardlink/options-maximum-size-8192 | 2 +- - tests/ts/hardlink/options | 16 ++++++++++++---- - 3 files changed, 14 insertions(+), 6 deletions(-) - -diff --git a/tests/expected/hardlink/options-maximum-size-8191 b/tests/expected/hardlink/options-maximum-size-8191 -index 30fe1acad4..d57c92ae94 100644 ---- a/tests/expected/hardlink/options-maximum-size-8191 -+++ b/tests/expected/hardlink/options-maximum-size-8191 -@@ -1,6 +1,6 @@ - Number of test files: 26 - Mode: real --Method: sha256 -+Method: [Redacted] - Files: 26 - Linked: 0 files - Compared: 0 xattrs -diff --git a/tests/expected/hardlink/options-maximum-size-8192 b/tests/expected/hardlink/options-maximum-size-8192 -index 723811e9ee..c571adf52d 100644 ---- a/tests/expected/hardlink/options-maximum-size-8192 -+++ b/tests/expected/hardlink/options-maximum-size-8192 -@@ -1,6 +1,6 @@ - Number of test files: 26 - Mode: real --Method: sha256 -+Method: [Redacted] - Files: 26 - Linked: 18 files - Compared: 0 xattrs -diff --git a/tests/ts/hardlink/options b/tests/ts/hardlink/options -index fc1a0d6525..2a1c919a28 100755 ---- a/tests/ts/hardlink/options -+++ b/tests/ts/hardlink/options -@@ -40,6 +40,14 @@ show_srcdir() - find "$SRCDIR" -type f -printf "%P\t%n\t%s\t%Ts\t%m\n" | sort - } - -+summary_clean() -+{ -+ sed -i \ -+ -e 's/^Duration:.*/Duration: [Redacted]/' \ -+ -e 's/^Method:.*/Method: [Redacted]/' \ -+ $TS_OUTPUT -+} -+ - create_srcdir - - ts_init_subtest "orig" # just list original dir -@@ -80,16 +88,16 @@ ts_finalize_subtest - ts_init_subtest "maximum-size-8191" - create_srcdir - echo "Number of test files: $(find "$SRCDIR" -type f | wc -l)" >> $TS_OUTPUT --$TS_CMD_HARDLINK --maximum-size 8191 "$SRCDIR" | \ -- sed 's/^Duration:.*/Duration: [Redacted]/' >> $TS_OUTPUT 2>> $TS_ERRLOG -+$TS_CMD_HARDLINK --maximum-size 8191 "$SRCDIR" >> $TS_OUTPUT 2>> $TS_ERRLOG -+summary_clean - show_srcdir >> $TS_OUTPUT 2>> $TS_ERRLOG - ts_finalize_subtest - - ts_init_subtest "maximum-size-8192" - create_srcdir - echo "Number of test files: $(find "$SRCDIR" -type f | wc -l)" >> $TS_OUTPUT --$TS_CMD_HARDLINK --maximum-size 8192 "$SRCDIR" | \ -- sed 's/^Duration:.*/Duration: [Redacted]/' >> $TS_OUTPUT 2>> $TS_ERRLOG -+$TS_CMD_HARDLINK --maximum-size 8192 "$SRCDIR" >> $TS_OUTPUT 2>> $TS_ERRLOG -+summary_clean - show_srcdir >> $TS_OUTPUT 2>> $TS_ERRLOG - ts_finalize_subtest - diff --git a/util-linux-2.38.1.tar.xz b/util-linux-2.39.1.tar.xz similarity index 47% rename from util-linux-2.38.1.tar.xz rename to util-linux-2.39.1.tar.xz index e99a8156eebf5538d69205a3ce720e730ce144dd..28bcec434c5889ce2bef190225feb2eb4817b767 100644 Binary files a/util-linux-2.38.1.tar.xz and b/util-linux-2.39.1.tar.xz differ diff --git a/util-linux.spec b/util-linux.spec index d6e51d5797ada5312736843534a20cc34c9b694f..772bd9a1b85d897cf128157e0920d222d3dffb91 100644 --- a/util-linux.spec +++ b/util-linux.spec @@ -1,55 +1,77 @@ -%define anolis_release 3 -%global upstream_version 2.38.1 -%global major_version v2.38 -%global compldir %{_datadir}/bash-completion/completions/ +Summary: Collection of basic system utilities +Name: util-linux +Version: 2.39.1 +Release: 1%{?dist} +License: GPLv2 and GPLv2+ and LGPLv2+ and BSD with advertising and Public Domain +URL: https://en.wikipedia.org/wiki/Util-linux -Name: util-linux -Version: 2.38.1 -Release: %{anolis_release}%{?dist} -Summary: Collection of basic system utilities - -License: GPLv2 and GPLv2+ and LGPLv2+ and BSD with advertising and Public Domain -URL: https://en.wikipedia.org/wiki/Util-linux -Source0: https://mirrors.edge.kernel.org/pub/linux/utils/util-linux/%{major_version}/util-linux-%{upstream_version}.tar.xz -Source1: util-linux-login.pamd -Source2: util-linux-remote.pamd -Source3: util-linux-chsh-chfn.pamd -Source4: uuidd-tmpfiles.conf -Source5: adjtime -Source12: util-linux-su.pamd -Source13: util-linux-su-l.pamd -Source14: util-linux-runuser.pamd -Source15: util-linux-runuser-l.pamd -# https://github.com/util-linux/util-linux/commit/1b5fc3fe13947baab133bd426f3377e2eb5ccc90.patch -Patch0: util-linux-2.38.1-harlink-test.patch - -BuildRequires: make -BuildRequires: audit-libs-devel -BuildRequires: gettext-devel -BuildRequires: libselinux-devel -BuildRequires: ncurses-devel -BuildRequires: readline-devel -BuildRequires: pam-devel -BuildRequires: zlib-devel -BuildRequires: popt-devel -BuildRequires: libutempter-devel -Buildrequires: systemd-devel -BuildRequires: systemd -Buildrequires: libuser-devel -BuildRequires: libcap-ng-devel -BuildRequires: python3-devel -BuildRequires: gcc -BuildRequires: autoconf -BuildRequires: automake -BuildRequires: libtool -BuildRequires: bison -BuildRequires: rubygem-asciidoctor +### Macros +%global compldir %{_datadir}/bash-completion/completions/ -Provides: /sbin/nologin -Provides: /sbin/findfs +%global pypkg python3 +%global pyver 3 + +### Dependencies +BuildRequires: make +BuildRequires: audit-libs-devel >= 1.0.6 +BuildRequires: gettext-devel +BuildRequires: libselinux-devel +BuildRequires: ncurses-devel +BuildRequires: readline-devel +BuildRequires: pam-devel +BuildRequires: zlib-devel +BuildRequires: popt-devel +BuildRequires: libutempter-devel +BuildRequires: systemd-devel +BuildRequires: systemd +BuildRequires: libcap-ng-devel +BuildRequires: %{pypkg}-devel +BuildRequires: gcc +BuildRequires: rubygem-asciidoctor +BuildRequires: po4a + +# enable if make changes to build-system +BuildRequires: autoconf +BuildRequires: automake +BuildRequires: libtool +BuildRequires: bison + +### Sources +Source0: https://mirrors.edge.kernel.org/pub/linux/utils/util-linux/v2.39/util-linux-%{version}.tar.xz +Source1: util-linux-login.pamd +Source2: util-linux-remote.pamd +Source3: util-linux-chsh-chfn.pamd +Source4: uuidd-tmpfiles.conf +Source5: adjtime +Source12: util-linux-su.pamd +Source13: util-linux-su-l.pamd +Source14: util-linux-runuser.pamd +Source15: util-linux-runuser-l.pamd + +### Obsoletes & Conflicts & Provides +Conflicts: initscripts < 9.79-4 +Conflicts: bash-completion < 1:2.1-1 +# su(1) and runuser(1) merged into util-linux v2.22 +Conflicts: coreutils < 8.20 +# eject has been merged into util-linux v2.22 +Obsoletes: eject <= 2.1.5 Provides: eject = 2.1.6 +# rfkill has been merged into util-linux v2.31 +Obsoletes: rfkill <= 0.5 Provides: rfkill = 0.5 +# sulogin, utmpdump merged into util-linux v2.22; +# last, lastb merged into util-linux v2.24 +Conflicts: sysvinit-tools < 2.88-14 +# rename from util-linux-ng back to util-linux +Obsoletes: util-linux-ng < 2.19 Provides: util-linux-ng = %{version}-%{release} +Conflicts: filesystem < 3 +Provides: /sbin/nologin +Provides: /sbin/findfs +# util-linux-user was dropped in 2.39-1 and its contents moved back +# to util-linux +Obsoletes: util-linux-user < 2.39-1 +Provides: util-linux-user = %{version}-%{release} Requires(post): coreutils Requires: pam >= 1.1.3-7, /etc/pam.d/system-auth @@ -61,14 +83,28 @@ Requires: libsmartcols = %{version}-%{release} Requires: libfdisk = %{version}-%{release} Requires: util-linux-core = %{version}-%{release} +### Ready for upstream? +### +# 151635 - makeing /var/log/lastlog +Patch0: login-lastlog-create.patch +# Add `/run/motd.d` to the hardcoded MOTD_FILE +# https://github.com/coreos/console-login-helper-messages/issues/60 +Patch1: login-default-motd-file.patch + +### Upstream +### +Patch2: libmount-Fix-regression-when-mounting-with-atime.patch + + %description The util-linux package contains a large variety of low-level system utilities that are necessary for a Linux system to function. Among -others, Util-linux contains the fdisk configuration tool and the login +others, util-linux contains the fdisk configuration tool and the login program. + %package -n util-linux-core -Summary: The most essential utilities from the util-linux suite. +Summary: The most essential utilities from the util-linux suite License: GPLv2 and GPLv2+ and LGPLv2+ and BSD with advertising and Public Domain Provides: /bin/dmesg Provides: /bin/kill @@ -94,17 +130,18 @@ minimal installations. %package -n libfdisk -Summary: Partitioning library for fdisk-like programs. +Summary: Partitioning library for fdisk-like programs License: LGPLv2+ %description -n libfdisk This is library for fdisk-like programs, part of util-linux. + %package -n libfdisk-devel -Summary: Partitioning library for fdisk-like programs. +Summary: Partitioning library for fdisk-like programs License: LGPLv2+ -Requires: libfdisk = %{version}-%{release} - +Requires: libfdisk%{?_isa} = %{version}-%{release} +Requires: pkgconfig %description -n libfdisk-devel This is development library and headers for fdisk-like programs, @@ -112,7 +149,7 @@ part of util-linux. %package -n libsmartcols -Summary: Formatting library for ls-like programs. +Summary: Formatting library for ls-like programs License: LGPLv2+ %description -n libsmartcols @@ -120,10 +157,10 @@ This is library for ls-like terminal programs, part of util-linux. %package -n libsmartcols-devel -Summary: Formatting library for ls-like programs. +Summary: Formatting library for ls-like programs License: LGPLv2+ -Requires: libsmartcols = %{version}-%{release} - +Requires: libsmartcols%{?_isa} = %{version}-%{release} +Requires: pkgconfig %description -n libsmartcols-devel This is development library and headers for ls-like terminal programs, @@ -133,18 +170,19 @@ part of util-linux. %package -n libmount Summary: Device mounting library License: LGPLv2+ -Requires: libblkid = %{version}-%{release} -Requires: libuuid = %{version}-%{release} +Requires: libblkid%{?_isa} = %{version}-%{release} +Requires: libuuid%{?_isa} = %{version}-%{release} Conflicts: filesystem < 3 %description -n libmount This is the device mounting library, part of util-linux. + %package -n libmount-devel Summary: Device mounting library License: LGPLv2+ -Requires: libmount = %{version}-%{release} - +Requires: libmount%{?_isa} = %{version}-%{release} +Requires: pkgconfig %description -n libmount-devel This is the device mounting development library and headers, @@ -154,9 +192,8 @@ part of util-linux. %package -n libblkid Summary: Block device ID library License: LGPLv2+ -Requires: libuuid = %{version}-%{release} +Requires: libuuid%{?_isa} = %{version}-%{release} Conflicts: filesystem < 3 -Requires(post): coreutils %description -n libblkid This is block device identification library, part of util-linux. @@ -165,13 +202,14 @@ This is block device identification library, part of util-linux. %package -n libblkid-devel Summary: Block device ID library License: LGPLv2+ -Requires: libblkid = %{version}-%{release} - +Requires: libblkid%{?_isa} = %{version}-%{release} +Requires: pkgconfig %description -n libblkid-devel This is the block device identification development library and headers, part of util-linux. + %package -n libuuid Summary: Universally unique ID library License: BSD @@ -192,8 +230,8 @@ See also the "uuid" package, which is a separate implementation. %package -n libuuid-devel Summary: Universally unique ID library License: BSD -Requires: libuuid = %{version}-%{release} - +Requires: libuuid%{?_isa} = %{version}-%{release} +Requires: pkgconfig %description -n libuuid-devel This is the universally unique ID development library and headers, @@ -208,6 +246,7 @@ across a network. See also the "uuid-devel" package, which is a separate implementation. + %package -n uuidd Summary: Helper daemon to guarantee uniqueness of time-based UUIDs Requires: libuuid = %{version}-%{release} @@ -223,62 +262,72 @@ uniqueness of time-based UUID generation even at very high rates on SMP systems. -%package -n python3-libmount +%package -n %{pypkg}-libmount Summary: Python bindings for the libmount library -Requires: libmount = %{version}-%{release} +Requires: libmount%{?_isa} = %{version}-%{release} License: LGPLv2+ -%description -n python3-libmount +%description -n %{pypkg}-libmount The libmount-python package contains a module that permits applications written in the Python programming language to use the interface supplied by the libmount library to work with mount tables (fstab, mountinfo, etc) and mount filesystems. -%package -n util-linux-user -Summary: libuser based util-linux utilities +%package -n util-linux-i18n +Summary: Internationalization pack for util-linux Requires: util-linux = %{version}-%{release} License: GPLv2 -%description -n util-linux-user -chfn and chsh utilities with dependence on libuser +%description -n util-linux-i18n +Internationalization pack with translated messages and manual pages for +util-linux commands. + %prep -%autosetup -n %{name}-%{upstream_version} -p1 +%autosetup -p1 -n %{name}-%{version} %build -./autogen.sh +unset LINGUAS || : + +# enable only when make a change to the build-system +#./autogen.sh + export CFLAGS="-D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 $RPM_OPT_FLAGS" export SUID_CFLAGS="-fpie" export SUID_LDFLAGS="-pie -Wl,-z,relro -Wl,-z,now" export DAEMON_CFLAGS="$SUID_CFLAGS" export DAEMON_LDFLAGS="$SUID_LDFLAGS" - %configure \ - --with-systemdsystemunitdir=%{_unitdir} \ - --disable-silent-rules \ - --disable-bfs \ - --disable-pg \ - --enable-chfn-chsh \ - --enable-usrdir-path \ - --enable-write \ - --disable-raw \ - --enable-hardlink \ - --enable-fdformat \ - --enable-asciidoc \ - --with-python=3 \ - --with-systemd \ - --with-udev \ - --with-selinux \ - --with-audit \ - --with-utempter \ - --disable-makeinstall-chown - + --with-systemdsystemunitdir=%{_unitdir} \ + --without-user \ + --disable-silent-rules \ + --disable-bfs \ + --disable-pg \ + --enable-chfn-chsh \ + --enable-usrdir-path \ + --enable-write \ + --disable-raw \ + --enable-hardlink \ + --enable-fdformat \ + --enable-asciidoc \ + --with-python=%{pyver} \ + --with-systemd \ + --with-udev \ + --with-selinux \ + --with-audit \ + --with-utempter \ + --disable-makeinstall-chown \ + +# build util-linux %make_build %check +#to run tests use "--with check" +%if %{?_with_check:1}%{!?_with_check:0} make check +%endif %install @@ -288,6 +337,7 @@ mkdir -p ${RPM_BUILD_ROOT}%{_sbindir} mkdir -p ${RPM_BUILD_ROOT}%{_sysconfdir}/{pam.d,security/console.apps} mkdir -p ${RPM_BUILD_ROOT}%{_tmpfilesdir}/tmpfiles.d +# install util-linux %make_install # And a dirs uuidd needs that the makefiles don't create @@ -298,6 +348,11 @@ install -d ${RPM_BUILD_ROOT}/var/lib/libuuid # /etc/adjtime install -m 644 %{SOURCE5} ${RPM_BUILD_ROOT}%{_sysconfdir}/adjtime +# libtool junk +rm -rf ${RPM_BUILD_ROOT}%{_libdir}/*.la +rm -f $RPM_BUILD_ROOT%{_libdir}/python*/site-packages/*.la +rm -f $RPM_BUILD_ROOT%{_libdir}/python*/site-packages/*.a + # PAM settings { pushd ${RPM_BUILD_ROOT}%{_sysconfdir}/pam.d @@ -315,21 +370,29 @@ install -m 644 %{SOURCE5} ${RPM_BUILD_ROOT}%{_sysconfdir}/adjtime ln -sf hwclock ${RPM_BUILD_ROOT}%{_sbindir}/clock echo ".so man8/hwclock.8" > ${RPM_BUILD_ROOT}%{_mandir}/man8/clock.8 + ln -sf ../proc/self/mounts %{buildroot}/etc/mtab + +# remove static libs rm -f $RPM_BUILD_ROOT%{_libdir}/lib{uuid,blkid,mount,smartcols,fdisk}.a + +# temporary remove to avoid conflicts with bash-completion pkg rm -f $RPM_BUILD_ROOT%{compldir}/{mount,umount} -%find_lang %name +# find MO files +%find_lang %{name} --all-name --with-man -mv %{name}.lang %{name}.files +touch %{name}.files +# create list of setarch(8) symlinks find $RPM_BUILD_ROOT%{_bindir}/ -regextype posix-egrep -type l \ - -regex ".*(linux32|linux64|i386|x86_64|uname26)$" \ - -printf "%{_bindir}/%f\n" >> %{name}.files + -regex ".*(linux32|linux64|i386|x86_64|uname26)$" \ + -printf "%{_bindir}/%f\n" >> %{name}.files find $RPM_BUILD_ROOT%{_mandir}/man8 -regextype posix-egrep \ - -regex ".*(linux32|linux64|i386|x86_64|uname26)\.8.*" \ - -printf "%{_mandir}/man8/%f*\n" >> %{name}.files + -regex ".*(linux32|linux64|i386|x86_64|uname26)\.8.*" \ + -printf "%{_mandir}/man8/%f*\n" >> %{name}.files + %pre -n uuidd getent group uuidd >/dev/null || groupadd -r uuidd @@ -338,11 +401,13 @@ useradd -r -g uuidd -d /var/lib/libuuid -s /sbin/nologin \ -c "UUID generator helper daemon" uuidd exit 0 +# Please, keep uuidd running after installation! Note that systemd_post is +# "systemctl preset" and it enable/disable service only. %post -n uuidd %systemd_post uuidd.service if [ $1 -eq 1 ] && [ -x /usr/bin/systemctl ]; then - # install - /bin/systemctl start uuidd.service > /dev/null 2>&1 || : + # install + /bin/systemctl start uuidd.service > /dev/null 2>&1 || : fi %preun -n uuidd @@ -361,24 +426,29 @@ fi %files -f %{name}.files %doc README NEWS AUTHORS -%doc Documentation/deprecated.txt +%doc Documentation/deprecated.txt %license Documentation/licenses/* %doc misc-utils/getopt-*.{bash,tcsh} -%config(noreplace) %{_sysconfdir}/pam.d/login -%config(noreplace) %{_sysconfdir}/pam.d/remote -%config(noreplace) %{_sysconfdir}/pam.d/su -%config(noreplace) %{_sysconfdir}/pam.d/su-l -%config(noreplace) %{_sysconfdir}/pam.d/runuser -%config(noreplace) %{_sysconfdir}/pam.d/runuser-l +%config(noreplace) %{_sysconfdir}/pam.d/login +%config(noreplace) %{_sysconfdir}/pam.d/remote +%config(noreplace) %{_sysconfdir}/pam.d/su +%config(noreplace) %{_sysconfdir}/pam.d/su-l +%config(noreplace) %{_sysconfdir}/pam.d/runuser +%config(noreplace) %{_sysconfdir}/pam.d/runuser-l +%config(noreplace) %{_sysconfdir}/pam.d/chfn +%config(noreplace) %{_sysconfdir}/pam.d/chsh %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/adjtime -%attr(4755,root,root) %{_bindir}/su -%attr(755,root,root) %{_bindir}/login -%attr(2755,root,tty) %{_bindir}/write +%attr(4755,root,root) %{_bindir}/su +%attr(755,root,root) %{_bindir}/login +%attr(2755,root,tty) %{_bindir}/write +%attr(4711,root,root) %{_bindir}/chfn +%attr(4711,root,root) %{_bindir}/chsh %{_unitdir}/fstrim.* + %{_bindir}/cal %{_bindir}/chmem %{_bindir}/choom @@ -389,6 +459,7 @@ fi %{_bindir}/eject %{_bindir}/fallocate %{_bindir}/fincore +%{_bindir}/fadvise %{_bindir}/getopt %{_bindir}/hexdump %{_bindir}/irqtop @@ -408,6 +479,7 @@ fi %{_bindir}/mcookie %{_bindir}/mesg %{_bindir}/namei +%{_bindir}/pipesz %{_bindir}/prlimit %{_bindir}/rename %{_bindir}/rev @@ -422,16 +494,20 @@ fi %{_bindir}/utmpdump %{_bindir}/uuidgen %{_bindir}/uuidparse +%{_bindir}/waitpid %{_bindir}/wall %{_bindir}/wdctl %{_bindir}/whereis %{_mandir}/man1/cal.1* +%{_mandir}/man1/chfn.1* %{_mandir}/man1/choom.1* +%{_mandir}/man1/chsh.1* %{_mandir}/man1/col.1* %{_mandir}/man1/colcrt.1* %{_mandir}/man1/colrm.1* %{_mandir}/man1/column.1* %{_mandir}/man1/eject.1* +%{_mandir}/man1/fadvise.1.* %{_mandir}/man1/fallocate.1* %{_mandir}/man1/fincore.1* %{_mandir}/man1/getopt.1* @@ -450,6 +526,7 @@ fi %{_mandir}/man1/mcookie.1* %{_mandir}/man1/mesg.1* %{_mandir}/man1/namei.1* +%{_mandir}/man1/pipesz.1.* %{_mandir}/man1/prlimit.1* %{_mandir}/man1/rename.1* %{_mandir}/man1/rev.1* @@ -462,9 +539,10 @@ fi %{_mandir}/man1/su.1* %{_mandir}/man1/uclampset.1.* %{_mandir}/man1/ul.1* -%{_mandir}/man1/utmpdump.1.* +%{_mandir}/man1/utmpdump.1* %{_mandir}/man1/uuidgen.1* %{_mandir}/man1/uuidparse.1* +%{_mandir}/man1/waitpid.1.* %{_mandir}/man1/wall.1* %{_mandir}/man1/whereis.1* %{_mandir}/man1/write.1* @@ -472,6 +550,7 @@ fi %{_mandir}/man5/terminal-colors.d.5* %{_mandir}/man8/addpart.8* %{_mandir}/man8/blkdiscard.8* +%{_mandir}/man8/blkpr.8.* %{_mandir}/man8/blkzone.8* %{_mandir}/man8/chcpu.8* %{_mandir}/man8/chmem.8* @@ -505,6 +584,7 @@ fi %{_mandir}/man8/zramctl.8* %{_sbindir}/addpart %{_sbindir}/blkdiscard +%{_sbindir}/blkpr %{_sbindir}/blkzone %{_sbindir}/chcpu %{_sbindir}/ctrlaltdel @@ -536,7 +616,9 @@ fi %{compldir}/blkzone %{compldir}/cal %{compldir}/chcpu +%{compldir}/chfn %{compldir}/chmem +%{compldir}/chsh %{compldir}/col %{compldir}/colcrt %{compldir}/colrm @@ -544,6 +626,7 @@ fi %{compldir}/ctrlaltdel %{compldir}/delpart %{compldir}/eject +%{compldir}/fadvise %{compldir}/fallocate %{compldir}/fdisk %{compldir}/fincore @@ -574,6 +657,7 @@ fi %{compldir}/mkfs.cramfs %{compldir}/mkfs.minix %{compldir}/namei +%{compldir}/pipesz %{compldir}/pivot_root %{compldir}/prlimit %{compldir}/readprofile @@ -597,12 +681,12 @@ fi %{compldir}/uuidgen %{compldir}/uuidparse %{compldir}/wall +%{compldir}/waitpid %{compldir}/wdctl %{compldir}/whereis %{compldir}/wipefs %{compldir}/write %{compldir}/zramctl - %{_sbindir}/clock %{_sbindir}/fdformat %{_sbindir}/hwclock @@ -612,7 +696,6 @@ fi %{_mandir}/man5/adjtime_config.5* %{compldir}/fdformat %{compldir}/hwclock - %{_sbindir}/cfdisk %{_sbindir}/sfdisk %{_mandir}/man8/cfdisk.8* @@ -620,10 +703,11 @@ fi %{compldir}/cfdisk %{compldir}/sfdisk + + %files -n util-linux-core -%ghost %verify(not md5 size mtime) %config(noreplace,missingok) /etc/mtab -%attr(4755,root,root) %{_bindir}/mount -%attr(4755,root,root) %{_bindir}/umount +%attr(4755,root,root) %{_bindir}/mount +%attr(4755,root,root) %{_bindir}/umount %{_bindir}/chrt %{_bindir}/dmesg %{_bindir}/findmnt @@ -707,17 +791,7 @@ fi %{_sbindir}/swapoff %{_sbindir}/swapon %{_sbindir}/switch_root - - -%files -n util-linux-user -%config(noreplace) %{_sysconfdir}/pam.d/chfn -%config(noreplace) %{_sysconfdir}/pam.d/chsh -%attr(4711,root,root) %{_bindir}/chfn -%attr(4711,root,root) %{_bindir}/chsh -%{_mandir}/man1/chfn.1* -%{_mandir}/man1/chsh.1* -%{compldir}/chfn -%{compldir}/chsh +/etc/mtab %files -n uuidd @@ -794,11 +868,17 @@ fi %{_mandir}/man3/uuid_unparse.3* %{_libdir}/pkgconfig/uuid.pc -%files -n python3-libmount +%files -n %{pypkg}-libmount %license Documentation/licenses/COPYING.LGPL-2.1-or-later libmount/COPYING -%{python3_sitearch}/libmount +%{_libdir}/python*/site-packages/libmount/ + +%files -n util-linux-i18n -f %{name}.lang + %changelog +* Mon Mar 11 2024 huang yang - 2.39.1-1 +- New version 2.39.1 + * Mon Mar 11 2024 Zhao Hang - 2.38.1-3 - Rebuild with python3.11 @@ -820,5 +900,5 @@ fi * Fri Mar 18 2022 forrest_ly - 2.38~rc4-1 - Update rc4 -* Fri Mar 4 2022 forrest_ly - 2.38~rc1-1 -- Init for Anolis OS 23 +* Fri Mar 4 2022 forrest_ly - 2.38~rc1-1 +- Init for Anolis OS 23