OpenSolaris

Printable Version Enter a New Search
Bug ID 6810237
Synopsis SUNWxwfnt upgrade is broken in 109 due to issues with bad *ph files delivery
State 10-Fix Delivered (Fix available in build)
Category:Subcategory xserver:install
Keywords 2009.06-reviewed
Responsible Engineer Jay Cotton
Reported Against snv_109 , snv_111
Duplicate Of
Introduced In
Commit to Fix snv_115
Fixed In snv_115
Release Fixed solaris_nevada(snv_115)
Related Bugs 6811087
Submit Date 25-February-2009
Last Update Date 24-April-2009
Description
Upgrade from 108 to 109 yields:

Doing pkgadd of SUNWxwfnt to /
pkgadd: ERROR: unable to create package object </a/usr/openwin/lib/X11/fonts/100dpi>.
    file type <s> expected <d> actual
    unable to remove existing directory at </a/usr/openwin/lib/X11/fonts/100dpi>
pkgadd: ERROR: unable to create package object </a/usr/openwin/lib/X11/fonts/75dpi>.
    file type <s> expected <d> actual
    unable to remove existing directory at </a/usr/openwin/lib/X11/fonts/75dpi>
39097 blocks
pkgadd: ERROR: unable to create package object </a/usr/openwin/lib/X11/fonts/100dpi>.
    file type <s> expected <d> actual
    unable to remove existing directory at </a/usr/openwin/lib/X11/fonts/100dpi>
pkgadd: ERROR: unable to create package object </a/usr/openwin/lib/X11/fonts/75dpi>.
    file type <s> expected <d> actual
    unable to remove existing directory at </a/usr/openwin/lib/X11/fonts/75dpi>

Installation of <SUNWxwfnt> partially failed.
pkgadd return code = 2
This is completely broken in snv_109. In snv_109, this is the entry in pkghistory:

For sparc:

PKG=SUNWxwfnt
ARCH=sparc
VERSION=6.9.0.5.11.10900,REV=0.2009.02.17
PKGRM=yes

For x86:

PKG=SUNWxwfnt
ARCH=i386
VERSION=6.9.0.5.11.10900,REV=0.2009.02.17
PKGRM=yes


Unforutnately this will break upgrade from S9 and S10 because SUNWxwfnt should not be pkgrm.  In S9 and S10,  SUNWxwfnt delivers /usr/openwin/bin/mkfontdir.

What we found out in the past is that if we do pkgrm of SUNWxwfnt during upgrade from S10/S10 Updates to snv, zones upgrade will be broken.

The snv_108 had the correct entry and we will need to figure out what needs to be delivered to fix this.  Stay tuned.
Besides the SUNWxwfnt.ph files problem.  Your change will impact other packages that had /usr/openwin/lib/X11/fonts/100dpi and 76dpi as a directory.

If you change /usr/openwin/lib/X11/fonts/100dpi and 76dpi to a symbolic link, all the packages that uses /usr/openwin/lib/X11/fonts/100dpi and 76dpi will need to update their pkgmap as links. Approrirate *ph files for those packages should also be delivered to handle upgrade.


As a glance, this is from snv_106:


/usr/openwin/lib/X11/fonts/100dpi d none 0755 root bin SUNWxwfnt SUNWxwoft
/usr/openwin/lib/X11/fonts/75dpi d none 0755 root bin SUNWxwfnt SUNWxwcft SUNWxwoft
If you do pkgrm of SUNWxwfnt, there is a postrmove script to do update_fontdir and aliases on the following directories:

update_fontdir_and_alias $BASEDIR/openwin/lib/X11/fonts/75dpi
update_fontdir_and_alias $BASEDIR/openwin/lib/X11/fonts/100dpi
update_fontdir_and_alias $BASEDIR/openwin/lib/X11/fonts/pcf
update_fontdir_and_alias $BASEDIR/openwin/lib/X11/fonts/Speedo
update_fontdir_and_alias $BASEDIR/openwin/lib/X11/fonts/misc
update_fontdir_and_alias $BASEDIR/openwin/lib/X11/fonts/F3bitmaps
update_fontdir_and_alias $BASEDIR/openwin/lib/X11/fonts/Type1/outline
update_fontdir_and_alias $BASEDIR/openwin/lib/X11/fonts/Type1/sun
update_fontdir_and_alias $BASEDIR/openwin/lib/X11/fonts/TrueType
update_fontdir_and_alias $BASEDIR/openwin/lib/X11/fonts/TTbitmaps

