/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License (the "License").
* You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright 2008 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
/* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */
/* All Rights Reserved */
#include <stdio.h>
#include <ctype.h>
#include <string.h>
#include <stdlib.h>
#include <unistd.h>
#include <limits.h>
#include <locale.h>
#include <libintl.h>
#include <pkgstrct.h>
#include "install.h"
#include <pkglib.h>
#include "libadm.h"
#include "libinst.h"
#include "pkginstall.h"
extern char pkgloc[];
extern char instdir[];
"installation requires %llu blocks, which includes a " \
"required %llu block buffer for open " \
"deleted files. %llu more blocks are needed."
"current installation requires %llu file nodes, " \
"which includes a required %llu file node buffer " \
"for temporary files. %llu more file nodes " \
"are needed."
#define TYPE_BLCK 0
static int fsys_stat(int n);
int
{
int i, error;
error = 0;
/*
* Also, vanilla SVr4 code used the output from popen()
* information about mounted filesystems, so we use the C
* interfaces to the mount table, which also happens to be
* much faster than running another process. Since several
* of the pkg commands need access to the mount table, this
* code is now in libinst. However, mount table info is needed
* at the time the base directory is determined, so the call
* to get the mount table information is in main.c
*/
return (-1);
for (i = 0; fs_tab = get_fs_entry(i); ++i) {
continue; /* not used by us */
error++;
}
/* bug id 1091292 */
continue;
error++;
}
}
return (error);
}
static void
{
} else {
}
}
static int
fsys_stat(int n)
{
if (n == BADFSYS)
return (1);
fs_tab = get_fs_entry(n);
/*
* At this point, we know we need information
* about a particular filesystem, so we can do the
* statvfs() now. For performance reasons, we only want to
* stat the filesystem once, at the first time we need to,
* and so we can key on whether or not we have the
* block size for that filesystem.
*/
return (0);
return (1);
}
/*
* statvfs returns number of fragment size blocks
* so will change this to number of 512 byte blocks
*/
return (0);
}
/*
* This function reads all of the package objects, maps them to their target
* filesystems and adds up the amount of space used on each. Wherever you see
* "fsys_value", that's the apparent filesystem which could be a temporary
* loopback mount for the purpose of constructing the client filesystem. It
* isn't necessarily the real target filesystem. Where you see "fsys_base"
* that's the real filesystem to which fsys_value may just refer. If this is
* installing to a standalone or a server, fsys_value will almost always be
* the same as fsys_base.
*/
static int
{
int i, n;
/*
* Handle the installation files (ftype i) that are in the
*/
continue;
/*
* These paths are treated differently from the others
* since their full pathnames are not included in the
* pkgmap.
*/
else
/* If we haven't done an fsys() series, do one */
/*
* Now check if this is a base or apparent filesystem. If
* it's just apparent, get the resolved filesystem entry,
* otherwise, base and value are the same.
*/
else
(*error)++;
continue;
}
/*
* Don't accumulate space requirements on read-only
* remote filesystems.
*/
continue;
else
blk = 0;
}
/*
* Handle the other files in the eptlist.
*/
continue;
/*
* Don't recalculate package objects that are already in the
* table.
*/
continue;
/*
* Don't accumulate space requirements on read-only
* remote filesystems.
*/
continue;
/*
* Now check if this is a base or apparent filesystem. If
* it's just apparent, get the resolved filesystem entry,
* otherwise, base and value are the same.
*/
else
/* At this point we know we have a good fsys_base. */
(*error)++;
continue;
}
/*
* We have to stat this path based upon it's real location.
* If this is a server-remap, ept->path isn't the real
* location.
*/
else
/* path cannot be accessed */
blk =
else
blk = 0;
} else {
/* path already exists */
blk = 0;
/*
* negative blocks show room freed, but since
* order of installation is uncertain show
* 0 blocks usage
*/
blk = 0;
else
} else
blk = 0;
}
}
return (0);
}
static int
{
int n;
return (0);
return (-1);
}
pt++;
continue;
n = resolved_fsys(path);
if (fsys_stat(n)) {
(*error)++;
continue;
}
/*
* Don't accumulate space requirements on read-only
* remote filesystems. NOTE: For some reason, this
* used to check for !remote && read only. If this
* blows up later, then maybe that was correct -- JST
*/
if (is_remote_fs_n(n) && !is_fs_writeable_n(n))
continue;
fs_tab = get_fs_entry(n);
}
return (0);
}