create_ramdisk.ksh revision 10293b58014f6102038e6708a24aa8bdd32edff9
#
# CDDL HEADER START
#
# The contents of this file are subject to the terms of the
# Common Development and Distribution License, Version 1.0 only
# (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 2005 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#pragma ident "%Z%%M% %I% %E% SMI"
#
# basic setup
#
#
# Parse options
#
do
if [ "$ALT_ROOT" != "/" ]; then
echo "Creating ram disk on ${ALT_ROOT}"
fi
;;
exit ;;
esac
done
fi
#
# mkisofs on s8 doesn't support functionality used by GRUB boot.
# Use ufs format for boot archive instead.
#
if [ "$release" = "5.8" ]; then
fi
if [ $# -eq 1 ]; then
ALT_ROOT=$1
echo "Creating ram disk on ${ALT_ROOT}"
fi
# make directory for temp files safely
# Clean up upon exit.
trap 'cleanup' EXIT
function cleanup {
}
function getsize {
# Estimate image size, add %10 overhead for ufs stuff
do
if [ -e $file ] ; then
fi
done
}
function create_ufs
{
# should we exclude amd64 binaries?
# calculate image size
mkfile ${total_size}k ${rdfile}
# do the actual copy
cd /${ALT_ROOT}
gzip -c ${rdfile} > ${ALT_ROOT}/${BOOT_ARCHIVE}-new
}
function create_isofs
{
# should we exclude amd64 binaries?
# create image directory seed with graft points
isocmd="mkisofs -quiet -graft-points -dlrDJN -relaxed-filenames ${NO_AMD64}"
do
fi
done
cd /${ALT_ROOT}
if [ -s ${errlog} ]; then
if [ $? -eq 0 ]; then
rm -f ${ALT_ROOT}/${BOOT_ARCHIVE}-new
fi
fi
}
#
# get filelist
#
fi
#
# decide if cpu is amd64 capable
#
is_amd64=$?
echo "updating ${ALT_ROOT}/${BOOT_ARCHIVE}...this may take a minute"
if [ $format = "ufs" ]; then
else
fi
echo "update of ${ALT_ROOT}/${BOOT_ARCHIVE} failed"
exit 1
fi
#
# For the diskless case, hardlink archive to /boot to make it
# visible via tftp. /boot is lofs mounted under /tftpboot/<hostname>.
# NOTE: this script must work on both client and server
#
if [ $? = 0 ]; then
exit
fi