# These symlinks cannot be put into packages directly, or even with installf,
# since pkgadd/pkgmk/pkgrm can't handle files with = in their pathname.
rm -f $BASEDIR/../etc/X11/fontpath.d/misc:unscaled:pri=10
rm -f $BASEDIR/../etc/X11/fontpath.d/misc:unscaled:pri=15
rm -f $BASEDIR/../etc/X11/fontpath.d/100dpi:unscaled:pri=20
rm -f $BASEDIR/../etc/X11/fontpath.d/75dpi:unscaled:pri=25
rm -f $BASEDIR/../etc/X11/fontpath.d/TTF:pri=40
rm -f $BASEDIR/../etc/X11/fontpath.d/TrueType:pri=41
rm -f $BASEDIR/../etc/X11/fontpath.d/misc:pri=80
rm -f $BASEDIR/../etc/X11/fontpath.d/misc:pri=85
rm -f $BASEDIR/../etc/X11/fontpath.d/100dpi:pri=90
rm -f $BASEDIR/../etc/X11/fontpath.d/75dpi:pri=95


Similar thing is also done with SUNWxwoft and SUNWxwcft:

SUNWxwoft:

update_fontdir_and_alias $BASEDIR/openwin/lib/X11/fonts/75dpi
update_fontdir_and_alias $BASEDIR/openwin/lib/X11/fonts/100dpi
update_fontdir_and_alias $BASEDIR/openwin/lib/X11/fonts/Speedo


SUNWxwcft:

update_fontdir_and_alias $BASEDIR/openwin/lib/X11/fonts/75dpi
update_fontdir_and_alias $BASEDIR/openwin/lib/X11/fonts/100dpi
update_fontdir_and_alias $BASEDIR/openwin/lib/X11/fonts/Speedo


In order to remove $BASEDIR/openwin/lib/X11/fonts/75dpi and $BASEDIR/openwin/lib/X11/fonts/100dpi, the directory must be empty.


If you do pkgrm of SUNWxwoft and SUNWxwcft, then the postremove script will execute and recreates the fontsdir again.  This will not work.
I was able to reproduce this when I do live upgrade from s10u6 FCS to snv_109.

I changed pkginstall/pkgremove so that it will log contents of /usr/openwin/lib/X11/fonts/75dpi and /usr/openwin/lib/X11/fonts/100dpi.

During pkgadd of SUNWxwfnt, you can see that the directory is clearly non-empty as follow:

Doing /usr/sadm/install/bin/pkginstall.exe -v -S -M -n -a /tmp/admin.un.usr.5323
 -R /a -O parent-zone-name=global -O parent-zone-type=global -N pkgadd /net/ins3
525-svr/export/nv/solarisdvd.nvs_dvd/latest/Solaris_11/Product SUNWxwfnt
total 36
    262285 drwxr-xr-x	2 root	   bin		5120 Feb 26 15:09 .
    262284 drwxr-xr-x  14 root	   bin		512 Feb 26 15:09 ..
    262488 -rw-r--r--	1 root	   other	10508 Oct	 7 19:14 fonts.alias
    262084 -rw-r--r--	1 root	   bin		  2 Feb 26 15:09 fonts.dir
total 34
    262489 drwxr-xr-x	2 root	   bin		5120 Feb 26 15:09 .
    262284 drwxr-xr-x  14 root	   bin		512 Feb 26 15:09 ..
    262504 -rw-r--r--	1 root	   other	10108 Oct	 7 19:14 fonts.alias
    262085 -rw-r--r--	1 root	   bin		  2 Feb 26 15:09 fonts.dir


