이 예에서 서비스 매니페스트가 /lib/svc/manifest/site로 설치되고 처음 부트 스크립트가 /opt/site로 설치됩니다.
$ mkdir -p proto/lib/svc/manifest/site $ mkdir -p proto/opt/site $ cp first-boot-script-svc-manifest.xml proto/lib/svc/manifest/site $ cp first-boot-script.sh proto/opt/site
다음과 같이 first-boot-script.p5m이라는 파일을 만듭니다.
set name=pkg.fmri value=first-boot-script@1.0,5.11-0
set name=pkg.summary value="AI first-boot script"
set name=pkg.description value="Script that runs at first boot after AI installation"
set name=info.classification value=\
"org.opensolaris.category.2008:System/Administration and Configuration"
file lib/svc/manifest/site/first-boot-script-svc-manifest.xml \
path=lib/svc/manifest/site/first-boot-script-svc-manifest.xml owner=root \
group=sys mode=0444
dir path=opt/site owner=root group=sys mode=0755
file opt/site/first-boot-script.sh path=opt/site/first-boot-script.sh \
owner=root group=sys mode=0555처음 부트 스크립트가 무엇인지에 따라, 종속성을 지정해야 할 수 있습니다. 이 매니페스트를 수정할 경우 새 매니페스트가 올바른지 확인합니다. 경고를 무시할 수 있습니다. pkgdepend, pkgmogrify 및 pkglint 명령에 대한 정보를 포함하여 패키지를 만드는 방법에 대한 자세한 내용은 Packaging and Delivering Software With the Image Packaging System in Oracle Solaris 11.2 의 2 장, Packaging Software With IPS를 참조하십시오.
이 예는 firstboot를 게시자로 사용하여 로컬 디렉토리에 저장소를 만듭니다.
$ pkgrepo create firstbootrepo $ pkgrepo -s firstbootrepo add-publisher firstboot
$ pkgsend publish -d ./proto -s ./firstbootrepo first-boot-script.p5m pkg://firstboot/first-boot-script@1.0,5.11-0:20140114T022508Z PUBLISHED
클라이언트가 firstbootrepo 저장소에서 패키지를 설치할 수 있습니다. 다음 섹션에 표시된 대로 firstbootrepo 원본과 함께 firstboot 게시자가 AI 매니페스트에 정의됩니다.
패키지를 나열하여 패키지가 사용 가능한지 확인합니다.
$ pkg list -g ./firstbootrepo first-boot-script NAME (PUBLISHER) VERSION IFO first-boot-script (firstboot) 1.0-0 ---
–n 옵션은 패키지가 설치되지 않음을 나타냅니다.
# pkg set-publisher -g ./firstbootrepo firstboot
# pkg publisher
PUBLISHER TYPE STATUS P LOCATION
solaris origin online F http://http://pkg.oracle.com/solaris/release/
firstboot origin online F file:///home/user1/firstboot/firstbootrepo/
# pkg list -af first-boot-script
NAME (PUBLISHER) VERSION IFO
first-boot-script (firstboot) 1.0-0 ---
# pkg install -nv first-boot-script
Packages to install: 1
Estimated space available: 50.68 GB
Estimated space to be consumed: 64.66 MB
Create boot environment: No
Create backup boot environment: No
Rebuild boot archive: No
Changed packages:
firstboot
first-boot-script
None -> 1.0,5.11-0:20140114T022508Z
Planning linked: 0/2 done; 1 working: zone:z2
Linked image 'zone:z2' output:
| Estimated space available: 50.68 GB
| Estimated space to be consumed: 62.07 MB
| Rebuild boot archive: No
`
Planning linked: 1/2 done; 1 working: zone:z1
Linked image 'zone:z1' output:
| Estimated space available: 50.67 GB
| Estimated space to be consumed: 62.07 MB
| Rebuild boot archive: No
다음 단계
NFS 공유 또는 HTTP를 통해 클라이언트 시스템이 새 저장소에 액세스할 수 있게 만드는 방법은 Oracle Solaris 11.2 패키지 저장소 복사 및 만들기 를 참조하십시오.