b.liu | e958203 | 2025-04-17 19:18:16 +0800 | [diff] [blame] | 1 | # |
| 2 | # Copyright (C) 2006-2014 OpenWrt.org |
| 3 | # Copyright 2010 Vertical Communications |
| 4 | # This is free software, licensed under the GNU General Public License v2. |
| 5 | # See /LICENSE for more information. |
| 6 | # |
| 7 | |
| 8 | include $(TOPDIR)/rules.mk |
| 9 | |
| 10 | PKG_NAME:=e2fsprogs |
| 11 | PKG_VERSION:=1.47.0 |
| 12 | PKG_RELEASE:=2 |
| 13 | |
| 14 | PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz |
| 15 | PKG_SOURCE_URL:=@KERNEL/linux/kernel/people/tytso/e2fsprogs/v$(PKG_VERSION)/ |
| 16 | PKG_HASH:=144af53f2bbd921cef6f8bea88bb9faddca865da3fbc657cc9b4d2001097d5db |
| 17 | |
| 18 | PKG_LICENSE:=GPL-2.0 |
| 19 | PKG_LICENSE_FILES:=NOTICE |
| 20 | PKG_CPE_ID:=cpe:/a:e2fsprogs_project:e2fsprogs |
| 21 | |
| 22 | PKG_BUILD_DEPENDS:=util-linux |
| 23 | PKG_INSTALL:=1 |
| 24 | |
| 25 | PKG_BUILD_PARALLEL:=1 |
| 26 | PKG_BUILD_FLAGS:=gc-sections lto |
| 27 | |
| 28 | include $(INCLUDE_DIR)/package.mk |
| 29 | include $(INCLUDE_DIR)/host-build.mk |
| 30 | |
| 31 | define Package/e2fsprogs |
| 32 | SECTION:=utils |
| 33 | CATEGORY:=Utilities |
| 34 | SUBMENU:=Filesystem |
| 35 | TITLE:=Ext2/3/4 filesystem utilities |
| 36 | URL:=http://e2fsprogs.sourceforge.net/ |
| 37 | DEPENDS:=+libuuid +libext2fs +libe2p |
| 38 | endef |
| 39 | |
| 40 | define Package/e2fsprogs/description |
| 41 | This package contains essential ext2 filesystem utilities which consists of |
| 42 | e2fsck, mke2fs and most of the other core ext2 filesystem utilities. |
| 43 | endef |
| 44 | |
| 45 | define Package/libext2fs |
| 46 | SECTION:=libs |
| 47 | CATEGORY:=Libraries |
| 48 | TITLE:=ext2/3/4 filesystem library |
| 49 | URL:=http://e2fsprogs.sourceforge.net/ |
| 50 | DEPENDS:=+libuuid +libblkid +libss +libcomerr |
| 51 | ABI_VERSION:=2 |
| 52 | endef |
| 53 | |
| 54 | define Package/libext2fs/description |
| 55 | libext2fs is a library which can access ext2, ext3 and ext4 filesystems. |
| 56 | endef |
| 57 | |
| 58 | define Package/libe2p |
| 59 | SECTION:=libs |
| 60 | CATEGORY:=Libraries |
| 61 | TITLE:=ext2fs userspace programs utility library |
| 62 | URL:=http://e2fsprogs.sourceforge.net/ |
| 63 | DEPENDS:=+libuuid |
| 64 | ABI_VERSION:=2 |
| 65 | endef |
| 66 | |
| 67 | define Package/libe2p/description |
| 68 | This package contains libe2p, ext2fs userspace programs utility library |
| 69 | bundled with e2fsprogs. |
| 70 | endef |
| 71 | |
| 72 | define Package/libss |
| 73 | SECTION:=libs |
| 74 | CATEGORY:=Libraries |
| 75 | TITLE:=command-line interface parsing library |
| 76 | URL:=http://e2fsprogs.sourceforge.net/ |
| 77 | DEPENDS:=+libcomerr |
| 78 | ABI_VERSION:=2 |
| 79 | endef |
| 80 | |
| 81 | define Package/libss/description |
| 82 | This pacakge contains libss, a command-line interface parsing library |
| 83 | bundled with e2fsprogs. |
| 84 | endef |
| 85 | |
| 86 | define Package/libcomerr |
| 87 | SECTION:=libs |
| 88 | CATEGORY:=Libraries |
| 89 | TITLE:=common error description library |
| 90 | URL:=http://e2fsprogs.sourceforge.net/ |
| 91 | DEPENDS:=+libuuid |
| 92 | ABI_VERSION:=0 |
| 93 | endef |
| 94 | |
| 95 | define Package/libcomerr/description |
| 96 | This package contains libcom_err, the common error description library |
| 97 | bundled with e2fsprogs. |
| 98 | endef |
| 99 | |
| 100 | define Package/tune2fs |
| 101 | $(call Package/e2fsprogs) |
| 102 | TITLE:=Ext2 Filesystem tune utility |
| 103 | DEPENDS:= +e2fsprogs |
| 104 | endef |
| 105 | |
| 106 | define Package/resize2fs |
| 107 | $(call Package/e2fsprogs) |
| 108 | TITLE:=Ext2 Filesystem resize utility |
| 109 | DEPENDS:= +e2fsprogs |
| 110 | endef |
| 111 | |
| 112 | define Package/badblocks |
| 113 | $(call Package/e2fsprogs) |
| 114 | TITLE:=Ext2 Filesystem badblocks utility |
| 115 | DEPENDS:= +e2fsprogs |
| 116 | endef |
| 117 | |
| 118 | define Package/dumpe2fs |
| 119 | $(call Package/e2fsprogs) |
| 120 | TITLE:=Ext2 Filesystem information dumping utility |
| 121 | DEPENDS:= +e2fsprogs |
| 122 | endef |
| 123 | |
| 124 | define Package/e2freefrag |
| 125 | $(call Package/e2fsprogs) |
| 126 | TITLE:=Ext2 Filesystem free space fragmentation information utility |
| 127 | DEPENDS:= +e2fsprogs |
| 128 | endef |
| 129 | |
| 130 | define Package/e4crypt |
| 131 | $(call Package/e2fsprogs) |
| 132 | TITLE:=Ext4 Filesystem encryption utility |
| 133 | DEPENDS:= +e2fsprogs |
| 134 | endef |
| 135 | |
| 136 | define Package/filefrag |
| 137 | $(call Package/e2fsprogs) |
| 138 | TITLE:=Ext2 Filesystem file fragmentation report utility |
| 139 | DEPENDS:= +e2fsprogs |
| 140 | endef |
| 141 | |
| 142 | define Package/debugfs |
| 143 | $(call Package/e2fsprogs) |
| 144 | TITLE:=Ext2 Filesystem debugger |
| 145 | DEPENDS:= +e2fsprogs |
| 146 | endef |
| 147 | |
| 148 | define Package/chattr |
| 149 | $(call Package/e2fsprogs) |
| 150 | TITLE:=Ext2 Filesystem chattr utility |
| 151 | DEPENDS:= +e2fsprogs |
| 152 | endef |
| 153 | |
| 154 | define Package/lsattr |
| 155 | $(call Package/e2fsprogs) |
| 156 | TITLE:=Ext2 Filesystem lsattr utility |
| 157 | DEPENDS:= +e2fsprogs |
| 158 | endef |
| 159 | |
| 160 | TARGET_CFLAGS += $(FPIC) |
| 161 | |
| 162 | CONFIGURE_ARGS += \ |
| 163 | --disable-testio-debug \ |
| 164 | --enable-elf-shlibs \ |
| 165 | --disable-libuuid \ |
| 166 | --disable-libblkid \ |
| 167 | --disable-uuidd \ |
| 168 | --disable-tls \ |
| 169 | --disable-nls \ |
| 170 | --disable-rpath \ |
| 171 | --disable-fuse2fs |
| 172 | |
| 173 | ifneq ($(CONFIG_USE_MUSL),) |
| 174 | CONFIGURE_VARS += ac_cv_func_lseek64=yes |
| 175 | endif |
| 176 | |
| 177 | define Build/Prepare |
| 178 | $(call Build/Prepare/Default) |
| 179 | $(CP) $(SCRIPT_DIR)/config.{guess,sub} $(PKG_BUILD_DIR)/config/ |
| 180 | endef |
| 181 | |
| 182 | define Build/Compile |
| 183 | +$(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR)/util \ |
| 184 | BUILDCC="$(HOSTCC)" \ |
| 185 | CFLAGS="" \ |
| 186 | CPPFLAGS="" \ |
| 187 | LDFLAGS="" \ |
| 188 | V=$(if $(findstring c,$(OPENWRT_VERBOSE)),1,) \ |
| 189 | subst |
| 190 | +$(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR) \ |
| 191 | BUILDCC="$(HOSTCC)" \ |
| 192 | DESTDIR="$(PKG_INSTALL_DIR)" \ |
| 193 | ELF_OTHER_LIBS="$(TARGET_LDFLAGS) -luuid" \ |
| 194 | SYSLIBS="$(TARGET_LDFLAGS) -ldl -L$(PKG_BUILD_DIR)/lib/ -l:libcom_err.so.0.0" \ |
| 195 | V=$(if $(findstring c,$(OPENWRT_VERBOSE)),1,) \ |
| 196 | all |
| 197 | endef |
| 198 | |
| 199 | define Build/InstallDev |
| 200 | $(INSTALL_DIR) $(1)/usr/lib/pkgconfig |
| 201 | |
| 202 | $(CP) $(PKG_BUILD_DIR)/lib/ext2fs/ext2fs.pc $(1)/usr/lib/pkgconfig |
| 203 | $(CP) $(PKG_BUILD_DIR)/lib/et/com_err.pc $(1)/usr/lib/pkgconfig |
| 204 | $(CP) $(PKG_BUILD_DIR)/lib/e2p/e2p.pc $(1)/usr/lib/pkgconfig |
| 205 | $(CP) $(PKG_BUILD_DIR)/lib/ss/ss.pc $(1)/usr/lib/pkgconfig |
| 206 | |
| 207 | $(INSTALL_DIR) $(1)/usr/lib |
| 208 | $(CP) $(PKG_BUILD_DIR)/lib/libext2fs.{so,a}* $(1)/usr/lib |
| 209 | $(CP) $(PKG_BUILD_DIR)/lib/libcom_err.{so,a}* $(1)/usr/lib |
| 210 | $(CP) $(PKG_BUILD_DIR)/lib/libss.{so,a}* $(1)/usr/lib |
| 211 | $(CP) $(PKG_BUILD_DIR)/lib/libe2p.{so,a}* $(1)/usr/lib |
| 212 | |
| 213 | $(INSTALL_DIR) $(1)/usr/include/ext2fs |
| 214 | $(CP) $(PKG_BUILD_DIR)/lib/ext2fs/*.h $(1)/usr/include/ext2fs |
| 215 | $(INSTALL_DIR) $(1)/usr/include/et |
| 216 | $(INSTALL_BIN) $(PKG_BUILD_DIR)/lib/et/*.h $(1)/usr/include/et |
| 217 | # Apparently there is some confusion |
| 218 | echo "#include <et/com_err.h>" > $(1)/usr/include/com_err.h |
| 219 | $(INSTALL_DIR) $(1)/usr/include/ss |
| 220 | $(CP) \ |
| 221 | $(PKG_BUILD_DIR)/lib/ss/ss.h \ |
| 222 | $(PKG_BUILD_DIR)/lib/ss/ss_err.h \ |
| 223 | $(1)/usr/include/ss/ |
| 224 | $(INSTALL_DIR) $(1)/usr/include/e2p |
| 225 | $(CP) $(PKG_BUILD_DIR)/lib/e2p/e2p.h $(1)/usr/include/e2p |
| 226 | endef |
| 227 | |
| 228 | define Package/e2fsprogs/conffiles |
| 229 | /etc/e2fsck.conf |
| 230 | endef |
| 231 | |
| 232 | define Package/e2fsprogs/install |
| 233 | $(INSTALL_DIR) $(1)/usr/sbin |
| 234 | $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/e2fsck $(1)/usr/sbin/ |
| 235 | $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/mke2fs $(1)/usr/sbin/ |
| 236 | $(LN) mke2fs $(1)/usr/sbin/mkfs.ext2 |
| 237 | $(LN) mke2fs $(1)/usr/sbin/mkfs.ext3 |
| 238 | $(LN) mke2fs $(1)/usr/sbin/mkfs.ext4 |
| 239 | $(LN) e2fsck $(1)/usr/sbin/fsck.ext2 |
| 240 | $(LN) e2fsck $(1)/usr/sbin/fsck.ext3 |
| 241 | $(LN) e2fsck $(1)/usr/sbin/fsck.ext4 |
| 242 | $(INSTALL_DIR) $(1)/usr/lib |
| 243 | $(INSTALL_DIR) $(1)/etc/init.d |
| 244 | $(INSTALL_DIR) $(1)/lib/functions/fsck |
| 245 | $(INSTALL_DATA) ./files/e2fsck.sh $(1)/lib/functions/fsck/ |
| 246 | $(INSTALL_DATA) ./files/e2fsck.conf $(1)/etc/e2fsck.conf |
| 247 | endef |
| 248 | |
| 249 | define Package/libe2p/install |
| 250 | $(INSTALL_DIR) $(1)/usr/lib |
| 251 | $(CP) $(PKG_INSTALL_DIR)/usr/lib/libe2p.so.* $(1)/usr/lib/ |
| 252 | endef |
| 253 | |
| 254 | define Package/libcomerr/install |
| 255 | $(INSTALL_DIR) $(1)/usr/lib |
| 256 | $(CP) $(PKG_INSTALL_DIR)/usr/lib/libcom_err.so.* $(1)/usr/lib/ |
| 257 | endef |
| 258 | |
| 259 | define Package/libss/install |
| 260 | $(INSTALL_DIR) $(1)/usr/lib |
| 261 | $(CP) $(PKG_INSTALL_DIR)/usr/lib/libss.so.* $(1)/usr/lib/ |
| 262 | endef |
| 263 | |
| 264 | define Package/libext2fs/install |
| 265 | $(INSTALL_DIR) $(1)/usr/lib |
| 266 | $(CP) $(PKG_INSTALL_DIR)/usr/lib/libext2fs.so.* $(1)/usr/lib/ |
| 267 | endef |
| 268 | |
| 269 | define Package/libext2fs/install_lib |
| 270 | $(INSTALL_DIR) $(1)/usr/lib |
| 271 | $(CP) $(PKG_BUILD_DIR)/lib/ext2fs/libext2fs.a $(1)/usr/lib/libext2fs_pic.a |
| 272 | endef |
| 273 | |
| 274 | define Package/tune2fs/install |
| 275 | $(INSTALL_DIR) $(1)/usr/sbin |
| 276 | $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/tune2fs $(1)/usr/sbin/ |
| 277 | endef |
| 278 | |
| 279 | define Package/resize2fs/install |
| 280 | $(INSTALL_DIR) $(1)/usr/sbin |
| 281 | $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/resize2fs $(1)/usr/sbin/ |
| 282 | endef |
| 283 | |
| 284 | define Package/badblocks/install |
| 285 | $(INSTALL_DIR) $(1)/usr/sbin |
| 286 | $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/badblocks $(1)/usr/sbin/ |
| 287 | endef |
| 288 | |
| 289 | define Package/dumpe2fs/install |
| 290 | $(INSTALL_DIR) $(1)/usr/sbin |
| 291 | $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/dumpe2fs $(1)/usr/sbin/ |
| 292 | endef |
| 293 | |
| 294 | define Package/e2freefrag/install |
| 295 | $(INSTALL_DIR) $(1)/usr/sbin |
| 296 | $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/e2freefrag $(1)/usr/sbin/ |
| 297 | endef |
| 298 | |
| 299 | define Package/e4crypt/install |
| 300 | $(INSTALL_DIR) $(1)/usr/sbin |
| 301 | $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/e4crypt $(1)/usr/sbin/ |
| 302 | endef |
| 303 | |
| 304 | define Package/filefrag/install |
| 305 | $(INSTALL_DIR) $(1)/usr/sbin |
| 306 | $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/filefrag $(1)/usr/sbin/ |
| 307 | endef |
| 308 | |
| 309 | define Package/debugfs/install |
| 310 | $(INSTALL_DIR) $(1)/usr/sbin |
| 311 | $(INSTALL_DIR) $(1)/usr/lib |
| 312 | $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/debugfs $(1)/usr/sbin/ |
| 313 | endef |
| 314 | |
| 315 | define Package/chattr/install |
| 316 | $(INSTALL_DIR) $(1)/usr/bin |
| 317 | $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/chattr $(1)/usr/bin/ |
| 318 | endef |
| 319 | |
| 320 | define Package/lsattr/install |
| 321 | $(INSTALL_DIR) $(1)/usr/bin |
| 322 | $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/lsattr $(1)/usr/bin/ |
| 323 | endef |
| 324 | |
| 325 | $(eval $(call BuildPackage,libcomerr)) |
| 326 | $(eval $(call BuildPackage,libss)) |
| 327 | $(eval $(call BuildPackage,libext2fs)) |
| 328 | $(eval $(call BuildPackage,libe2p)) |
| 329 | $(eval $(call BuildPackage,e2fsprogs)) |
| 330 | $(eval $(call BuildPackage,tune2fs)) |
| 331 | $(eval $(call BuildPackage,resize2fs)) |
| 332 | $(eval $(call BuildPackage,badblocks)) |
| 333 | $(eval $(call BuildPackage,dumpe2fs)) |
| 334 | $(eval $(call BuildPackage,e2freefrag)) |
| 335 | $(eval $(call BuildPackage,e4crypt)) |
| 336 | $(eval $(call BuildPackage,filefrag)) |
| 337 | $(eval $(call BuildPackage,debugfs)) |
| 338 | $(eval $(call BuildPackage,chattr)) |
| 339 | $(eval $(call BuildPackage,lsattr)) |