Operating System - HP-UX
1833758 Members
2829 Online
110063 Solutions
New Discussion

Re: "directory" mapping in .psf file

 
SOLVED
Go to solution
Hanry Zhou
Super Advisor

"directory" mapping in .psf file

When I create a .psf file for creating a depot, I have the following line in the fileset section, for instance,
directory /build/hpux/mfg/usr = /usr
...
1.
when I run swpackage, it will collect all files under /build/hpux/mfg/usr to form the depot (where is specified in swpackage), and swinstall the fileset underd /usr on the system where I want to put the software to.
Is this statment right?


2.
Also the source file under /build/hpux/mfg/usr should be on the system as where depot will located. Is this right
none
20 REPLIES 20
Sridhar Bhaskarla
Honored Contributor

Re: "directory" mapping in .psf file

Hi Hanry,

1. Correct.

2. No. On the system where you are putting the package file, you don't need this directory structure. When you swpackage, these files will be collected and placed under individual product/fileset directories in your depot path. After running the swpackage command do

find /wherever_your_depot_is

And you will see the files actually got copied underneath that directory structure.

-Sri
You may be disappointed if you fail, but you are doomed if you don't try
Jeff Schussele
Honored Contributor

Re: "directory" mapping in .psf file

Hi Hanry,

1) Yes - that's how you can "direct" the files for that product/subproduct to where you want them on the destination system when it's up in the product/subproduct definition area

2) I'm not sure what you mean. But further down in the fileset definition area you'll need:
directory /build/hpux/mfg/usr=/usr
file file1
file file2

files (i.e. named file1 & file2) have to be under /build/hpux/mfg/usr *until* the next
directory dir_name1=new_dir_name
statement & then all files folowing have to be under that.
Does that make sense?

Rgds,
Jeff
PERSEVERANCE -- Remember, whatever does not kill you only makes you stronger!
Jeff Schussele
Honored Contributor

Re: "directory" mapping in .psf file

Then when you actually package the SW - you can specify the depot be created anywhere - like:

swpackage -s /path/to/sample.psf @ /path/to/depot/location/pkg_name

And the depot will be created there & all that's left is to register it

swreg -l depot /path/to/depot/location/pkg_name

HTH,
Jeff
PERSEVERANCE -- Remember, whatever does not kill you only makes you stronger!
Hanry Zhou
Super Advisor

Re: "directory" mapping in .psf file

Sri,

Okay, I probably did not make the 2nd question clear. Let me try it again.

The source files(in this case, it is under /build/hpux/mfg/usr) that swpackage will use to form the depot has to be located on the same system as where the depot will be located.

In another words, if the source file is located on "sysa", and the depot has to be also created on the system called "sysa"

Am I right?

none
Sridhar Bhaskarla
Honored Contributor
Solution

Re: "directory" mapping in .psf file

Hi,

I think I got it now. Yes.

What I meant was - if the depot got created on sysA, it can be swcopied over to another system say sysB via swcopy. But sysB doesn't need to have the /build/hpux/mfg/usr files.

-Sri
You may be disappointed if you fail, but you are doomed if you don't try
Hanry Zhou
Super Advisor

Re: "directory" mapping in .psf file

Thanks Sri and Jeff,

Before I assign points to this thread, I have one more questions.

If I want to execute the postinstall script, where I should place the "control script" in .psf, do I have to put it at the end of all fileset sections?

Thanks,
none
Hanry Zhou
Super Advisor

Re: "directory" mapping in .psf file

I wanted to execute the script at the end of software loading.
none
Sridhar Bhaskarla
Honored Contributor

Re: "directory" mapping in .psf file

Hi Hanry,

I put them under the definitions of the corresponding product and|or fileset depending on when you want to execute the script. For ex.,

...cut..
product

tag pkg1
title "some package"
revision 3.1.1
number MYPKG1
category System_management
category_title System_management Software
architecture HP-UX_B.11.00_700/800
vendor_tag HP
machine_type 9000/[678]??
os_name HP-UX
os_release ?.11.??
os_version ?
directory /somewhere
all_filesets pkg-MAN pkg-RUN
is_locatable false
checkinstall checkinstall
preinstall preinstall
postinstall postinstall
configure configure
preremove preremove
postremove postremove
..cut..

My scripts postinstall, preinstall, checkinstall etc are located under the current directory.

-Sri
You may be disappointed if you fail, but you are doomed if you don't try
Hanry Zhou
Super Advisor

Re: "directory" mapping in .psf file

Any difference between these two or could be any one of them?

product
.....
fileset
....
end
postinstall scripts
end

or

product
.....
fileset
....
end
end
postinstall scripts

none
Sridhar Bhaskarla
Honored Contributor

