- 论坛徽章:
- 0
|
还是有点问题(debian mkinitrd的问题)
initrd-tools虽然已经安装上了
但是它只能够制作cramfs格式的initrd
所以我不停的搜索google终于找到了解决的方法,实际上这是偷懒的
呵呵,感谢Mark W. Alexander 的提示
Then all is well, except in 2.6.0-2.6.N (where N=whenever it was merged)
you need to edit /etc/mkinitrd/mkinitrd.conf and replace the line:
MKIMAGE='mkcramfs %s %s >; /dev/null'
with
MKIMAGE='/usr/local/sbin/mkext2fs %s %s >; /dev/null'
and create /usr/local/sbin/mkext2fs as follows:
==============================================================
#!/bin/bash
# similar to mkcramfs (for use with debian mkinitrd)
# mkext2fs dirname outfile
#
# no options are parsed
#
# Written by: Fabian Franz <mkext2fs@fabian-franz.de>;
# GPL v.2 - See: `locate gpl.txt`
if [ $# -lt 2 ]
then
echo "Usage: $(basename $0) dirname outfile"
exit 1
fi
TMPDIR=/tmp/$(basename $0).$$
mkdir $TMPDIR
function clean_exit
{
umount $TMPDIR 2>;/dev/null
rm -rf $TMPDIR
}
trap clean_exit EXIT
COUNT=$[$(du -s $1 | awk '{ print $1 }' )*2+1000]
dd if=/dev/zero of=$TMPDIR/image count=$COUNT
mke2fs -F $TMPDIR/image
mount -o loop $TMPDIR/image $TMPDIR
cp -a $1/* $TMPDIR
umount $TMPDIR
cat $TMPDIR/image | gzip - >; $2 |
|