Katex

顯示具有 Fedora 標籤的文章。 顯示所有文章
顯示具有 Fedora 標籤的文章。 顯示所有文章

2011年6月23日 星期四

安裝舊Fedora/ kernel

1. download Fedora and install
    http://archives.fedoraproject.org/pub/archive/fedora/linux/core/4/i386/iso/


2. Fedora 裝完, 安裝相關compiler program for kernel rebuilding
    Fedora : Add or Remove Packages : Development


3. download kernel
    http://www.kernel.org/pub/linux/kernel/v2.6/

4. extract kernel to /usr/src/kernels

5. copy config file from /boot and then rebuild kernel
    # make
    # make install
    # make modules
    # make modules_install

2011年6月19日 星期日

Add user to group / 把使用者加入某個 group

Suppose that you want to add the user ( named neo ) into the group ( named vboxusers )
假設你要將使用者 neo 加入群組 vboxusers


virtualbox

http://www.virtualbox.org/wiki/Linux_Downloads

Fedora :

1. download rpm

2. Install rpm 

    (1)  Open the file folder and double click on the rpm file
          打開檔案 folder, 在所下載的檔案上點兩下, 即可安裝

    (2)  Then you can see "Oracle VM VirtualBox" at Applications->System Tools
          在 Applications->System Tools 就能看到 "Oracle VM VirtualBox" 的應用程式


    

2011年5月25日 星期三

2011年1月9日 星期日

[Linux module program] 1. Hello World

編寫 hello.c 如下



##include <linux/module.h>
#include <linux/kernel.h>
#include <linux/init.h>

static int __init hello_init(void)
{
    printk(KERN_INFO "Hello world \n");

    return 0;
}

static void __exit hello_exit(void)
{
    printk(KERN_INFO "Goodbye, world \n");
}

module_init(hello_init);
module_exit(hello_exit);


編寫 Makefile 如下



obj-m += hello.o

all:
        make -C /lib/modules/$(shell uname -r)/build M=$(PWD) modules
clean:
        make -C /lib/modules/$(shell uname -r)/build M=$(PwD) clean


PS: 請注意 make 前面為tab 而非空白

--
編譯前的準備:
1.  安裝所需程式:
     切換身份為 root, 執行
     yum install yum-utils
     yum install rpmdevtools
     yum install redhat-rpm-config
     yum install xmlto asciidoc elfutils-devel binutils-devel python-devel perl perl-ExtUtils-Embed

2.  Fedora 的 kernel source code
     (1) 先用指令 "uname -a" 查看 kernel 版本
           2.6.35.6-45.fc14.i686

     (2) 下載 kernel source rpm 檔
          http://download.fedora.redhat.com/pub/fedora/linux/releases/
          選擇 Fedora 的版本, 如 Fedora 14
          http://download.fedora.redhat.com/pub/fedora/linux/releases/14/Fedora/source/SRPMS/
         檔案:  kernel-2.6.35.6-45.fc14.src.rpm

     (3) 執行指令
          rpm -ivh kernel-2.6.35.6-45.fc14.src.rpm

          過程中會看到訊息:
          warning: user mockbuild does not exist - using root
          warning: group mockbuild does not exist - using root
          可以加入使用者後再執行一次
          su -c "groupadd mockbuild"
          su -c "useradd mockbuild -g mockbuild"

          安裝完後 會在使用者目錄下產生:  ~/rpmbuild
          切換目錄到 " cd ~/rpmbuild/SPEC"
          執行: rpmbuild -bp --target=$(uname -m) kernel.spec

          接著source會產生在BUILD底下, 可以copy 到 /usr/src/kernels 下
          cp -fr ./rpmbuild/BUILD/kernel-2.6.35.fc14/linux-2.6.35.i686 /usr/src/kernels/2.6.35.6-45.fc14.i686

          並確認 /lib/modules/2.6.35.6-45.fc14.i686/build -> ../../../usr/src/kernels/2.6.35.6-45.fc14.i686

    (4) 編譯 kernel 
          cd /usr/src/kernels/2.6.35.6-45.fc14.i686
          make

-- 編譯 Hello world
   在同 helloworld.c / Makefile 目錄下打 make , 出現問題: 
   (1) 缺少了 generated/bounds.h 檔
        可在 kernel source 目錄下執行 "make prepare"
   (2) insmod error : 
        insmod: error inserting 'hello.ko': -1 Invalid module format
        可用 dmesg 查看原因: 
        hello: version magic '2.6.35.6 SMP mod_unload 686 ' should be '2.6.35.6-45.fc14.i686 SMP mod_unload 686 '
        這是因為 module 版本與 kernel 版本不同的關係
        在 kernel source ( ) 的 Makefile 定義了
              VERSION = 2
              PATCHLEVEL = 6 
              SUBLEVEL = 35
              EXTRAVERSION = .6
        可將 EXTRAVERSION = .6 改為 EXTRAVERSION = .6-45.fc14.i686