If the directory is non-empty, the pkgadd will fail.

Perhaps might need to use preinstall script to handle this properly for SUNWxwfnt.
The latest preinstall script is still broken when I try to liveupgrade from snv_106 to snv_111:

DISKLESS_SRVC=
is_srngz=99
is_ngz=99
+ [ -x /usr/bin/pkgcond ]
+ /usr/bin/pkgcond is_sparse_root_nonglobal_zone
is_srngz=1
+ /usr/bin/pkgcond -v is_nonglobal_zone
is_ngz=1
+ make_font_link 100dpi
XWFNT_DIROLD=/a/usr/openwin/lib/X11/fonts
XWFNT_DIRNEW=/a/usr/X11/lib/X11/fonts
+ [ -d /a/usr/openwin/lib/X11/fonts/100dpi -a ! -h /a/usr/openwin/lib/X11/fonts/
100dpi ]
+ /usr/bin/mkdir -p /a/usr/X11/lib/X11/fonts
+ test_writable /a/usr/X11/lib/X11/fonts
+ [ 1 -ne 99 ]
+ /usr/bin/pkgcond is_path_writable /a/usr/X11/lib/X11/fonts
+ return 0
+ mv /a/usr/openwin/lib/X11/fonts/100dpi /a/usr/X11/lib/X11/fonts/100dpi
mv: cannot rename /a/usr/openwin/lib/X11/fonts/100dpi to /a/usr/X11/lib/X11/font
s/100dpi/100dpi: Invalid argument
+ make_font_link 75dpi
XWFNT_DIROLD=/a/usr/openwin/lib/X11/fonts
XWFNT_DIRNEW=/a/usr/X11/lib/X11/fonts
+ [ -d /a/usr/openwin/lib/X11/fonts/75dpi -a ! -h /a/usr/openwin/lib/X11/fonts/7
5dpi ]
+ /usr/bin/mkdir -p /a/usr/X11/lib/X11/fonts
+ test_writable /a/usr/X11/lib/X11/fonts
+ [ 1 -ne 99 ]
+ /usr/bin/pkgcond is_path_writable /a/usr/X11/lib/X11/fonts
+ return 0
+ mv /a/usr/openwin/lib/X11/fonts/75dpi /a/usr/X11/lib/X11/fonts/75dpi
mv: cannot rename /a/usr/openwin/lib/X11/fonts/75dpi to /a/usr/X11/lib/X11/fonts
/75dpi/75dpi: Invalid argument
+ exit 0
pkgadd: ERROR: unable to create package object </a/usr/openwin/lib/X11/fonts/100
dpi>.
    file type <s> expected <d> actual
    unable to remove existing directory at </a/usr/openwin/lib/X11/fonts/100dpi>
pkgadd: ERROR: unable to create package object </a/usr/openwin/lib/X11/fonts/75d
pi>.
    file type <s> expected <d> actual
    unable to remove existing directory at </a/usr/openwin/lib/X11/fonts/75dpi>
This is still broken in snv_113 when I try to lu my desktop from snv_106 to snv_113, the following is in the upgrade_log:

Doing pkgadd of SUNWxwfnt to /
/a/var/sadm/pkg/SUNWxwfnt/install/preinstall: test_writeable: not found
/a/var/sadm/pkg/SUNWxwfnt/install/preinstall: test_writeable: not found
pkgadd: ERROR: unable to create package object </a/usr/openwin/lib/X11/fonts/100
dpi>.
    file type <s> expected <d> actual
    unable to remove existing directory at </a/usr/openwin/lib/X11/fonts/100dpi>
pkgadd: ERROR: unable to create package object </a/usr/openwin/lib/X11/fonts/75d
pi>.
    file type <s> expected <d> actual
    unable to remove existing directory at </a/usr/openwin/lib/X11/fonts/75dpi>
35611 blocks
pkgadd: ERROR: unable to create package object </a/usr/openwin/lib/X11/fonts/100
dpi>.
    file type <s> expected <d> actual
    unable to remove existing directory at </a/usr/openwin/lib/X11/fonts/100dpi>
