Compare commits
6 Commits
Author | SHA1 | Date |
---|---|---|
Karel Zak | 3970669624 | |
Karel Zak | a58c6f06c9 | |
Karel Zak | 89123660f1 | |
Kalev Lember | 62ebf4b190 | |
Karel Zak | 9f9313beb4 | |
Karel Zak | bf2bbaa192 |
|
@ -76,3 +76,4 @@
|
||||||
/util-linux-2.35-rc2.tar.xz
|
/util-linux-2.35-rc2.tar.xz
|
||||||
/util-linux-2.35.tar.xz
|
/util-linux-2.35.tar.xz
|
||||||
/util-linux-2.35.1.tar.xz
|
/util-linux-2.35.1.tar.xz
|
||||||
|
/util-linux-2.35.2.tar.xz
|
||||||
|
|
|
@ -1,134 +0,0 @@
|
||||||
From 00e53f17c8462cb34ece08cc10db60a7da29a305 Mon Sep 17 00:00:00 2001
|
|
||||||
From: Karel Zak <kzak@redhat.com>
|
|
||||||
Date: Tue, 4 Feb 2020 15:11:19 +0100
|
|
||||||
Subject: [PATCH] libfdisk: (script) accept sector-size, ignore unknown headers
|
|
||||||
|
|
||||||
- add sector-size between supported headers (already in --dump output)
|
|
||||||
|
|
||||||
- report unknown headers by -ENOTSUP
|
|
||||||
|
|
||||||
- ignore ENOTSUP in sfdisk (but print warning) and in fdisk_script_read_file()
|
|
||||||
|
|
||||||
Addresses: https://github.com/karelzak/util-linux/issues/949
|
|
||||||
Signed-off-by: Karel Zak <kzak@redhat.com>
|
|
||||||
---
|
|
||||||
disk-utils/sfdisk.c | 6 +++++-
|
|
||||||
libfdisk/src/script.c | 49 +++++++++++++++++++++++--------------------
|
|
||||||
2 files changed, 31 insertions(+), 24 deletions(-)
|
|
||||||
|
|
||||||
diff --git a/disk-utils/sfdisk.c b/disk-utils/sfdisk.c
|
|
||||||
index bb6e1c6df..c0bea7046 100644
|
|
||||||
--- a/disk-utils/sfdisk.c
|
|
||||||
+++ b/disk-utils/sfdisk.c
|
|
||||||
@@ -1782,7 +1782,11 @@ static int command_fdisk(struct sfdisk *sf, int argc, char **argv)
|
|
||||||
}
|
|
||||||
|
|
||||||
rc = fdisk_script_read_line(dp, stdin, buf, sizeof(buf));
|
|
||||||
- if (rc < 0) {
|
|
||||||
+ if (rc == -ENOTSUP) {
|
|
||||||
+ buf[sizeof(buf) - 1] = '\0';
|
|
||||||
+ fdisk_warnx(sf->cxt, _("Unknown script header '%s' -- ignore."), buf);
|
|
||||||
+ continue;
|
|
||||||
+ } else if (rc < 0) {
|
|
||||||
DBG(PARSE, ul_debug("script parsing failed, trying sfdisk specific commands"));
|
|
||||||
buf[sizeof(buf) - 1] = '\0';
|
|
||||||
rc = loop_control_commands(sf, dp, buf);
|
|
||||||
diff --git a/libfdisk/src/script.c b/libfdisk/src/script.c
|
|
||||||
index a21771b6a..d3e67fa9c 100644
|
|
||||||
--- a/libfdisk/src/script.c
|
|
||||||
+++ b/libfdisk/src/script.c
|
|
||||||
@@ -805,8 +805,12 @@ static inline int is_header_line(const char *s)
|
|
||||||
/* parses "<name>: value", note modifies @s*/
|
|
||||||
static int parse_line_header(struct fdisk_script *dp, char *s)
|
|
||||||
{
|
|
||||||
- int rc = -EINVAL;
|
|
||||||
+ size_t i;
|
|
||||||
char *name, *value;
|
|
||||||
+ static const char *supported[] = {
|
|
||||||
+ "label", "unit", "label-id", "device", "grain",
|
|
||||||
+ "first-lba", "last-lba", "table-length", "sector-size"
|
|
||||||
+ };
|
|
||||||
|
|
||||||
DBG(SCRIPT, ul_debugobj(dp, " parse header '%s'", s));
|
|
||||||
|
|
||||||
@@ -816,7 +820,7 @@ static int parse_line_header(struct fdisk_script *dp, char *s)
|
|
||||||
name = s;
|
|
||||||
value = strchr(s, ':');
|
|
||||||
if (!value)
|
|
||||||
- goto done;
|
|
||||||
+ return -EINVAL;
|
|
||||||
*value = '\0';
|
|
||||||
value++;
|
|
||||||
|
|
||||||
@@ -825,32 +829,30 @@ static int parse_line_header(struct fdisk_script *dp, char *s)
|
|
||||||
ltrim_whitespace((unsigned char *) value);
|
|
||||||
rtrim_whitespace((unsigned char *) value);
|
|
||||||
|
|
||||||
+ if (!*name || !*value)
|
|
||||||
+ return -EINVAL;
|
|
||||||
+
|
|
||||||
+ /* check header name */
|
|
||||||
+ for (i = 0; i < ARRAY_SIZE(supported); i++) {
|
|
||||||
+ if (strcmp(name, supported[i]) == 0)
|
|
||||||
+ break;
|
|
||||||
+ }
|
|
||||||
+ if (i == ARRAY_SIZE(supported))
|
|
||||||
+ return -ENOTSUP;
|
|
||||||
+
|
|
||||||
+ /* header specific actions */
|
|
||||||
if (strcmp(name, "label") == 0) {
|
|
||||||
if (dp->cxt && !fdisk_get_label(dp->cxt, value))
|
|
||||||
- goto done; /* unknown label name */
|
|
||||||
+ return -EINVAL; /* unknown label name */
|
|
||||||
dp->force_label = 1;
|
|
||||||
+
|
|
||||||
} else if (strcmp(name, "unit") == 0) {
|
|
||||||
if (strcmp(value, "sectors") != 0)
|
|
||||||
- goto done; /* only "sectors" supported */
|
|
||||||
- } else if (strcmp(name, "label-id") == 0
|
|
||||||
- || strcmp(name, "device") == 0
|
|
||||||
- || strcmp(name, "grain") == 0
|
|
||||||
- || strcmp(name, "first-lba") == 0
|
|
||||||
- || strcmp(name, "last-lba") == 0
|
|
||||||
- || strcmp(name, "table-length") == 0) {
|
|
||||||
- ; /* whatever is possible */
|
|
||||||
- } else
|
|
||||||
- goto done; /* unknown header */
|
|
||||||
+ return -EINVAL; /* only "sectors" supported */
|
|
||||||
|
|
||||||
- if (*name && *value)
|
|
||||||
- rc = fdisk_script_set_header(dp, name, value);
|
|
||||||
-done:
|
|
||||||
- if (rc)
|
|
||||||
- DBG(SCRIPT, ul_debugobj(dp, "header parse error: "
|
|
||||||
- "[rc=%d, name='%s', value='%s']",
|
|
||||||
- rc, name, value));
|
|
||||||
- return rc;
|
|
||||||
+ }
|
|
||||||
|
|
||||||
+ return fdisk_script_set_header(dp, name, value);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* returns zero terminated string with next token and @str is updated */
|
|
||||||
@@ -1363,7 +1365,8 @@ int fdisk_script_set_fgets(struct fdisk_script *dp,
|
|
||||||
*
|
|
||||||
* Reads next line into dump.
|
|
||||||
*
|
|
||||||
- * Returns: 0 on success, <0 on error, 1 when nothing to read.
|
|
||||||
+ * Returns: 0 on success, <0 on error, 1 when nothing to read. For unknown headers
|
|
||||||
+ * returns -ENOTSUP, it's usually safe to ignore this error.
|
|
||||||
*/
|
|
||||||
int fdisk_script_read_line(struct fdisk_script *dp, FILE *f, char *buf, size_t bufsz)
|
|
||||||
{
|
|
||||||
@@ -1428,7 +1431,7 @@ int fdisk_script_read_file(struct fdisk_script *dp, FILE *f)
|
|
||||||
|
|
||||||
while (!feof(f)) {
|
|
||||||
rc = fdisk_script_read_line(dp, f, buf, sizeof(buf));
|
|
||||||
- if (rc)
|
|
||||||
+ if (rc && rc != -ENOTSUP)
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
--
|
|
||||||
2.24.1
|
|
||||||
|
|
|
@ -1,34 +0,0 @@
|
||||||
From 61b384b36105fe682ddf16b9379f446d935603bc Mon Sep 17 00:00:00 2001
|
|
||||||
From: Karel Zak <kzak@redhat.com>
|
|
||||||
Date: Tue, 4 Feb 2020 16:17:42 +0100
|
|
||||||
Subject: [PATCH] fstrim: do not use Protect setting in systemd service
|
|
||||||
|
|
||||||
The ProtectHome= and ProtectSystem= settings mounts all stuff for the service in read-only mode.
|
|
||||||
|
|
||||||
The fstrim ioctl operates on read-only mountpoint file descriptor, but
|
|
||||||
on some read-only filesystem the operation can fail, so since
|
|
||||||
2d22ac64e4 we check for read-only volumes and skip it.
|
|
||||||
|
|
||||||
References: Upstream: http://github.com/karelzak/util-linux/commit/2d22ac64e4d6e6732640f38b7232b5bcdc84a877
|
|
||||||
Addresses: https://github.com/karelzak/util-linux/issues/948
|
|
||||||
Signed-off-by: Karel Zak <kzak@redhat.com>
|
|
||||||
---
|
|
||||||
sys-utils/fstrim.service.in | 2 --
|
|
||||||
1 file changed, 2 deletions(-)
|
|
||||||
|
|
||||||
diff --git a/sys-utils/fstrim.service.in b/sys-utils/fstrim.service.in
|
|
||||||
index a8b631730..b58728ef4 100644
|
|
||||||
--- a/sys-utils/fstrim.service.in
|
|
||||||
+++ b/sys-utils/fstrim.service.in
|
|
||||||
@@ -6,8 +6,6 @@ ConditionVirtualization=!container
|
|
||||||
[Service]
|
|
||||||
Type=oneshot
|
|
||||||
ExecStart=@sbindir@/fstrim --fstab --verbose --quiet
|
|
||||||
-ProtectSystem=strict
|
|
||||||
-ProtectHome=read-only
|
|
||||||
PrivateDevices=no
|
|
||||||
PrivateNetwork=yes
|
|
||||||
PrivateUsers=no
|
|
||||||
--
|
|
||||||
2.24.1
|
|
||||||
|
|
2
sources
2
sources
|
@ -1 +1 @@
|
||||||
SHA512 (util-linux-2.35.1.tar.xz) = 6e27e08bfc02378970f015decfea5a52d6c342c4c8f4ac48dd07d248485eb797e506d91d290dbbca344c3e5cfe1fc150db80a23d510367427232f5abeabe591a
|
SHA512 (util-linux-2.35.2.tar.xz) = 59e038ba71aa74c9af6f927b357483a965f675ab3ffcd25cf0c1b043656312d2d2d07c55659fd3da69ede165bec313e0ae7e1cd73758e49681ae610604b399a2
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
### Header
|
### Header
|
||||||
Summary: A collection of basic system utilities
|
Summary: A collection of basic system utilities
|
||||||
Name: util-linux
|
Name: util-linux
|
||||||
Version: 2.35.1
|
Version: 2.35.2
|
||||||
Release: 4%{?dist}
|
Release: 1%{?dist}
|
||||||
License: GPLv2 and GPLv2+ and LGPLv2+ and BSD with advertising and Public Domain
|
License: GPLv2 and GPLv2+ and LGPLv2+ and BSD with advertising and Public Domain
|
||||||
URL: http://en.wikipedia.org/wiki/Util-linux
|
URL: http://en.wikipedia.org/wiki/Util-linux
|
||||||
|
|
||||||
|
@ -107,10 +107,6 @@ Requires: libfdisk = %{version}-%{release}
|
||||||
###
|
###
|
||||||
# 151635 - makeing /var/log/lastlog
|
# 151635 - makeing /var/log/lastlog
|
||||||
Patch0: 2.28-login-lastlog-create.patch
|
Patch0: 2.28-login-lastlog-create.patch
|
||||||
# https://github.com/karelzak/util-linux/issues/949
|
|
||||||
Patch1: 0001-libfdisk-script-accept-sector-size-ignore-unknown-he.patch
|
|
||||||
# https://github.com/karelzak/util-linux/issues/948
|
|
||||||
Patch2: 0002-fstrim-do-not-use-Protect-setting-in-systemd-service.patch
|
|
||||||
|
|
||||||
%description
|
%description
|
||||||
The util-linux package contains a large variety of low-level system
|
The util-linux package contains a large variety of low-level system
|
||||||
|
@ -483,8 +479,11 @@ fi
|
||||||
%postun -n uuidd
|
%postun -n uuidd
|
||||||
%systemd_postun_with_restart uuidd.service
|
%systemd_postun_with_restart uuidd.service
|
||||||
|
|
||||||
%triggerpostun -- fedora-release < 32
|
%triggerpostun -- util-linux < 2.35.1-7
|
||||||
%systemd_post fstrim.timer
|
if [ $1 -gt 1 ] && [ -x /usr/bin/systemctl ] ; then
|
||||||
|
# Enable fstrim.timer for upgrades to F32
|
||||||
|
/usr/bin/systemctl --no-reload preset fstrim.timer || :
|
||||||
|
fi
|
||||||
|
|
||||||
%files -f %{name}.files
|
%files -f %{name}.files
|
||||||
%doc README NEWS AUTHORS
|
%doc README NEWS AUTHORS
|
||||||
|
@ -934,6 +933,22 @@ fi
|
||||||
%{_libdir}/python*/site-packages/libmount/
|
%{_libdir}/python*/site-packages/libmount/
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
* Wed May 20 2020 Karel Zak <kzak@redhat.com> - 2.35.2-1
|
||||||
|
- upgrade to upstream bug fix release 2.35.2
|
||||||
|
https://www.kernel.org/pub/linux/utils/util-linux/v2.35/v2.35.2-ReleaseNotes
|
||||||
|
|
||||||
|
* Wed Apr 15 2020 Karel Zak <kzak@redhat.com> - 2.35.1-8
|
||||||
|
- fix #1823463 - hwclock unable to set system time
|
||||||
|
|
||||||
|
* Tue Mar 24 2020 Kalev Lember <klember@redhat.com> - 2.35.1-7
|
||||||
|
- Another attempt at enabling fstrim.timer on F32 upgrades (#1811506)
|
||||||
|
|
||||||
|
* Thu Mar 19 2020 Karel Zak <kzak@redhat.com> - 2.35.1-6
|
||||||
|
- fix #1811506 (triggerpostun)
|
||||||
|
|
||||||
|
* Tue Feb 25 2020 Karel Zak <kzak@redhat.com> - 2.35.1-5
|
||||||
|
- fix lsblk -P output for RAIDs, etc.
|
||||||
|
|
||||||
* Thu Feb 06 2020 Karel Zak <kzak@redhat.com> - 2.35.1-4
|
* Thu Feb 06 2020 Karel Zak <kzak@redhat.com> - 2.35.1-4
|
||||||
- add triggerpostun for fstrim.timer (#1785041, FESCo #2309)
|
- add triggerpostun for fstrim.timer (#1785041, FESCo #2309)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue