Tuesday, July 20, 2010

Install Code::Blocks in Fedora 9.

Ref [1] http://wiki.codeblocks.org/index.php?title=Installing_Code::Blocks_from_source_on_Linux
Ref [2] http://www.friendlyarm.net/forum/topic/26


1.
-------------------------------
[q.yang@localhost ~]$ mkdir ~/devel

2.Checking the presence of GTK+ library
---------------------------------------
[q.yang@localhost ~]$ rpm -qa |grep gtk
pygtk2-codegen-2.12.1-6.fc9.i386
gtk-nodoka-engine-0.7.1-2.fc9.i386
gtk-doc-1.9-4.fc9.noarch
authconfig-gtk-5.4.4-1.fc9.i386
gtkmm24-2.12.7-1.fc9.i386
gtksourceview2-2.2.2-1.fc9.i386
gtkhtml2-2.11.1-3.fc9.i386
pygtk2-doc-2.12.1-6.fc9.i386
pygtksourceview-2.2.0-1.fc9.i386
usermode-gtk-1.98-1.fc9.i386
gtk2-engines-2.14.3-1.fc9.i386
gnome-python2-gtkhtml2-2.19.1-28.fc9.i386
gtk2-2.12.12-2.fc9.i386
gtkspell-2.0.11-8.fc9.i386
gtk-sharp2-2.12.1-1.fc9.i386
GConf2-gtk-2.22.0-1.fc9.i386
pygtk2-libglade-2.12.1-6.fc9.i386
pygtk2-2.12.1-6.fc9.i386
xdg-user-dirs-gtk-0.7-1.fc9.i386
pygtk2-devel-2.12.1-6.fc9.i386
gtkhtml3-3.18.3-1.fc9.i386
gtk2-devel-2.12.12-2.fc9.i386
[q.yang@localhost ~]$ ll /usr/lib/ | grep libgtk
lrwxrwxrwx 1 root root 21 2010-06-04 02:47 libgtkhtml-2.so.0 -> libgtkhtml-2.so.0.0.0
-rwxr-xr-x 1 root root 451304 2008-02-10 14:34 libgtkhtml-2.so.0.0.0
lrwxrwxrwx 1 root root 25 2010-06-07 18:04 libgtkhtml-3.14.so.19 -> libgtkhtml-3.14.so.19.1.0
-rwxr-xr-x 1 root root 764296 2008-06-30 21:58 libgtkhtml-3.14.so.19.1.0
lrwxrwxrwx 1 root root 22 2010-06-07 17:50 libgtkmm-2.4.so.1 -> libgtkmm-2.4.so.1.0.30
-rwxr-xr-x 1 root root 3446444 2008-04-12 22:43 libgtkmm-2.4.so.1.0.30
-rwxr-xr-x 1 root root 24160 2008-09-20 19:23 libgtksharpglue-2.so
lrwxrwxrwx 1 root root 29 2010-06-07 17:50 libgtksourceview-2.0.so.0 -> libgtksourceview-2.0.so.0.0.0
-rwxr-xr-x 1 root root 264908 2008-07-02 01:00 libgtksourceview-2.0.so.0.0.0
lrwxrwxrwx 1 root root 20 2010-06-04 02:36 libgtkspell.so.0 -> libgtkspell.so.0.0.0
-rwxr-xr-x 1 root root 21540 2008-02-10 14:29 libgtkspell.so.0.0.0
lrwxrwxrwx 1 root root 27 2010-06-07 18:23 libgtk-x11-2.0.so -> libgtk-x11-2.0.so.0.1200.12
lrwxrwxrwx 1 root root 27 2010-06-07 17:47 libgtk-x11-2.0.so.0 -> libgtk-x11-2.0.so.0.1200.12
-rwxr-xr-x 1 root root 4233032 2008-11-21 19:06 libgtk-x11-2.0.so.0.1200.12

3. Checking the presence of libwxGTK library
---------------------------------------
A. Download source if not installed or no yum rpm package available.

[q.yang@localhost ~]$ cd devel/
[q.yang@localhost devel]$ ll
-rw-rw-r-- 1 q.yang q.yang 13078779 2010-07-21 16:27 wxGTK-2.8.11.tar.gz

[q.yang@localhost devel]$ tar zxf wxGTK-2.8.11.tar.gz
[q.yang@localhost devel]$ cd wxGTK-2.8.11

B. Config, compile and install.

[q.yang@localhost wxGTK-2.8.11]$ mkdir build_gtk2_shared_monolithic_unicode
[q.yang@localhost wxGTK-2.8.11]$ cd build_gtk2_shared_monolithic_unicode/
[q.yang@localhost build_gtk2_shared_monolithic_unicode]$ ../configure --prefix=/opt/wx/2.8 \
> --enable-xrc \
> --enable-monolithic \
> --enable-unicode

......................
..................
config.status: creating contrib/src/net/Makefile
config.status: creating lib/wx/include/gtk2-unicode-release-2.8/wx/setup.h
config.status: executing wx-config commands

Configured wxWidgets 2.8.11 for `i686-pc-linux-gnu'

Which GUI toolkit should wxWidgets use? GTK+ 2 with support for gnomeprint
Should wxWidgets be compiled into single library? yes
Should wxWidgets be compiled in debug mode? no
Should wxWidgets be linked as a shared library? yes
Should wxWidgets be compiled in Unicode mode? yes
What level of wxWidgets compatibility should be enabled?
wxWidgets 2.4 no
wxWidgets 2.6 yes
Which libraries should wxWidgets use?
jpeg sys
png sys
regex builtin
tiff sys
zlib sys
odbc no
expat sys
libmspack no
sdl no


[q.yang@localhost build_gtk2_shared_monolithic_unicode]$ make
[root@localhost build_gtk2_shared_monolithic_unicode]# make install
...................................................................
...................................................................
if test ! -d /opt/wx/2.8/include/wx-2.8/`dirname $f` ; then \
/usr/bin/install -c -d /opt/wx/2.8/include/wx-2.8/`dirname $f`; \
fi; \
/usr/bin/install -c -m 644 ../include/$f /opt/wx/2.8/include/wx-2.8/$f; \
done

------------------------------------------------------

The installation of wxWidgets is finished. On certain
platforms (e.g. Linux) you'll now have to run ldconfig
if you installed a shared library and also modify the
LD_LIBRARY_PATH (or equivalent) environment variable.

wxWidgets comes with no guarantees and doesn't claim
to be suitable for any purpose.

Read the wxWidgets Licence on licencing conditions.

------------------------------------------------------

C. Added /opt/wx/2.8/bin into $PATH

[q.yang@localhost build_gtk2_shared_monolithic_unicode]$ vi ~/.bash_profile
[q.yang@localhost build_gtk2_shared_monolithic_unicode]$ source ~/.bash_profile
[q.yang@localhost build_gtk2_shared_monolithic_unicode]$ echo $PATH
/usr/lib/qt-3.3/bin:/usr/kerberos/bin:/usr/lib/ccache:/usr/local/bin:/bin:/usr/bin:/home/q.yang/bin:/sbin:/usr/sbin:/home/q.yang/j2sdk1.4.2_12/bin:/home/q.yang/j2sdk1.4.2_12/jre/bin:/home/q.yang/eclipse_workspace/MyMacProj/bin:/home/q.yang/bin:/sbin:/usr/sbin:/opt/wx/2.8/bin:/home/q.yang/j2sdk1.4.2_12/bin:/home/q.yang/j2sdk1.4.2_12/jre/bin:/home/q.yang/eclipse_workspace/MyMacProj/bin

D. Some extra changes.

[root@localhost build_gtk2_shared_monolithic_unicode]# vi /etc/ld.so.conf
[root@localhost build_gtk2_shared_monolithic_unicode]# exit
exit
[q.yang@localhost build_gtk2_shared_monolithic_unicode]$ cat /etc/ld.so.conf
include ld.so.conf.d/*.conf
include /opt/wx/2.8/lib

[root@localhost build_gtk2_shared_monolithic_unicode]# ldconfig

[q.yang@localhost build_gtk2_shared_monolithic_unicode]$ wx-config --prefix
/opt/wx/2.8
[q.yang@localhost build_gtk2_shared_monolithic_unicode]$ wx-config --libs
-L/opt/wx/2.8/lib -pthread -lwx_gtk2u-2.8
[q.yang@localhost build_gtk2_shared_monolithic_unicode]$ which wx-config
/opt/wx/2.8/bin/wx-config


4. Getting Code::Blocks sources
---------------------------------------------------------------

[q.yang@localhost devel]$ svn checkout svn://svn.berlios.de/codeblocks/trunk
.....................................
...................................
A trunk/TODO
A trunk/codeblocks.spec.in
A trunk/acinclude.m4
A trunk/codeblocks.plist.in
A trunk/COPYING
A trunk/Makefile.am
A trunk/update_revision.sh
A trunk/NEWS
A trunk/bootstrap
A trunk/codeblocks.pc.in
A trunk/README.debian
Checked out revision 6411.

[q.yang@localhost trunk]$ ./bootstrap
...............................
configure.in:77: error: possibly undefined macro: AM_OPTIONS_WXCONFIG
If this token and others are legitimate, please use m4_pattern_allow.
See the Autoconf documentation.
configure.in:78: error: possibly undefined macro: AM_PATH_WXCONFIG

[root@localhost trunk]# echo `wx-config --prefix`/share/aclocal >> /usr/share/aclocal/dirlist

[q.yang@localhost trunk]$ ./bootstrap THIS TIME IT'LL HAVE NO ERROR.

5. Install code:block
---------------------------------------
[q.yang@localhost trunk]$ ./configure ALL INSTALLATION WILL BE USING DEFAULT SETTING.

[q.yang@localhost trunk]$./configure --prefix=/opt/codeblocks20100721-svn --with-contrib-plugins=all
......................................
config.status: creating src/include/config.h
config.status: src/include/config.h is unchanged
config.status: executing depfiles commands
*************************************************
* Code::Blocks source tree has been configured. *
*************************************************
You can now build Code::Blocks by issuing 'make'.
When the build is complete, become root and install
it by issuing 'make install'.

[q.yang@localhost trunk]$ make

........error occurred during make ..... in particular in /plug-in/...


[root@localhost trunk]# make install

.............................

PATH="$PATH:/sbin" ldconfig -n /opt/codeblocks20100721-svn/lib/wxSmithContribItems
----------------------------------------------------------------------
Libraries have been installed in:
/opt/codeblocks20100721-svn/lib/wxSmithContribItems

If you ever happen to want to link against installed libraries
in a given directory, LIBDIR, you must either use libtool, and
specify the full pathname of the library, or use the `-LLIBDIR'
flag during linking and do at least one of the following:
- add LIBDIR to the `LD_LIBRARY_PATH' environment variable
during execution
- add LIBDIR to the `LD_RUN_PATH' environment variable
during linking
- use the `-Wl,--rpath -Wl,LIBDIR' linker flag
- have your system administrator add LIBDIR to `/etc/ld.so.conf'

See any operating system documentation about shared libraries for
more information, such as the ld(1) and ld.so(8) manual pages.
----------------------------------------------------------------------
....................................

CParser.cpp:111: error: 'preprocessor' was not declared in this scope
CParser.cpp:115: error: 'comment' was not declared in this scope
CParser.cpp:119: error: 'special_w' was not declared in this scope
CParser.cpp:145: error: 'parse_info' was not declared in this scope
CParser.cpp:145: error: expected primary-expression before 'const'
CParser.cpp:145: error: expected `;' before 'const'
CParser.cpp:151: error: 'info' was not declared in this scope
make[4]: *** [CParser.lo] Error 1
make[4]: Leaving directory `/home/q.yang/devel/trunk/src/plugins/contrib/NassiShneiderman'
make[3]: *** [install-recursive] Error 1
make[3]: Leaving directory `/home/q.yang/devel/trunk/src/plugins/contrib'
make[2]: *** [install-recursive] Error 1
make[2]: Leaving directory `/home/q.yang/devel/trunk/src/plugins'
make[1]: *** [install-recursive] Error 1
make[1]: Leaving directory `/home/q.yang/devel/trunk/src'
make: *** [install-recursive] Error 1



6. Last thing to do before running code:blocks
-------------------------------------------------------
[q.yang@localhost trunk]$ /opt/codeblocks20100721-svn/bin/codeblocks
/opt/codeblocks20100721-svn/bin/codeblocks: error while loading shared libraries: libwx_gtk2u-2.8.so.0: cannot open shared object file: No such file or directory

[root@localhost trunk]# vi /etc/ld.so.conf
[root@localhost trunk]# ldconfig

[q.yang@localhost trunk]$ cat /etc/ld.so.conf
include ld.so.conf.d/*.conf
/opt/wx/2.8/lib
/opt/codeblocks20100721-svn/lib


7. DONE ---- Code::blocks can be started now
--------------------------------------------------
[q.yang@localhost trunk]$ /opt/codeblocks20100721-svn/bin/codeblocks
Initialize EditColourSet .....
Initialize EditColourSet: done.



8. Set Compiler to use LTIB arm tool Chain
----------------------------------------------
Code:Blocks svn build rev 6411

1. navigate to home/username and edit .bash_profile

LTIB_TOOL_CHAIN_FREESCALE_PATH=/opt/freescale/usr/local/gcc-4.1.2-glibc-2.5-nptl-3/arm-none-linux-gnueabi

PATH=$PATH:$HOME/bin:/sbin:/usr/sbin:/opt/wx/2.8/bin:$LTIB_TOOL_CHAIN_FREESCALE_PATH:/opt/codeblocks20100721-svn/bin/

2. $source .bash_profile
3. Go to Settings/Compiler and debugger and in Select compiler find GNU
ARM GCC compiler, select it and Set as default or it reverts to GNU GCC
Compiler everytime you start a new project
4. in the tab Toolchain executables (make sure this window is maximised or
you don’t see this tab!) and Compiler’s installation directory put
/opt/freescale/usr/local/gcc-4.1.2-glibc-2.5-nptl-3/arm-none-linux-gnueabi (bin not necessary)
5. now in the Program Files window:

manually select and map the c/c++ compiler, linker with actual 'commands'

C compiler arm-none-linux-gnueabi-gcc-4.1.2
C++ compiler arm-none-linux-gnueabi-g++
Linker for dynamic libs arm-none-linux-gnueabi-gcc-g++
Linker for static libs arm-none-linux-gnueabi-ar
Debugger gdb (Make sure [*] cross gdb (runs on build machine) ticked in LTIB, so that u can find gdb in ~/lpc3250/ltib-qs/bin/ )
make program make

Then add /usr/bin/ into addtional path so that compiler can find where is 'make' command.




Successfully passed GDB debugging after adding and enabling [*]cross gdb Tool Chain in LTIB, and configured it in Code blocks(/ltib-qs/bin/gdb). Here's the screen shot when using LTIB tool chain for debugging.





Successfully passed GDB debugging after intalling CodeSourcery Tool Chain, and configured it in Code blocks. Here's the screen shot when using code sourcery.






To make it easy to identify, you can rename the compiler


FW: Six Popular IDEs For Developing Software in C/C++ on Windows Platform

http://beans.seartipy.com/2006/12/31/six-popular-ides-for-developing-software-in-cc-on-windows-platform/


Six Popular IDEs For Developing Software in C/C++ on Windows Platform

Sunday, July 18, 2010

MOVE /HOME DIRECTORY TO 2ND HARD DISK

MOVE /HOME DIRECTORY TO 2ND HARD DISK
-----------------------------------------------
#mkdir -p /mnt/200GData
#mount /dev/sdb5 /mnt/200GData

#cp -rpf /home/* /mnt/200GData transfer current home to 2nd hard drive
#umount /mnt/200GData

#vi /etc/fstab add two lines /dev/sdb5, /dev/sdb1

[root@localhost ltib-qs]# cat /etc/fstab
/dev/VolGroup00/LogVol00 / ext3 defaults 1 1
UUID=db85ce6b-b0e2-4f47-ad07-011f425bd92c /boot ext3 defaults 1 2
tmpfs /dev/shm tmpfs defaults 0 0
devpts /dev/pts devpts gid=5,mode=620 0 0
sysfs /sys sysfs defaults 0 0
proc /proc proc defaults 0 0
/dev/VolGroup00/LogVol01 swap swap defaults 0 0
/dev/sdb5 /home ext2 defaults 0 0
/dev/sdb1 /opt ext2 defaults 0 0


#mount -a

Now the /home is on 2nd drive /dev/sdb5, if #umount /home, /home is on original 1st drive.

Ref [1] http://forums.fedoraforum.org/showthread.php?t=179402
[2] http://www.ibm.com/developerworks/library/l-partplan.html


SELinx warning after move /home to seperate hard drive
----------------------------------------------------------------
SELinux permission checks on files labeled file_t are being denied. file_t is
the context the SELinux kernel gives to files that do not have a label. This
indicates a serious labeling problem. No files on an SELinux box should ever be
labeled file_t. If you have just added a new disk drive to the system you can
relabel it using the restorecon command. Otherwise you should relabel the entire
files system.

[root@localhost /]# restorecon -r /home/
restorecon: unable to stat file /home/q.yang/.gvfs: Permission denied
[root@localhost /]# restorecon -r /opt/

Wednesday, July 14, 2010

Build Linux Kernel from Source in Fedora 9

Ref [1] http://fedoraproject.org/wiki/Docs/CustomKernel#Configure_Kernel_Options
Ref [2] http://www.howtoforge.com/kernel_compilation_fedora

GET KERNEL SOURCE CODE BY EITHER YUM OR DIRECTLY FROM HTTP SITE
--------------------------------------------------------------

WHERE IS KERNEL SOURCE CODE IN FEDORA 9
----------------------------------------------------

JUST GET HEADER FILES OF KERNEL (enough to compile some extra modules)
-----------------------------------------------------------------------
kernel-devel-2.6.25-14.fc9.i686.rpm only gives you the header files of linux kernel
[root@localhost sierra_drv_1.7.32]# yum install kernel-devel-2.6.25-14.fc9.i686

DIRECT DOWNLOAD KERNEL RPM
--------------------------------
cd /usr/src
wget http://download.fedora.redhat.com/pub/fedora/linux/core/9/source/SRPMS/kernel-2.6.25-14.fc9.src.rpm
rpm -ivh kernel-2.6.18-1.2798.fc6.src.rpm

NOTE: .src.rpm is no longer availabe in above path.


GET KERNEL RPM VIA YUM
-----------------------------------
yum install rpmdevtools yum-utils
yumdownloader --destdir /home/q.yang/Download/LinuxSrcRpm2.6.27/ --source kernel
[q.yang@localhost ~]$ rpmdev-setuptree
[q.yang@localhost ~]$ su -c 'yum-builddep Download/LinuxSrcRpm2.6.27/kernel-2.6.27.25-78.2.56.fc9.src.rpm'

[q.yang@localhost ~]$ rpm -ivh /home/q.yang/Download/LinuxSrcRpm2.6.27/kernel-2.6.27.25-78.2.56.fc9.src.rpm

[q.yang@localhost SPECS]$ rpmbuild -bp --target=i686 kernel.spec

BUILD KERNEL ON USER SPACE
-----------------------------
1. Prepare a RPM package building environment in your home directory. Run the following command:
[q.yang@localhost ~]$ rpmdev-setuptree
[q.yang@localhost ~]$ ll
total 40
drwxr-xr-x 2 q.yang q.yang 4096 2010-06-03 17:23 Desktop
drwxr-xr-x 4 q.yang q.yang 4096 2010-07-06 10:54 Documents
drwxr-xr-x 4 q.yang q.yang 4096 2010-07-06 09:54 Download
drwxrwxr-x 3 q.yang q.yang 4096 2010-06-10 11:37 lpc3250
drwxr-xr-x 2 q.yang q.yang 4096 2010-06-03 17:13 Music
drwxr-xr-x 2 q.yang q.yang 4096 2010-06-03 17:13 Pictures
drwxr-xr-x 2 q.yang q.yang 4096 2010-06-03 17:13 Public
drwxrwxr-x 7 q.yang q.yang 4096 2010-07-06 10:55 rpmbuild NEW DIRECTORY
drwxr-xr-x 2 q.yang q.yang 4096 2010-06-03 17:13 Templates
drwxr-xr-x 2 q.yang q.yang 4096 2010-06-03 17:13 Videos

rpmbuild directory automatically only locate in user's home directory (i.e., ~)
and a new .rpmmacros will appear

NOTE: pls run 'rpmdev-setuptree' command with q.yang user instead of root. It will impact where the target directory of 'rpm -ivh ....' command.


2. Install build dependencies for the kernel source with the yum-builddep command (root is required to install these packages):
[q.yang@localhost ~]$ su -c 'yum-builddep Download/LinuxSrcRpm2.6.27/kernel-2.6.27.25-78.2.56.fc9.src.rpm'
Password:
Loaded plugins: refresh-packagekit
module-init-tools-3.4-13.fc9.i386
patch-2.5.4-35.fc9.i386
bash-3.2-23.fc9.i386
coreutils-6.10-35.fc9.i386
2:tar-1.19-6.fc9.i386
bzip2-1.0.5-2.fc9.i386
1:findutils-4.2.33-3.fc9.i386
gzip-1.3.12-6.fc9.i386
m4-1.4.10-3.fc9.i386
4:perl-5.10.0-68.fc9.i386
1:make-3.81-12.fc9.i386
diffutils-2.8.1-21.fc9.i386
gawk-3.1.5-17.fc9.i386
gcc-4.3.0-8.i386
binutils-2.18.50.0.6-7.fc9.i386
redhat-rpm-config-9.0.2-1.fc9.noarch
rpm-build-4.4.2.3-3.fc9.i386
No uninstalled build requires

3. Install kernel-.src.rpm with the following command
rpm -ivh /home/q.yang/Download/LinuxSrcRpm2.6.27/kernel-2.6.27.25-78.2.56.fc9.src.rpm

New installation use:
[q.yang@localhost ~]$ rpm -ivh /home/q.yang/Download/LinuxSrcRpm2.6.27/kernel-2.6.27.25-78.2.56.fc9.src.rpm

To just update the installation use:
[q.yang@localhost ~]$ rpm -Uvh Download/LinuxSrcRpm2.6.27/kernel-2.6.27.25-78.2.56.fc9.src.rpm

1:kernel warning: user mockbuild does not exist - using root
warning: group mockbuild does not exist - using root
warning: user mockbuild does not exist - using root
warning: group mockbuild does not exist - using root

( Afterwards, new files appear under path : /home/q.yang/rpmbuild/SOURCES/ )

4. This step expands all of the source code files for the kernel. This is required to view the code, edit the code, or to generate a patch.
Prepare the kernel source tree using the following commands:

[q.yang@localhost SPECS]$ rpmbuild -bp --target=i686 kernel.spec

(
Afterwards, you will see all source codes and new directories under path /BUILD/:

|-- BUILD
| `-- kernel-2.6.27
| |-- linux-2.6.27.i686
| `-- vanilla-2.6.27


vanilla-2.6.27/drivers/rtc/rtc-sysfs.c
..........................
vanilla-2.6.27/drivers/rtc/rtc-bfin.c
................................
vanilla-2.6.27/drivers/rtc/rtc-sh.c
vanilla-2.6.27/drivers/watchdog/alim1535_wdt.c
....................................
vanilla-2.6.27/drivers/watchdog/pcwd_pci.c
vanilla-2.6.27/drivers/watchdog/s3c2410_wdt.c


linux-2.6.27.i686/drivers/rtc/rtc-sysfs.c
..........................
linux-2.6.27.i686/drivers/rtc/rtc-bfin.c
................................
linux-2.6.27.i686/drivers/rtc/rtc-sh.c
linux-2.6.27.i686/drivers/watchdog/alim1535_wdt.c
....................................
linux-2.6.27.i686/drivers/watchdog/pcwd_pci.c
linux-2.6.27.i686/drivers/watchdog/s3c2410_wdt.c



5. Do a source code copy if need to generate kernel patch.

[q.yang@localhost ~]$ cp -r ~/rpmbuild/BUILD/kernel-2.6.27/linux-2.6.27.i686 ~/rpmbuild/BUILD/kernel-2.6.27.orig
[q.yang@localhost ~]$ cp -al ~/rpmbuild/BUILD/kernel-2.6.27.orig/ ~/rpmbuild/BUILD/kernel-2.6.27.new

6. Config customized kernel.

[q.yang@localhost linux-2.6.27.i686]$ pwd
/home/q.yang/rpmbuild/BUILD/kernel-2.6.27/linux-2.6.27.i686
[q.yang@localhost linux-2.6.27.i686]$ make menuconfig
HOSTCC scripts/kconfig/lxdialog/checklist.o
HOSTCC scripts/kconfig/lxdialog/inputbox.o
HOSTCC scripts/kconfig/lxdialog/menubox.o
HOSTCC scripts/kconfig/lxdialog/textbox.o
HOSTCC scripts/kconfig/lxdialog/util.o
HOSTCC scripts/kconfig/lxdialog/yesno.o
HOSTCC scripts/kconfig/mconf.o
HOSTLD scripts/kconfig/mconf
scripts/kconfig/mconf arch/x86/Kconfig
#
# configuration written to .config
#


*** End of Linux kernel configuration.
*** Execute 'make' to build the kernel or try 'make help'.


7. Edit .config and copy to /rpmbuild/SOURCE
Add a new line to the top of the config file that contains the hardware platform the kernel is built for (the output of uname -i).
[q.yang@localhost linux-2.6.27.i686]$ vi .config
Added '# i386' in the first line of .config

[q.yang@localhost linux-2.6.27.i686]$ cp .config ~/rpmbuild/SOURCES/config-i686

===Following steps will Prepare Build Files======

8. Edit /rpmbuild/SPECS/kernel.spec
[q.yang@localhost linux-2.6.27.i686]$ cd ~/rpmbuild/SPECS/
[q.yang@localhost SPECS]$ vi kernel.spec

%define buildid .gsncommsdev

9. If you generated a patch, add the patch to the kernel.spec file, preferably at the end of all the existing patches and clearly commented.

The patch then needs to be applied in the patch application section of the spec file. Again, at the end of the existing patch applications and clearly commented.

===Following steps will build the new kernel=============

10.
To build all kernel flavors:
[q.yang@localhost SPECS]$ rpmbuild -bb --target=i686 kernel.spec

= To disable specific kernel flavors from the build (for a faster build):
rpmbuild -bb --without

Wednesday, June 9, 2010

Q and A Fedora 9

# Make pdf document error.
------------------------------------------------
[q.yang@localhost DocBook]$ make pdfdocs
make: *** No rule to make target `/scripts/kernel-doc', needed by `/wanbook.xml'. Stop.

