[packages] dosfstools: update to 3.0.12, add fsck script (#10697)
authorStephen Walker <stephendwalker@gmail.com>
Fri, 9 Mar 2012 01:11:17 +0000 (01:11 +0000)
committerStephen Walker <stephendwalker@gmail.com>
Fri, 9 Mar 2012 01:11:17 +0000 (01:11 +0000)
SVN-Revision: 30858

utils/dosfstools/Makefile
utils/dosfstools/files/dosfsck.sh [new file with mode: 0644]
utils/dosfstools/patches/002-linux_26_headers.patch

index cf32d8484ed9dfae5037ba3f2aab4f4477c8799c..031cb85d708641131cb5e71c5081fd43fc3bc38c 100644 (file)
@@ -1,5 +1,5 @@
 #
-# Copyright (C) 2006-2011 OpenWrt.org
+# Copyright (C) 2006-2012 OpenWrt.org
 #
 # This is free software, licensed under the GNU General Public License v2.
 # See /LICENSE for more information.
@@ -8,12 +8,12 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=dosfstools
-PKG_VERSION:=3.0.11
+PKG_VERSION:=3.0.12
 PKG_RELEASE:=1
 
-PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=http://www.daniel-baumann.ch/software/dosfstools
-PKG_MD5SUM:=8d2211d5bd813164e20740e7c852aa06
+PKG_MD5SUM:=4c1f1e72b82371704f93ebdd3c7b6259
 
 include $(INCLUDE_DIR)/package.mk
 
@@ -73,6 +73,8 @@ define Build/Compile
 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/
        (cd $(1)/usr/sbin; ln -sf dosfsck fsck.msdos; ln -sf dosfsck fsck.vfat)
diff --git a/utils/dosfstools/files/dosfsck.sh b/utils/dosfstools/files/dosfsck.sh
new file mode 100644 (file)
index 0000000..bcc29b9
--- /dev/null
@@ -0,0 +1,30 @@
+#!/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"
index c4d506f30fd571ef7c21da7a965ff6828de2b4b7..b55a7c83c3904272cd87ca98587728f47ec1d9e2 100644 (file)
@@ -4,31 +4,29 @@
     can be found in /usr/share/common-licenses/GPL-3 file.
  */
  
--# include <asm/types.h>
+-#include <asm/types.h>
 +#include <linux/types.h>
  
  #ifndef _COMMON_H
  #define _COMMON_H
 --- a/src/dosfsck.h
 +++ b/src/dosfsck.h
-@@ -32,8 +32,8 @@
- #define _LINUX_STRING_H_      /* hack to avoid inclusion of <linux/string.h>*/
- #define _LINUX_FS_H             /* hack to avoid inclusion of <linux/fs.h> */
+@@ -31,7 +31,7 @@
+ #define _LINUX_STRING_H_      /* hack to avoid inclusion of <linux/string.h> */
+ #define _LINUX_FS_H           /* hack to avoid inclusion of <linux/fs.h> */
  
--# include <asm/types.h>
--# include <asm/byteorder.h>
+-#include <asm/types.h>
 +#include <linux/types.h>
-+#include <asm/byteorder.h>
+ #include <asm/byteorder.h>
  
  #include <linux/msdos_fs.h>
 --- a/src/file.c
 +++ b/src/file.c
-@@ -34,7 +34,7 @@
- #define _LINUX_STRING_H_      /* hack to avoid inclusion of <linux/string.h>*/
- #define _LINUX_FS_H             /* hack to avoid inclusion of <linux/fs.h> */
+@@ -33,7 +33,7 @@
+ #define _LINUX_STRING_H_      /* hack to avoid inclusion of <linux/string.h> */
+ #define _LINUX_FS_H           /* hack to avoid inclusion of <linux/fs.h> */
  
--# include <asm/types.h>
+-#include <asm/types.h>
 +#include <linux/types.h>
  
  #include <linux/msdos_fs.h>
@@ -49,7 +47,7 @@
  #include <time.h>
  #include <errno.h>
  
--# include <asm/types.h>
+-#include <asm/types.h>
 +#include <linux/types.h>
  
  #if __BYTE_ORDER == __BIG_ENDIAN