Thursday, December 8, 2011

cp --preserve doesn't work as expected under ubuntu 11.10

I have been struggling with a very strong issue after upgraded to Ubuntu 11.10 (Oneiric Ocelot), and finally found out this is from a low level error from ubuntu - the root cause is because cp command with the switch of -a when copy a folder doesn't work as expected of "-dR --preserve=all" from cp --help.
    #cp --help
    ...

    Mandatory arguments to long options are mandatory for short options too.
      -a, --archive                same as -dR --preserve=all
           --backup[=CONTROL]       make a backup of each existing destination file
    ...

Under Ubuntu 11.04, when copy folders, all the attributes will be preserved with the --preserve option, but with Ubuntu 11.10, some attributes will be lost.

Here is a simple test procedure.

Note: e-xiao is below to administrator group.
1. Create a folder say test
     #mkdir test
     #ls -all
       drwxr-xr-x   2 e-xiao e-xiao     4096 2011-12-08 23:14 test
2. Trying to cp it with -a.
     #cp -a test test1

Under Ubuntu 11.10,
     #ls -all
       drwx------   2 e-xiao e-xiao     4096 2011-12-08 23:14 test1

Yes, with the  --preserve=all option, you are still losing all attributes not owned by owner.
Not sure if this is from any policy changes from ubuntu, I tried to google the web, but yet found any useful information so far :(

[Workaround]
1. Use "--backup -R" options
2. Use "-dR" only without "--preserve" option

Sunday, November 27, 2011

View Japanese/Chinese PDF files under Ubuntu

Long time, I could not find a good PDF viewer which can enable me to view Japanese/Chinese PDF files under ubuntu - with some files they may works, but mostly they will not - either display garbles or display nothing at all.
evince can display the file all the blank...
Adobe Reader is always telling you that you need to install Asian Font Package, but after many times challenge, I gave up, I installed the font package again and again, but never succeed ...
Foxit Reader is good after doing some settings in font mapping from preference menu, however the display is not perfect as expected.

Finally, I found okular + poppler-data is the perfect solution. It at least displays one of my important file perfectly.

Try following, and that's all!

$sudo apt-get install okular poppler-data

Tuesday, November 1, 2011

Can not login to Ubuntu after un-installed Byobu

Yesterday, I un-installed the long time not used Byobu. I couldn't even image that this could be the reason of why I could not login to Ubuntu 11.10 today.

 I tried many times to login as usually, however, every time, the login was aborted and the screen came back to the login screen user account list again and again.

I tried to login with my root account - fortunately, I created the root user account. When checking the file .xsession-errors under my user account home folder,  it sounds the trouble is caused by a line in ~/.profile.

~/.profile line 75: .: filename argument required
.: usage: . filename [arguments]
 
In the ~/.profile line 75, the command is as following.

 
. $(which byobu-launch) 


After I deleted the line, I could login as usual again.
It was too bad that un-install the Byobu could lead to this big trouble. It sounds for some reasons, the un-install of byobu doesn't clean up this line in the ~/.profile file!

Wednesday, October 19, 2011

Fix the dependency error for mozc under ubuntu 11.10

When build mozc revision 74 Debian package under ubuntu 11.10, got the dependency error for libibus-dev.

dpkg-checkbuilddeps: Unmet build dependencies: libibus-dev
dpkg-buildpackage: warning: Build dependencies/conflicts unsatisfied; aborting.
dpkg-buildpackage: warning: (Use -d flag to override.)
debuild: fatal error at line 1348:
dpkg-buildpackage -rfakeroot -D -us -uc -b failed

This is because there is no libibus-dev package now in ubuntu 11.10. Instead you need to install libibus-1.0-dev (sudo apt-get install libibus-1.0-dev) and change a little in following file.
Index: debian/control
===================================================================
--- debian/control (revision 74)
+++ debian/control (working copy)
@@ -2,7 +2,7 @@
Section: utils
Priority: extra
Maintainer: Yusuke Sato
-Build-Depends: debhelper (>= 4.0.0), libibus-dev, libcurl4-openssl-dev, pkg-config, libprotobuf-dev, protobuf-compiler, libgtest-dev, libqt4-dev, scim, libscim-dev, gyp, libzinnia-dev
+Build-Depends: debhelper (>= 4.0.0), libibus-1.0-dev, libcurl4-openssl-dev, pkg-config, libprotobuf-dev, protobuf-compiler, libgtest-dev, libqt4-dev, scim, libscim-dev, gyp, libzinnia-dev
Standards-Version: 3.6.2

Package: ibus-mozc

Resolve the Build Errors for Android 2.3.4 under 32-bit ubuntu 11.10

ERROR#1
Firstly need to enable to build android on a 32-bit system. Otherwise, you will see the following error message immediately when you start to build the source tree.
************************************************************
You are attempting to build on a 32-bit system.
Only 64-bit build environments are supported beyond froyo/2.2.
************************************************************
modify following files.
external/clearsilver/java-jni/Android.mk
external/clearsilver/util/Android.mk
external/clearsilver/cgi/Android.mk
external/clearsilver/cs/Android.mk
Find all lines of
LOCAL_CFLAGS += -m64
or
LOCAL_LDFLAGS += -m64
Change then with
LOCAL_CFLAGS += -m32
or
LOCAL_LDFLAGS += -m32

Need also change all lines in build/core/main.mk
ifneq (64,$(findstring 64,$(build_arch)))
to
ifneq (i686,$(findstring i686,$(build_arch)))
too.

ERROR#2
host C++: libutils <= frameworks/base/libs/utils/RefBase.cpp
frameworks/base/libs/utils/RefBase.cpp: In member function ‘void android::RefBase::weakref_type::trackMe(bool, bool)’:
frameworks/base/libs/utils/RefBase.cpp:483:67: error: passing ‘const android::RefBase::weakref_impl’ as ‘this’ argument of ‘void android::RefBase::weakref_impl::trackMe(bool, bool)’ discards qualifiers [-fpermissive]

make: *** [out/host/linux-x86/obj/STATIC_LIBRARIES/libutils_intermediates/RefBase.o] Error 1

With file
frameworks/base/libs/utils/Android.mk
Change the line:
LOCAL_CFLAGS += -DLIBUTILS_NATIVE=1 $(TOOL_CFLAGS)
To:
LOCAL_CFLAGS += -DLIBUTILS_NATIVE=1 $(TOOL_CFLAGS) -fpermissive

ERROR#3
host C++: obbtool <= frameworks/base/tools/obbtool/Main.cpp
:0:0: error: "_FORTIFY_SOURCE" redefined [-Werror]
:0:0: note: this is the location of the previous definition
cc1plus: all warnings being treated as errors

make: *** [out/host/linux-x86/obj/EXECUTABLES/obbtool_intermediates/Main.o] Error 1

To fix this, refer to this patch.
https://github.com/CyanogenMod/android_build/commit/e9cbfa60c8dd60d04570d8bf7bd0d54a4304baf5
It will patch line 61 in core/combo/HOST_linux-x86.mk as following.
-HOST_GLOBAL_CFLAGS += -D_FORTIFY_SOURCE=0
+HOST_GLOBAL_CFLAGS += -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=0

Thursday, September 4, 2008

Compile error for vmhgfs module

  • wget http://downloads.sourceforge.net/open-vm-tools/open-vm-tools-2008.08.08-109361.tar.gz
  • cd open-vm-tools-2008.08.08-109361/modules/linux
  • mv vmhgfs vmhgfs-only
  • tar to vmhgfs.tar
  • cd /usr/lib/vmware-tools/modules/source/
  • mv vmhgfs.tar vmhgfs.backup.tar
  • cp the new vmhgfs.tar to the folder

Saturday, June 7, 2008

Enable Japanese Input for fedora

Need install SCIM-Anthy.
#yum install scim-anthy