From patchwork Tue Jul 4 11:21:20 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Samuel Martin X-Patchwork-Id: 783895 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3x21mp1VSWz9ryQ for ; Tue, 4 Jul 2017 21:22:01 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="Tzk1kafp"; dkim-atps=neutral Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id 3A63385638; Tue, 4 Jul 2017 11:21:55 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from fraxinus.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id jgOyu9PLBnn8; Tue, 4 Jul 2017 11:21:51 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by fraxinus.osuosl.org (Postfix) with ESMTP id 018898738D; Tue, 4 Jul 2017 11:21:50 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133]) by ash.osuosl.org (Postfix) with ESMTP id 9BAB21C0146 for ; Tue, 4 Jul 2017 11:21:35 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id 9551588EBE for ; Tue, 4 Jul 2017 11:21:35 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from hemlock.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id z1Zy07M6L1OX for ; Tue, 4 Jul 2017 11:21:34 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-wr0-f173.google.com (mail-wr0-f173.google.com [209.85.128.173]) by hemlock.osuosl.org (Postfix) with ESMTPS id 5AE9B88EBA for ; Tue, 4 Jul 2017 11:21:34 +0000 (UTC) Received: by mail-wr0-f173.google.com with SMTP id r103so247588356wrb.0 for ; Tue, 04 Jul 2017 04:21:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=UoYEE9qvgF7RQ7XPE9l1fTMXvN3ECuAaOFQbMhGuWAE=; b=Tzk1kafpvDTgHcgHo6fOshSUjXbUFVIcxphoULEzBat063xkiG0MYtXYYHxSSyQRv+ taex1fAmn1+Sg4Il7LeoQm7/ja6Si9kC37W4/0pVLH8fNReGl1Bh+C2KaTy6Uuz5YGUJ 98OLWkMKvWBMZmpzy5wwVv/MvbVpIi6ILjjUzgV+MEvQ65fumqPMoefZKJ8+SmsdU1bp qsgI1WDIoyR6BClpWdGPe5I3mARbtSm5l8wGAxdA4Ae9XFDMO1vt53xuDhsXln3ME6JN SMGupd/ThdJp1O7L9c/tBpgqAR2yRjcL2oBdG2DuZQMC7MDLhNYisLlorJ3VxyHeJvbR aT4A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=UoYEE9qvgF7RQ7XPE9l1fTMXvN3ECuAaOFQbMhGuWAE=; b=VRhtaptVvmaL+73uUZg0B1x5XpPLsQ36iGBLILnhbUQJUbxA7UVPgx09AJDAzhsF6b cfyuWr6XSA1SO7/Fvf3wa3QYts1GNw45fYKaPsNV4Uw3itJOxnYoiq1YCWL4MdN0GTY4 LxPb4P4E8rh3KwloNrE2AF+1piVY+SDPp8DHnkscm+/hALEX8rmyFW13fqkc1tloovr5 wYNYDHmmXGl/LbEVGJPytNt7F2SEXilv8o9C9FJYaBVlK7/k3aj4a7rR6QneVZQwF7vk LRdWS63Chji440Q14JpOhP5aypKp9fkJSDc7bM7gAiNL7Msz5BdU/sDxC+lWnNS371XW G/vw== X-Gm-Message-State: AKS2vOyl+eDUE18mRW1yLGOJtFYcYCsaCP2v0iy7n+481h9rvrYpE7VO 9T9J7zGL/Z9LJKCp2sY= X-Received: by 10.223.151.213 with SMTP id t21mr39940924wrb.20.1499167292453; Tue, 04 Jul 2017 04:21:32 -0700 (PDT) Received: from localhost.localdomain (2a01cb08861073004a51b7fffed22913.ipv6.abo.wanadoo.fr. [2a01:cb08:8610:7300:4a51:b7ff:fed2:2913]) by smtp.gmail.com with ESMTPSA id e131sm11102319wmd.28.2017.07.04.04.21.30 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 04 Jul 2017 04:21:31 -0700 (PDT) From: Samuel Martin To: buildroot@buildroot.org Date: Tue, 4 Jul 2017 13:21:20 +0200 Message-Id: <20170704112120.27977-6-s.martin49@gmail.com> X-Mailer: git-send-email 2.13.2 In-Reply-To: <20170704112120.27977-1-s.martin49@gmail.com> References: <20170704112120.27977-1-s.martin49@gmail.com> MIME-Version: 1.0 Cc: "Yann E. MORIN" Subject: [Buildroot] [PATCH v4 5/5] package/mke2img: remove package X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" From: Sébastien Szymanski Now that we use mkfs to generate ext2/3/4 filesystem image by calling mkfs directly from fs/ext2/ext2.mk, we can remove this package. Signed-off-by: Sébastien Szymanski Signed-off-by: Samuel Martin Cc: "Yann E. MORIN" --- changes v3->v4: - none changes v2->v3: - none changes v1->v2: - rebase --- Config.in.legacy | 6 ++ DEVELOPERS | 1 - package/Config.in.host | 1 - package/mke2img/Config.in.host | 11 --- package/mke2img/mke2img | 205 ----------------------------------------- package/mke2img/mke2img.mk | 13 --- 6 files changed, 6 insertions(+), 231 deletions(-) delete mode 100644 package/mke2img/Config.in.host delete mode 100755 package/mke2img/mke2img delete mode 100644 package/mke2img/mke2img.mk diff --git a/Config.in.legacy b/Config.in.legacy index c922cceec8..9f5fd45cc5 100644 --- a/Config.in.legacy +++ b/Config.in.legacy @@ -145,6 +145,12 @@ endif ############################################################################### comment "Legacy options removed in 2017.08" +config BR2_PACKAGE_HOST_MKE2IMG + bool "host mke2img has been removed" + select BR2_LEGACY + help + We now call mkfs directly to generate ext2/3/4 filesystem image. + config BR2_TARGET_ROOTFS_EXT2_BLOCKS int "exact size in blocks has been removed" default 0 diff --git a/DEVELOPERS b/DEVELOPERS index 209491aef7..4faa1a8b2e 100644 --- a/DEVELOPERS +++ b/DEVELOPERS @@ -1783,7 +1783,6 @@ F: package/libiscsi/ F: package/libseccomp/ F: package/linux-tools/ F: package/mesa3d-headers/ -F: package/mke2img/ F: package/nbd/ F: package/nut/ F: package/nvidia-driver/ diff --git a/package/Config.in.host b/package/Config.in.host index 0932b9f1f9..c5a852b858 100644 --- a/package/Config.in.host +++ b/package/Config.in.host @@ -24,7 +24,6 @@ menu "Host utilities" source "package/lpc3250loader/Config.in.host" source "package/lttng-babeltrace/Config.in.host" source "package/mfgtools/Config.in.host" - source "package/mke2img/Config.in.host" source "package/mkpasswd/Config.in.host" source "package/mtd/Config.in.host" source "package/mtools/Config.in.host" diff --git a/package/mke2img/Config.in.host b/package/mke2img/Config.in.host deleted file mode 100644 index b5bcb8455f..0000000000 --- a/package/mke2img/Config.in.host +++ /dev/null @@ -1,11 +0,0 @@ -config BR2_PACKAGE_HOST_MKE2IMG - bool "host mke2img" - select BR2_PACKAGE_HOST_E2FSPROGS - select BR2_PACKAGE_HOST_GENEXT2FS - help - Easily create filesystems of the extend familly: ext2/3/4. - - This tool is bundled by, and specific to Buildroot. However, it can - be used from post-images scripts is needed. - - https://code.google.com/p/mke2img/ diff --git a/package/mke2img/mke2img b/package/mke2img/mke2img deleted file mode 100755 index 399012a2be..0000000000 --- a/package/mke2img/mke2img +++ /dev/null @@ -1,205 +0,0 @@ -#!/usr/bin/env bash - -# Buildroot wrapper to the collection of ext2/3/4 filesystem tools: -# - genext2fs, to generate ext2 filesystem images -# - tune2fs, to modify an ext2/3/4 filesystem (possibly in an image file) -# - e2fsck, to check and fix an ext2/3/4 filesystem (possibly in an image file) - -set -e - -main() { - local OPT OPTARG - local nb_blocks nb_inodes nb_res_blocks root_dir image gen rev label uuid - local -a genext2fs_opts - local -a tune2fs_opts - local tune2fs_O_opts - - # Default values - gen=2 - rev=1 - nb_extra_inodes=0 - - while getopts :hB:b:i:I:r:d:o:G:R:l:u: OPT; do - case "${OPT}" in - h) help; exit 0;; - B) block_size="${OPTARG}";; - b) nb_blocks=${OPTARG};; - i) nb_inodes=${OPTARG};; - I) nb_extra_inodes=${OPTARG};; - r) nb_res_blocks=${OPTARG};; - d) root_dir="${OPTARG}";; - o) image="${OPTARG}";; - G) gen=${OPTARG};; - R) rev=${OPTARG};; - l) label="${OPTARG}";; - u) uuid="${OPTARG}";; - :) error "option '%s' expects a mandatory argument\n" "${OPTARG}";; - \?) error "unknown option '%s'\n" "${OPTARG}";; - esac - done - - # Sanity checks - if [ -z "${root_dir}" ]; then - error "you must specify a root directory with '-d'\n" - fi - if [ -z "${image}" ]; then - error "you must specify an output image file with '-o'\n" - fi - if [ -z "${nb_blocks}" ]; then - error "you must specify the size of the output image with '-b'\n" - fi - case "${block_size}" in - 1024|2048|4096) ;; # Sole valid values - '') error "you must specify the size of a block with -B\n";; - *) error "invalid block size '%s' (valid: 1024. 2048, 4096)\n" "${block_size}";; - esac - case "${gen}:${rev}" in - 2:0|2:1|3:1|4:1) - ;; - 3:0|4:0) - error "revision 0 is invalid for ext3 and ext4\n" - ;; - *) error "unknown ext generation '%s' and/or revision '%s'\n" \ - "${gen}" "${rev}" - ;; - esac - - # calculate needed inodes - if [ ${nb_inodes:-0} -eq 0 ]; then - nb_inodes=$(find "${root_dir}" | wc -l) - nb_inodes=$((nb_inodes+400)) - fi - nb_inodes=$((nb_inodes+nb_extra_inodes)) - - # Upgrade to rev1 if needed - if [ ${rev} -ge 1 ]; then - tune2fs_O_opts+=",filetype,sparse_super" - fi - - # Add a journal for ext3 and above - if [ ${gen} -ge 3 ]; then - tune2fs_opts+=( -j -J size=1 ) - fi - - # Add ext4 specific features - if [ ${gen} -ge 4 ]; then - tune2fs_O_opts+=",extents,uninit_bg,dir_index" - fi - - # Add our -O options (there will be at most one leading comma, remove it) - if [ -n "${tune2fs_O_opts}" ]; then - tune2fs_opts+=( -O "${tune2fs_O_opts#,}" ) - fi - - # Add the label if specified - if [ -n "${label}" ]; then - tune2fs_opts+=( -L "${label}" ) - fi - - # Generate the filesystem - genext2fs_opts=( -z -B ${block_size} -b ${nb_blocks} -N ${nb_inodes} -d "${root_dir}" ) - if [ -n "${nb_res_blocks}" ]; then - genext2fs_opts+=( -m ${nb_res_blocks} ) - fi - genext2fs "${genext2fs_opts[@]}" "${image}" - - # genext2fs does not generate a UUID, but fsck will whine if one - # is missing, so we need to add a UUID. - # Of course, this has to happen _before_ we run fsck. - # Also, some ext4 metadata are based on the UUID, so we must - # set it before we can convert the filesystem to ext4. - # If the user did not specify a UUID, we generate a random one. - # Although a random UUID may seem bad for reproducibility, there - # already are so many things that are not reproducible in a - # filesystem: file dates, file ordering, content of the files... - tune2fs -U "${uuid:-random}" "${image}" - - # Upgrade the filesystem - if [ ${#tune2fs_opts[@]} -ne 0 ]; then - tune2fs "${tune2fs_opts[@]}" "${image}" - fi - - # After changing filesystem options, running fsck is required - # (see: man tune2fs). Running e2fsck in other cases will ensure - # coherency of the filesystem, although it is not required. - # 'e2fsck -pDf' means: - # - automatically repair - # - optimise and check for duplicate entries - # - force checking - # Sending output to oblivion, as e2fsck can be *very* verbose, - # especially with filesystems generated by genext2fs. - # Exit codes 1 & 2 are OK, it means fs errors were successfully - # corrected, hence our little trick with $ret. - ret=0 - e2fsck -pDf "${image}" >/dev/null || ret=$? - case ${ret} in - 0|1|2) ;; - *) errorN ${ret} "failed to run e2fsck on '%s' (ext%d)\n" \ - "${image}" ${gen} - esac - printf "\n" - trace "e2fsck was successfully run on '%s' (ext%d)\n" "${image}" ${gen} - printf "\n" - - # Remove count- and time-based checks, they are not welcome - # on embedded devices, where they can cause serious boot-time - # issues by tremendously slowing down the boot. - tune2fs -c 0 -i 0 "${image}" -} - -help() { - cat <<_EOF_ -NAME - ${my_name} - Create an ext2/3/4 filesystem image - -SYNOPSIS - ${my_name} [OPTION]... - -DESCRIPTION - Create ext2/3/4 filesystem image from the content of a directory. - - -b BLOCKS - Create a filesystem of BLOCKS 1024-byte blocs. The default is to - compute the required number of blocks. - - -i INODES - Create a filesystem with INODES inodes. The default is to compute - the required number of inodes. - - -r RES_BLOCKS - Create a filesystem with RES_BLOCKS reserved blocks. The default - is to reserve 0 block. - - -d ROOT_DIR - Create a filesystem, using the content of ROOT_DIR as the content - of the root of the filesystem. Mandatory. - - -o FILE - Create the filesystem in FILE. Madatory. - - -G GEN -R REV - Create a filesystem of generation GEN (2, 3 or 4), and revision - REV (0 or 1). The default is to generate an ext2 revision 1 - filesystem; revision 0 is invalid for ext3 and ext4. - - -l LABEL - Create a filesystem with label LABEL. The default is to not set - a label. - - -u UUID - Create filesystem with uuid UUID. The default is to set a random - UUID. - - Exit status: - 0 if OK - !0 in case of error -_EOF_ -} - -trace() { local msg="${1}"; shift; printf "%s: ${msg}" "${my_name}" "${@}"; } -warn() { trace "${@}" >&2; } -errorN() { local ret="${1}"; shift; warn "${@}"; exit ${ret}; } -error() { errorN 1 "${@}"; } - -my_name="${0##*/}" -main "$@" diff --git a/package/mke2img/mke2img.mk b/package/mke2img/mke2img.mk deleted file mode 100644 index 9de387a3a3..0000000000 --- a/package/mke2img/mke2img.mk +++ /dev/null @@ -1,13 +0,0 @@ -################################################################################ -# -# mke2img -# -################################################################################ - -HOST_MKE2IMG_DEPENDENCIES = host-genext2fs host-e2fsprogs - -define HOST_MKE2IMG_INSTALL_CMDS - $(INSTALL) -D -m 0755 package/mke2img/mke2img $(HOST_DIR)/usr/bin/mke2img -endef - -$(eval $(host-generic-package))