2 # Copyright (C) 2007-2015 OpenWrt.org
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
8 include $(TOPDIR)/rules.mk
14 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
15 PKG_SOURCE_URL:=@KERNEL/linux/utils/$(PKG_NAME)/v2.25
16 PKG_MD5SUM:=cab3d7be354000f629bc601238b629b3
19 PKG_LICENSE_FILES:=COPYING getopt/COPYING libblkid/COPYING libmount/COPYING Documentation/licenses/COPYING.GPLv2 Documentation/licenses/COPYING.LGPLv2.1 libuuid/COPYING Documentation/licenses/COPYING.BSD-3
23 PKG_CONFIG_DEPENDS:= \
25 CONFIG_PACKAGE_cfdisk \
26 CONFIG_PACKAGE_setterm
30 include $(INCLUDE_DIR)/package.mk
32 define Package/util-linux/Default
35 URL:=http://www.kernel.org/pub/linux/utils/util-linux/
45 $(if $(CONFIG_PACKAGE_cal)$(CONFIG_PACKAGE_cfdisk)$(CONFIG_PACKAGE_setterm),--with-ncurses,--without-ncurses)
47 TARGET_CFLAGS += $(FPIC) -std=gnu99
49 define Build/InstallDev
50 $(MAKE) -C $(PKG_BUILD_DIR) \
53 installdirs install-data
55 $(INSTALL_DIR) $(1)/usr/lib/pkgconfig
56 $(CP) $(PKG_BUILD_DIR)/libblkid/blkid.pc $(1)/usr/lib/pkgconfig
57 $(CP) $(PKG_BUILD_DIR)/libmount/mount.pc $(1)/usr/lib/pkgconfig
58 $(CP) $(PKG_BUILD_DIR)/libsmartcols/smartcols.pc $(1)/usr/lib/pkgconfig
59 $(CP) $(PKG_BUILD_DIR)/libuuid/uuid.pc $(1)/usr/lib/pkgconfig
61 $(INSTALL_DIR) $(1)/usr/include/blkid
62 $(CP) $(PKG_BUILD_DIR)/libblkid/src/blkid.h $(1)/usr/include/blkid
63 $(INSTALL_DIR) $(1)/usr/include/libmount
64 $(CP) $(PKG_BUILD_DIR)/libmount/src/libmount.h $(1)/usr/include/libmount
65 $(INSTALL_DIR) $(1)/usr/include/uuid
66 $(CP) $(PKG_BUILD_DIR)/libuuid/src/uuid.h $(1)/usr/include/uuid
67 $(INSTALL_DIR) $(1)/usr/include/smartcols
68 $(CP) $(PKG_BUILD_DIR)/libsmartcols/src/libsmartcols.h $(1)/usr/include/smartcols
70 $(INSTALL_DIR) $(1)/usr/lib
71 $(CP) $(PKG_BUILD_DIR)/.libs/libblkid.{a,so*} $(1)/usr/lib
72 $(CP) $(PKG_BUILD_DIR)/.libs/libmount.{a,so*} $(1)/usr/lib
73 $(CP) $(PKG_BUILD_DIR)/.libs/libuuid.{a,so*} $(1)/usr/lib
74 $(CP) $(PKG_BUILD_DIR)/.libs/libsmartcols.{a,so*} $(1)/usr/lib
77 define Package/libblkid
78 $(call Package/util-linux/Default)
80 TITLE:=block device id library
85 define Package/libblkid/description
86 The libblkid library is used to identify block devices (disks) as to their
87 content (e.g. filesystem type, partitions) as well as extracting additional
88 information such as filesystem labels/volume names, partitions, unique
89 identifiers/serial numbers...
92 define Package/libmount
93 $(call Package/util-linux/Default)
100 define Package/libmount/description
101 The libmount library is used to parse /etc/fstab, /etc/mtab and
102 /proc/self/mountinfo files, manage the mtab file, evaluate mount options...
105 define Package/libuuid
106 $(call Package/util-linux/Default)
107 TITLE:=DCE compatible Universally Unique Identifier library
112 define Package/libuuid/description
113 The UUID library is used to generate unique identifiers for objects
114 that may be accessible beyond the local system. This library
115 generates UUIDs compatible with those created by the Open Software
116 Foundation (OSF) Distributed Computing Environment (DCE) utility.
119 define Package/libsmartcols
120 $(call Package/util-linux/Default)
121 TITLE:=table or tree library
126 define Package/libsmartcols/description
127 The smartcols library is used to print tables and trees in a pretty way.
130 define Package/agetty
131 $(call Package/util-linux/Default)
132 TITLE:=alternative Linux getty
136 define Package/agetty/description
137 agetty opens a tty port, prompts for a login name and invokes the
142 $(call Package/util-linux/Default)
143 TITLE:=locate/print block device attributes
144 DEPENDS:= +libblkid +libuuid
148 define Package/blkid/description
149 The blkid program is the command-line interface to working with the libblkid
154 $(call Package/util-linux/Default)
155 TITLE:=display a calendar
156 DEPENDS:= +libncurses
159 define Package/cal/description
160 cal displays a simple calendar
163 define Package/cfdisk
164 $(call Package/util-linux/Default)
165 TITLE:=display or manipulate disk partition table
166 DEPENDS:= +libblkid +libncurses +libsmartcols
170 define Package/cfdisk/description
171 cfdisk is a curses-based program for partitioning any hard disk drive
175 $(call Package/util-linux/Default)
176 TITLE:=print or control the kernel ring buffer
180 define Package/dmesg/description
181 dmesg is used to examine or control the kernel ring buffer
185 $(call Package/util-linux/Default)
186 TITLE:=manipulate disk partition table
187 DEPENDS:= +libblkid +libsmartcols
191 define Package/fdisk/description
192 a menu-driven program for creation and manipulation of partition tables
195 define Package/findfs
196 $(call Package/util-linux/Default)
197 TITLE:=find a filesystem by label or UUID
202 define Package/findfs/description
203 findfs will search the disks in the system looking for a filesystem which has
204 a label matching label or a UUID equal to uuid
208 $(call Package/util-linux/Default)
209 TITLE:=manage locks from shell scripts
212 define Package/flock/description
213 manages flock locks from within shell scripts or the command line
216 define Package/getopt
217 $(call Package/util-linux/Default)
218 TITLE:=parse command options (enhanced)
221 define Package/getopt/description
222 getopt is used to break up (parse) options in command lines for easy parsing
223 by shell procedures, and to check for legal options
226 define Package/hwclock
227 $(call Package/util-linux/Default)
228 TITLE:=query or set the hardware clock
231 define Package/hwclock/description
232 hwclock is a tool for accessing the Hardware Clock
235 define Package/logger
236 $(call Package/util-linux/Default)
237 TITLE:=a shell command interface to the syslog system log module
240 define Package/logger/description
241 logger makes entries in the system log, it provides a shell command interface
242 to the syslog system log module
246 $(call Package/util-linux/Default)
247 TITLE:=display lines beginning with a given string
250 define Package/look/description
251 look utility displays any lines in file which contain string
254 define Package/losetup
255 $(call Package/util-linux/Default)
256 TITLE:=set up and control loop devices
257 DEPENDS:= +libsmartcols
260 define Package/losetup/description
261 losetup is used to associate loop devices with regular files or block devices,
262 to detach loop devices and to query the status of a loop device
266 $(call Package/util-linux/Default)
267 TITLE:=list block devices
268 DEPENDS:= +libblkid +libmount +libsmartcols
272 define Package/lsblk/description
273 lsblk lists information about all or the specified block devices
276 define Package/mcookie
277 $(call Package/util-linux/Default)
278 TITLE:=generate magic cookies for xauth
281 define Package/mcookie/description
282 mcookie generates a 128-bit random hexadecimal number for use with the X
286 define Package/mount-utils
287 $(call Package/util-linux/Default)
288 TITLE:=related (u)mount utilities
289 DEPENDS+= +libmount +libsmartcols
292 define Package/mount-utils/description
293 contains: mount, umount, findmnt
297 $(call Package/util-linux/Default)
298 TITLE:=follow a pathname until a terminal point is found
301 define Package/namei/description
302 namei uses its arguments as pathnames to any type of Unix file (symlinks,
303 files, directories, and so forth)
306 define Package/rename
307 $(call Package/util-linux/Default)
311 define Package/rename/description
312 rename will rename the specified files by replacing the first occurrence of
313 expression in their name by replacement
316 define Package/partx-utils
317 $(call Package/util-linux/Default)
318 TITLE:=inform kernel about the presence and numbering of on-disk partitions
319 DEPENDS:= +libblkid +libsmartcols
323 define Package/partx-utils/description
324 contains partx, addpart, delpart
327 define Package/script-utils
328 $(call Package/util-linux/Default)
329 TITLE:=make and replay typescript of terminal session
333 define Package/script-utils/description
334 contains: script, scriptreplay
337 define Package/setterm
338 $(call Package/util-linux/Default)
339 TITLE:=set terminal attributes
340 DEPENDS:= +libncurses
344 define Package/setterm/description
345 setterm writes to standard output a character string that will invoke the
346 specified terminal capabilities
349 define Package/sfdisk
350 $(call Package/util-linux/Default)
351 TITLE:=partition table manipulator for Linux
355 define Package/sfdisk/description
356 list the size of a partition, list the partitions on a device, check the
357 partitions on a device and repartition a device
360 define Package/swap-utils
361 $(call Package/util-linux/Default)
362 TITLE:=swap space management utilities
367 define Package/swap-utils/description
368 contains: mkswap, swaplabel
372 $(call Package/util-linux/Default)
373 TITLE:=UUID generation daemon
377 define Package/uuidd/description
378 The uuidd daemon is used by the UUID library to generate universally unique
379 identifiers (UUIDs), especially time-based UUIDs, in a secure and
380 guaranteed-unique fashion, even in the face of large numbers of threads
381 running on different CPUs trying to grab UUIDs.
384 define Package/uuidgen
385 $(call Package/util-linux/Default)
386 TITLE:=create a new UUID value
390 define Package/uuidgen/description
391 The uuidgen program creates (and prints) a new universally unique identifier
392 (UUID) using the libuuid library. The new UUID can reasonably be considered
393 unique among all UUIDs created on the local system, and among UUIDs created on
394 other systems in the past and in the future.
398 $(call Package/util-linux/Default)
399 TITLE:=send a message to everybody's terminal
403 define Package/wall/description
404 wall sends a message to everybody logged in with their mesg permission
408 define Package/whereis
409 $(call Package/util-linux/Default)
410 TITLE:=locate the binary, source, and manual page files for a command
413 define Package/whereis/description
414 whereis locates source/binary and manuals sections for specified files
417 define Package/wipefs
418 $(call Package/util-linux/Default)
419 TITLE:=wipe a signature from a device
424 define Package/wipefs/description
425 wipefs can erase filesystem, raid or partition table signatures (magic
426 strings) from the specified device to make the signature invisible for
430 define Package/libblkid/install
431 $(INSTALL_DIR) $(1)/usr/lib
432 $(CP) $(PKG_BUILD_DIR)/.libs/libblkid.so* $(1)/usr/lib/
435 define Package/libmount/install
436 $(INSTALL_DIR) $(1)/usr/lib
437 $(CP) $(PKG_BUILD_DIR)/.libs/libmount.so* $(1)/usr/lib/
440 define Package/libsmartcols/install
441 $(INSTALL_DIR) $(1)/usr/lib
442 $(CP) $(PKG_BUILD_DIR)/.libs/libsmartcols.so* $(1)/usr/lib/
445 define Package/libuuid/install
446 $(INSTALL_DIR) $(1)/usr/lib
447 $(CP) $(PKG_BUILD_DIR)/.libs/libuuid.so* $(1)/usr/lib/
450 define Package/agetty/install
451 $(INSTALL_DIR) $(1)/usr/sbin
452 $(INSTALL_BIN) $(PKG_BUILD_DIR)/agetty $(1)/usr/sbin/
455 define Package/blkid/install
456 $(INSTALL_DIR) $(1)/usr/sbin
457 $(INSTALL_BIN) $(PKG_BUILD_DIR)/.libs/blkid $(1)/usr/sbin/
460 define Package/cal/install
461 $(INSTALL_DIR) $(1)/usr/bin
462 $(INSTALL_BIN) $(PKG_BUILD_DIR)/cal $(1)/usr/bin/
465 define Package/cfdisk/install
466 $(INSTALL_DIR) $(1)/usr/sbin
467 $(INSTALL_BIN) $(PKG_BUILD_DIR)/.libs/cfdisk $(1)/usr/sbin/
470 define Package/dmesg/install
471 $(INSTALL_DIR) $(1)/usr/sbin
472 $(INSTALL_BIN) $(PKG_BUILD_DIR)/dmesg $(1)/usr/sbin/
475 define Package/fdisk/install
476 $(INSTALL_DIR) $(1)/usr/sbin
477 $(INSTALL_BIN) $(PKG_BUILD_DIR)/.libs/fdisk $(1)/usr/sbin/
480 define Package/findfs/install
481 $(INSTALL_DIR) $(1)/usr/sbin
482 $(INSTALL_BIN) $(PKG_BUILD_DIR)/.libs/findfs $(1)/usr/sbin/
485 define Package/flock/install
486 $(INSTALL_DIR) $(1)/usr/bin
487 $(INSTALL_BIN) $(PKG_BUILD_DIR)/flock $(1)/usr/bin/
490 define Package/getopt/install
491 $(INSTALL_DIR) $(1)/usr/bin
492 $(INSTALL_BIN) $(PKG_BUILD_DIR)/getopt $(1)/usr/bin/
495 define Package/hwclock/install
496 $(INSTALL_DIR) $(1)/usr/sbin
497 $(INSTALL_BIN) $(PKG_BUILD_DIR)/hwclock $(1)/usr/sbin/
500 define Package/logger/install
501 $(INSTALL_DIR) $(1)/usr/bin
502 $(INSTALL_BIN) $(PKG_BUILD_DIR)/logger $(1)/usr/bin/
505 define Package/look/install
506 $(INSTALL_DIR) $(1)/usr/bin
507 $(INSTALL_BIN) $(PKG_BUILD_DIR)/look $(1)/usr/bin/
510 define Package/losetup/install
511 $(INSTALL_DIR) $(1)/usr/sbin
512 $(INSTALL_BIN) $(PKG_BUILD_DIR)/.libs/losetup $(1)/usr/sbin/
515 define Package/lsblk/install
516 $(INSTALL_DIR) $(1)/usr/bin
517 $(INSTALL_BIN) $(PKG_BUILD_DIR)/.libs/lsblk $(1)/usr/bin/
520 define Package/mcookie/install
521 $(INSTALL_DIR) $(1)/usr/bin
522 $(INSTALL_BIN) $(PKG_BUILD_DIR)/mcookie $(1)/usr/bin/
525 define Package/mount-utils/install
526 $(INSTALL_DIR) $(1)/usr/bin
527 $(INSTALL_BIN) $(PKG_BUILD_DIR)/.libs/{u,}mount $(1)/usr/bin/
528 $(INSTALL_BIN) $(PKG_BUILD_DIR)/.libs/mountpoint $(1)/usr/bin/
529 $(INSTALL_BIN) $(PKG_BUILD_DIR)/.libs/findmnt $(1)/usr/bin/
532 define Package/namei/install
533 $(INSTALL_DIR) $(1)/usr/bin
534 $(INSTALL_BIN) $(PKG_BUILD_DIR)/namei $(1)/usr/bin/
537 define Package/rename/install
538 $(INSTALL_DIR) $(1)/usr/bin
539 $(INSTALL_BIN) $(PKG_BUILD_DIR)/rename $(1)/usr/bin/
542 define Package/partx-utils/install
543 $(INSTALL_DIR) $(1)/usr/sbin
544 $(INSTALL_BIN) $(PKG_BUILD_DIR)/.libs/partx $(1)/usr/sbin/
545 $(INSTALL_BIN) $(PKG_BUILD_DIR)/addpart $(1)/usr/sbin/
546 $(INSTALL_BIN) $(PKG_BUILD_DIR)/delpart $(1)/usr/sbin/
549 define Package/script-utils/install
550 $(INSTALL_DIR) $(1)/usr/bin
551 $(INSTALL_BIN) $(PKG_BUILD_DIR)/script $(1)/usr/bin/
552 $(INSTALL_BIN) $(PKG_BUILD_DIR)/scriptreplay $(1)/usr/bin/
555 define Package/setterm/install
556 $(INSTALL_DIR) $(1)/usr/bin
557 $(INSTALL_BIN) $(PKG_BUILD_DIR)/setterm $(1)/usr/bin/
560 define Package/sfdisk/install
561 $(INSTALL_DIR) $(1)/usr/sbin
562 $(INSTALL_BIN) $(PKG_BUILD_DIR)/sfdisk $(1)/usr/sbin/
565 define Package/swap-utils/install
566 $(INSTALL_DIR) $(1)/usr/sbin
567 $(INSTALL_BIN) $(PKG_BUILD_DIR)/.libs/mkswap $(1)/usr/sbin/
568 $(INSTALL_BIN) $(PKG_BUILD_DIR)/.libs/swaplabel $(1)/usr/sbin/
571 define Package/uuidd/install
572 $(INSTALL_DIR) $(1)/usr/sbin
573 $(INSTALL_BIN) $(PKG_BUILD_DIR)/.libs/uuidd $(1)/usr/sbin/
576 define Package/uuidgen/install
577 $(INSTALL_DIR) $(1)/usr/bin
578 $(INSTALL_BIN) $(PKG_BUILD_DIR)/.libs/uuidgen $(1)/usr/bin/
581 define Package/wall/install
582 $(INSTALL_DIR) $(1)/usr/bin
583 $(INSTALL_BIN) $(PKG_BUILD_DIR)/wall $(1)/usr/bin/
586 define Package/whereis/install
587 $(INSTALL_DIR) $(1)/usr/bin
588 $(INSTALL_BIN) $(PKG_BUILD_DIR)/whereis $(1)/usr/bin/
591 define Package/wipefs/install
592 $(INSTALL_DIR) $(1)/usr/sbin
593 $(INSTALL_BIN) $(PKG_BUILD_DIR)/.libs/wipefs $(1)/usr/sbin/
596 $(eval $(call BuildPackage,libblkid))
597 $(eval $(call BuildPackage,libmount))
598 $(eval $(call BuildPackage,libsmartcols))
599 $(eval $(call BuildPackage,libuuid))
600 $(eval $(call BuildPackage,agetty))
601 $(eval $(call BuildPackage,blkid))
602 $(eval $(call BuildPackage,cal))
603 $(eval $(call BuildPackage,cfdisk))
604 $(eval $(call BuildPackage,dmesg))
605 $(eval $(call BuildPackage,fdisk))
606 $(eval $(call BuildPackage,findfs))
607 $(eval $(call BuildPackage,flock))
608 $(eval $(call BuildPackage,getopt))
609 $(eval $(call BuildPackage,hwclock))
610 $(eval $(call BuildPackage,logger))
611 $(eval $(call BuildPackage,look))
612 $(eval $(call BuildPackage,losetup))
613 $(eval $(call BuildPackage,lsblk))
614 $(eval $(call BuildPackage,mcookie))
615 $(eval $(call BuildPackage,mount-utils))
616 $(eval $(call BuildPackage,namei))
617 $(eval $(call BuildPackage,rename))
618 $(eval $(call BuildPackage,partx-utils))
619 $(eval $(call BuildPackage,script-utils))
620 $(eval $(call BuildPackage,setterm))
621 $(eval $(call BuildPackage,sfdisk))
622 $(eval $(call BuildPackage,swap-utils))
623 $(eval $(call BuildPackage,uuidd))
624 $(eval $(call BuildPackage,uuidgen))
625 $(eval $(call BuildPackage,wall))
626 $(eval $(call BuildPackage,whereis))
627 $(eval $(call BuildPackage,wipefs))