[q.yang@localhost linux-2.6.27.8]$ make pdfdocs
HOSTCC scripts/basic/fixdep
HOSTCC scripts/basic/docproc
DOCPROC Documentation/DocBook/wanbook.xml
PDF Documentation/DocBook/wanbook.pdf
*** You have to install docbook-utils or xmlto ***
make[1]: *** [Documentation/DocBook/wanbook.pdf] Error 1
make: *** [pdfdocs] Error 2
[q.yang@localhost linux-2.6.27.8]$ yum install docbook-utils
[root@localhost linux-2.6.27.8]# yum install xmlto

SAMBA Setting - Fedora 9 / 20

1. [root@localhost usb]# yum install system-config-samba
2. [root@localhost usb]# system-config-samba

addShare->basic (directory,sharename,description,writable&visible)
->Access (only allow access to specific user)

[root@localhost usb]# vi /etc/samba/smb.conf can see the changes made by 'system-config-samba'.

3. [root@localhost usb]# system-config-firewall
4. [root@localhost usb]# smbpasswd -a q.yang
New SMB password:
Retype new SMB password:
Added user q.yang.

this is doing something that also can be done in
'[root@localhost usb]# system-config-user'
5. [root@localhost usb]# system-config-services

enable smb service so that smb auto start after reboot
This can also be done via command line:
[root@localhost usb]# chkconfig smb on