Re: "directory" mapping in .psf file

There are two places where you can place the control scripts. In the "product" specification area and|or in the "fileset" specification area.

product #start of product definition

tag bla
title bla
..
postinstall postinstall.product

fileset1 #start of fileset1 definition
tag bla
title bla
..
postinstall postinstall.fileset1
..
end #end of fileset1 definition

fileset2 #start of fileset2 definition
tag bla
title bla
..
end #end of fileset2 definition

end #end of product definition

In the above, postinstall.product will run whenver any fileset under the product is installed. However, postinstall.fileset1 is run only when fileset1 is installed. So, it depends on where you put the control file.

-Sri
You may be disappointed if you fail, but you are doomed if you don't try
Hanry Zhou
Super Advisor

Re: "directory" mapping in .psf file

Okay, if I want to run the postscript at the end of software loading, I should put the script at the end of product.. end


product
....
flieset1
...
end

fileset2
..
end
end
mypostinstall scripts

Am I right?
none
Sridhar Bhaskarla
Honored Contributor

Re: "directory" mapping in .psf file

Nop. The directive "postinstall" associated with the script tells it when to run. For ex.,

postinstall postinstall.sh

will tell the swinstall process to run postinstall.sh script after loading the fileset|product. It has to be within the 'module' of the corresponding product or fileset. Putting this script at the end of the file wont' work. Moreover, if is not contained in any of the modules, then you may get syntax errors during swpackage.

Look at the following document

http://docs.hp.com/hpux/onlinedocs/B2355-90154/B2355-90154.html

"Using control scripts" is what you want.

-Sri

-Sri
You may be disappointed if you fail, but you are doomed if you don't try
Hanry Zhou
Super Advisor

Re: "directory" mapping in .psf file

the software we get by making configure, make..., and it consists of quite a few files and directories. I believe I'm going to have only product, and a few filesets. Every fileset is corresnonding to either a file or directory.

none
Hanry Zhou
Super Advisor

Re: "directory" mapping in .psf file

okay, according to your previous posting, it does matters if I put the line "postinstall mypostinstallscripts" in different places, but where exactly I should put this line, if I don't want it to be run everytime the filesets are installed? I only want it to be run at the end of loading the software, product I guess in my case.

Thanks,
none
Geoff Wild
Honored Contributor

Re: "directory" mapping in .psf file

Put all of the files that you want to include under one directory.
Name the directory using the following format: name-major.minor. For example, sysinfo3.01

PSF in the paren directory:

product
tag SYSINFO
title HP System configuration information collector
revision 3.01
fileset
tag sysinfo
directory sysinfo-3.01=/usr/local/sysinfo
file getsn
file sched.models
file sysinfo
file sysinfo.manpage.wri
file sysinfo3.01
file xpinfo
end
end

Run from the parent of this directory...

swpackage -vv -s sysinfo.psf @/var/software/SYSINFO

swreg -l depot /var/software/SYSINFO

That's how I do it...

Proverbs 3:5,6 Trust in the Lord with all your heart and lean not on your own understanding; in all your ways acknowledge him, and he will make all your paths straight.
Hanry Zhou
Super Advisor

Re: "directory" mapping in .psf file

What I'm thinking is that I should put the line "postinstall myscript" within product... end, but outside of any filesets sections. Am I right?

like following:

product
tag
title
...
postinstall myscripts
...
fileset1
...
end

fileset2
...
end
...
end
none
Hanry Zhou
Super Advisor

Re: "directory" mapping in .psf file

Good approach!

what if there are also a few subdirectories underneath sysinfo3.01?
none
Hanry Zhou
Super Advisor

Re: "directory" mapping in .psf file

Geoff,

You also need to assign permissions to these files and directories under sysinfo3.01. Right?
none
Sridhar Bhaskarla
Honored Contributor

Re: "directory" mapping in .psf file

Hanry,

Exactly. You got it right about postinstall (control scripts) now.

Make sure the scripts are written according to the nominclature. There are quite a few functions available if you source in /usr/lbin/sw/control_utils in your script like mod_pathfile etc., Writing control scripts is explained in the document I referenced in the previous message.

Calling it a day today. Have a good one.

-Sri
You may be disappointed if you fail, but you are doomed if you don't try
Geoff Wild
Honored Contributor

Re: "directory" mapping in .psf file

Hanry,

Yes - set the correct permissions under the directory ahead of time - for directories below, you have to include them/file(s)

file extradir/myfile

Atleast I assume that will work - havn't tested it....

Rgds...Geoff
Proverbs 3:5,6 Trust in the Lord with all your heart and lean not on your own understanding; in all your ways acknowledge him, and he will make all your paths straight.