Browse Source

dosfstools: update to v4.0

This updates dosfstools to the latest release available and uses the new
automatically generated Makefiles instead of a hard coded compilation.

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
lilik-openwrt-22.03
Álvaro Fernández Rojas 8 years ago
parent
commit
dcd7fcfa5b
5 changed files with 79 additions and 74 deletions
  1. +18
    -31
      utils/dosfstools/Makefile
  2. +0
    -30
      utils/dosfstools/files/dosfsck.sh
  3. +34
    -0
      utils/dosfstools/patches/0001-mkfs-Default-to-64-32-heads-sectors-for-targets-smal.patch
  4. +27
    -0
      utils/dosfstools/patches/0002-Switch-to-AC_CHECK_LIB-for-iconv-library-linking.patch
  5. +0
    -13
      utils/dosfstools/patches/010-consistent_use_of_uint32.patch

+ 18
- 31
utils/dosfstools/Makefile View File

@ -1,5 +1,5 @@
#
# Copyright (C) 2006-2015 OpenWrt.org
# Copyright (C) 2006-2016 OpenWrt.org
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
@ -8,7 +8,7 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=dosfstools
PKG_VERSION:=3.0.28
PKG_VERSION:=4.0
PKG_RELEASE:=1
PKG_LICENSE:=GPL-3.0+
@ -16,14 +16,21 @@ PKG_LICENSE_FILES:=COPYING
PKG_MAINTAINER:=David Bonnes <david.bonnes@gmail.com>
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
PKG_SOURCE_URL:=https://github.com/dosfstools/dosfstools/releases/download/v$(PKG_VERSION)/ \
http://fossies.org/linux/misc
PKG_MD5SUM:=64e3b3a59b51d2a97d7ac38b23a124bb
PKG_MD5SUM:=9037738953559d1efe04fc5408b6846216cc0138f7f9d32de80b6ec3c35e7daf
PKG_INSTALL:=1
PKG_FIXUP:=autoreconf
include $(INCLUDE_DIR)/package.mk
include $(INCLUDE_DIR)/nls.mk
CONFIGURE_ARGS += \
--enable-compat-symlinks \
--without-udev
define Package/dosfstools/Default
SECTION:=utils
CATEGORY:=Utilities
@ -62,46 +69,26 @@ define Package/mkdosfs/description
(mkfs.vfat and mkfs.fat for creating FAT volumes)
endef
LDFLAGS+=$(ICONV_LDFLAGS)
LDLIBS+=-liconv
define Build/Configure
endef
define Build/Compile
$(MAKE) -C $(PKG_BUILD_DIR) \
$(TARGET_CONFIGURE_OPTS) \
OPTFLAGS="$(TARGET_CFLAGS) -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE" \
PREFIX="/usr" \
SBINDIR="/usr/sbin" \
LDFLAGS="$(LDFLAGS)" \
LDLIBS="$(LDLIBS)" \
all
$(MAKE) -C $(PKG_BUILD_DIR) \
$(TARGET_CONFIGURE_OPTS) \
OPTFLAGS="$(TARGET_CFLAGS) -D_FILE_OFFSET_BITS=64" \
PREFIX="$(PKG_INSTALL_DIR)/usr" \
SBINDIR="$(PKG_INSTALL_DIR)/usr/sbin" \
install-bin
endef
define Package/dosfsck/install
$(INSTALL_DIR) $(1)/lib/functions/fsck
$(INSTALL_DATA) ./files/dosfsck.sh $(1)/lib/functions/fsck/
$(INSTALL_DIR) $(1)/usr/sbin
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/dosfsck $(1)/usr/sbin/
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/fsck.fat $(1)/usr/sbin/
(cd $(1)/usr/sbin; ln -sf fsck.fat fsck.msdos; ln -sf fsck.fat fsck.vfat; ln -sf fsck.fat dosfsck)
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/fsck.msdos $(1)/usr/sbin/
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/fsck.vfat $(1)/usr/sbin/
endef
define Package/dosfslabel/install
$(INSTALL_DIR) $(1)/usr/sbin
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/dosfslabel $(1)/usr/sbin/
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/fatlabel $(1)/usr/sbin/
endef
define Package/mkdosfs/install
$(INSTALL_DIR) $(1)/usr/sbin
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/mkdosfs $(1)/usr/sbin/
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/mkfs.fat $(1)/usr/sbin/
(cd $(1)/usr/sbin; ln -sf mkfs.fat mkfs.msdos; ln -sf mkfs.fat mkfs.vfat)
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/mkfs.msdos $(1)/usr/sbin/
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/mkfs.vfat $(1)/usr/sbin/
endef
$(eval $(call BuildPackage,dosfsck))


