commit 77274d2
Michael Forney
·
2026-03-13 05:36:56 +0000 UTC
parent 59fc74e
util-linux: Update to 2.41.3 Also, switch to tar archive for pre-generated man pages.
20 files changed,
+323,
-832
+0,
-4
1@@ -116,10 +116,6 @@
2 path = pkg/ubase/src
3 url = https://github.com/michaelforney/ubase
4 ignore = all
5-[submodule "pkg/util-linux/src"]
6- path = pkg/util-linux/src
7- url = https://git.kernel.org/pub/scm/utils/util-linux/util-linux.git
8- ignore = all
9 [submodule "pkg/vis/src"]
10 path = pkg/vis/src
11 url = https://github.com/martanne/vis
+1,
-0
1@@ -38,6 +38,7 @@
2 /tinyemu-2019-12-21.tar.gz
3 /transmission-3.00.tar.xz
4 /u-boot-2021.04.tar.bz2
5+/util-linux-2.41.3.tar.gz
6 /unzip60.tar.gz
7 /wpa_supplicant-2.11.tar.gz
8 /yt-dlp.tar.gz
+1,
-1
1@@ -1 +1 @@
2-man/*.gz
3+/src
+135,
-32
1@@ -1,7 +1,7 @@
2 #define _PATH_RUNSTATEDIR "/run"
3+#define _PATH_LOCALSTATEDIR "/var"
4 #define LOCALEDIR "/share/locale"
5
6-/* #undef AC_APPLE_UNIVERSAL_BUILD */
7 #define AGETTY_RELOAD 1
8 #define CHFN_CHSH_PASSWORD 1
9 #define CONFIG_ADJTIME_PATH "/etc/adjtime"
10@@ -11,6 +11,7 @@
11 /* #undef HAVE_ASM_IO_H */
12 #define HAVE_BTRFS_SUPPORT 1
13 #define HAVE_BYTESWAP_H 1
14+/* #undef HAVE_CACHESTAT */
15 /* #undef HAVE_CFLOCALECOPYCURRENT */
16 /* #undef HAVE_CFPREFERENCESCOPYAPPVALUE */
17 #define HAVE_CLEARENV 1
18@@ -24,13 +25,18 @@
19 #define HAVE_DECL_BLK_ZONE_REP_CAPACITY 1
20 #define HAVE_DECL_CPU_ALLOC 1
21 /* #undef HAVE_DECL_DIRFD */
22+#define HAVE_DECL_PR_REP_CAPACITY 0
23+/* #undef HAVE_DECL_SD_SESSION_GET_USERNAME */
24 /* #undef HAVE_DECL_TZNAME */
25+#define HAVE_DECL_VMADDR_CID_LOCAL 1
26 #define HAVE_DECL__NL_TIME_WEEK_1STDAY 0
27 #define HAVE_DIRFD 1
28 /* #undef HAVE_DIR_DD_FD */
29 #define HAVE_DLFCN_H 1
30 #define HAVE_EACCESS 1
31+/* #undef HAVE_ECONF_READCONFIG */
32 #define HAVE_ENDIAN_H 1
33+#define HAVE_ENUM_FSCONFIG_COMMAND 1
34 #define HAVE_ENVIRON_DECL 1
35 #define HAVE_ERR 1
36 #define HAVE_ERRNO_H 1
37@@ -39,8 +45,13 @@
38 #define HAVE_EXPLICIT_BZERO 1
39 /* #undef HAVE_FALLOCATE */
40 #define HAVE_FCNTL_H 1
41+#define HAVE_FNMATCH 1
42 #define HAVE_FPURGE 1
43+/* #undef HAVE_FSCONFIG */
44 #define HAVE_FSEEKO 1
45+/* #undef HAVE_FSMOUNT */
46+/* #undef HAVE_FSOPEN */
47+/* #undef HAVE_FSPICK */
48 #define HAVE_FSTATAT 1
49 #define HAVE_FSYNC 1
50 #define HAVE_FUTIMENS 1
51@@ -53,6 +64,7 @@
52 #define HAVE_GETRLIMIT 1
53 /* #undef HAVE_GETSGNAM */
54 /* #undef HAVE_GETTEXT */
55+/* #undef HAVE_GETTTYNAM */
56 #define HAVE_GETUSERSHELL 1
57 #define HAVE_ICONV 1
58 #define HAVE_INOTIFY_INIT 1
59@@ -62,19 +74,24 @@
60 #define HAVE_IOPL 1
61 /* #undef HAVE_ISNAN */
62 #define HAVE_JRAND48 1
63+/* #undef HAVE_LANDLOCK_ADD_RULE */
64+/* #undef HAVE_LANDLOCK_CREATE_RULESET */
65+/* #undef HAVE_LANDLOCK_RESTRICT_SELF */
66 /* #undef HAVE_LANGINFO_ALTMON */
67 #define HAVE_LANGINFO_H 1
68 /* #undef HAVE_LANGINFO_NL_ABALTMON */
69 #define HAVE_LASTLOG_H 1
70 #define HAVE_LCHOWN 1
71+#define HAVE_LGETXATTR 1
72 /* #undef HAVE_LIBAUDIT */
73 #define HAVE_LIBBLKID 1
74 /* #undef HAVE_LIBCAP_NG */
75-/* #undef HAVE_LIBCRYPT */
76 /* #undef HAVE_LIBECONF */
77+/* #undef HAVE_LIBLASTLOG2 */
78 /* #undef HAVE_LIBMOUNT */
79 /* #undef HAVE_LIBNCURSES */
80 /* #undef HAVE_LIBNCURSESW */
81+#define HAVE_LIBPTHREAD 1
82 /* #undef HAVE_LIBREADLINE */
83 /* #undef HAVE_LIBRTAS */
84 /* #undef HAVE_LIBSELINUX */
85@@ -86,8 +103,10 @@
86 #define HAVE_LIBUTIL 1
87 /* #undef HAVE_LIBUTIL_H */
88 #define HAVE_LIBUUID 1
89+#define HAVE_LINUX_AUDIT_H 1
90 #define HAVE_LINUX_BLKPG_H 1
91 #define HAVE_LINUX_BLKZONED_H 1
92+#define HAVE_LINUX_BPF_H 1
93 #define HAVE_LINUX_BTRFS_H 1
94 #define HAVE_LINUX_CAPABILITY_H 1
95 #define HAVE_LINUX_CDROM_H 1
96@@ -97,22 +116,33 @@
97 #define HAVE_LINUX_FIEMAP_H 1
98 #define HAVE_LINUX_FS_H 1
99 #define HAVE_LINUX_GSMMUX_H 1
100+#define HAVE_LINUX_IF_ALG_H 1
101+#define HAVE_LINUX_KCMP_H 1
102+#define HAVE_LINUX_LANDLOCK_H 1
103 #define HAVE_LINUX_MAJOR_H 1
104+#define HAVE_LINUX_MOUNT_H 1
105 #define HAVE_LINUX_NET_NAMESPACE_H 1
106 #define HAVE_LINUX_NSFS_H 1
107+#define HAVE_LINUX_PR_H 1
108 /* #undef HAVE_LINUX_RAW_H */
109+#define HAVE_LINUX_SECCOMP_H 1
110 #define HAVE_LINUX_SECUREBITS_H 1
111 #define HAVE_LINUX_TIOCL_H 1
112 #define HAVE_LINUX_VERSION_H 1
113 #define HAVE_LINUX_WATCHDOG_H 1
114+#define HAVE_LLISTXATTR 1
115 /* #undef HAVE_LLSEEK */
116 #define HAVE_LOCALE_H 1
117 /* #undef HAVE_LOFF_T */
118 /* #undef HAVE_MAGIC */
119-#define HAVE_MEMORY_H 1
120 #define HAVE_MEMPCPY 1
121+/* #undef HAVE_MINIX_CONFIG_H */
122 #define HAVE_MKOSTEMP 1
123 #define HAVE_MNTENT_H 1
124+#define HAVE_MOUNTFD_API 1
125+/* #undef HAVE_MOUNT_SETATTR */
126+/* #undef HAVE_MOVE_MOUNT */
127+#define HAVE_MQUEUE_H 1
128 #define HAVE_NANOSLEEP 1
129 /* #undef HAVE_NCURSESW_NCURSES_H */
130 /* #undef HAVE_NCURSESW_TERM_H */
131@@ -122,12 +152,15 @@
132 #define HAVE_NETINET_IN_H 1
133 /* #undef HAVE_NET_IF_DL_H */
134 #define HAVE_NET_IF_H 1
135+#define HAVE_NEWLOCALE 1
136 /* #undef HAVE_NTP_GETTIME */
137+#define HAVE_OPAL_GET_STATUS 1
138 #define HAVE_OPENAT 1
139 #define HAVE_OPEN_MEMSTREAM 1
140+/* #undef HAVE_OPEN_TREE */
141 #define HAVE_PATHS_H 1
142-/* #undef HAVE_PCRE2_POSIX */
143 #define HAVE_PERSONALITY 1
144+/* #undef HAVE_PIDFD_GETFD */
145 /* #undef HAVE_PIDFD_OPEN */
146 /* #undef HAVE_PIDFD_SEND_SIGNAL */
147 #define HAVE_POSIX_FADVISE 1
148@@ -138,7 +171,9 @@
149 #define HAVE_PTY 1
150 #define HAVE_PTY_H 1
151 #define HAVE_QSORT_R 1
152+#define HAVE_REALLOCARRAY 1
153 #define HAVE_REBOOT 1
154+/* #undef HAVE_RENAMEAT2 */
155 /* #undef HAVE_RESIZETERM */
156 /* #undef HAVE_RPMATCH */
157 /* #undef HAVE_SA_LEN */
158@@ -150,6 +185,9 @@
159 /* #undef HAVE_SECURITY_OPENPAM_H */
160 /* #undef HAVE_SECURITY_PAM_APPL_H */
161 /* #undef HAVE_SECURITY_PAM_MISC_H */
162+/* #undef HAVE_SECURITY_PAM_MODULES_H */
163+#define HAVE_SEMAPHORE_H 1
164+#define HAVE_SEM_CLOSE 1
165 #define HAVE_SENDFILE 1
166 /* #undef HAVE_SETITIMER */
167 #define HAVE_SETNS 1
168@@ -157,16 +195,21 @@
169 #define HAVE_SETRESGID 1
170 #define HAVE_SETRESUID 1
171 #define HAVE_SHADOW_H 1
172+#define HAVE_SHM_OPEN 1
173 #define HAVE_SIGHANDLER_T 1
174 #define HAVE_SIGQUEUE 1
175+#define HAVE_SIGSET_T 1
176 /* #undef HAVE_SLANG_H */
177 /* #undef HAVE_SLANG_SLANG_H */
178 /* #undef HAVE_SLANG_SLCURSES_H */
179 /* #undef HAVE_SLCURSES_H */
180 /* #undef HAVE_SMACK */
181 #define HAVE_SRANDOM 1
182+/* #undef HAVE_STATMOUNT_API */
183+#define HAVE_STATX 1
184 #define HAVE_STDINT_H 1
185 #define HAVE_STDIO_EXT_H 1
186+#define HAVE_STDIO_H 1
187 #define HAVE_STDLIB_H 1
188 #define HAVE_STRINGS_H 1
189 #define HAVE_STRING_H 1
190@@ -174,6 +217,10 @@
191 #define HAVE_STRNDUP 1
192 #define HAVE_STRNLEN 1
193 #define HAVE_STRSIGNAL_DECL 1
194+#define HAVE_STRTOD_L 1
195+#define HAVE_STRUCT_MOUNT_ATTR 1
196+#define HAVE_STRUCT_STATX 1
197+/* #undef HAVE_STRUCT_STATX_STX_MNT_ID */
198 #define HAVE_STRUCT_STAT_ST_MTIM_TV_NSEC 1
199 #define HAVE_STRUCT_TERMIOS_C_LINE 1
200 #define HAVE_STRUCT_TM_TM_ZONE 1
201@@ -189,14 +236,17 @@
202 #define HAVE_SYS_IOCTL_H 1
203 #define HAVE_SYS_IO_H 1
204 /* #undef HAVE_SYS_MKDEV_H */
205+#define HAVE_SYS_MMAN_H 1
206 #define HAVE_SYS_MOUNT_H 1
207 #define HAVE_SYS_PARAM_H 1
208+/* #undef HAVE_SYS_PIDFD_H */
209 #define HAVE_SYS_PRCTL_H 1
210 #define HAVE_SYS_RESOURCE_H 1
211 #define HAVE_SYS_SENDFILE_H 1
212 #define HAVE_SYS_SIGNALFD_H 1
213 #define HAVE_SYS_SOCKET_H 1
214 /* #undef HAVE_SYS_SOCKIO_H */
215+#define HAVE_SYS_STATFS_H 1
216 #define HAVE_SYS_STAT_H 1
217 #define HAVE_SYS_SWAP_H 1
218 #define HAVE_SYS_SYSCALL_H 1
219@@ -207,6 +257,7 @@
220 #define HAVE_SYS_TYPES_H 1
221 /* #undef HAVE_SYS_UCRED_H */
222 #define HAVE_SYS_UN_H 1
223+#define HAVE_SYS_VFS_H 1
224 #define HAVE_SYS_XATTR_H 1
225 /* #undef HAVE_TERM_H */
226 #define HAVE_TIMEGM 1
227@@ -222,6 +273,7 @@
228 #define HAVE_UNLINKAT 1
229 #define HAVE_UNSHARE 1
230 #define HAVE_UPDWTMPX 1
231+#define HAVE_USELOCALE 1
232 /* #undef HAVE_USE_DEFAULT_COLORS */
233 #define HAVE_USLEEP 1
234 #define HAVE_UTIMENSAT 1
235@@ -231,16 +283,18 @@
236 #define HAVE_VWARNX 1
237 #define HAVE_WARN 1
238 #define HAVE_WARNX 1
239+#define HAVE_WCHAR_H 1
240 #define HAVE_WIDECHAR 1
241 #define HAVE___FPENDING 1
242 #define HAVE___FPURGE 1
243 #define HAVE___PROGNAME 1
244 /* #undef HAVE___SECURE_GETENV */
245-#define LIBBLKID_DATE "01-Jun-2021"
246-#define LIBBLKID_VERSION "2.37.0"
247-#define LIBFDISK_VERSION "2.37.0"
248-#define LIBMOUNT_VERSION "2.37.0"
249-#define LIBSMARTCOLS_VERSION "2.37.0"
250+#define LIBBLKID_DATE "15-Dec-2025"
251+#define LIBBLKID_VERSION "2.41.3"
252+#define LIBFDISK_VERSION "2.41.3"
253+#define LIBLASTLOG2_VERSION "2.41.3"
254+#define LIBMOUNT_VERSION "2.41.3"
255+#define LIBSMARTCOLS_VERSION "2.41.3"
256 /* #undef LOGIN_CHOWN_VCS */
257 /* #undef LOGIN_STAT_MAIL */
258 #define LT_OBJDIR ".libs/"
259@@ -250,23 +304,35 @@
260 #define PACKAGE "util-linux"
261 #define PACKAGE_BUGREPORT "kzak@redhat.com"
262 #define PACKAGE_NAME "util-linux"
263-#define PACKAGE_STRING "util-linux 2.37"
264+#define PACKAGE_STRING "util-linux 2.41.3"
265 #define PACKAGE_TARNAME "util-linux"
266-#define PACKAGE_URL "http://www.kernel.org/pub/linux/utils/util-linux/"
267-#define PACKAGE_VERSION "2.37"
268+#define PACKAGE_URL "https://www.kernel.org/pub/linux/utils/util-linux/"
269+#define PACKAGE_VERSION "2.41.3"
270 #define PG_BELL 1
271 #define STDC_HEADERS 1
272 /* #undef SYS_close_range */
273 /* #undef SYS_fallocate */
274+/* #undef SYS_fsconfig */
275+/* #undef SYS_fsmount */
276+/* #undef SYS_fsopen */
277+/* #undef SYS_fspick */
278 /* #undef SYS_ioprio_get */
279 /* #undef SYS_ioprio_set */
280+/* #undef SYS_listmount */
281+/* #undef SYS_mount_setattr */
282+/* #undef SYS_move_mount */
283+/* #undef SYS_open_tree */
284+/* #undef SYS_pidfd_getfd */
285 /* #undef SYS_pidfd_open */
286 /* #undef SYS_pidfd_send_signal */
287 /* #undef SYS_pivot_root */
288+/* #undef SYS_prctl */
289 /* #undef SYS_prlimit64 */
290+/* #undef SYS_renameat2 */
291 /* #undef SYS_sched_getaffinity */
292 /* #undef SYS_sched_setattr */
293 /* #undef SYS_setns */
294+/* #undef SYS_statmount */
295 /* #undef SYS_swapoff */
296 /* #undef SYS_swapon */
297 /* #undef SYS_unshare */
298@@ -274,47 +340,84 @@
299 #define USE_COLORS_BY_DEFAULT 1
300 /* #undef USE_HWCLOCK_CMOS */
301 #define USE_HWCLOCK_GPLv3_DATETIME 1
302-/* #undef USE_LIBMOUNT_SUPPORT_MTAB */
303+#define USE_LIBMOUNT_MOUNTFD_SUPPORT 1
304 #define USE_LIBMOUNT_SUPPORT_NAMESPACES 1
305+/* #undef USE_LOGIN_LASTLOG */
306 #define USE_PLYMOUTH_SUPPORT 1
307 /* #undef USE_SULOGIN_EMERGENCY_MOUNT */
308+/* #undef USE_SYSTEMD */
309 #ifndef _ALL_SOURCE
310 # define _ALL_SOURCE 1
311 #endif
312+#ifndef _DARWIN_C_SOURCE
313+# define _DARWIN_C_SOURCE 1
314+#endif
315+#ifndef __EXTENSIONS__
316+# define __EXTENSIONS__ 1
317+#endif
318 #ifndef _GNU_SOURCE
319 # define _GNU_SOURCE 1
320 #endif
321+#ifndef _HPUX_ALT_XOPEN_SOCKET_API
322+# define _HPUX_ALT_XOPEN_SOCKET_API 1
323+#endif
324+#ifndef _MINIX
325+/* # undef _MINIX */
326+#endif
327+#ifndef _NETBSD_SOURCE
328+# define _NETBSD_SOURCE 1
329+#endif
330+#ifndef _OPENBSD_SOURCE
331+# define _OPENBSD_SOURCE 1
332+#endif
333+#ifndef _POSIX_SOURCE
334+/* # undef _POSIX_SOURCE */
335+#endif
336+#ifndef _POSIX_1_SOURCE
337+/* # undef _POSIX_1_SOURCE */
338+#endif
339 #ifndef _POSIX_PTHREAD_SEMANTICS
340 # define _POSIX_PTHREAD_SEMANTICS 1
341 #endif
342+#ifndef __STDC_WANT_IEC_60559_ATTRIBS_EXT__
343+# define __STDC_WANT_IEC_60559_ATTRIBS_EXT__ 1
344+#endif
345+#ifndef __STDC_WANT_IEC_60559_BFP_EXT__
346+# define __STDC_WANT_IEC_60559_BFP_EXT__ 1
347+#endif
348+#ifndef __STDC_WANT_IEC_60559_DFP_EXT__
349+# define __STDC_WANT_IEC_60559_DFP_EXT__ 1
350+#endif
351+#ifndef __STDC_WANT_IEC_60559_EXT__
352+# define __STDC_WANT_IEC_60559_EXT__ 1
353+#endif
354+#ifndef __STDC_WANT_IEC_60559_FUNCS_EXT__
355+# define __STDC_WANT_IEC_60559_FUNCS_EXT__ 1
356+#endif
357+#ifndef __STDC_WANT_IEC_60559_TYPES_EXT__
358+# define __STDC_WANT_IEC_60559_TYPES_EXT__ 1
359+#endif
360+#ifndef __STDC_WANT_LIB_EXT2__
361+# define __STDC_WANT_LIB_EXT2__ 1
362+#endif
363+#ifndef __STDC_WANT_MATH_SPEC_FUNCS__
364+# define __STDC_WANT_MATH_SPEC_FUNCS__ 1
365+#endif
366 #ifndef _TANDEM_SOURCE
367 # define _TANDEM_SOURCE 1
368 #endif
369-#ifndef __EXTENSIONS__
370-# define __EXTENSIONS__ 1
371+#ifndef _XOPEN_SOURCE
372+/* # undef _XOPEN_SOURCE */
373 #endif
374 #define USE_TTY_GROUP 1
375 /* #undef USE_USRDIR_PATHS_ONLY */
376 /* #undef USE_VENDORDIR */
377-#define VERSION "2.37"
378-#if defined AC_APPLE_UNIVERSAL_BUILD
379-# if defined __BIG_ENDIAN__
380-# define WORDS_BIGENDIAN 1
381-# endif
382-#else
383-# ifndef WORDS_BIGENDIAN
384-/* # undef WORDS_BIGENDIAN */
385-# endif
386-#endif
387-/* #undef _DARWIN_C_SOURCE */
388-#ifndef _DARWIN_USE_64_BIT_INODE
389-# define _DARWIN_USE_64_BIT_INODE 1
390-#endif
391+#define VERSION "2.41.3"
392+#define _DARWIN_C_SOURCE 1
393 /* #undef _FILE_OFFSET_BITS */
394 /* #undef _LARGEFILE_SOURCE */
395 /* #undef _LARGE_FILES */
396-/* #undef _MINIX */
397-/* #undef _POSIX_1_SOURCE */
398-/* #undef _POSIX_SOURCE */
399+/* #undef _TIME_BITS */
400+/* #undef __MINGW_USE_VC2005_COMPAT */
401 /* #undef const */
402 /* #undef volatile */
+11,
-7
1@@ -1,4 +1,4 @@
2-set('version', '2.37.0')
3+set('version', '2.41.3')
4 cflags{
5 '-include $dir/config.h',
6 '-I $outdir',
7@@ -50,6 +50,8 @@ lib('libcommon.a', [[
8 canonicalize.c
9 crc32.c
10 crc32c.c
11+ crc64.c
12+ c_strtod.c
13 encode.c
14 env.c
15 fileutils.c
16@@ -59,24 +61,25 @@ lib('libcommon.a', [[
17 match.c
18 mbsalign.c
19 md5.c
20- pager.c
21 pwdutils.c
22 randutils.c
23 sha1.c
24+ sha256.c
25 signames.c
26 strutils.c
27 strv.c
28 timeutils.c
29 ttyutils.c
30+ xxhash.c
31
32 linux_version.c
33- procutils.c
34 loopdev.c
35
36 cpuset.c
37
38 path.c
39 sysfs.c
40+ procfs.c
41 )
42 ]])
43
44@@ -122,6 +125,7 @@ lib('libblkid.a', [[
45 bitlocker.c
46 bluestore.c
47 btrfs.c
48+ cs_fvault2.c
49 cramfs.c
50 ddf_raid.c
51 drbd.c
52@@ -226,7 +230,6 @@ lib('libsmartcols.a', [[
53 print.c
54 print-api.c
55 version.c
56- buffer.c
57 calculate.c
58 grouping.c
59 walk.c
60@@ -257,16 +260,17 @@ lib('libuuid.a', [[
61
62 exe('fdisk', [[
63 disk-utils/(fdisk.c fdisk-menu.c fdisk-list.c)
64+ lib/pager.c
65 libfdisk.a.d libsmartcols.a.d
66 ]])
67 file('bin/fdisk', '755', '$outdir/fdisk')
68-man{'$dir/man/fdisk.8'}
69+man{'disk-utils/fdisk.8'}
70
71 exe('losetup', [[
72 sys-utils/losetup.c
73 libsmartcols.a.d libcommon.a
74 ]])
75 file('bin/losetup', '755', '$outdir/losetup')
76-man{'$dir/man/losetup.8'}
77+man{'sys-utils/losetup.8'}
78
79-fetch 'git'
80+fetch 'curl'
+0,
-294
1@@ -1,294 +0,0 @@
2-'\" t
3-.\" Title: fdisk
4-.\" Author: [see the "AUTHOR(S)" section]
5-.\" Generator: Asciidoctor 2.0.15
6-.\" Date: 2021-06-01
7-.\" Manual: System Administration
8-.\" Source: util-linux {release-version}
9-.\" Language: English
10-.\"
11-.TH "FDISK" "8" "2021-06-01" "util\-linux {release\-version}" "System Administration"
12-.ie \n(.g .ds Aq \(aq
13-.el .ds Aq '
14-.ss \n[.ss] 0
15-.nh
16-.ad l
17-.de URL
18-\fI\\$2\fP <\\$1>\\$3
19-..
20-.als MTO URL
21-.if \n[.g] \{\
22-. mso www.tmac
23-. am URL
24-. ad l
25-. .
26-. am MTO
27-. ad l
28-. .
29-. LINKSTYLE blue R < >
30-.\}
31-.SH "NAME"
32-fdisk \- manipulate disk partition table
33-.SH "SYNOPSIS"
34-.sp
35-\fBfdisk\fP [options] \fIdevice\fP
36-.sp
37-\fBfdisk\fP \fB\-l\fP [\fIdevice\fP...]
38-.SH "DESCRIPTION"
39-.sp
40-\fBfdisk\fP is a dialog\-driven program for creation and manipulation of partition tables. It understands GPT, MBR, Sun, SGI and BSD partition tables.
41-.sp
42-Block devices can be divided into one or more logical disks called \fIpartitions\fP. This division is recorded in the \fIpartition table\fP, usually found in sector 0 of the disk. (In the BSD world one talks about `disk slices\(aq and a `disklabel\(aq.)
43-.sp
44-All partitioning is driven by device I/O limits (the topology) by default. \fBfdisk\fP is able to optimize the disk layout for a 4K\-sector size and use an alignment offset on modern devices for MBR and GPT. It is always a good idea to follow \fBfdisk\fP\(aqs defaults as the default values (e.g., first and last partition sectors) and partition sizes specified by the +/\-<size>{M,G,...} notation are always aligned according to the device properties.
45-.sp
46-CHS (Cylinder\-Head\-Sector) addressing is deprecated and not used by default. Please, do not follow old articles and recommendations with \fBfdisk \-S <n> \-H <n>\fP advices for SSD or 4K\-sector devices.
47-.sp
48-Note that \fBpartx\fP(8) provides a rich interface for scripts to print disk layouts, \fBfdisk\fP is mostly designed for humans. Backward compatibility in the output of \fBfdisk\fP is not guaranteed. The input (the commands) should always be backward compatible.
49-.SH "OPTIONS"
50-.sp
51-\fB\-b\fP, \fB\-\-sector\-size\fP \fIsectorsize\fP
52-.RS 4
53-Specify the sector size of the disk. Valid values are 512, 1024, 2048, and 4096. (Recent kernels know the sector size. Use this option only on old kernels or to override the kernel\(cqs ideas.) Since util\-linux\-2.17, \fBfdisk\fP differentiates between logical and physical sector size. This option changes both sector sizes to \fIsectorsize\fP.
54-.RE
55-.sp
56-\fB\-B\fP, \fB\-\-protect\-boot\fP
57-.RS 4
58-Don\(cqt erase the beginning of the first disk sector when creating a new disk label. This feature is supported for GPT and MBR.
59-.RE
60-.sp
61-\fB\-c\fP, \fB\-\-compatibility\fP[=\fImode\fP]
62-.RS 4
63-Specify the compatibility mode, \(aqdos\(aq or \(aqnondos\(aq. The default is non\-DOS mode. For backward compatibility, it is possible to use the option without the \fImode\fP argument \(em then the default is used. Note that the optional \fImode\fP argument cannot be separated from the \fB\-c\fP option by a space, the correct form is for example \fB\-c\fP=\fIdos\fP.
64-.RE
65-.sp
66-\fB\-h\fP, \fB\-\-help\fP
67-.RS 4
68-Display a help text and exit.
69-.RE
70-.sp
71-\fB\-L\fP, \fB\-\-color\fP[=\fIwhen\fP]
72-.RS 4
73-Colorize the output. The optional argument \fIwhen\fP can be \fBauto\fP, \fBnever\fP or \fBalways\fP. If the \fIwhen\fP argument is omitted, it defaults to \fBauto\fP. The colors can be disabled; for the current built\-in default see the \fB\-\-help\fP output. See also the \fBCOLORS\fP section.
74-.RE
75-.sp
76-\fB\-l\fP, \fB\-\-list\fP
77-.RS 4
78-List the partition tables for the specified devices and then exit.
79-.sp
80-If no devices are given, the devices mentioned in \fI/proc/partitions\fP (if this file exists) are used. Devices are always listed in the order in which they are specified on the command\-line, or by the kernel listed in \fI/proc/partitions\fP.
81-.RE
82-.sp
83-\fB\-x\fP, \fB\-\-list\-details\fP
84-.RS 4
85-Like \fB\-\-list\fP, but provides more details.
86-.RE
87-.sp
88-\fB\-\-lock\fP[=\fImode\fP]
89-.RS 4
90-Use exclusive BSD lock for device or file it operates. The optional argument \fImode\fP can be \fByes\fP, \fBno\fP (or 1 and 0) or \fBnonblock\fP. If the \fImode\fP argument is omitted, it defaults to \fB"yes"\fP. This option overwrites environment variable \fB$LOCK_BLOCK_DEVICE\fP. The default is not to use any lock at all, but it\(cqs recommended to avoid collisions with udevd or other tools.
91-.RE
92-.sp
93-\fB\-n\fP, \fB\-\-noauto\-pt\fP
94-.RS 4
95-Don\(cqt automatically create a default partition table on empty device. The partition table has to be explicitly created by user (by command like \(aqo\(aq, \(aqg\(aq, etc.).
96-.RE
97-.sp
98-\fB\-o\fP, \fB\-\-output\fP \fIlist\fP
99-.RS 4
100-Specify which output columns to print. Use \fB\-\-help\fP to get a list of all supported columns.
101-.sp
102-The default list of columns may be extended if \fIlist\fP is specified in the format \fI+list\fP (e.g., \fB\-o +UUID\fP).
103-.RE
104-.sp
105-\fB\-s\fP, \fB\-\-getsz\fP
106-.RS 4
107-Print the size in 512\-byte sectors of each given block device. This option is DEPRECATED in favour of \fBblockdev\fP(8).
108-.RE
109-.sp
110-\fB\-t\fP, \fB\-\-type\fP \fItype\fP
111-.RS 4
112-Enable support only for disklabels of the specified \fItype\fP, and disable support for all other types.
113-.RE
114-.sp
115-\fB\-u\fP, \fB\-\-units\fP[=\fIunit\fP]
116-.RS 4
117-When listing partition tables, show sizes in \(aqsectors\(aq or in \(aqcylinders\(aq. The default is to show sizes in sectors. For backward compatibility, it is possible to use the option without the \fIunit\fP argument \(em then the default is used. Note that the optional \fIunit\fP argument cannot be separated from the \fB\-u\fP option by a space, the correct form is for example \(aq*\-u=*\fIcylinders\fP\(aq.
118-.RE
119-.sp
120-\fB\-C\fP, \fB\-\-cylinders\fP \fInumber\fP
121-.RS 4
122-Specify the number of cylinders of the disk. I have no idea why anybody would want to do so.
123-.RE
124-.sp
125-\fB\-H\fP, \fB\-\-heads\fP \fInumber\fP
126-.RS 4
127-Specify the number of heads of the disk. (Not the physical number, of course, but the number used for partition tables.) Reasonable values are 255 and 16.
128-.RE
129-.sp
130-\fB\-S\fP, \fB\-\-sectors\fP \fInumber\fP
131-.RS 4
132-Specify the number of sectors per track of the disk. (Not the physical number, of course, but the number used for partition tables.) A reasonable value is 63.
133-.RE
134-.sp
135-\fB\-w\fP, \fB\-\-wipe\fP \fIwhen\fP
136-.RS 4
137-Wipe filesystem, RAID and partition\-table signatures from the device, in order to avoid possible collisions. The argument \fIwhen\fP can be \fBauto\fP, \fBnever\fP or \fBalways\fP. When this option is not given, the default is \fBauto\fP, in which case signatures are wiped only when in interactive mode. In all cases detected signatures are reported by warning messages before a new partition table is created. See also \fBwipefs\fP(8) command.
138-.RE
139-.sp
140-\fB\-W\fP, \fB\-\-wipe\-partitions\fP \fIwhen\fP
141-.RS 4
142-Wipe filesystem, RAID and partition\-table signatures from a newly created partitions, in order to avoid possible collisions. The argument \fIwhen\fP can be \fBauto\fP, \fBnever\fP or \fBalways\fP. When this option is not given, the default is \fBauto\fP, in which case signatures are wiped only when in interactive mode and after confirmation by user. In all cases detected signatures are reported by warning messages before a new partition is created. See also \fBwipefs\fP(8) command.
143-.RE
144-.sp
145-\fB\-V\fP, \fB\-\-version\fP
146-.RS 4
147-Display version information and exit.
148-.RE
149-.SH "DEVICES"
150-.sp
151-The \fIdevice\fP is usually \fI/dev/sda\fP, \fI/dev/sdb\fP or so. A device name refers to the entire disk. Old systems without libata (a library used inside the Linux kernel to support ATA host controllers and devices) make a difference between IDE and SCSI disks. In such cases the device name will be \fI/dev/hd*\fP (IDE) or \fI/dev/sd*\fP (SCSI).
152-.sp
153-The \fIpartition\fP is a device name followed by a partition number. For example, \fI/dev/sda1\fP is the first partition on the first hard disk in the system. See also Linux kernel documentation (the \fIDocumentation/admin\-guide/devices.txt\fP file).
154-.SH "SIZES"
155-.sp
156-The "last sector" dialog accepts partition size specified by number of sectors or by +/\-<size>{K,B,M,G,...} notation.
157-.sp
158-If the size is prefixed by \(aq+\(aq then it is interpreted as relative to the partition first sector. If the size is prefixed by \(aq\-\(aq then it is interpreted as relative to the high limit (last available sector for the partition).
159-.sp
160-In the case the size is specified in bytes than the number may be followed by the multiplicative suffixes KiB=1024, MiB=1024*1024, and so on for GiB, TiB, PiB, EiB, ZiB and YiB. The "iB" is optional, e.g., "K" has the same meaning as "KiB".
161-.sp
162-The relative sizes are always aligned according to device I/O limits. The +/\-<size>{K,B,M,G,...} notation is recommended.
163-.sp
164-For backward compatibility fdisk also accepts the suffixes KB=1000, MB=1000*1000, and so on for GB, TB, PB, EB, ZB and YB. These 10^N suffixes are deprecated.
165-.SH "SCRIPT FILES"
166-.sp
167-\fBfdisk\fP allows reading (by \(aqI\(aq command) \fBsfdisk\fP(8) compatible script files. The script is applied to in\-memory partition table, and then it is possible to modify the partition table before you write it to the device.
168-.sp
169-And vice\-versa it is possible to write the current in\-memory disk layout to the script file by command \(aqO\(aq.
170-.sp
171-The script files are compatible between \fBcfdisk\fP(8), \fBsfdisk\fP(8), \fBfdisk\fP and other libfdisk applications. For more details see \fBsfdisk\fP(8).
172-.SH "DISK LABELS"
173-.sp
174-\fBGPT (GUID Partition Table)\fP
175-.RS 4
176-GPT is modern standard for the layout of the partition table. GPT uses 64\-bit logical block addresses, checksums, UUIDs and names for partitions and an unlimited number of partitions (although the number of partitions is usually restricted to 128 in many partitioning tools).
177-.sp
178-Note that the first sector is still reserved for a \fBprotective MBR\fP in the GPT specification. It prevents MBR\-only partitioning tools from mis\-recognizing and overwriting GPT disks.
179-.sp
180-GPT is always a better choice than MBR, especially on modern hardware with a UEFI boot loader.
181-.RE
182-.sp
183-\fBDOS\-type (MBR)\fP
184-.RS 4
185-A DOS\-type partition table can describe an unlimited number of partitions. In sector 0 there is room for the description of 4 partitions (called `primary\(aq). One of these may be an extended partition; this is a box holding logical partitions, with descriptors found in a linked list of sectors, each preceding the corresponding logical partitions. The four primary partitions, present or not, get numbers 1\-4. Logical partitions are numbered starting from 5.
186-.sp
187-In a DOS\-type partition table the starting offset and the size of each partition is stored in two ways: as an absolute number of sectors (given in 32 bits), and as a \fBCylinders/Heads/Sectors\fP triple (given in 10+8+6 bits). The former is OK \(em with 512\-byte sectors this will work up to 2 TB. The latter has two problems. First, these C/H/S fields can be filled only when the number of heads and the number of sectors per track are known. And second, even if we know what these numbers should be, the 24 bits that are available do not suffice. DOS uses C/H/S only, Windows uses both, Linux never uses C/H/S. The \fBC/H/S addressing is deprecated\fP and may be unsupported in some later \fBfdisk\fP version.
188-.sp
189-\fBPlease, read the DOS\-mode section if you want DOS\-compatible partitions.\fP \fBfdisk\fP does not care about cylinder boundaries by default.
190-.RE
191-.sp
192-\fBBSD/Sun\-type\fP
193-.RS 4
194-A BSD/Sun disklabel can describe 8 partitions, the third of which should be a `whole disk\(aq partition. Do not start a partition that actually uses its first sector (like a swap partition) at cylinder 0, since that will destroy the disklabel. Note that a \fBBSD label\fP is usually nested within a DOS partition.
195-.RE
196-.sp
197-\fBIRIX/SGI\-type\fP
198-.RS 4
199-An IRIX/SGI disklabel can describe 16 partitions, the eleventh of which should be an entire `volume\(aq partition, while the ninth should be labeled `volume header\(aq. The volume header will also cover the partition table, i.e., it starts at block zero and extends by default over five cylinders. The remaining space in the volume header may be used by header directory entries. No partitions may overlap with the volume header. Also do not change its type or make some filesystem on it, since you will lose the partition table. Use this type of label only when working with Linux on IRIX/SGI machines or IRIX/SGI disks under Linux.
200-.sp
201-A sync() and an ioctl(BLKRRPART) (rereading the partition table from disk) are performed before exiting when the partition table has been updated.
202-.RE
203-.SH "DOS MODE AND DOS 6.X WARNING"
204-.sp
205-\fBNote that all this is deprecated. You don\(cqt have to care about things like\fP \fBgeometry and cylinders on modern operating systems. If you really want\fP \fBDOS\-compatible partitioning then you have to enable DOS mode and cylinder\fP \fBunits by using the \(aq\-c=dos \-u=cylinders\(aq fdisk command\-line options.\fP
206-.sp
207-The DOS 6.x FORMAT command looks for some information in the first sector of the data area of the partition, and treats this information as more reliable than the information in the partition table. DOS FORMAT expects DOS FDISK to clear the first 512 bytes of the data area of a partition whenever a size change occurs. DOS FORMAT will look at this extra information even if the /U flag is given \(em we consider this a bug in DOS FORMAT and DOS FDISK.
208-.sp
209-The bottom line is that if you use \fBfdisk\fP or \fBcfdisk\fP to change the size of a DOS partition table entry, then you must also use \fBdd\fP(1) to \fBzero the first 512 bytes\fP of that partition before using DOS FORMAT to format the partition. For example, if you were using \fBfdisk\fP to make a DOS partition table entry for \fI/dev/sda1\fP, then (after exiting \fBfdisk\fP and rebooting Linux so that the partition table information is valid) you would use the command \fBdd if=/dev/zero of=/dev/sda1 bs=512 count=1\fP to zero the first 512 bytes of the partition.
210-.sp
211-\fBfdisk\fP usually obtains the disk geometry automatically. This is not necessarily the physical disk geometry (indeed, modern disks do not really have anything like a physical geometry, certainly not something that can be described in the simplistic Cylinders/Heads/Sectors form), but it is the disk geometry that MS\-DOS uses for the partition table.
212-.sp
213-Usually all goes well by default, and there are no problems if Linux is the only system on the disk. However, if the disk has to be shared with other operating systems, it is often a good idea to let an \fBfdisk\fP from another operating system make at least one partition. When Linux boots it looks at the partition table, and tries to deduce what (fake) geometry is required for good cooperation with other systems.
214-.sp
215-Whenever a partition table is printed out in DOS mode, a consistency check is performed on the partition table entries. This check verifies that the physical and logical start and end points are identical, and that each partition starts and ends on a cylinder boundary (except for the first partition).
216-.sp
217-Some versions of MS\-DOS create a first partition which does not begin on a cylinder boundary, but on sector 2 of the first cylinder. Partitions beginning in cylinder 1 cannot begin on a cylinder boundary, but this is unlikely to cause difficulty unless you have OS/2 on your machine.
218-.sp
219-For best results, you should always use an OS\-specific partition table program. For example, you should make DOS partitions with the DOS FDISK program and Linux partitions with the Linux \fBfdisk\fP or Linux \fBcfdisk\fP(8) programs.
220-.SH "COLORS"
221-.sp
222-Implicit coloring can be disabled by an empty file \fI/etc/terminal\-colors.d/fdisk.disable\fP.
223-.sp
224-See \fBterminal\-colors.d\fP(5) for more details about colorization configuration. The logical color names supported by \fBfdisk\fP are:
225-.sp
226-\fBheader\fP
227-.RS 4
228-The header of the output tables.
229-.RE
230-.sp
231-\fBhelp\-title\fP
232-.RS 4
233-The help section titles.
234-.RE
235-.sp
236-\fBwarn\fP
237-.RS 4
238-The warning messages.
239-.RE
240-.sp
241-\fBwelcome\fP
242-.RS 4
243-The welcome message.
244-.RE
245-.SH "ENVIRONMENT"
246-.sp
247-\fBFDISK_DEBUG\fP=all
248-.RS 4
249-enables fdisk debug output.
250-.RE
251-.sp
252-\fBLIBFDISK_DEBUG\fP=all
253-.RS 4
254-enables libfdisk debug output.
255-.RE
256-.sp
257-\fBLIBBLKID_DEBUG\fP=all
258-.RS 4
259-enables libblkid debug output.
260-.RE
261-.sp
262-\fBLIBSMARTCOLS_DEBUG\fP=all
263-.RS 4
264-enables libsmartcols debug output.
265-.RE
266-.sp
267-\fBLIBSMARTCOLS_DEBUG_PADDING\fP=on
268-.RS 4
269-use visible padding characters. Requires enabled \fBLIBSMARTCOLS_DEBUG\fP.
270-.RE
271-.sp
272-\fBLOCK_BLOCK_DEVICE\fP=<mode>
273-.RS 4
274-use exclusive BSD lock. The mode is "1" or "0". See \fB\-\-lock\fP for more details.
275-.RE
276-.SH "AUTHORS"
277-.sp
278-.MTO "kzak\(atredhat.com" "Karel Zak" ","
279-.MTO "dave\(atgnu.org" "Davidlohr Bueso" ""
280-.sp
281-The original version was written by Andries E. Brouwer, A. V. Le Blanc and others.
282-.SH "SEE ALSO"
283-.sp
284-\fBcfdisk\fP(8),
285-\fBmkfs\fP(8),
286-\fBpartx\fP(8),
287-\fBsfdisk\fP(8)
288-.SH "REPORTING BUGS"
289-.sp
290-For bug reports, use the issue tracker at \c
291-.URL "https://github.com/karelzak/util\-linux/issues" "" "."
292-.SH "AVAILABILITY"
293-.sp
294-The \fBfdisk\fP command is part of the util\-linux package which can be downloaded from \c
295-.URL "https://www.kernel.org/pub/linux/utils/util\-linux/" "Linux Kernel Archive" "."
+0,
-240
1@@ -1,240 +0,0 @@
2-'\" t
3-.\" Title: losetup
4-.\" Author: [see the "AUTHOR(S)" section]
5-.\" Generator: Asciidoctor 2.0.15
6-.\" Date: 2021-06-01
7-.\" Manual: System Administration
8-.\" Source: util-linux {release-version}
9-.\" Language: English
10-.\"
11-.TH "LOSETUP" "8" "2021-06-01" "util\-linux {release\-version}" "System Administration"
12-.ie \n(.g .ds Aq \(aq
13-.el .ds Aq '
14-.ss \n[.ss] 0
15-.nh
16-.ad l
17-.de URL
18-\fI\\$2\fP <\\$1>\\$3
19-..
20-.als MTO URL
21-.if \n[.g] \{\
22-. mso www.tmac
23-. am URL
24-. ad l
25-. .
26-. am MTO
27-. ad l
28-. .
29-. LINKSTYLE blue R < >
30-.\}
31-.SH "NAME"
32-losetup \- set up and control loop devices
33-.SH "SYNOPSIS"
34-.sp
35-Get info:
36-.sp
37-\fBlosetup\fP [\fIloopdev\fP]
38-.sp
39-\fBlosetup\fP \fB\-l\fP [\fB\-a\fP]
40-.sp
41-\fBlosetup\fP \fB\-j\fP \fIfile\fP [\fB\-o\fP \fIoffset\fP]
42-.sp
43-Detach a loop device:
44-.sp
45-\fBlosetup\fP \fB\-d\fP \fIloopdev\fP ...
46-.sp
47-Detach all associated loop devices:
48-.sp
49-\fBlosetup\fP \fB\-D\fP
50-.sp
51-Set up a loop device:
52-.sp
53-\fBlosetup\fP [\fB\-o\fP \fIoffset\fP] [\fB\-\-sizelimit\fP \fIsize\fP] [\fB\-\-sector\-size\fP \fIsize\fP] [\fB\-Pr\fP] [\fB\-\-show\fP] \fB\-f\fP \fIloopdev file\fP
54-.sp
55-Resize a loop device:
56-.sp
57-\fBlosetup\fP \fB\-c\fP \fIloopdev\fP
58-.SH "DESCRIPTION"
59-.sp
60-\fBlosetup\fP is used to associate loop devices with regular files or block devices, to detach loop devices, and to query the status of a loop device. If only the \fIloopdev\fP argument is given, the status of the corresponding loop device is shown. If no option is given, all loop devices are shown.
61-.sp
62-Note that the old output format (i.e., \fBlosetup \-a\fP) with comma\-delimited strings is deprecated in favour of the \fB\-\-list\fP output format.
63-.sp
64-It\(cqs possible to create more independent loop devices for the same backing file. \fBThis setup may be dangerous, can cause data loss, corruption and overwrites.\fP Use \fB\-\-nooverlap\fP with \fB\-\-find\fP during setup to avoid this problem.
65-.sp
66-The loop device setup is not an atomic operation when used with \fB\-\-find\fP, and \fBlosetup\fP does not protect this operation by any lock. The number of attempts is internally restricted to a maximum of 16. It is recommended to use for example flock1 to avoid a collision in heavily parallel use cases.
67-.SH "OPTIONS"
68-.sp
69-The \fIsize\fP and \fIoffset\fP arguments may be followed by the multiplicative suffixes KiB (=1024), MiB (=1024*1024), and so on for GiB, TiB, PiB, EiB, ZiB and YiB (the "iB" is optional, e.g., "K" has the same meaning as "KiB") or the suffixes KB (=1000), MB (=1000*1000), and so on for GB, TB, PB, EB, ZB and YB.
70-.sp
71-\fB\-a\fP, \fB\-\-all\fP
72-.RS 4
73-Show the status of all loop devices. Note that not all information is accessible for non\-root users. See also \fB\-\-list\fP. The old output format (as printed without \fB\-\-list)\fP is deprecated.
74-.RE
75-.sp
76-\fB\-d\fP, \fB\-\-detach\fP \fIloopdev\fP...
77-.RS 4
78-Detach the file or device associated with the specified loop device(s). Note that since Linux v3.7 kernel uses "lazy device destruction". The detach operation does not return \fBEBUSY\fP error anymore if device is actively used by system, but it is marked by autoclear flag and destroyed later.
79-.RE
80-.sp
81-\fB\-D\fP, \fB\-\-detach\-all\fP
82-.RS 4
83-Detach all associated loop devices.
84-.RE
85-.sp
86-\fB\-f\fP, \fB\-\-find\fP [\fIfile\fP]
87-.RS 4
88-Find the first unused loop device. If a \fIfile\fP argument is present, use the found device as loop device. Otherwise, just print its name.
89-.RE
90-.sp
91-\fB\-\-show\fP
92-.RS 4
93-Display the name of the assigned loop device if the \fB\-f\fP option and a \fIfile\fP argument are present.
94-.RE
95-.sp
96-\fB\-L\fP, \fB\-\-nooverlap\fP
97-.RS 4
98-Check for conflicts between loop devices to avoid situation when the same backing file is shared between more loop devices. If the file is already used by another device then re\-use the device rather than a new one. The option makes sense only with \fB\-\-find\fP.
99-.RE
100-.sp
101-\fB\-j\fP, \fB\-\-associated\fP \fIfile\fP [\fB\-o\fP \fIoffset\fP]
102-.RS 4
103-Show the status of all loop devices associated with the given \fIfile\fP.
104-.RE
105-.sp
106-\fB\-o\fP, \fB\-\-offset\fP \fIoffset\fP
107-.RS 4
108-The data start is moved \fIoffset\fP bytes into the specified file or device. The \fIoffset\fP may be followed by the multiplicative suffixes; see above.
109-.RE
110-.sp
111-\fB\-\-sizelimit\fP \fIsize\fP
112-.RS 4
113-The data end is set to no more than \fIsize\fP bytes after the data start. The \fIsize\fP may be followed by the multiplicative suffixes; see above.
114-.RE
115-.sp
116-\fB\-b\fP, \fB\-\-sector\-size\fP \fIsize\fP
117-.RS 4
118-Set the logical sector size of the loop device in bytes (since Linux 4.14). The option may be used when create a new loop device as well as stand\-alone command to modify sector size of the already existing loop device.
119-.RE
120-.sp
121-\fB\-c\fP, \fB\-\-set\-capacity\fP \fIloopdev\fP
122-.RS 4
123-Force the loop driver to reread the size of the file associated with the specified loop device.
124-.RE
125-.sp
126-\fB\-P\fP, \fB\-\-partscan\fP
127-.RS 4
128-Force the kernel to scan the partition table on a newly created loop device. Note that the partition table parsing depends on sector sizes. The default is sector size is 512 bytes, otherwise you need to use the option \fB\-\-sector\-size\fP together with \fB\-\-partscan\fP.
129-.RE
130-.sp
131-\fB\-r\fP, \fB\-\-read\-only\fP
132-.RS 4
133-Set up a read\-only loop device.
134-.RE
135-.sp
136-\fB\-\-direct\-io\fP[\fB=on\fP|\fBoff\fP]
137-.RS 4
138-Enable or disable direct I/O for the backing file. The optional argument can be either \fBon\fP or \fBoff\fP. If the argument is omitted, it defaults to \fBoff\fP.
139-.RE
140-.sp
141-\fB\-v\fP, \fB\-\-verbose\fP
142-.RS 4
143-Verbose mode.
144-.RE
145-.sp
146-\fB\-l\fP, \fB\-\-list\fP
147-.RS 4
148-If a loop device or the \fB\-a\fP option is specified, print the default columns for either the specified loop device or all loop devices; the default is to print info about all devices. See also \fB\-\-output\fP, \fB\-\-noheadings\fP, \fB\-\-raw\fP, and \fB\-\-json\fP.
149-.RE
150-.sp
151-\fB\-O\fP, \fB\-\-output\fP \fIcolumn\fP[,\fIcolumn\fP]...
152-.RS 4
153-Specify the columns that are to be printed for the \fB\-\-list\fP output. Use \fB\-\-help\fP to get a list of all supported columns.
154-.RE
155-.sp
156-\fB\-\-output\-all\fP
157-.RS 4
158-Output all available columns.
159-.RE
160-.sp
161-\fB\-n\fP, \fB\-\-noheadings\fP
162-.RS 4
163-Don\(cqt print headings for \fB\-\-list\fP output format.
164-.RE
165-.sp
166-\fB\-\-raw\fP
167-.RS 4
168-Use the raw \fB\-\-list\fP output format.
169-.RE
170-.sp
171-\fB\-J\fP, \fB\-\-json\fP
172-.RS 4
173-Use JSON format for \fB\-\-list\fP output.
174-.RE
175-.sp
176-\fB\-V\fP, \fB\-\-version\fP
177-.RS 4
178-Display version information and exit.
179-.RE
180-.sp
181-\fB\-h\fP, \fB\-\-help\fP
182-.RS 4
183-Display help text and exit.
184-.RE
185-.SH "ENCRYPTION"
186-.sp
187-\fBCryptoloop is no longer supported in favor of dm\-crypt.\fP For more details see \fBcryptsetup\fP(8).
188-.SH "EXIT STATUS"
189-.sp
190-\fBlosetup\fP returns 0 on success, nonzero on failure. When \fBlosetup\fP displays the status of a loop device, it returns 1 if the device is not configured and 2 if an error occurred which prevented determining the status of the device.
191-.SH "NOTES"
192-.sp
193-Since version 2.37 \fBlosetup\fP uses \fBLOOP_CONFIGURE\fP ioctl to setup a new loop device by one ioctl call. The old versions use \fBLOOP_SET_FD\fP and \fBLOOP_SET_STATUS64\fP ioctls to do the same.
194-.SH "ENVIRONMENT"
195-.sp
196-LOOPDEV_DEBUG=all
197-.RS 4
198-enables debug output.
199-.RE
200-.SH "FILES"
201-.sp
202-\fI/dev/loop[0..N]\fP
203-.RS 4
204-loop block devices
205-.RE
206-.sp
207-\fI/dev/loop\-control\fP
208-.RS 4
209-loop control device
210-.RE
211-.SH "EXAMPLE"
212-.sp
213-The following commands can be used as an example of using the loop device.
214-.sp
215-.if n .RS 4
216-.nf
217-.fam C
218-# dd if=/dev/zero of=~/file.img bs=1024k count=10
219-# losetup \-\-find \-\-show ~/file.img
220-/dev/loop0
221-# mkfs \-t ext2 /dev/loop0
222-# mount /dev/loop0 /mnt
223-\&...
224-# umount /dev/loop0
225-# losetup \-\-detach /dev/loop0
226-.fam
227-.fi
228-.if n .RE
229-.SH "AUTHORS"
230-.sp
231-.MTO "kzak\(atredhat.com" "Karel Zak" ","
232-based on the original version from
233-.MTO "tytso\(atathena.mit.edu" "Theodore Ts\(cqo" "."
234-.SH "REPORTING BUGS"
235-.sp
236-For bug reports, use the issue tracker at \c
237-.URL "https://github.com/karelzak/util\-linux/issues" "" "."
238-.SH "AVAILABILITY"
239-.sp
240-The \fBlosetup\fP command is part of the util\-linux package which can be downloaded from \c
241-.URL "https://www.kernel.org/pub/linux/utils/util\-linux/" "Linux Kernel Archive" "."
1@@ -1,4 +1,4 @@
2-From 8dc30022b3a899eae7e323b99b5e4fb79518e216 Mon Sep 17 00:00:00 2001
3+From e7bd9ecb3e914918a91c1f2f25533b943cd787bd Mon Sep 17 00:00:00 2001
4 From: Michael Forney <mforney@mforney.org>
5 Date: Tue, 18 Jun 2019 01:38:53 -0700
6 Subject: [PATCH] Don't omit second operand to `?` operator
7@@ -13,7 +13,7 @@ Subject: [PATCH] Don't omit second operand to `?` operator
8 6 files changed, 6 insertions(+), 6 deletions(-)
9
10 diff --git a/libfdisk/src/bsd.c b/libfdisk/src/bsd.c
11-index 313ae5ae0..0883915f6 100644
12+index cb45e3f1a..ba73b596a 100644
13 --- a/libfdisk/src/bsd.c
14 +++ b/libfdisk/src/bsd.c
15 @@ -116,7 +116,7 @@ static struct fdisk_parttype *bsd_partition_parttype(
16@@ -26,10 +26,10 @@ index 313ae5ae0..0883915f6 100644
17
18
19 diff --git a/libfdisk/src/dos.c b/libfdisk/src/dos.c
20-index 4368e5266..a8103ac72 100644
21+index c88d2a4f2..9bcf1ba55 100644
22 --- a/libfdisk/src/dos.c
23 +++ b/libfdisk/src/dos.c
24-@@ -148,7 +148,7 @@ static struct fdisk_parttype *dos_partition_parttype(
25+@@ -141,7 +141,7 @@ static struct fdisk_parttype *dos_partition_parttype(
26 {
27 struct fdisk_parttype *t
28 = fdisk_label_get_parttype_from_code(cxt->label, p->sys_ind);
29@@ -39,10 +39,10 @@ index 4368e5266..a8103ac72 100644
30
31 /*
32 diff --git a/libfdisk/src/gpt.c b/libfdisk/src/gpt.c
33-index 97b161312..5fd9b4d73 100644
34+index b11c325f8..85040fb6b 100644
35 --- a/libfdisk/src/gpt.c
36 +++ b/libfdisk/src/gpt.c
37-@@ -262,7 +262,7 @@ static struct fdisk_parttype *gpt_partition_parttype(
38+@@ -264,7 +264,7 @@ static struct fdisk_parttype *gpt_partition_parttype(
39
40 guid_to_string(&guid, str);
41 t = fdisk_label_get_parttype_from_string(cxt->label, str);
42@@ -52,10 +52,10 @@ index 97b161312..5fd9b4d73 100644
43
44 static void gpt_entry_set_type(struct gpt_entry *e, struct gpt_guid *uuid)
45 diff --git a/libfdisk/src/parttype.c b/libfdisk/src/parttype.c
46-index 3a5db9c28..b8d017a1d 100644
47+index 8e36ada74..cb555d4c9 100644
48 --- a/libfdisk/src/parttype.c
49 +++ b/libfdisk/src/parttype.c
50-@@ -491,7 +491,7 @@ struct fdisk_parttype *fdisk_label_advparse_parttype(
51+@@ -496,7 +496,7 @@ struct fdisk_parttype *fdisk_label_advparse_parttype(
52
53 if (res)
54 DBG(PARTTYPE, ul_debugobj(res, "returns parsed '%s' [%s] partition type",
55@@ -65,10 +65,10 @@ index 3a5db9c28..b8d017a1d 100644
56 }
57
58 diff --git a/libfdisk/src/sgi.c b/libfdisk/src/sgi.c
59-index 64adf3454..02fd59650 100644
60+index 71abedd3f..eefa4f1dc 100644
61 --- a/libfdisk/src/sgi.c
62 +++ b/libfdisk/src/sgi.c
63-@@ -351,7 +351,7 @@ static struct fdisk_parttype *sgi_get_parttype(struct fdisk_context *cxt, size_t
64+@@ -353,7 +353,7 @@ static struct fdisk_parttype *sgi_get_parttype(struct fdisk_context *cxt, size_t
65 return NULL;
66
67 t = fdisk_label_get_parttype_from_code(cxt->label, sgi_get_sysid(cxt, n));
68@@ -78,10 +78,10 @@ index 64adf3454..02fd59650 100644
69
70 /* fdisk_get_partition() backend */
71 diff --git a/libfdisk/src/sun.c b/libfdisk/src/sun.c
72-index 4c3b1d8cb..7a5c63b5b 100644
73+index cd965ab13..c0f757c3e 100644
74 --- a/libfdisk/src/sun.c
75 +++ b/libfdisk/src/sun.c
76-@@ -827,7 +827,7 @@ static struct fdisk_parttype *sun_get_parttype(
77+@@ -831,7 +831,7 @@ static struct fdisk_parttype *sun_get_parttype(
78
79 t = fdisk_label_get_parttype_from_code(cxt->label,
80 be16_to_cpu(sunlabel->vtoc.infos[n].id));
81@@ -91,5 +91,5 @@ index 4c3b1d8cb..7a5c63b5b 100644
82
83
84 --
85-2.31.1
86+2.49.0
87
1@@ -1,4 +1,4 @@
2-From edb05302e2c747253afd4698bc445e36c8726306 Mon Sep 17 00:00:00 2001
3+From 7f1d554cb07e8ada1842983e8ff8fa4dfe2ecf55 Mon Sep 17 00:00:00 2001
4 From: Michael Forney <mforney@mforney.org>
5 Date: Tue, 18 Jun 2019 02:29:07 -0700
6 Subject: [PATCH] Avoid a few unnecessary statement expressions
7@@ -8,10 +8,10 @@ Subject: [PATCH] Avoid a few unnecessary statement expressions
8 1 file changed, 6 insertions(+), 7 deletions(-)
9
10 diff --git a/include/c.h b/include/c.h
11-index b891ad480..b420b5187 100644
12+index dcb2d683c..3ba42306c 100644
13 --- a/include/c.h
14 +++ b/include/c.h
15-@@ -176,9 +176,8 @@
16+@@ -210,9 +210,8 @@
17 * @member: the name of the member within the struct.
18 */
19 #ifndef container_of
20@@ -22,8 +22,8 @@ index b891ad480..b420b5187 100644
21 + ((type *)( (char *)ptr - offsetof(type,member) ))
22 #endif
23
24- #ifndef HAVE_PROGRAM_INVOCATION_SHORT_NAME
25-@@ -256,11 +255,11 @@ errmsg(char doexit, int excode, char adderr, const char *fmt, ...)
26+ #define read_unaligned_member(p, m) __extension__ ({ \
27+@@ -310,11 +309,11 @@ void __err_oom(const char *file, unsigned int line)
28
29 /* Don't use inline function to avoid '#include "nls.h"' in c.h
30 */
31@@ -37,7 +37,7 @@ index b891ad480..b420b5187 100644
32
33 /* After failed execvp() */
34 #define EX_EXEC_FAILED 126 /* Program located, but not usable. */
35-@@ -387,10 +386,10 @@ static inline int xusleep(useconds_t usec)
36+@@ -481,10 +480,10 @@ static inline void __attribute__((__noreturn__)) ul_sig_err(int excode, const ch
37
38 #define UTIL_LINUX_VERSION _("%s from %s\n"), program_invocation_short_name, PACKAGE_STRING
39
40@@ -48,8 +48,8 @@ index b891ad480..b420b5187 100644
41 -})
42 +} while (0)
43
44- /*
45- * seek stuff
46+ static inline void print_features(const char *const*features, const char *prefix)
47+ {
48 --
49-2.31.1
50+2.49.0
51
R pkg/util-linux/patch/0005-Avoid-statement-expressions-min-max.patch =>
pkg/util-linux/patch/0004-Avoid-statement-expressions-min-max.patch
+121,
-62
1@@ -1,4 +1,4 @@
2-From ad5d729e363236dbdcf15b82d8575bd5d9db77ea Mon Sep 17 00:00:00 2001
3+From 965ca8368f78249ab7e64e4b7686e6b0d7d77084 Mon Sep 17 00:00:00 2001
4 From: Michael Forney <mforney@mforney.org>
5 Date: Tue, 12 Mar 2019 17:13:45 -0700
6 Subject: [PATCH] Avoid statement expressions min/max
7@@ -7,22 +7,25 @@ Subject: [PATCH] Avoid statement expressions min/max
8 include/c.h | 24 ++++++++++--------------
9 include/strutils.h | 3 ++-
10 lib/mbsalign.c | 2 +-
11+ lib/sysfs.c | 4 ++--
12+ libblkid/src/probe.c | 4 ++--
13 libblkid/src/superblocks/befs.c | 6 +++---
14 libblkid/src/superblocks/exfat.c | 2 +-
15 libblkid/src/superblocks/iso9660.c | 4 ++--
16 libblkid/src/superblocks/minix.c | 4 ++--
17+ libblkid/src/superblocks/romfs.c | 2 +-
18 libfdisk/src/alignment.c | 8 ++++----
19 libfdisk/src/context.c | 4 ++--
20 libfdisk/src/gpt.c | 4 ++--
21- libsmartcols/src/calculate.c | 8 ++++----
22- libsmartcols/src/column.c | 2 +-
23- 12 files changed, 34 insertions(+), 37 deletions(-)
24+ libsmartcols/src/calculate.c | 6 +++---
25+ libsmartcols/src/column.c | 7 ++++---
26+ 15 files changed, 41 insertions(+), 43 deletions(-)
27
28 diff --git a/include/c.h b/include/c.h
29-index b420b5187..fe82a8847 100644
30+index 3ba42306c..1ba8c2beb 100644
31 --- a/include/c.h
32 +++ b/include/c.h
33-@@ -141,21 +141,17 @@
34+@@ -145,21 +145,17 @@
35 # define FALSE 0
36 #endif
37
38@@ -52,27 +55,27 @@ index b420b5187..fe82a8847 100644
39 + return x < y ? x : y;
40 +}
41
42- #ifndef cmp_numbers
43- # define cmp_numbers(x, y) __extension__ ({ \
44+ #ifndef abs_diff
45+ # define abs_diff(x, y) __extension__ ({ \
46 diff --git a/include/strutils.h b/include/strutils.h
47-index 7969a84d0..45c1768f0 100644
48+index a7177fc23..273aaedb8 100644
49 --- a/include/strutils.h
50 +++ b/include/strutils.h
51-@@ -70,7 +70,8 @@ static inline void xstrncpy(char *dest, const char *src, size_t n)
52+@@ -90,7 +90,8 @@ static inline int xstrncpy(char *dest, const char *src, size_t n)
53
54 if (!len)
55- return;
56+ return 0;
57 - len = min(len, n - 1);
58 + if (n - 1 < len)
59 + len = n - 1;
60 memcpy(dest, src, len);
61 dest[len] = 0;
62- }
63+ return len;
64 diff --git a/lib/mbsalign.c b/lib/mbsalign.c
65-index e251202af..f3ea1a2df 100644
66+index b4ab7becd..ea531119b 100644
67 --- a/lib/mbsalign.c
68 +++ b/lib/mbsalign.c
69-@@ -614,7 +614,7 @@ mbsalign_unibyte:
70+@@ -629,7 +629,7 @@ mbsalign_unibyte:
71
72 dest = mbs_align_pad (dest, dest_end, start_spaces, padchar);
73 space_left = dest_end - dest;
74@@ -81,11 +84,49 @@ index e251202af..f3ea1a2df 100644
75 mbs_align_pad (dest, dest_end, end_spaces, padchar);
76 }
77 #ifdef HAVE_WIDECHAR
78+diff --git a/lib/sysfs.c b/lib/sysfs.c
79+index c888617b7..7ecfdc9a8 100644
80+--- a/lib/sysfs.c
81++++ b/lib/sysfs.c
82+@@ -479,9 +479,9 @@ static int sysfs_devchain_is_removable(char *chain)
83+ close(fd);
84+
85+ if (rc > 0) {
86+- if (strncmp(buf, "fixed", min(rc, 5)) == 0) {
87++ if (strncmp(buf, "fixed", umin(rc, 5)) == 0) {
88+ return 0;
89+- } else if (strncmp(buf, "removable", min(rc, 9)) == 0) {
90++ } else if (strncmp(buf, "removable", umin(rc, 9)) == 0) {
91+ return 1;
92+ }
93+ }
94+diff --git a/libblkid/src/probe.c b/libblkid/src/probe.c
95+index a38f5990e..8aea0cd5f 100644
96+--- a/libblkid/src/probe.c
97++++ b/libblkid/src/probe.c
98+@@ -1021,7 +1021,7 @@ static uint64_t blkid_get_io_size(int fd)
99+ for (i = 0; i < ARRAY_SIZE(ioctls); i++) {
100+ r = ioctl(fd, ioctls[i], &s);
101+ if (r == 0 && is_power_of_2(s) && s >= DEFAULT_SECTOR_SIZE)
102+- return min(s, 1U << 16);
103++ return umin(s, 1U << 16);
104+ }
105+
106+ return DEFAULT_SECTOR_SIZE;
107+@@ -2009,7 +2009,7 @@ static void blkid_probe_log_csum_mismatch(blkid_probe pr, size_t n, const void *
108+ {
109+ char csum_hex[256];
110+ char expected_hex[sizeof(csum_hex)];
111+- int hex_size = min(sizeof(csum_hex), n * 2);
112++ int hex_size = umin(sizeof(csum_hex), n * 2);
113+
114+ for (int i = 0; i < hex_size; i+=2) {
115+ snprintf(&csum_hex[i], sizeof(csum_hex) - i, "%02X", ((const unsigned char *) csum)[i / 2]);
116 diff --git a/libblkid/src/superblocks/befs.c b/libblkid/src/superblocks/befs.c
117-index 211feae9f..35c2b19c4 100644
118+index 5d082a949..322118601 100644
119 --- a/libblkid/src/superblocks/befs.c
120 +++ b/libblkid/src/superblocks/befs.c
121-@@ -257,7 +257,7 @@ static int32_t compare_keys(const char keys1[], uint16_t keylengths1[],
122+@@ -264,7 +264,7 @@ static int32_t compare_keys(const char keys1[], uint16_t keylengths1[],
123
124 key1 = &keys1[keystart1];
125
126@@ -94,7 +135,7 @@ index 211feae9f..35c2b19c4 100644
127
128 if (result == 0)
129 return keylength1 - keylength2;
130-@@ -386,8 +386,8 @@ static int get_uuid(blkid_probe pr, const struct befs_super_block *bs,
131+@@ -393,8 +393,8 @@ static int get_uuid(blkid_probe pr, const struct befs_super_block *bs,
132
133 bi_size = (uint64_t)FS16_TO_CPU(bs->root_dir.len, fs_le) <<
134 FS32_TO_CPU(bs->block_shift, fs_le);
135@@ -106,10 +147,10 @@ index 211feae9f..35c2b19c4 100644
136 offset = 0;
137
138 diff --git a/libblkid/src/superblocks/exfat.c b/libblkid/src/superblocks/exfat.c
139-index f586ec786..3c0448027 100644
140+index a7d3e0298..a67e6f5e0 100644
141 --- a/libblkid/src/superblocks/exfat.c
142 +++ b/libblkid/src/superblocks/exfat.c
143-@@ -126,7 +126,7 @@ static int probe_exfat(blkid_probe pr, const struct blkid_idmag *mag)
144+@@ -259,7 +259,7 @@ static int probe_exfat(blkid_probe pr, const struct blkid_idmag *mag)
145 label = find_label(pr, sb);
146 if (label)
147 blkid_probe_set_utf8label(pr, label->name,
148@@ -119,13 +160,13 @@ index f586ec786..3c0448027 100644
149 else if (errno)
150 return -errno;
151 diff --git a/libblkid/src/superblocks/iso9660.c b/libblkid/src/superblocks/iso9660.c
152-index 289a325c8..ac4cc274f 100644
153+index a7a364f30..6567dc519 100644
154 --- a/libblkid/src/superblocks/iso9660.c
155 +++ b/libblkid/src/superblocks/iso9660.c
156-@@ -228,8 +228,8 @@ static int probe_iso9660(blkid_probe pr, const struct blkid_idmag *mag)
157- unsigned char *desc =
158+@@ -257,8 +257,8 @@ static int probe_iso9660(blkid_probe pr, const struct blkid_idmag *mag)
159+ const unsigned char *desc =
160 blkid_probe_get_buffer(pr,
161- off,
162+ off + (is_hs ? 8 : 0), /* High Sierra has 8 bytes before descriptor with Volume Descriptor LBN value */
163 - max(sizeof(struct boot_record),
164 - sizeof(struct iso_volume_descriptor)));
165 + umax(sizeof(struct boot_record),
166@@ -134,7 +175,7 @@ index 289a325c8..ac4cc274f 100644
167 if (desc == NULL || desc[0] == ISO_VD_END)
168 break;
169 diff --git a/libblkid/src/superblocks/minix.c b/libblkid/src/superblocks/minix.c
170-index b521efb2b..d1fb64f64 100644
171+index dba299d23..b18bcf89e 100644
172 --- a/libblkid/src/superblocks/minix.c
173 +++ b/libblkid/src/superblocks/minix.c
174 @@ -83,8 +83,8 @@ static int probe_minix(blkid_probe pr,
175@@ -148,8 +189,21 @@ index b521efb2b..d1fb64f64 100644
176 if (!data)
177 return errno ? -errno : 1;
178 version = get_minix_version(data, &swabme);
179+diff --git a/libblkid/src/superblocks/romfs.c b/libblkid/src/superblocks/romfs.c
180+index 86c09adc3..ac2f0ba78 100644
181+--- a/libblkid/src/superblocks/romfs.c
182++++ b/libblkid/src/superblocks/romfs.c
183+@@ -27,7 +27,7 @@ struct romfs_super_block {
184+ static int romfs_verify_csum(blkid_probe pr, const struct blkid_idmag *mag,
185+ const struct romfs_super_block *ros)
186+ {
187+- uint32_t csummed_size = min((uint32_t) 512,
188++ uint32_t csummed_size = umin((uint32_t) 512,
189+ be32_to_cpu(ros->ros_full_size));
190+ const unsigned char *csummed;
191+ uint32_t csum;
192 diff --git a/libfdisk/src/alignment.c b/libfdisk/src/alignment.c
193-index 3ae721913..a1a05f48a 100644
194+index 2c7a00486..6fc1b9b9d 100644
195 --- a/libfdisk/src/alignment.c
196 +++ b/libfdisk/src/alignment.c
197 @@ -38,7 +38,7 @@
198@@ -179,8 +233,8 @@ index 3ae721913..a1a05f48a 100644
199 cxt->alignment_offset) / cxt->sector_size;
200
201 if (direction == FDISK_ALIGN_UP && res < lba)
202-@@ -398,7 +398,7 @@ int fdisk_apply_user_device_properties(struct fdisk_context *cxt)
203- fdisk_reset_alignment(cxt);
204+@@ -405,7 +405,7 @@ int fdisk_apply_user_device_properties(struct fdisk_context *cxt)
205+ return rc;
206
207 if (cxt->user_grain) {
208 - unsigned long granularity = max(cxt->phy_sector_size, cxt->min_io_size);
209@@ -189,10 +243,10 @@ index 3ae721913..a1a05f48a 100644
210 cxt->grain = cxt->user_grain < granularity ? granularity : cxt->user_grain;
211 DBG(CXT, ul_debugobj(cxt, "new grain: %lu", cxt->grain));
212 diff --git a/libfdisk/src/context.c b/libfdisk/src/context.c
213-index 083b255d3..a3bfff993 100644
214+index 3b2a4d25f..b1363bbd9 100644
215 --- a/libfdisk/src/context.c
216 +++ b/libfdisk/src/context.c
217-@@ -919,7 +919,7 @@ int fdisk_reread_changes(struct fdisk_context *cxt, struct fdisk_table *org)
218+@@ -920,7 +920,7 @@ int fdisk_reread_changes(struct fdisk_context *cxt, struct fdisk_table *org)
219 /* the current layout */
220 fdisk_get_partitions(cxt, &tb);
221 /* maximal number of partitions */
222@@ -201,7 +255,7 @@ index 083b255d3..a3bfff993 100644
223
224 while (fdisk_diff_tables(org, tb, &itr, &pa, &change) == 0) {
225 if (change == FDISK_DIFF_UNCHANGED)
226-@@ -976,7 +976,7 @@ int fdisk_reread_changes(struct fdisk_context *cxt, struct fdisk_table *org)
227+@@ -977,7 +977,7 @@ int fdisk_reread_changes(struct fdisk_context *cxt, struct fdisk_table *org)
228 /* Let's follow the Linux kernel and reduce
229 * DOS extended partition to 1 or 2 sectors.
230 */
231@@ -211,10 +265,10 @@ index 083b255d3..a3bfff993 100644
232 if (partx_add_partition(cxt->dev_fd, pa->partno + 1,
233 pa->start * ssf, sz) != 0) {
234 diff --git a/libfdisk/src/gpt.c b/libfdisk/src/gpt.c
235-index 5fd9b4d73..97e23767d 100644
236+index 85040fb6b..76a6ab65b 100644
237 --- a/libfdisk/src/gpt.c
238 +++ b/libfdisk/src/gpt.c
239-@@ -504,7 +504,7 @@ static int gpt_mknew_pmbr(struct fdisk_context *cxt)
240+@@ -506,7 +506,7 @@ static int gpt_mknew_pmbr(struct fdisk_context *cxt)
241 pmbr->partition_record[0].end_track = 0xFF;
242 pmbr->partition_record[0].starting_lba = cpu_to_le32(1);
243 pmbr->partition_record[0].size_in_lba =
244@@ -223,7 +277,7 @@ index 5fd9b4d73..97e23767d 100644
245
246 return 0;
247 }
248-@@ -956,7 +956,7 @@ static int valid_pmbr(struct fdisk_context *cxt)
249+@@ -958,7 +958,7 @@ static int valid_pmbr(struct fdisk_context *cxt)
250 /* Note that gpt_write_pmbr() overwrites PMBR, but we want to keep it valid already
251 * in memory too to disable warnings when valid_pmbr() called next time */
252 pmbr->partition_record[part].size_in_lba =
253@@ -233,45 +287,37 @@ index 5fd9b4d73..97e23767d 100644
254 }
255 }
256 diff --git a/libsmartcols/src/calculate.c b/libsmartcols/src/calculate.c
257-index 974fc340c..0c11627a7 100644
258+index 77e843397..d0e892187 100644
259 --- a/libsmartcols/src/calculate.c
260 +++ b/libsmartcols/src/calculate.c
261-@@ -57,7 +57,7 @@ static int count_cell_width(struct libscols_table *tb,
262-
263- if (len == (size_t) -1) /* ignore broken multibyte strings */
264- len = 0;
265-- cl->width_max = max(len, cl->width_max);
266-+ cl->width_max = umax(len, cl->width_max);
267+@@ -66,11 +66,11 @@ static int count_cell_width(struct libscols_table *tb,
268
269- if (cl->is_extreme && cl->width_avg && len > cl->width_avg * 2)
270- return 0;
271-@@ -66,10 +66,10 @@ static int count_cell_width(struct libscols_table *tb,
272- cl->extreme_sum += len;
273- cl->extreme_count++;
274- }
275-- cl->width = max(len, cl->width);
276-+ cl->width = umax(len, cl->width);
277 if (scols_column_is_tree(cl)) {
278- size_t treewidth = buffer_get_safe_art_size(buf);
279+ size_t treewidth = ul_buffer_get_safe_pointer_width(buf, SCOLS_BUFPTR_TREEEND);
280 - cl->width_treeart = max(cl->width_treeart, treewidth);
281 + cl->width_treeart = umax(cl->width_treeart, treewidth);
282 }
283- return 0;
284- }
285-@@ -115,7 +115,7 @@ static int count_column_width(struct libscols_table *tb,
286- if (data) {
287- size_t len = scols_table_is_noencoding(tb) ?
288- mbs_width(data) : mbs_safe_width(data);
289-- cl->width_min = max(cl->width_min, len);
290-+ cl->width_min = umax(cl->width_min, len);
291- } else
292- no_header = 1;
293+
294+ ce->width = len;
295+- cl->wstat.width_max = max(len, cl->wstat.width_max);
296++ cl->wstat.width_max = umax(len, cl->wstat.width_max);
297+ done:
298+ scols_table_reset_cursor(tb);
299+ return rc;
300+@@ -178,7 +178,7 @@ static int count_column_width(struct libscols_table *tb,
301+ size_t len = scols_table_is_noencoding(tb) ?
302+ mbs_width(data) : mbs_safe_width(data);
303+
304+- st->width_min = max(st->width_min, len);
305++ st->width_min = umax(st->width_min, len);
306+ } else
307+ no_header = 1;
308
309 diff --git a/libsmartcols/src/column.c b/libsmartcols/src/column.c
310-index c11df69f5..1285d42e6 100644
311+index e83d297fc..151adcfe0 100644
312 --- a/libsmartcols/src/column.c
313 +++ b/libsmartcols/src/column.c
314-@@ -347,7 +347,7 @@ size_t scols_wrapnl_chunksize(const struct libscols_column *cl __attribute__((un
315+@@ -574,7 +574,7 @@ size_t scols_wrapnl_chunksize(const struct libscols_column *cl __attribute__((un
316 mbs_width(data) :
317 mbs_safe_width(data);
318 }
319@@ -280,6 +326,19 @@ index c11df69f5..1285d42e6 100644
320 data = p;
321 }
322
323+@@ -1068,9 +1068,10 @@ int scols_column_greatest_wrap(
324+ while (scols_column_next_wrap(cl, ce, data) == 0) {
325+ size_t sz = strlen(*data);
326+
327+- maxsz = max(maxsz, sz);
328+- if (maxsz == sz)
329++ if (maxsz <= sz) {
330++ maxsz = sz;
331+ res = *data;
332++ }
333+ }
334+
335+ *data = res;
336 --
337-2.37.3
338+2.49.0
339
1@@ -1,83 +0,0 @@
2-From 1c563b2cc82ee2f7ec5daeba5747346250fcc2e2 Mon Sep 17 00:00:00 2001
3-From: Michael Forney <mforney@mforney.org>
4-Date: Tue, 18 Jun 2019 11:54:57 -0700
5-Subject: [PATCH] Remove need for VLA for label name
6-
7----
8- disk-utils/fdisk-list.c | 10 +++-------
9- libfdisk/src/label.c | 6 ++++--
10- libfdisk/src/libfdisk.h.in | 2 +-
11- 3 files changed, 8 insertions(+), 10 deletions(-)
12-
13-diff --git a/disk-utils/fdisk-list.c b/disk-utils/fdisk-list.c
14-index 62aa2b3f5..dafab3ca4 100644
15---- a/disk-utils/fdisk-list.c
16-+++ b/disk-utils/fdisk-list.c
17-@@ -469,19 +469,15 @@ void list_available_columns(FILE *out)
18- static int fieldname_to_id(const char *name, size_t namesz)
19- {
20- const struct fdisk_field *fl;
21-- char buf[namesz + 1];
22-
23- assert(name);
24- assert(namesz);
25- assert(fields_label);
26-
27-- memcpy(buf, name, namesz);
28-- buf[namesz] = '\0';
29--
30-- fl = fdisk_label_get_field_by_name(fields_label, buf);
31-+ fl = fdisk_label_get_field_by_name(fields_label, name, namesz);
32- if (!fl) {
33-- warnx(_("%s unknown column: %s"),
34-- fdisk_label_get_name(fields_label), buf);
35-+ warnx(_("%s unknown column: %.*s"),
36-+ fdisk_label_get_name(fields_label), (int)namesz, name);
37- return -1;
38- }
39- return fdisk_field_get_id(fl);
40-diff --git a/libfdisk/src/label.c b/libfdisk/src/label.c
41-index 524a2bfb4..e0ec7da43 100644
42---- a/libfdisk/src/label.c
43-+++ b/libfdisk/src/label.c
44-@@ -223,12 +223,14 @@ const struct fdisk_field *fdisk_label_get_field(const struct fdisk_label *lb, in
45- * fdisk_label_get_field_by_name
46- * @lb: label
47- * @name: field name
48-+ * @len: field name length
49- *
50- * Returns: pointer to static instance of the field.
51- */
52- const struct fdisk_field *fdisk_label_get_field_by_name(
53- const struct fdisk_label *lb,
54-- const char *name)
55-+ const char *name,
56-+ size_t len)
57- {
58- size_t i;
59-
60-@@ -236,7 +238,7 @@ const struct fdisk_field *fdisk_label_get_field_by_name(
61- assert(name);
62-
63- for (i = 0; i < lb->nfields; i++) {
64-- if (lb->fields[i].name && strcasecmp(lb->fields[i].name, name) == 0)
65-+ if (lb->fields[i].name && strncasecmp(lb->fields[i].name, name, len) == 0 && lb->fields[i].name[len] == '\0')
66- return &lb->fields[i];
67- }
68-
69-diff --git a/libfdisk/src/libfdisk.h.in b/libfdisk/src/libfdisk.h.in
70-index 6f2e77d04..a0e7aa4b2 100644
71---- a/libfdisk/src/libfdisk.h.in
72-+++ b/libfdisk/src/libfdisk.h.in
73-@@ -466,7 +466,7 @@ extern int fdisk_label_get_fields_ids_all(
74- extern const struct fdisk_field *fdisk_label_get_field(const struct fdisk_label *lb, int id);
75- extern const struct fdisk_field *fdisk_label_get_field_by_name(
76- const struct fdisk_label *lb,
77-- const char *name);
78-+ const char *name, size_t len);
79-
80- extern void fdisk_label_set_changed(struct fdisk_label *lb, int changed);
81- extern int fdisk_label_is_changed(const struct fdisk_label *lb);
82---
83-2.31.1
84-
R pkg/util-linux/patch/0006-Avoid-initialization-of-flexible-array-in-struct.patch =>
pkg/util-linux/patch/0005-Avoid-initialization-of-flexible-array-in-struct.patch
+12,
-12
1@@ -1,4 +1,4 @@
2-From 56273e92326b26a326c73e47b3d5929bbce9ac03 Mon Sep 17 00:00:00 2001
3+From ebf2fe8b09eb71a148800bdae671dfb00befc02c Mon Sep 17 00:00:00 2001
4 From: Michael Forney <mforney@mforney.org>
5 Date: Mon, 24 Jun 2019 22:48:57 -0700
6 Subject: [PATCH] Avoid initialization of flexible array in struct
7@@ -8,10 +8,10 @@ Subject: [PATCH] Avoid initialization of flexible array in struct
8 1 file changed, 9 insertions(+), 9 deletions(-)
9
10 diff --git a/disk-utils/fdisk-menu.c b/disk-utils/fdisk-menu.c
11-index 71355f684..fb5b2e253 100644
12+index 4e5801bce..979f32e83 100644
13 --- a/disk-utils/fdisk-menu.c
14 +++ b/disk-utils/fdisk-menu.c
15-@@ -37,7 +37,7 @@ struct menu {
16+@@ -46,7 +46,7 @@ struct menu {
17 const struct menu *,
18 const struct menu_entry *);
19
20@@ -20,7 +20,7 @@ index 71355f684..fb5b2e253 100644
21 };
22
23 struct menu_context {
24-@@ -92,7 +92,7 @@ DECLARE_MENU_CB(generic_menu_cb);
25+@@ -101,7 +101,7 @@ DECLARE_MENU_CB(generic_menu_cb);
26 /* Generic menu */
27 static const struct menu menu_generic = {
28 .callback = generic_menu_cb,
29@@ -29,7 +29,7 @@ index 71355f684..fb5b2e253 100644
30 MENU_BSEP(N_("Generic")),
31 MENU_ENT ('d', N_("delete a partition")),
32 MENU_ENT ('F', N_("list free unpartitioned space")),
33-@@ -134,7 +134,7 @@ static const struct menu menu_createlabel = {
34+@@ -145,7 +145,7 @@ static const struct menu menu_createlabel = {
35 .callback = createlabel_menu_cb,
36 .exclude = FDISK_DISKLABEL_BSD,
37 .nonested = 1,
38@@ -38,7 +38,7 @@ index 71355f684..fb5b2e253 100644
39 MENU_SEP(N_("Create a new label")),
40 MENU_ENT('g', N_("create a new empty GPT partition table")),
41 MENU_ENT('G', N_("create a new empty SGI (IRIX) partition table")),
42-@@ -151,7 +151,7 @@ static const struct menu menu_createlabel = {
43+@@ -162,7 +162,7 @@ static const struct menu menu_createlabel = {
44 static const struct menu menu_geo = {
45 .callback = geo_menu_cb,
46 .exclude = FDISK_DISKLABEL_GPT | FDISK_DISKLABEL_BSD,
47@@ -47,7 +47,7 @@ index 71355f684..fb5b2e253 100644
48 MENU_XSEP(N_("Geometry (for the current label)")),
49 MENU_XENT('c', N_("change number of cylinders")),
50 MENU_XENT('h', N_("change number of heads")),
51-@@ -163,7 +163,7 @@ static const struct menu menu_geo = {
52+@@ -174,7 +174,7 @@ static const struct menu menu_geo = {
53 static const struct menu menu_gpt = {
54 .callback = gpt_menu_cb,
55 .label = FDISK_DISKLABEL_GPT,
56@@ -56,7 +56,7 @@ index 71355f684..fb5b2e253 100644
57 MENU_BSEP(N_("GPT")),
58 MENU_XENT('i', N_("change disk GUID")),
59 MENU_XENT('n', N_("change partition name")),
60-@@ -184,7 +184,7 @@ static const struct menu menu_gpt = {
61+@@ -195,7 +195,7 @@ static const struct menu menu_gpt = {
62 static const struct menu menu_sun = {
63 .callback = sun_menu_cb,
64 .label = FDISK_DISKLABEL_SUN,
65@@ -65,7 +65,7 @@ index 71355f684..fb5b2e253 100644
66 MENU_BSEP(N_("Sun")),
67 MENU_ENT('a', N_("toggle the read-only flag")),
68 MENU_ENT('c', N_("toggle the mountable flag")),
69-@@ -201,7 +201,7 @@ static const struct menu menu_sun = {
70+@@ -212,7 +212,7 @@ static const struct menu menu_sun = {
71 static const struct menu menu_sgi = {
72 .callback = sgi_menu_cb,
73 .label = FDISK_DISKLABEL_SGI,
74@@ -74,7 +74,7 @@ index 71355f684..fb5b2e253 100644
75 MENU_SEP(N_("SGI")),
76 MENU_ENT('a', N_("select bootable partition")),
77 MENU_ENT('b', N_("edit bootfile entry")),
78-@@ -214,7 +214,7 @@ static const struct menu menu_sgi = {
79+@@ -225,7 +225,7 @@ static const struct menu menu_sgi = {
80 static const struct menu menu_dos = {
81 .callback = dos_menu_cb,
82 .label = FDISK_DISKLABEL_DOS,
83@@ -83,7 +83,7 @@ index 71355f684..fb5b2e253 100644
84 MENU_BSEP(N_("DOS (MBR)")),
85 MENU_ENT('a', N_("toggle a bootable flag")),
86 MENU_ENT('b', N_("edit nested BSD disklabel")),
87-@@ -232,7 +232,7 @@ static const struct menu menu_dos = {
88+@@ -244,7 +244,7 @@ static const struct menu menu_dos = {
89 static const struct menu menu_bsd = {
90 .callback = bsd_menu_cb,
91 .label = FDISK_DISKLABEL_BSD,
92@@ -93,5 +93,5 @@ index 71355f684..fb5b2e253 100644
93 MENU_ENT('e', N_("edit drive data")),
94 MENU_ENT('i', N_("install bootstrap")),
95 --
96-2.25.0
97+2.49.0
98
R pkg/util-linux/patch/0009-Use-static-inline-function-for-cmp_numbers.patch =>
pkg/util-linux/patch/0006-Use-static-inline-function-for-cmp_numbers.patch
+8,
-8
1@@ -1,4 +1,4 @@
2-From f9e192ecdbfd369fe42da4c9b8a3ab90cfa6f10f Mon Sep 17 00:00:00 2001
3+From 8dc8b17a429e26984936fb04b21a62a857c433bf Mon Sep 17 00:00:00 2001
4 From: Michael Forney <mforney@mforney.org>
5 Date: Tue, 25 Jun 2019 00:13:43 -0700
6 Subject: [PATCH] Use static inline function for cmp_numbers
7@@ -10,12 +10,12 @@ uintmax_t.
8 1 file changed, 5 insertions(+), 7 deletions(-)
9
10 diff --git a/include/c.h b/include/c.h
11-index fe82a8847..eb48e7f77 100644
12+index 1ba8c2beb..0c923112d 100644
13 --- a/include/c.h
14 +++ b/include/c.h
15-@@ -153,13 +153,11 @@ umin(uintmax_t x, uintmax_t y)
16- return x < y ? x : y;
17- }
18+@@ -165,13 +165,11 @@ umin(uintmax_t x, uintmax_t y)
19+ _a > _b ? _a - _b : _b - _a; })
20+ #endif
21
22 -#ifndef cmp_numbers
23 -# define cmp_numbers(x, y) __extension__ ({ \
24@@ -30,8 +30,8 @@ index fe82a8847..eb48e7f77 100644
25 + return x == y ? 0 : x > y ? 1 : -1;
26 +}
27
28- #ifndef offsetof
29- #define offsetof(TYPE, MEMBER) ((size_t) &((TYPE *)0)->MEMBER)
30+
31+ #ifndef cmp_timespec
32 --
33-2.31.1
34+2.49.0
35
R pkg/util-linux/patch/0010-Avoid-use-of-long-double.patch =>
pkg/util-linux/patch/0007-Avoid-use-of-long-double.patch
+9,
-9
1@@ -1,4 +1,4 @@
2-From d9162eab76d43c1cbd289665c1b02a7e062a2017 Mon Sep 17 00:00:00 2001
3+From 74dc839d640c8df63e597c5826458bb6a3b57cb2 Mon Sep 17 00:00:00 2001
4 From: Michael Forney <mforney@mforney.org>
5 Date: Mon, 6 Sep 2021 18:05:22 -0700
6 Subject: [PATCH] Avoid use of long double
7@@ -8,26 +8,26 @@ Subject: [PATCH] Avoid use of long double
8 1 file changed, 4 insertions(+), 2 deletions(-)
9
10 diff --git a/lib/strutils.c b/lib/strutils.c
11-index 5b5e686aa..ac1a0f527 100644
12+index 54746fcae..fb42fb0cf 100644
13 --- a/lib/strutils.c
14 +++ b/lib/strutils.c
15-@@ -459,6 +459,7 @@ err:
16+@@ -456,6 +456,7 @@ err:
17 errx(STRTOXX_EXIT_CODE, "%s: '%s'", errmesg, str);
18 }
19
20 +#if 0
21- long double strtold_or_err(const char *str, const char *errmesg)
22+ int ul_strtold(const char *str, long double *num)
23 {
24- double num;
25-@@ -479,6 +480,7 @@ err:
26+ char *end = NULL;
27+@@ -483,6 +484,7 @@ long double strtold_or_err(const char *str, const char *errmesg)
28
29 errx(STRTOXX_EXIT_CODE, "%s: '%s'", errmesg, str);
30 }
31 +#endif
32
33- long strtol_or_err(const char *str, const char *errmesg)
34+ uintmax_t strtosize_or_err(const char *str, const char *errmesg)
35 {
36-@@ -538,9 +540,9 @@ uintmax_t strtosize_or_err(const char *str, const char *errmesg)
37+@@ -500,9 +502,9 @@ uintmax_t strtosize_or_err(const char *str, const char *errmesg)
38
39 void strtotimeval_or_err(const char *str, struct timeval *tv, const char *errmesg)
40 {
41@@ -40,5 +40,5 @@ index 5b5e686aa..ac1a0f527 100644
42 tv->tv_usec = (suseconds_t)((user_input - tv->tv_sec) * 1000000);
43 }
44 --
45-2.32.0
46+2.49.0
47
1@@ -1,28 +0,0 @@
2-From abcdd92972cc92840e8db22d7018c44dbb9ec2f4 Mon Sep 17 00:00:00 2001
3-From: Michael Forney <mforney@mforney.org>
4-Date: Mon, 24 Jun 2019 23:41:53 -0700
5-Subject: [PATCH] Use MAXIMUM_PARTS instead of VLA
6-
7-This is the upper bound on the pte array, so just use it as the
8-static array length.
9----
10- libfdisk/src/dos.c | 3 +--
11- 1 file changed, 1 insertion(+), 2 deletions(-)
12-
13-diff --git a/libfdisk/src/dos.c b/libfdisk/src/dos.c
14-index 7a1f6ea34..967b7bd19 100644
15---- a/libfdisk/src/dos.c
16-+++ b/libfdisk/src/dos.c
17-@@ -1624,8 +1624,7 @@ static int dos_verify_disklabel(struct fdisk_context *cxt)
18- {
19- size_t i, j;
20- fdisk_sector_t total = 1, n_sectors = cxt->total_sectors;
21-- fdisk_sector_t first[cxt->label->nparts_max],
22-- last[cxt->label->nparts_max];
23-+ fdisk_sector_t first[MAXIMUM_PARTS], last[MAXIMUM_PARTS];
24- struct dos_partition *p;
25- struct fdisk_dos_label *l = self_label(cxt);
26- int nerrors = 0;
27---
28-2.28.0
29-
1@@ -1,28 +0,0 @@
2-From 7943a7c1c795a1ffe79b2898eb4860cec60dec23 Mon Sep 17 00:00:00 2001
3-From: Michael Forney <mforney@mforney.org>
4-Date: Mon, 24 Jun 2019 23:54:21 -0700
5-Subject: [PATCH] Use alloca if VLAs aren't supported
6-
7----
8- lib/path.c | 4 ++++
9- 1 file changed, 4 insertions(+)
10-
11-diff --git a/lib/path.c b/lib/path.c
12-index 75fa85305..af90261a6 100644
13---- a/lib/path.c
14-+++ b/lib/path.c
15-@@ -982,7 +982,11 @@ static int ul_path_cpuparse(struct path_cxt *pc, cpu_set_t **set, int maxcpus, i
16- {
17- FILE *f;
18- size_t setsize, len = maxcpus * 7;
19-+#ifndef __STDC_NO_VLA__
20- char buf[len];
21-+#else
22-+ char *buf = alloca(len);
23-+#endif
24- int rc;
25-
26- *set = NULL;
27---
28-2.28.0
29-
+1,
-0
1@@ -0,0 +1 @@
2+24160e7c3bfc6feecb9076706437fdb1212817549aaf9b4408f5a8e0b94e3eca util-linux-2.41.3.tar.gz
+0,
-1
1@@ -1 +0,0 @@
2-Subproject commit 50736e4998fde0fff9b7876476137a21b85bd5a6
+1,
-0
1@@ -0,0 +1 @@
2+url = "https://www.kernel.org/pub/linux/utils/util-linux/v2.41/util-linux-2.41.3.tar.gz"
+1,
-1
1@@ -1 +1 @@
2-2.37 r2
3+2.41.3 0