Still the problem of chinese display in text mode during installing

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Still the problem of chinese display during installing in text mode
hi,everybody:
maybe I depict the problem confusingly,so no one pays attention to it
I'll show the details:
in order to show chinese,I use the bterm and I do my test in fc5
first,i changed the file lang-table in the subdir etc/ of isolinux/initrd.img
Chinese(Simplified)  zh_CN  bterm zh_CN.UTF-8 us Asia/Shanghai
...
secondly,I modified /usr/src/redhat/SOURCES/anaconda-11.0.5/text.py
in the def run of class InstallInterface
##add 
        if (flags.setupFilesystems and
            (id.instLanguage.getFontFile(id.instLanguage.getCurrent()) == "bterm")
            and not isys.isPsudoTTY(0)
            and not flags.serial):
            log.info("starting bterm")
            try:
                rc = isys.startBterm()
                time.sleep(1)
            except Exception, e:
                log.info("got an exception starting bterm: %s" %(e,))
##end
if id.instLanguage.getFontFile(id.instLanguage.getCurrent()) == "none":
            ButtonChoiceWindow(self.screen, "Language Unavailable",
                               "%s display is unavailable in text mode.  "
                               "The installation will continue in "
                               "English." % (oldlang,),
                               buttons=[TEXT_OK_BUTTON])
...
thirdly,in /usr/src/redhat/SOURCES/anaconda-11.0.5/isys/
some related files were isys.py isys.c lang.h lang.c
(1)isys.py
import _isys
##the above code [rc = isys.startBterm()] calls this code,and it was there not added by me
def startBterm():
    return _isys.startBterm()
(2)isys.c ,it was the interface which c provided python interpreter to called up
#include "lang.h"
static PyObject * start_bterm(PyObject *s, PyObject *args);//add 
static PyMethodDef isysModuleMethods[] = {
     ...
    { "startBterm", (PyCFunction) start_bterm, METH_VARARGS, NULL },//add 
    { NULL, NULL, 0, NULL }
} ;
static PyObject * start_bterm(PyObject *s, PyObject *args) {
    if(!PyArg_ParseTuple(args,"")) return NULL;
    return Py_BuildValue("i", isysStartBterm());
   
}
(3)lang.h
int isysStartBterm(void);//add 
(4)lang.c
##add
/* returns 0 on success, 1 on failure */
extern int bterm_main(int argc, char **argv);
int isysStartBterm(void) {
    char * btermargs[4] = { "bterm", "-s", "-f", NULL };
    int rc;
    struct stat sb;
    /* if we've already successfully started bterm, we don't need to again */
    if (!access("/var/run/bterm.run", R_OK))
        return 0;
    /* assume that if we're already on a pty we can handle unicode */
    fstat(0, &sb);
    if (major(sb.st_rdev) == 3 || major(sb.st_rdev) == 136)
 return 0;
    if (!access("/etc/font.bgf.gz", R_OK))
 btermargs[3] = "/etc/font.bgf.gz";
    else if (!access("/usr/lib/bogl/font.bgf.gz", R_OK))
 btermargs[3] = "/usr/lib/bogl/font.bgf.gz";
    else if (!access("font.bgf.gz", R_OK))
 btermargs[3] = "font.bgf.gz";
    else
        return 1;
   
    rc = bterm_main(4, btermargs);//Line 213
    if (!rc) {
        int fd = open("/var/run/bterm.run", O_CREAT | O_TRUNC | O_RDWR, 0600);
        close(fd);
    }
 
    return rc;
}
#end
fourthly,I change the Makefile in /usr/src/redhat/SOURCES/anaconda-11.0.5/isys/
LOADLIBES = ... -lbterm -lbogl -lwlite ...

fifthly,I unpacked the bogl-0.1.18-7.src.rpm
in the /usr/src/redhat/SOURCES/
there was a patch named bogl-0.1.18-rh.patch
the contents in it related (I thought) above the problem were:
+bterm-lib.o: bterm.c
+    $(CC) ...-Dmain=bterm_main $<
+
+bterm-lib.do:bterm.c
+    diet $(CC) ...-Dmain=bterm_main $<

sixthly,I rpmbuild -ba bogl.spec and I installed four rpms that had just be produced
bogl
bogl-bterm
bogl-debuginfo
bogl-devel
seventhly, i recompile anaconda
it gives the error
../isys/libisys.a(lang.o):In function 'isysStartBterm':
/usr.src/redhat/BUILD/anaconda-11.0.5/isys/lang.c:213: undefined reference
to 'bterm_main'
collect2: ld returned 1 exit status
make[1]:***[loader] Error 1
...
and I wondered why it can not find the define of bterm_main,how i solved it
or there're other ways to fix the final problem of chinese display, thanks for any help
 
codes are referenced to
http://web.mit.edu/AFS/dev/user/amb/installer/new/redhat/anaconda/







3G 时 代 来 临 了,坚 决 对 传 统 邮 箱 说 不 !
新 一 代 极 速 3G 邮 箱 闪 亮 登 场 ,280 兆 网 盘 免 费 送 ! 点 击 此 处 注 册

[Index of Archives]     [Kickstart]     [Fedora Users]     [Fedora Legacy List]     [Fedora Maintainers]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]
  Powered by Linux