Linux
[Linux] kernel image 압축 및 압축 해제
Kimos
2010. 6. 23. 13:42
Kernel image 압축 해제
1. /boot 밑에 있는 img 파일을 임의 디렉토리에 gzip파일로 확장자를 변경하여 가지고 온다.
#> cp linux-2.6.29.6 /temp/linux-2.6.29.6.gz
2. 이미지 파일을 decompress 시켜준다.
#> cd /temp
#> gzip -d initrd-2.6.29.6.img.gz
3. 이미지의 압축을 풀어준다.
#> cd /temp/tmp
#> cpio -i --make-directories < /temp/initrd-2.6.29.6R1.img
4. 변경 사항을 수정한다.
ex) init 파일 변경 등등
Kernel image 압축
1. 수정이 끝났으면 다시 이미지 파일로 압축하여 준다.
#> pwd
/temp/tmp
#> find . | cpio -o -c |gzip -9 > /temp/initrd-2.6.29.6.img
2. 다시 생성된 이미지 파일을 /boot 디렉토리로 복사한다.
#> cp /temp/initrd-2.6.29.6.img /boot/initrd-2.6.29.6.img