#! /usr/bin/ksh # # Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. # # # This script is executed once to fix certain problems that may happen # on upgrade but not on install. It will disable itself after it has been # executed. # . /lib/svc/share/smf_include.sh if ! is_self_assembly_boot; then exit $SMF_EXIT_OK fi # # If the inittab was ever edited, it won't be modified during upgrade; # if this line isn't added, an immutable global zone will fail to boot. # Sure we could "pkg revert" but what if someone added something to # /etc/inittab. # initline="dev::sysinit:/usr/sbin/devfsadm -P" if ! fgrep -s "$initline" /etc/inittab; then tmp=$(mktemp /tmp/inittab.XXXXXX) cp /etc/inittab $tmp sed -e 's%^ap%dev::sysinit:/usr/sbin/devfsadm -P\ &%' < $tmp > /etc/inittab rm -f $tmp /usr/sbin/devfsadm -P fi # # During upgrade from an older system, we might not have properly added # new attributes to /etc/security/device_policy # if ! fgrep -s tpd_member /etc/security/device_policy; then list="$(pkg list -H --no-refresh \ system/kernel storage/svm driver/storage/cmdk driver/storage/ssd \ system/io/fc/fc-port driver/x11/xsvc 2>/dev/null | nawk '{print $1}')" if [[ -n "$list" ]]; then pkg fix --accept $list fi fi svcadm disable $SMF_FMRI