게시물 261건
   
[redhat6] [KERNEL] INITRD/INITRAMFS 편집하기
글쓴이 : theko 날짜 : 2016-06-28 (화) 11:57 조회 : 4039

Table of contents

  1. initrd ? initramfs ?

  2. initrd, initramfs 구분 방법

  3. initrd 편집하기

  4. initramfs 편집하기 



1. initrd ? initramfs ?

  압축 방법의 차이가 있다는 것은 알겠는데 정확한 차이점은 잘 모르겠음. 이건 나중에 업데이트 할 것임. 


2. initrd, initramfs 구분 방법

image name : initrd-2.4.19.img.gz


아래와 같이 입력시 


  gunzip -c /boot/initrd-2.4.19.img.gz | file -


아래와 같이 나오면 initrd


  "/dev/stdin: Linux rev 1.0 ext2 filesystem data"


아래와 같이 나오면 initramfs 임. 


"/dev/stdin: ASCII cpio archive (SVR4 with no CRC)"



3. initrd 편집하기

3-1. 압출 풀기 & 마운트

  step 1. mkdir temp

  step 2. gunzip -c /boot/initrd-2.4.19.img.gz > initrd.img

  step 3. mount -t ext2 -o loop initrd.img temp/


3-2. 다시 묶기

  step 1. umount temp

  step 2. gzip -9 -c initrd.img > /boot/initrd-2.4.19.img.gz-NEW


4. initramfs 편집하기

4-1. 압출 풀기 & 마운트

  step 1. mkdir temp

  step 2. cd temp

  step 3. gunzip -c /boot/initrd-2.4.19.img.gz | cpio -i


4-2. 다시 묶기

  step 1. pwd

            /root/temp

  step 2. find . | cpio -H newc -o | gzip -9 > /initrd-2.4.19.img.gz-NEW



이 내용은, http://backreference.org/2010/07/04/modifying-initrdinitramfs-files/  의 내용을 번역, 정리한 것임. 



참고사이트 : http://poplinux.tistory.com/141


이름 패스워드
비밀글 (체크하면 글쓴이만 내용을 확인할 수 있습니다.)
왼쪽의 글자를 입력하세요.
   

miwit.com sir.co.kr DNS Powered by DNSEver.com DNS Powered by DNSEver.com