Skip to contentSkip to conversation

Link mkswap to mkfs.swap so mkfs -t swap works

PATCH In review Josh Triplett 2 participants 3 messages Aug 3, 2014 – Aug 6, 2014 Util-Linux package

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Link mkswap to mkfs.swap so mkfs -t swap works

This makes it easier to write generic code that deals with swap along with other filesystems.

---
 disk-utils/Makemodule.am | 10 ++++++++++
 1 file changed, 10 insertions(+)
disk-utils/Makemodule.am +10 -0
index 995e085..3f8f96b 100644
@@ -59,6 +59,16 @@ endif
 if HAVE_SELINUX
 mkswap_LDADD += -lselinux
 endif
+
+install-exec-hook-mkswap:
+	ln -sf mkswap $(DESTDIR)$(sbindir)/mkfs.swap
+
+uninstall-hook-mkswap:
+	rm -f $(DESTDIR)$(sbindir)/mkfs.swap
+
+INSTALL_EXEC_HOOKS += install-exec-hook-mkswap
+UNINSTALL_HOOKS += uninstall-hook-mkswap
+
 endif # BUILD_MKSWAP
 
 
Signature · 1 line
2.0.1
maintainer
#1 lore raw
Quoted 2 lines · Josh Triplett

This makes it easier to write generic code that deals with swap along with other filesystems.

Hmm... mkfs wrapper is deprecated, it does not provide any functionality and it seems better when people use directly the FS specific tools to create filesystems.

Karel

Signature · 2 lines
 Karel Zak  <[email protected]>
 http://karelzak.blogspot.com
#2 lore raw
Quoted 7 lines · Karel Zak
Quoted 2 lines · Josh Triplett

This makes it easier to write generic code that deals with swap along with other filesystems.

Hmm... mkfs wrapper is deprecated, it does not provide any functionality and it seems better when people use directly the FS specific tools to create filesystems.

I've come across more than one script that takes a table of partition sizes/proportions and filesystem types, creates the partitions, and calls mkfs with the filesystem type.

Some of those scripts directly call mkfs.$type instead, rather than mkfs -t $type, but either way this change would eliminate a special-case for swap.

- Josh Triplett