-- 執行 "insmod hello.ko"
    dmesg : 可以看到 "Hello world"
    執行 "rmmod hello"
    dmesg : 可以看到 "Goodbye, world"
   
        




2010年12月26日 星期日

[Fedora 14] wifi adsl setting

setup PPPOE connection : 設定 PPPOE 連線
    "su" to change to root, and do "pppoe-setup"
    切換為 root, 執行 /usr/sbin/pppoe-setup

---
Enter your Login Name (default root):  輸入 ADSL 帳號


2007年10月23日 星期二

Fedora 7 on Lenovo T61 - screen

畫面修好了, 原來被設成TVOutput, 畫面缺了右邊一角. 修正之後好看多了.

1. Patch Driver
[Ref] http://www.fedoraforum.org/forum/showthread.php?t=159516

Patch Intel Video Driver
sudo yum install xorg-x11-server-sdk
tar zxvf xf86-video-intel-2.0.0.tar.gz
cd xf86-video-intel-2.0.0
./configure
make
sudo make install

2. 設定 /etc/X11/xorg
[Ref] http://carrot.hep.upenn.edu/wiki/doku.php?id=thinkpad:start

加上這一塊
Section "Monitor"
Identifier "TVOutput"
Option "Disable" "true"
EndSection

增加一行Option 在原本的Videocard0 Device
Section "Device"
Identifier "Videocard0"
Driver "intel"
Option "monitor-TV" "TVOutput"
EndSection

OK 啦

2007年10月21日 星期日

Fedora 7 on Lenovo T61 - mms

totem can not play mms...

我加入了Fedora Forum, 找到一篇 ramasees 寫的回覆, 照著安裝之後可以使用. 
看來這個方法可以解決大部分的媒體檔


rpm -ivh http://rpm.livna.org/livna-release-7.rpm
yum -y remove totem*
yum -y install totem-xine
yum -y install rhythmbox
yum -y install libdvdcss
yum -y install xine-lib-extras-nonfree
yum -y install compat-libstdc++-33
下載 http://www.real.com/realcom/R?href=...r10GO LD%2Erpm
rpm -Uvh RealPlayer10GOLD.rpm
下載 http://www1.mplayerhq.hu/MPlayer/re...0061022.tar.bz2
tar -jxvf all-20061022.tar.bz2
su -c ’mkdir -p /usr/local/lib/codecs’
su -c ’cp all-20061022/* /usr/local/lib/codecs’
su -c ’ln -sf /usr/local/lib/codecs /usr/lib/codecs && ln -sf /usr/local/lib/codecs /usr/local/lib/win32 && ln -sf /usr/local/lib/codecs /usr/lib/win32’
yum -y install vlc

Fedora 7 on Lenovo T61 - Sound

公司配發了一台Notebook : Lenovo IBM T61, 心血來潮, 下載了Fedora 7 : 
F-7-i386-DVD.iso, 燒到DVD上, 開始了脫離微軟之路. 

Fedora 的畫面很不錯, 而且有個yum更新程式很不錯. (太久沒碰Linux了)
([Ref] http://linux.vbird.org/linux_server/0450apt.php#yum )
花了一晚自動更新了許多程式之後, 今天很興奮的開始使用.

一開始遇到的是沒有聲音. 後來雖然有聲音, 但麥克風沒有動作, 經過半天的努力與搜尋解法, 
總算可以打skype電話了. 方法記載如下: 

[Ref]http://thinkwiki.org/wiki/Installing_Ubuntu_7.04_%28Feisty_Fawn%29_on_a_ThinkPad_T61#Audio


1. 下載新的ALSA driver
alsa-driver-1.0.15rc3.tar.bz2 
[Download] ftp://ftp.alsa-project.org/pub/driver/
alsa-lib-1.0.15rc3.tar.bz2 
[Download] ftp://ftp.alsa-project.org/pub/lib/
alsa-firmware-1.0.15rc1.tar.bz2
[Download] ftp://ftp.alsa-project.org/pub/firmware/
alsa-utils-1.0.15rc1.tar.bz2
[Download] ftp://ftp.alsa-project.org/pub/utils/

2. update driver
tar jxvf alsa-driver-1.0.15rc3.tar.bz2 
cd alsa-driver-1.0.15rc3
./configure --with-cards=hda-intel
make
sudo make install

3. update lib, firmware, util
tar jxvf [zip file]
cd [directory]
./configure
make
sudo make install

4. alsaconf
in the utility , there is a tool : alsaconf, in directory alsaconf/
make this file executable by ”chmod +x alsaconf”, and run it

5. modify /etc/modprobe.conf, change one line
options snd-hda-intel index=0 to
options snd-hda-intel index=0 model=thinkpad

6. reboot

7. Tune the sound by the Volume Control
(1) Turn on menu by Edit->preference (select all items)
(2) Remember to turn on Mic Boost and raise it
(3) Turn on Capture, Capture1, digital in recording tab
(4) In options , Mix can be chosen in Input source c

熱門文章