Thursday Jul 16, 2009

如何使用Opensoalris中的多媒体播放器totem

(转载请注明来源地址http://blogs.sun.com/weixue)

安装了Opensolaris后,多数的用户可能马上就像要进行的应用,就是听歌,看电影了。呵呵,可惜阿由于某些原因,很多多媒体格式的解码器都不是默认安装的,可能你发现了,totem这个多媒体播放器其实什么也不能播放。。怎么办呢?很简单安转相应的解码器就行了。玩过Unix/linux的都知道其实这些解码器插件都在GStreamer里。这里为大家提供几个简单的方法可以用现成的:

1. 最有效,最简单,最全面的结局方案就是去这个网站,这里提供了很多Solaris上的多媒体软件,有的是商业的,有的可以自由使用。 把它(http://ips.homeunix.com:10906/) 加到pulisher里,直接就可以安转各种解码器的IPS 包了。比如你要安装播放flash和MPEG的解码器插件:

  1. "pkg set-authority -O http://ips.homeunix.com:10906 ips.homeunix.com" to add repository.
  2. "pkg refresh --full" to update catalog.
  3. "pkg install MBLgst-plugin-ffmpeg MBLgst-plugin-flv" to install plugins.

这里还很很多mp3, DVD的插件,转好这些包一般的视频音频基本上可以自由看听了。

2. 这个网站提供了一些:GStreamer Input Selector Plugin for OpenSolaris

http://addons.songbirdnest.com/addon/1354/versions

3. 有个热心人,自己编译了一些常用的解码器: http://blog.sartek.net/2009/05/gstreamer-stuff-on-opensolaris.html

当然,你完全也可以自己下载GStreamer,然后自己编译。

Monday May 25, 2009

Changing Truetype Fonts path to make NV and OpenSolaris same

Solaris Nevada will be "Changing Truetype Fonts path to make NV and OpenSolaris same". Post simple description one-page here for discussion.  It's automatic approved now. If you have any comments, please let me know asap.

Monday May 04, 2009

Build Open X on Solaris by yourself - OpenSolaris Project: Fully Open X Project

转载时请以超链接形式标明文章原始出处和作者信息.  :
http://blogs.sun.com/weixue/entry/build_open_x_on_solaris

OpenSolaris Project: Fully Open X Project is fully X project which include X library and application for  Opensolaris. The Fully Open X Project (FOX) will create a public Mercurial gate on opensolaris.org containing a merge of these three source bases:

  • the current OpenSolaris X code drops published by the Sun X team
  • the Xorg SPARC driver sources created by Martin Bochnig for Martux
  • the full X11R7.2 source builds created by Moinak Ghosh for Belenix
Build fox-gate: please see:  http://opensolaris.org/os/project/fox/build_inst/

Thursday Apr 30, 2009

Tip: Different master pty regards between Solaris and Linux

转载时请以超链接形式标明文章原始出处和作者信息
http://blogs.sun.com/weixue/entry/tip_differece_master_pty_regards

During investigation Opensolaris bug 6824625. The root cause is the different result of calling tcsetattr() for pty on Solaris and Linux.
Solaris and Linux treat slave pty differently.
For opening pty (Pseudo Terminal), there have two steps, open master device and slave device sequently. On Solaris, master pty device is not regarded as a terminal device. it regard slave device as a terminal device only.
But On Linux(I tested on Ubuntu), both master and slave devices are regarded as terminal devices.

So, tcsetattr() can work for both master and slave device on Linux. But, tcsetattr() can only work for slave pty device on Solaris. You can also use isatty() to tests if file descriptor is associated with terminal device .

It's a useful tip for porting terminal application between Solaris and Linux.

A piece of code for your reference, how to open pty: You can see that ioctl() only apply to slave device on Solaris(in macro #ifdef __sun).

FYI.

The Open Group Base Specifications : General Terminal Interface.
Concept of pty, tty..(in Chinese)

Tuesday Apr 07, 2009

Macro SVR4 or __SVR4 for Xorg on Solaris

During investigate Opensolaris bug 6824625(And 6728611 ) . There is a issue about macro Xorg, the Xorg  seems to be a remnant of old Imake world.  For example, in app/luit/sys.c, it always use #ifdef SVR4 as switch.  but on Solaris there is no pre-define for "SVR4", only pre-define "__SVR4". (check : CC -xdumpmacros -c dummy.c). For resolve this issue, X team support a header file <X11/Xosdefs.h>. So please include this header file in the program which need use CC or gcc pre-define macros.  In Xosdefs.h:

#ifdef sun
/\* Imake configs define SVR4 on Solaris, but cc & gcc only define __SVR4
  \* This check allows non-Imake configured programs to build correctly.
  \*/
#if defined(__SVR4) && !defined(SVR4)
#define SVR4 1
#endif
#endif
This issue also be discussed in xorg mail-list early (Some portabity issues). Alan gave the solution on Solaris.

Saturday Oct 11, 2008

how to compile with gtk on OpenSolaris

For people who use gtk+ on OpenSolaris first time. When you compile the application which used gtk+ library, the necessary compile and link options must be used. But for gtk+, the options are too much to list them all. "pkg-config" is useful to help you compile.
This is a simplest gtk application example:

/\*
\* base.c
\*/
#include <gtk/gtk.h>

int main( int argc, char \*argv[] )
{
GtkWidget \*window;
gtk_init (&argc, &argv);
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
gtk_widget_show (window);
gtk_main ();
return(0);
}

compile as following step: 1>cc -c `pkg-config --cflags gtk+-2.0` base.c 2>cc -o base `pkg-config --libs gtk+-2.0` base.o

Tuesday Jul 01, 2008

Adding Malaysian Indonesian Vietnamese UTF 8 Locales to Solaris

So far, Solaris do not support Malaysian Indonesian Vietnamese locales. For adding these three locales :
Malaysian: ms_MY.UTF-8
Indonesian: id_ID.UTF-8
Vietnamese: vi_VN.UTF-8

I commit one-pager: http://wikis.sun.com/display/xi18n/One+Pager+for+Adding+Malaysian+Indonesian+Vietnamese+UTF+8+Locales

If you are interested in these project,please review and give your comments.
Another importing thing: I'm not native speaker either of three language, so I am looking forward to know if there have anyone, who know one of these tree languages, would like to be volunteer to test the new locales when I finish them. If you are interested, please feel free contact me. Any help will be highly appreciated.

Monday Apr 14, 2008

patch or gpatch on Solairs?

The patch command on Solaris seems is compatible with diff format patch:
$patch -p0 < a.patch
  Looks like a unified context diff.
File to patch:

The command is block and need you input patch file. So, I have to use gpatch, and gpatch work fine.

I google it and found, I am not the first one encounter this problem. Patching PHP on Solaris hosts (all patch utilities are not created equal!)

Could anyone know if I can use Solaris patch by add some options?
 

Wednesday Feb 27, 2008

dbx点滴-(1)

断断续续的看过dbx手册的一些章节,虽然大部分的内容不常用到,但是对某些特定情形的调试还是相当有用。本博的目的就是把一些个人认为有用的东西摘抄出来,方便查询。

1>

要消除库问题并用 dbx 调试 “不匹配”的核心文件,您可以执行以下操作:
1. 将 dbx 环境变量 core_lo_pathmap 设置为 on。
2. 使用 pathmap 命令告知 dbx 核心文件的正确库的位置。
3. 使用 debug 命令加载程序和核心文件。
例如,假定核心主机的根分区已通过 NFS 导出,并且可以通过 dbx 主机上的
/net/core-host/ 访问,应使用下面的命令加载 prog 程序和 prog.core 核心文件
来进行调试:
 (dbx) dbxenv core_lo_pathmap on
 (dbx) pathmap /usr /net/core-host/usr
 (dbx) pathmap /appstuff /net/core-host/appstuff
 (dbx) debug prog prog.core
如果没有导出核心主机的根分区,则必须手动复制这些库。不需要重新创建符号链接。
(例如,  您不必建立从 libc.so 到 libc.so.1 的链接,       只要确保 libc.so.1 可用。) 


注意事项
调试不匹配的核心文件时应注意:
■ pathmap 命令不能识别 “/”路径映射,因此不能使用以下命令:
  pathmap / /net/core-host
■  pathmap 命令的单参数模式不能与加载对象路径名同时使用,因此请使用二元模式
  from-path to-path。
 

■ 如果 dbx 主机使用的 Solaris 操作环境版本与核心主机相同或更新,那么调试核心文件时效果可能会更好,虽然这并不总是必要的。可能需要的系统库是:
   ■ 对于运行时链接程序: 
        /usr/lib/ld.so.1
        /usr/lib/librtld_db.so.1
        /usr/lib/64/ld.so.1
        /usr/lib/64/librtld_db.so.1
   ■ 对于线程库,取决于您所使用的 libthread 执行: 
        /usr/lib/libthread_db.so.1
        /usr/lib/64/libthread_db.so.1
        /usr/lib/lwp/libthread_db.so.1
        /usr/lib/lwp/64/libthread_db.so.1
   /usr/lib/lwp 文件仅适用于在 Solaris 8 操作环境中运行 dbx 的情况,  并且仅在您
   使用交替 libthread 库时适用。
   如果 dbx 在支持 64 位的 Solaris OS 版本上运行,则需要 xxx_db.so 库的 64 位版
   本,因为这些系统库是作为 dbx 的一部分而不是目标程序的一部分装入和使用的。
   ld.so.1 库是核心文件映像的一部分,与 libc.so 或其他任何库一样,因此需要与
   创建该核心文件的程序相匹配的 32 位 ld.so.1 库或 64 位 ld.so.1 库。
■ 如果正在查看来自某个线程程序的核心文件,并且 where 命令未显示栈,请尝试使用
   lwp 命令。例如:
  (dbx) where
  current thread: t@0
  [1] 0x0(), at 0xffffffff
  (dbx) lwps
  o>l@1 signal SIGSEGV in _sigfillset()
  (dbx) lwp l@1
  (dbx) where
  =>[1] _sigfillset(), line 2 in "lo.c"
     [2] _liblwp_init(0xff36291c, 0xff2f9740, ...
     [3] _init(0x0, 0xff3e2658, 0x1, ...
  ...
   缺少线程栈表明 thread_db.so.1 有问题,因此,需要尝试从核心主机中复制适当
   的 libthread_db.so.1 库。
 

2>
启动加载配置文件的顺序:
dbx  -s可以指定加载的初始化配置文件。
寻找.dbxrc 的顺序:
/installation_directory/lib ->
当前目录./.dbxrc-> $HOME: $HOME/.dbxrc
 在 Solaris 平台上,默认 installation_directory 为
/opt/SUNWspro ;在 Linux 平台上,默认 installation_directory 为
/opt/sun/sun/sunstudio10u1

3>
创建 .dbxrc 文件:
(dbx) help .dbxrc>$HOME/.dbxrc

Wednesday Feb 13, 2008

Compile and Use 7z on Solaris

What is 7z:
7-Zip is a file archiver with a high compression ratio.
7z home page: http://www.7-zip.org/

Download 7z source code(7zXXX.tar.bz2) from :
http://sourceforge.net/project/showfiles.php?group_id=14481

Compile on Solaris:
Uncomprese source file, then:
1>cp makefile.solaris_x86 makefile.machine.
2>set up CBE env.
3>make
4>make install

Usage simple:
7za a archive.7z myfile
compress and archive myfile to archive.7z
7za x archive.7z:
: extracts all files from archive archive.7z
                   to the current directory

You can see Readme have more detail information.

Thursday Nov 15, 2007

在Solaris Nevada OS 中使用可移动存贮介质,USB 移动硬盘,U盘(Flash闪存)

在Solaris Nevada OS 中使用可移动存贮介质,USB 移动硬盘,U盘(Flash闪存)

非常感谢Sun中国技术社区wiki的贡献者。在wiki"如何在Solaris下使用USB设备"中有一个比较全面的介绍了。

但是在最新的Solaris Nevada(我用的是Build73)中有些内容有些不适用了,需要修改一下。在这里我就根据原文的结构修改了相关的一些内容。

1.利用服务自动mount,,(这个可不是所有的USB设备都可以支持的)

首先查看卷管理服务:svc:/system/filesystem/rmvolmgr:default
可以用以下命令查看
#svcs -a|grep vol
online         10月_29 svc:/system/filesystem/rmvolmgr:default

如果rmvolmgr服务没有启动:
offline        10月_29 svc:/system/filesystem/rmvolmgr:default

使用如下命令启动rmvolmgr服务
#svcadm enable svc:/system/filesystem/rmvolmgr:default

我的尼康数码相机是可以直接自动mount上了。还有哪些可以自动mount上,就靠你自己试了。

2。
如果不能自动mount你的U盘,那么就直接查询设备路径,手动mount该设备:

如果该USB设备已经存在文件系统,且Solaris支持该文件系统,可以直接mount该文件系统。以FAT32文件系统为例,首先要了解USB设备的路径:

# rmformat
正在查找设备...
     1. Logical Node: /dev/rdsk/c3t0d0p0
        Physical Node: /pci@0,0/pci1028,1c2@1d,7/storage@4/disk@0,0
        Connected Device: aigo     USB DISK         1100
        Device Type: Removable
        Bus: USB
        Size: 967.5 MB
        Label: <None>
        Access permissions: 媒体未被写保护。


然后,直接mount该设备(以FAT32,即PCFS格式为例):

# mount -F pcfs /dev/dsk/c3t0d0p0:c /mnt


如果要使用的是有多个分区(这里例子为2个)移动硬盘:
首先,创建两个目录DiskC,DiskD.
     #cd /mnt
     #mkdir DiskC
     #mkdir DiskC

# rmformat
正在查找设备...
     1. Logical Node: /dev/rdsk/c5t0d0p0
        Physical Node: /pci@0,0/pci1028,1c2@1d,7/storage@6/disk@0,0
        Connected Device: SAMSUNG  MP0402H          0811
        Device Type: Removable
        Bus: USB
        Size: 38.2 GB
        Label: <None>
        Access permissions: 媒体未被写保护。

mount第一个分区:
        # mount -F pcfs /dev/dsk/c5t0d0p0:c /mnt/DiskC
mount第二个分区:
        # mount -F pcfs /dev/dsk/c5t0d0p0:d /mnt/DiskD

(注:关于硬盘名字的含义,参考:p0是整个硬盘,包括启动扇区和所有的分区。p1-p4 是代表四个可能的fdisk分区。(目前只能使用p0)在内部,在硬盘的slice表中它们是第16到第20的位置。允许你在p0上做一个使用整个硬盘的新的文件系统,这时使用p0:M的方法来在代表pcfs代码。 'M'为'c'时,代表主FAT分区,'M'为'd'-'z'时代表一个扩展分区内的逻辑分区。
p0 is the entire disk, including the boot sectors and all the partitions. The p1-p4 are the four possible fdisk partitions. Internally these are the 16th-20th positions in the slice table for the disk.This allows you to do a newfs on p0 and use the entire disk as a file system. The p0:M method is handled within the pcfs code, where 'M' is 'c' for a primary FAT partition and 'd'-'z' for logical FAT partitions within an extended partition.)


卸载U盘前,需要确保该mount目录没有正在使用:
    # umount /mnt

Wiki中还说要:
    # eject rmdisk0
或者,
    # eject  /dev/rdsk/c3t0d0p0
但是对于U盘,移动硬盘eject这个命令一般不用,因为没有看出来有什么作用,通常umount后就可以直接拔出U盘了。

卸载移动硬盘前,需要确保该mount目录没有正在使用:
    # umount /mnt/DiskC
    # umount /mnt/DiskD

关于USB的更多信息请参考:Solaris USB FAQ: http://www.sun.com/io_technologies/usb/USB-Faq.html

Tuesday Nov 13, 2007

FW: Disks, partitions and slices under Solaris

These paper describe concept of disks, partitions and slices under Solaris. I think this a comprehensive description of these concept. Hope it can help you understand disk partitions and slice in Solaris. here only list the skelton. From http://multiboot.solaris-x86.org/iv/3.html  see details.

Disks, partitions and slices under Solaris

  • Disk addressing conventions

  • Slices and VTOC

  • Creating and mounting additional UFS file systems

  • Two Solaris partitions on the same drive

  • Mounting FAT partitions




http://multiboot.solaris-x86.org/iv/3.html  see details.

 

Friday Nov 09, 2007

BigAmin 技术文章:在同一个硬盘上安装多个版本的Solaris OS (适用平台:X86 / SPARC )中文版上线

BigAmin 技术文章:在同一个硬盘上安装多个版本的Solaris OS (适用平台:X86 / SPARC )中文版上线了。

同时日文版也已经在翻译计划中,相信很快就会上线。

http://www.sun.com/bigadmin/hubs/multilingual/simp_chinese/content/install_multi_solaris.jsp

 

英文版参见http://blogs.sun.com/weixue/entry/my_first_bigadmin_tech_article 或者

http://www.sun.com/bigadmin/features/articles/install_multi_solaris.jsp

Friday Oct 19, 2007

My first Bigadmin tech article - Installing Multiple Solaris OS Versions on the Same Hard Disk for x86 and SPARC Platforms

My first Bigadmin tech article is online.
I hope it is helpful for you who want to install multi-version Solaris
OS in one disk/machine.

http://www.sun.com/bigadmin/features/articles/install_multi_solaris.jsp

I will translate it into S.Chinese as soon, I will notify you when it available. So if you are Chinese reader, please be patient.

Tuesday Sep 18, 2007

How To Set Env For Using GNU Gcc In Solaris (English&中文)

How to using gcc to compile in Solaris:

Some GNU software must be build by gcc, and for most of  Solaris developer, default compiler is SunStudio, so,for using gcc in Solaris, you should set some env variable.

export CPP="/usr/sfw/bin/gcc -E"

export CC=/usr/sfw/bin/gcc

export CXX=/usr/sfw/bin/g++


在Solaris中编译gnu的软件,有时候必须使用gcc.对于Solaris上的开发者来说,通常默认使用的是SunStutio,所以直接编译这些GNU软件可能行不通,需要进行一些设置才能使用gcc来编译。

首先介绍一些常用的内置变量:

CC:用来指定c编译器

CPP:c编译器预编译

CXX:用来指定cxx编译器

PKG_CONFIG_PATH:用来指定pkg-config用到的pc文件的路径,默认是/usr/lib/pkgconfig,pc文件是文本文件,扩展名是.pc,里面定义开发包的安装路径,Libs参数和Cflags参数等等。

因为Solaris通常将GNU的编译器已经安装到/usr/sfw/bin/中,(当然你也可以自己安装gcc到你喜欢的目录,设置时制定你所设置的目录即可),所以通常需要做的设置如下:

export CPP="/usr/sfw/bin/gcc -E"

export CC=/usr/sfw/bin/gcc

export CXX=/usr/sfw/bin/g++

About

williamxue

Search

Archives
« April 2014
SunMonTueWedThuFriSat
  
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
   
       
Today