[arch-projects] [mkinitcpio][PATCH 2/6] install/fsck: use fsck.ext4 for ext[234]
Dan McGee
dpmcgee at gmail.com
Sat Mar 3 18:06:54 EST 2012
On Sat, Mar 3, 2012 at 4:47 PM, Dave Reisner <d at falconindy.com> wrote:
> e2fsprogs makes a lot of hardlinks for its fsck tools. If ext[234] is
> detected, add the fsck.ext4 binary and add symlinks.
>
> Signed-off-by: Dave Reisner <dreisner at archlinux.org>
> ---
> I'm not thrilled with the ext[234] hack, but I also don't like the idea of
> duplicating hardlinks as separate files on the image.
Looks good to me; if mkfs.ext? binaries ever appear in initcpio images
the same would apply there as well.
> install/fsck | 14 ++++++++++++--
> 1 file changed, 12 insertions(+), 2 deletions(-)
>
> diff --git a/install/fsck b/install/fsck
> index 9d9943b..b820063 100644
> --- a/install/fsck
> +++ b/install/fsck
> @@ -3,12 +3,22 @@
> build() {
> local added=0
>
> + add_fsck() {
> + if [[ $1 = ext[234] ]]; then
> + add_binary fsck.ext4
> + add_symlink /usr/bin/fsck.ext2 fsck.ext4
> + add_symlink /usr/bin/fsck.ext3 fsck.ext4
> + else
> + add_binary "fsck.$1"
> + fi
> + }
> +
> if (( ! fs_autodetect_failed )) && [[ $rootfstype$usrfstype ]]; then
> if [[ $rootfstype ]]; then
> - add_binary fsck.$rootfstype && (( ++added ))
> + add_fsck $rootfstype && (( ++added ))
> fi
> if [[ $usrfstype && $usrfstype != $rootfstype ]]; then
> - add_binary fsck.$usrfstype && (( ++added ))
> + add_fsck $usrfstype && (( ++added ))
> fi
> else
> for fsck in "$BASEDIR"/sbin/fsck.*; do
> --
> 1.7.9.2
>
More information about the arch-projects
mailing list