pkgadd: ERROR: unable to create package object </a/usr/openwin/lib/X11/fonts/75d
pi>.
    file type <s> expected <d> actual
    unable to remove existing directory at </a/usr/openwin/lib/X11/fonts/75dpi>

Installation of <SUNWxwfnt> partially failed.
pkgadd return code = 2



There is a typo in the preinstall script and test_writeable should be test_writable.
Work Around
This seems to repair the damage:

yes | pkgrm -R /.alt.snv_109 SUNWhttf SUNWkxmft SUNWi13rf SUNWi15rf SUNWi2rf SUNWi5rf SUNWi7rf SUNWi9rf SUNWi4rf SUNW1251f SUNWkoi8f SUNWxwcsl SUNWgttf SUNW5ttf SUNWinttf SUNWjxcft SUNWkxfnt SUNWcttf SUNWttf-hanyang-ko SUNWi8rf SUNWtxfnt SUNWttf-hanyang-ko-core SUNWkttf SUNWttf-fonts-core SUNWarrf SUNWxsun-server SUNWgnome-fonts SUNWxwfnt SUNWxwcft SUNWxwoft SUNWxwfsw SUNWolrte
rm -rf /.alt.snv_109/usr/X11/lib/X11/fonts
rm -rf /.alt.snv_109/usr/openwin/lib/X11/fonts
yes | pkgadd -R /.alt.snv_109 -d /path/to/image/Solaris_11/Product SUNWhttf SUNWkxmft SUNWi13rf SUNWi15rf SUNWi2rf SUNWi5rf SUNWi7rf SUNWi9rf SUNWi4rf SUNW1251f SUNWkoi8f SUNWxwcsl SUNWgttf SUNW5ttf SUNWinttf SUNWjxcft SUNWkxfnt SUNWcttf SUNWttf-hanyang-ko SUNWi8rf SUNWtxfnt SUNWttf-hanyang-ko-core SUNWkttf SUNWttf-fonts-core SUNWarrf SUNWxsun-server SUNWgnome-fonts SUNWxwfnt SUNWxwcft SUNWxwoft SUNWxwfsw SUNWolrte
This work around did not work for me.  By not working, I mean that
-adobe-courier-medium-r-normal--12-120-75-75-m-70-iso8859-1 could
not be found.  This is the font that I have been using in my
xterm windows for a decade or so.
The workaround should be this:

yes | pkgrm -R /.alt.snv_109  SUNWxwcft SUNWxwoft SUNWxwfnt
rm -rf /.alt.snv_109/usr/X11/lib/X11/fonts/100dpi
rm -rf /.alt.snv_109/usr/X11/lib/X11/fonts/75dpi
rm -rf /.alt.snv_109/usr/openwin/lib/X11/fonts/100dpi
rm -rf /.alt.snv_109/usr/openwin/lib/X11/fonts/75dpi
yes | pkgadd -R /.alt.snv_109 -d /path/to/image/Solaris_11/Product SUNWxwfnt SUNWxwoft SUNWxwcft
An additional step which does appear to make it all work again
is to run

# rm /var/cache/fontconfig/*
# /usr/bin/fc-cache -f -s
Comments
In X NV B111 test cycle:
When I upgrade X from 110 to 111, the installation of SUNWxwfnt failed. So this bug fix  failed. The error notice is as below:
 
/var/sadm/pkg/SUNWxwfnt/install/preinstall: bad substitution
/var/sadm/pkg/SUNWxwfnt/install/preinstall: CH}.all: not found
/var/sadm/pkg/SUNWxwfnt/install/preinstall: syntax error at line 87: `}' unexpected
pkgadd: ERROR: preinstall script did not complete successfully
Installation of <SUNWxwfnt> partially failed.

[Using SNV110 + X NV B111 installed]
--Hao Wei
Respun SUNWxwfnt for B111 to correct the installation error.
This bug is verified on X snv_113,both x86 and sparc.