+ 0
- 30
utils/dosfstools/files/dosfsck.sh View File

@ -1,30 +0,0 @@
#!/bin/sh
# Copyright 2010 Vertical Communications
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
#
fsck_dosfsck() {
dosfsck -p "$device" 2>&1 | logger -t "fstab: dosfsck ($device)"
local status="$?"
case "$status" in
0|1) ;; #success
2) reboot;;
4) echo "dosfsck ($device): Warning! Uncorrected errors."| logger -t fstab
return 1
;;
*) echo "dosfsck ($device): Error $status. Check not complete."| logger -t fstab;;
esac
return 0
}
fsck_dos() {
fsck_dosfsck "$@"
}
fsck_vfat() {
fsck_dosfsck "$@"
}
append libmount_known_fsck "dos"
append libmount_known_fsck "vfat"

+ 34
- 0
utils/dosfstools/patches/0001-mkfs-Default-to-64-32-heads-sectors-for-targets-smal.patch View File

@ -0,0 +1,34 @@
From 1e76e5778a1885452939a79d9145b80634a5b023 Mon Sep 17 00:00:00 2001
From: Andreas Bombe <aeb@debian.org>
Date: Wed, 11 May 2016 03:44:58 +0200
Subject: [PATCH] mkfs: Default to 64/32 heads/sectors for targets smaller than
512 MB
This may put defaults in certain use cases a little bit more in line
with the old defaults in versions up to 3.0.28. It has mostly aesthetic
value in most cases.
Signed-off-by: Andreas Bombe <aeb@debian.org>
---
src/mkfs.fat.c | 10 ++++++++++
1 file changed, 10 insertions(+)
--- a/src/mkfs.fat.c
+++ b/src/mkfs.fat.c
@@ -519,6 +519,16 @@ static void establish_params(struct devi
unsigned int cluster_size = 4; /* starting point for FAT12 and FAT16 */
int def_root_dir_entries = 512;
+ if (info->size < 512 * 1024 * 1024) {
+ /*
+ * These values are more or less meaningless, but we can at least
+ * use less extreme values for smaller filesystems where the large
+ * dummy values signifying LBA only access are not needed.
+ */
+ sec_per_track = 32;
+ heads = 64;
+ }
+
if (info->type != TYPE_FIXED) {
/* enter default parameters for floppy disks if the size matches */
switch (info->size / 1024) {

+ 27
- 0
utils/dosfstools/patches/0002-Switch-to-AC_CHECK_LIB-for-iconv-library-linking.patch View File

@ -0,0 +1,27 @@
From 1c6c135ee15e449c1bf2e76d5307f83a3a1d7425 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C3=81lvaro=20Fern=C3=A1ndez=20Rojas?= <noltari@gmail.com>
Date: Tue, 11 Oct 2016 12:07:48 +0200
Subject: [PATCH] Switch to AC_CHECK_LIB for iconv library linking.
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
AC_SEARCH_LIB doesn't work properly for openwrt/lede when building dosfstools
as a package.
Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
---
configure.ac | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/configure.ac
+++ b/configure.ac
@@ -59,7 +59,7 @@ if test "x$with_udev" != "xno"; then
[true])
fi
-AC_SEARCH_LIBS(iconv_open, iconv)
+AC_CHECK_LIB(iconv, iconv_open)
AC_CONFIG_FILES([Makefile src/Makefile src/version.h
manpages/Makefile manpages/mkfs.fat.8

+ 0
- 13
utils/dosfstools/patches/010-consistent_use_of_uint32.patch View File

@ -1,13 +0,0 @@
Index: dosfstools-3.0.28/src/mkfs.fat.c
===================================================================
--- dosfstools-3.0.28.orig/src/mkfs.fat.c
+++ dosfstools-3.0.28/src/mkfs.fat.c
@@ -1412,7 +1412,7 @@ int main(int argc, char **argv)
gettimeofday(&create_timeval, NULL);
create_time = create_timeval.tv_sec;
- volume_id = (u_int32_t) ((create_timeval.tv_sec << 20) | create_timeval.tv_usec); /* Default volume ID = creation time, fudged for more uniqueness */
+ volume_id = (uint32_t) ((create_timeval.tv_sec << 20) | create_timeval.tv_usec); /* Default volume ID = creation time, fudged for more uniqueness */
check_atari();
printf("mkfs.fat " VERSION " (" VERSION_DATE ")\n");

Loading…
Cancel
Save