4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License (the "License").
6 * You may not use this file except in compliance with the License.
8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9 * or http://www.opensolaris.org/os/licensing.
10 * See the License for the specific language governing permissions
11 * and limitations under the License.
13 * When distributing Covered Code, include this CDDL HEADER in each
14 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15 * If applicable, add the following below this CDDL HEADER, with the
16 * fields enclosed by brackets "[]" replaced with your own identifying
17 * information: Portions Copyright [yyyy] [name of copyright owner]
23 * Copyright 2009 Sun Microsystems, Inc. All rights reserved.
24 * Use is subject to license terms.
27 /* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */
28 /* All Rights Reserved */
36 #include <sys/types.h>
39 #include "pkglibmsgs.h"
40 #include "pkglocale.h"
42 #define PKGMAP "pkgmap"
43 #define PKGINFO "pkginfo"
46 ckvolseq(char *dir
, int part
, int nparts
)
48 static struct cinfo cinfo
;
49 char ftype
, path
[PATH_MAX
];
55 * save stats about content information of pkginfo
56 * file in order to verify multi-volume packages
58 cinfo
.cksum
= cinfo
.size
= cinfo
.modtime
= (-1L);
59 (void) snprintf(path
, sizeof (path
), "%s/pkginfo", dir
);
60 if (cverify(0, &ftype
, path
, &cinfo
, 1)) {
61 logerr(pkg_gt(ERR_BADPKGINFO
), path
);
62 logerr(getErrbufAddr());
65 (void) snprintf(path
, sizeof (path
), "%s/pkgmap", dir
);
66 if (access(path
, 0)) {
67 logerr(pkg_gt(ERR_NOPKGMAP
), path
);
71 /* temp fix due to summit problem */
74 /* pkginfo file doesn't match first floppy */
75 (void) snprintf(path
, sizeof (path
), "%s/pkginfo", dir
);
76 if (cverify(0, &ftype
, path
, &cinfo
, 1)) {
77 logerr(pkg_gt(MSG_CORRUPT
));
78 logerr(getErrbufAddr());
86 * each volume in a multi-volume package must
87 * contain either the root.n or reloc.n directories
90 /* look for multi-volume specification */
91 (void) snprintf(path
, sizeof (path
), "%s/root.%d", dir
, part
);
92 if (access(path
, 0) == 0)
94 (void) snprintf(path
, sizeof (path
), "%s/reloc.%d", dir
, part
);
95 if (access(path
, 0) == 0)
98 (void) snprintf(path
, sizeof (path
), "%s/install",
100 if (access(path
, 0) == 0)
104 logerr(pkg_gt(MSG_SEQ
));