fs-root (a227b7f4) fs-root (b1593d50)
1#!/sbin/sh
2#
3# CDDL HEADER START
4#
5# The contents of this file are subject to the terms of the
6# Common Development and Distribution License (the "License").
7# You may not use this file except in compliance with the License.
8#

--- 6 unchanged lines hidden (view full) ---

15# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16# If applicable, add the following below this CDDL HEADER, with the
17# fields enclosed by brackets "[]" replaced with your own identifying
18# information: Portions Copyright [yyyy] [name of copyright owner]
19#
20# CDDL HEADER END
21#
22#
1#!/sbin/sh
2#
3# CDDL HEADER START
4#
5# The contents of this file are subject to the terms of the
6# Common Development and Distribution License (the "License").
7# You may not use this file except in compliance with the License.
8#

--- 6 unchanged lines hidden (view full) ---

15# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16# If applicable, add the following below this CDDL HEADER, with the
17# fields enclosed by brackets "[]" replaced with your own identifying
18# information: Portions Copyright [yyyy] [name of copyright owner]
19#
20# CDDL HEADER END
21#
22#
23# Copyright 2008 Sun Microsystems, Inc. All rights reserved.
23# Copyright 2009 Sun Microsystems, Inc. All rights reserved.
24# Use is subject to license terms.
25#
24# Use is subject to license terms.
25#
26# ident "%Z%%M% %I% %E% SMI"
27#
26#
28# Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T.
29# All rights reserved.
30#
31
32# Make sure that the libraries essential to this stage of booting can be found.
33LD_LIBRARY_PATH=/lib; export LD_LIBRARY_PATH
34
35libc_mount() {
36 #
37 # If there is an optimized libc available in /usr that fits this
38 # processor, mount it on top of the base libc.
39 #
27#
28
29# Make sure that the libraries essential to this stage of booting can be found.
30LD_LIBRARY_PATH=/lib; export LD_LIBRARY_PATH
31
32libc_mount() {
33 #
34 # If there is an optimized libc available in /usr that fits this
35 # processor, mount it on top of the base libc.
36 #
40 MOE=`/usr/bin/moe -32 '/usr/lib/libc/$HWCAP'`
41 if [ -n "$MOE" ]; then
37 LIBC_MOE_32=`/usr/bin/moe -32 '/usr/lib/libc/$HWCAP'`
38 if [ -n "$LIBC_MOE_32" ]; then
42 /usr/sbin/mount | egrep -s "^/lib/libc.so.1 on "
43 if [ $? -ne 0 ]; then
39 /usr/sbin/mount | egrep -s "^/lib/libc.so.1 on "
40 if [ $? -ne 0 ]; then
44 /usr/sbin/mount -O -F lofs $MOE /lib/libc.so.1
41 /usr/sbin/mount -O -F lofs $LIBC_MOE_32 /lib/libc.so.1
45 fi
46 fi
42 fi
43 fi
44
45 ARCH64=`isainfo | awk '{print $1}'`
46 LIBC_MOE_64=`/usr/bin/moe -64 /usr/lib/$ARCH64/libc/'$HWCAP'`
47 if [ -n "$LIBC_MOE_64" ]; then
48 /usr/sbin/mount | egrep -s "^/lib/$ARCH64/libc.so.1 on "
49 if [ $? -ne 0 ]; then
50 /usr/sbin/mount -O -F lofs $LIBC_MOE_64 \
51 /lib/$ARCH64/libc.so.1
52 fi
53 fi
47}
48
49# This mount function is sun4v only. It may be melded with the sun4u-us3
50# version later.
51sun4v_libc_psr_mount() {
52 LIBC_MOE_32=`/usr/bin/moe -32 /platform/$PLAT/lib/libc_psr/'$HWCAP'`
53 if [ -n "$LIBC_MOE_32" ]; then
54 /usr/sbin/mount |

--- 74 unchanged lines hidden (view full) ---

129
130#
131# Discover architecture and find and mount optimal libc_psr
132#
133libc_psr_mount() {
134 PLAT=`/usr/bin/uname -i`
135 ARCH=`/usr/bin/uname -m`
136 if [ "$ARCH" = "sun4v" ]; then
54}
55
56# This mount function is sun4v only. It may be melded with the sun4u-us3
57# version later.
58sun4v_libc_psr_mount() {
59 LIBC_MOE_32=`/usr/bin/moe -32 /platform/$PLAT/lib/libc_psr/'$HWCAP'`
60 if [ -n "$LIBC_MOE_32" ]; then
61 /usr/sbin/mount |

--- 74 unchanged lines hidden (view full) ---

136
137#
138# Discover architecture and find and mount optimal libc_psr
139#
140libc_psr_mount() {
141 PLAT=`/usr/bin/uname -i`
142 ARCH=`/usr/bin/uname -m`
143 if [ "$ARCH" = "sun4v" ]; then
137 sun4v_libc_psr_mount
144 # Check if we already loaded libc_hwcapX.so.1 thru libc_mount
145 # We can get rid of this check (and the libc_psr mount),
146 # if all the sun4v platforms start using libc_hwcap.
147 if [ ! -n "$LIBC_MOE_32" ]; then
148 sun4v_libc_psr_mount
149 fi
138 elif [ "$ARCH" = "sun4u" ]; then
139 if [ -h /platform/$PLAT/lib/libc_psr.so.1 ]; then
140 LINKSTO=`/usr/bin/ls -l \
141 /platform/$PLAT/lib/libc_psr.so.1 |
142 /usr/bin/awk '{print $NF}'`
143 if [ "$LINKSTO" = \
144 "../../sun4u-us3/lib/libc_psr.so.1" ]; then
145 ARCH=sun4u-us3

--- 143 unchanged lines hidden ---
150 elif [ "$ARCH" = "sun4u" ]; then
151 if [ -h /platform/$PLAT/lib/libc_psr.so.1 ]; then
152 LINKSTO=`/usr/bin/ls -l \
153 /platform/$PLAT/lib/libc_psr.so.1 |
154 /usr/bin/awk '{print $NF}'`
155 if [ "$LINKSTO" = \
156 "../../sun4u-us3/lib/libc_psr.so.1" ]; then
157 ARCH=sun4u-us3

--- 143 unchanged lines hidden ---