6. [root@localhost usb]# service smb restart
Shutting down SMB services: [ OK ]
Starting SMB services: [ OK ]

7. check samba service

[root@localhost usb]# smbclient -L localhost
Enter q.yang's password:
Domain=[LOCALHOST] OS=[Unix] Server=[Samba 3.2.11-0.28.fc9]

Sharename Type Comment
--------- ---- -------
Fedora9Samba Disk Quentin's Linux Box
IPC$ IPC IPC Service (Samba Server Version 3.2.11-0.28.fc9)
q.yang Disk Home Directories
Domain=[LOCALHOST] OS=[Unix] Server=[Samba 3.2.11-0.28.fc9]

Server Comment
--------- -------

Workgroup Master
--------- -------
GRIDSENSE ENG-R50E
MYGROUP LOCALHOST


8. If samba not accessible from another PC, check firewall
In fedora20
#firewall-config  make sure to tick 'samaba' service


=========== finished samba setting up to this point============

=== validate it from windows ================
map network device

\\10.10.20.70\Fedora9Samba\

You will be asked user name and samba password.






[root@localhost usb]# yum install system-config-samba
Loaded plugins: refresh-packagekit
updates-newkey | 3.4 kB 00:00
fedora | 2.4 kB 00:00
http://archive.kernel.org/fedora-archive/fedora/linux/updates/9/i386/repodata/repomd.xml: [Errno 14] HTTP Error 404: Not Found
Trying other mirror.
updates | 2.6 kB 00:00
Setting up Install Process
Parsing package install arguments
Resolving Dependencies
--> Running transaction check
---> Package system-config-samba.noarch 0:1.2.63-1.fc9 set to be updated
--> Processing Dependency: samba for package: system-config-samba
--> Running transaction check
---> Package samba.i386 0:3.2.11-0.28.fc9 set to be updated
--> Finished Dependency Resolution

