

d.getVar("POSTINST_INTERCEPTS")$ bitbake image에서 d.getVar("POSTINST_INTERCEPTS")'oe-core/scripts/postinst-intercepts/delay_to_first_boot
oe-core/scripts/postinst-intercepts/postinst_intercept
oe-core/scripts/postinst-intercepts/update_desktop_database
oe-core/scripts/postinst-intercepts/update_font_cache
oe-core/scripts/postinst-intercepts/update_gio_module_cache
oe-core/scripts/postinst-intercepts/update_gtk_icon_cache
oe-core/scripts/postinst-intercepts/update_gtk_immodules_cache
oe-core/scripts/postinst-intercepts/update_mime_database
oe-core/scripts/postinst-intercepts/update_pixbuf_cache
oe-core/scripts/postinst-intercepts/update_udev_hwdb'
(pre|post)inst, (pre|post)rm| script | description |
|---|---|
preinst | 패키지가 압축 '해제'되기 '전' 실행된다. 서비스들은 설치나 업그레이드를 위해, preinst가 실행되기 전에 멈춰져야 한다. |
postinst | 이 스크립트는, 패키지가 압축 해제된 '후'에 필요한 환경설정을 한다. |
prerm | 보통 패키지와 관련된 daemon을 멈춘다. 패키지와 관련된 파일이 지워지기 전에 실행된다. |
postrm | 패키지에 의해 생성된 파일, 링크 수정 |
do_rootfs()에서 rootfs 생성 시 실행된다.installed로 표시unpacked로 표시unpacked 상태인 패키지는 이미지가 처음 부팅되고 난 후 스크립트를 다시 실행하게 된다.do_rootfs() 단계에서 실행할 때, ${D}의 유무를 보고 do_rootfs()단계의 Host에서 실행 인지, target에서 실행 중인지 스크립트는 알 수 있다.${D}가 있다면, do_rootfs()가 실행 중인 Host 환경${D}="<Image Workdir>/rootfs; ${D}/etc/opkg${D} 가 없는데, ${D}/etc/opkg 실행 시, Host의 /etc/opkg에 영향을 주는 꼴postinst에 (추가|작성)할 것이 있다면, 아래의 코드를 작성한다.pkg_postinst_${PN} () {
#!/bin/sh -e
#Insert commands above
}
postinst에 스크립트의 실행을 미뤄, target device에서 실행하도록 하는 것은 다음과 같이 작성할 수 있다.
unpacked 상태인 패키지는 이미지가 처음 부팅 되고 난 후, 스크립트를 다시 실행한다${D}가 값을 가지고 있다면, 이 스크립트는 error를 반환하고 패키지는 압축 해제됨 상태가 된다.if 구문에 작성된 문장은 변수 ${D}가 할당되지 않았을 때만 실행된다.postinst의 실행을 건너 뛰어, rootfs를 만드는 시점에 데몬이 실행되는 것을 막고 업그레이드가 완료된 이후에 실행하게 할 수도 있다.
read-only-rootfs로 만들 경우, 모든 postinst 스크립트는 성공해야한다.pkg_postinst가 do_rootfs에서 실행 가능한지 확인해야한다. (IMAGE_FEATURES += "read-only-rootfs " 경우 필요)