2011年04月01日
e2fsprogsの取得
e2fsprogsはLinuxの標準で利用されるext4(ext2/3)のユーティリティプログラムで、
通常はデフォルトでインストールされているので特に意識する事はないです。
ただLinuxのコミュニティでは現在も開発が続いており、いち早く機能を試したい場合はgitを使いソースツリーを取得します。
# git については改めてまとめます。
e2fsprogsのページです。
http://e2fsprogs.sourceforge.net/
1. git cloneでソースツリーを取得します(2-3分かかります)。
[root@localhost mnt]# git clone http://git.kernel.org/pub/scm/fs/ext2/e2fsprogs.git
Cloning into e2fsprogs...
remote: Counting objects: 29475, done.
remote: Compressing objects: 100% (5618/5618), done.
remote: Total 29475 (delta 23742), reused 29319 (delta 23628)
Receiving objects: 100% (29475/29475), 13.18 MiB | 45 KiB/s, done.
Resolving deltas: 100% (23742/23742), done.
2. コンパイルの準備をします。
[root@localhost mnt]# cd e2fsprogs/
[root@localhost e2fsprogs]# ./configure
Generating configuration file for e2fsprogs version 1.41.14
Release date is December, 2010
checking build system type... x86_64-unknown-linux-gnu
checking host system type... x86_64-unknown-linux-gnu
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables
...
3. コンパイルします(5分くらいかかります)。
[root@localhost e2fsprogs]# make
cd ./util ; make subst
make[1]: ディレクトリ `/mnt/e2fsprogs/util' に入ります
CC subst.c
LD subst
make[1]: ディレクトリ `/mnt/e2fsprogs/util' から出ます
make[1]: ディレクトリ `/mnt/e2fsprogs' に入ります
cd .; CONFIG_FILES=./lib/ext2fs/ext2_types.h ./config.status
4. 既存のe2fsprogsのコマンド(mke2fsなど)と置き換えても良い場合はイントールします。
[root@localhost e2fsprogs]# make install
make[1]: ディレクトリ `/mnt/e2fsprogs' に入ります
make[1]: `lib/ext2fs/ext2_types.h' は更新済みです
make[1]: ディレクトリ `/mnt/e2fsprogs' から出ます
make[1]: ディレクトリ `/mnt/e2fsprogs' に入ります
make[1]: `lib/blkid/blkid_types.h' は更新済みです
make[1]: ディレクトリ `/mnt/e2fsprogs' から出ます
make[1]: ディレクトリ `/mnt/e2fsprogs' に入ります
make[1]: `lib/uuid/uuid_types.h' は更新済みです
...
以上で、最新のe2fsprogsパッケージを利用出来ます。
各種コマンドについての詳細は後ほど解説します。
上記のコマンドを打つのが面倒な場合は下記のスクリプトを実行すれば指定した場所にe2fsprogsを取得し、コンパイル->インストールします。
# 実行するにはファイルに実行権をつけ、実行します。
e.g. chmod +x mke2progs.sh ; ./mke2progs.sh
通常はデフォルトでインストールされているので特に意識する事はないです。
ただLinuxのコミュニティでは現在も開発が続いており、いち早く機能を試したい場合はgitを使いソースツリーを取得します。
# git については改めてまとめます。
e2fsprogsのページです。
http://e2fsprogs.sourceforge.net/
1. git cloneでソースツリーを取得します(2-3分かかります)。
[root@localhost mnt]# git clone http://git.kernel.org/pub/scm/fs/ext2/e2fsprogs.git
Cloning into e2fsprogs...
remote: Counting objects: 29475, done.
remote: Compressing objects: 100% (5618/5618), done.
remote: Total 29475 (delta 23742), reused 29319 (delta 23628)
Receiving objects: 100% (29475/29475), 13.18 MiB | 45 KiB/s, done.
Resolving deltas: 100% (23742/23742), done.
2. コンパイルの準備をします。
[root@localhost mnt]# cd e2fsprogs/
[root@localhost e2fsprogs]# ./configure
Generating configuration file for e2fsprogs version 1.41.14
Release date is December, 2010
checking build system type... x86_64-unknown-linux-gnu
checking host system type... x86_64-unknown-linux-gnu
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables
...
3. コンパイルします(5分くらいかかります)。
[root@localhost e2fsprogs]# make
cd ./util ; make subst
make[1]: ディレクトリ `/mnt/e2fsprogs/util' に入ります
CC subst.c
LD subst
make[1]: ディレクトリ `/mnt/e2fsprogs/util' から出ます
make[1]: ディレクトリ `/mnt/e2fsprogs' に入ります
cd .; CONFIG_FILES=./lib/ext2fs/ext2_types.h ./config.status
4. 既存のe2fsprogsのコマンド(mke2fsなど)と置き換えても良い場合はイントールします。
[root@localhost e2fsprogs]# make install
make[1]: ディレクトリ `/mnt/e2fsprogs' に入ります
make[1]: `lib/ext2fs/ext2_types.h' は更新済みです
make[1]: ディレクトリ `/mnt/e2fsprogs' から出ます
make[1]: ディレクトリ `/mnt/e2fsprogs' に入ります
make[1]: `lib/blkid/blkid_types.h' は更新済みです
make[1]: ディレクトリ `/mnt/e2fsprogs' から出ます
make[1]: ディレクトリ `/mnt/e2fsprogs' に入ります
make[1]: `lib/uuid/uuid_types.h' は更新済みです
...
以上で、最新のe2fsprogsパッケージを利用出来ます。
各種コマンドについての詳細は後ほど解説します。
上記のコマンドを打つのが面倒な場合は下記のスクリプトを実行すれば指定した場所にe2fsprogsを取得し、コンパイル->インストールします。
# 実行するにはファイルに実行権をつけ、実行します。
e.g. chmod +x mke2progs.sh ; ./mke2progs.sh
#!/bin/bash
E2FS="http://git.kernel.org/pub/scm/fs/ext2/e2fsprogs.git"
WORKDIR="./"
if [ $# -eq 1 ];then
WORKDIR=$1
elif [ $# -gt 1 ];then
echo "Usage: ./mke2fsprogs [TARGET-DIR]"
exit 1
fi
cd $WORKDIR
[ -e "e2fsprogs" ]
if [ $? -eq 0 ];then
echo "Directory (e2fsprogs) already exists on $WORKDIR."
exit 1
fi
echo "You will create e2fsprogs at $WORKDIR."
git clone $E2FS
if [ $? -ne 0 ];then
echo "Failed to do git clone."
exit 1
fi
cd e2fsprogs
printf "configure ..."
./configure > /dev/null
[ $? -ne 0 ] || printf " [OK]\n"
printf "make ..."
make > /dev/null
[ $? -ne 0 ] || printf " [OK]\n"
printf "make install ..."
make install > /dev/null
[ $? -ne 0 ] || printf " [OK]\n"
exit 0
【Linuxの最新記事】
この記事へのコメント