Dependencies Resolved

======================================================================================
Package Arch Version Repository Size
======================================================================================
Installing:
system-config-samba noarch 1.2.63-1.fc9 fedora 413 k
Installing for dependencies:
samba i386 3.2.11-0.28.fc9 updates-newkey 3.9 M

Transaction Summary
======================================================================================
Install 2 Package(s)
Update 0 Package(s)
Remove 0 Package(s)

Total download size: 4.3 M
Is this ok [y/N]: y
Downloading Packages:
(1/2): system-config-samba-1.2.63-1.fc9.noarch.rpm | 413 kB 00:03
(2/2): samba-3.2.11-0.28.fc9.i386.rpm | 3.9 MB 01:50
-----------------------------------------------------------------------------------------------
Total 38 kB/s | 4.3 MB 01:56
Running rpm_check_debug
Running Transaction Test
Finished Transaction Test
Transaction Test Succeeded
Running Transaction
Installing : samba 1/2
Installing : system-config-samba 2/2

Installed:
system-config-samba.noarch 0:1.2.63-1.fc9

Dependency Installed:
samba.i386 0:3.2.11-0.28.fc9

Complete!


[root@fedora20 samba]# yum install system-config-samba
[root@fedora20 samba]# rpm -qa |grep samba
samba-4.1.6-1.fc20.x86_64
samba-common-4.1.6-1.fc20.x86_64
system-config-samba-1.2.100-2.fc20.noarch
samba-client-4.1.6-1.fc20.x86_64
samba-libs-4.1.6-1.fc20.x86_64
#system-config-samba
Use GUI to add samba user; then choose /home/q.yang as samba shared folder and only specific user access.
smb.conf will be changed after GUI change
[Fedora20Home]
comment = Quentin's Fedora20 home
path = /home/q.yang
read only = no
; browseable = yes
valid users = q.yang
#systemctl enable smb.service
#systemctl restart  smb.service
[root@fedora20 samba]# systemctl |grep smb
smb.service         loaded active running   Samba SMB Daemon

[q.yang@fedora20 samba]$ smbclient -L localhost
Enter q.yang's password:
Domain=[MYGROUP] OS=[Unix] Server=[Samba 4.1.6]

Sharename       Type      Comment
---------       ----      -------
Fedora20Home    Disk      Quentin's Fedora20 home
IPC$            IPC       IPC Service (Samba Server Version 4.1.6)
q.yang          Disk      Home Directories
Domain=[MYGROUP] OS=[Unix] Server=[Samba 4.1.6]

Server               Comment
---------            -------

Workgroup            Master
---------            -------