]
トップ «前の日記(2009-03-03) 最新 次の日記(2009-03-07)» 編集

Yukiharu YABUKI の tDiary



このtDiaryを検索します。

2009-03-04 [長年日記]

_ kernelに付属のgen_init_cpio

cpioのmanで使われているfind + cpioだとinitrdを作るときにまずい場合があるとJFのドキュメントには書いてある。そこで、gen_init_cpioなのだという。

yabuki@yelona:~$ /usr/src/linux-source-2.6.27/usr/gen_init_cpio Usage:

/usr/src/linux-source-2.6.27/usr/gen_init_cpio <cpio_list>

<cpio_list> is a file containing newline separated entries that describe the files to be included in the initramfs archive:

# a comment
file <name> <location> <mode> <uid> <gid> [<hard links>] dir <name> <mode> <uid> <gid>
nod <name> <mode> <uid> <gid> <dev_type> <maj> <min> slink <name> <target> <mode> <uid> <gid> pipe <name> <mode> <uid> <gid>
sock <name> <mode> <uid> <gid>

<name> name of the file/dir/nod/etc in the archive <location> location of the file in the current filesystem

<target>     link target
<mode>       mode/permissions of the file
<uid>        user id (0=root)
<gid>        group id (0=root)
<dev_type>   device type (b=block, c=character)
<maj>        major number of nod
<min>        minor number of nod

<hard links> space separated list of other links to file

# A simple initramfs
dir /dev 0755 0 0
nod /dev/console 0600 0 0 c 5 1
dir /root 0700 0 0
dir /sbin 0755 0 0
file /sbin/kinit /usr/src/klibc/kinit/kinit 0755 0 0
yabuki@yelona:~$

_ 端末で、相手が何をやっているか確認する方法

screenを使う方法は、両方からの入力があるときに便利だけど、ほんとうに「見ているだけ」の場合には、man 1 script に載っている方法が簡単でよい。

おまけに、mkfifoコマンドを活用する方法も覚えることができる。

mkfifo /tmp/hoge; script -f /tmp/hoge
と入力して、別の端末から、
cat /tmp/hoge
とすると、相手のやっていることがみえる。ただ、場合によってはエスケープシーケンスが見えることがある。