2012年11月21日 星期三

install arch64 for hard driver

以前弄ubuntu的似乎是比較簡單,arch設定有點不同,今天終於弄成功了,很棒!



  • 另外得知pacstrap、genfstab、arch-chroot,只要安裝arch-install-scripts就能執行了,這樣應該能在原有系統進行安裝囉。







我們要先取得存放裝置的_id與iso檔案的archisolabel



  • _id

sudo blkid|grep total
/dev/sdb2: LABEL="total" UUID="b7d0b427-8963-4e09-a5cd-93d703b9ff9f" TYPE="ext4"


  • archisolabel

iso-info /mnt/total/iso/arch/archlinux-2012.11.01-dual.iso
iso-info version 0.83 x86_64-unknown-linux-gnu

ISO 9660 image: /mnt/total/iso/arch/archlinux-2012.11.01-dual.iso

Application: ARCH LINUX LIVE/RESCUE CD

Preparer : PREPARED BY MKARCHISO

Publisher : ARCH LINUX

Volume : ARCH_201211


完成後新建一個檔案,內容請自行修改。

sudo vim /etc/grub.d/60_Arch


#!/bin/bash
exec tail -n +3 $0
menuentry "Archlinux-2012.11.01 uuid" {
_id=b7d0b427-8963-4e09-a5cd-93d703b9ff9f
insmod loopback
insmod iso9660
search --fs-uuid --no-floppy --set=root $_id
set isofile="/iso/arch/archlinux-2012.11.01-dual.iso"
loopback loop $isofile
linux (loop)/arch/boot/x86_64/vmlinuz archisolabel=ARCH_201211 img_dev=/dev/disk/by-uuid/$_id img_loop=$isofile
initrd (loop)/arch/boot/x86_64/archiso.img
}


再來就是寫入grub.cfg,最後重新開機測試囉

sudo chmod +x /etc/grub.d/60_Arch
sudo grub-mkconfig -o /boot/grub/grub.cfg


附上Installation Guide (正體中文)



參考資料: GRUB2 (正體中文)

2012年11月7日 星期三

Install Nvidia Beta Driver On Arch Linux

我沒有實際在Linux試過遊戲效能,只是看到新東西就想裝一下,加上安裝出現下面那個錯誤就順便記錄一下怎麼處理。



NVIDIA 推出全新 GeForce R310 驅動程式 大幅提升 Linux 平台遊戲效能

Valve 公司行銷副總裁 Doug Lombardi 表示:「 NVIDIA (輝達) 今天釋出的驅動程式,可讓遊戲在 Linux 平台上全面提升效能。 NVIDIA (輝達) 在遊戲界的領導地位毋庸置疑,並率先與我們和其他遊戲開發商一起開發了 R310 驅動程式,這是遊戲玩家在 Linux 玩遊戲的一大福音,這無疑是一個讓 Linux 遊戲快速大幅提升效能的好方法。」


NVIDIA R310驅動性能翻番-Steam,Linux,NVIDIA,R310,310.14-驅動之家

所謂的遊戲性能翻番,NVIDIA是這麼解釋的:在基於Core i7-3930K 3.2GHz處理器、8GB內存、GeForce GTX 680顯卡、Ubuntu 12.04 32位系統的平台上,《Left 4 Dead 2》遊戲使用304.51驅動的幀率為142.7FPS,換成310.14則可以跑出301.4FPS,提升了1.1倍。
根據NVIDIA的說法,310.14驅動適合使用GeForce GTX 600系列最新顯卡的Linux玩家,GeForce 8800 GT以上的也可以更新但效果沒那麼明顯。






nvidia-beta-all適用於liunx、linux-ck(我有裝這兩個核心),linux-uksm、linux-uksm-ck或許可用(目前沒裝沒試)。



For hava yaourt

yaourt -S nvidia-beta-all


For no have yaourt

先安裝nvidia-utils-beta後安裝nvidia-beta-all



Error message

如果安裝過程出現以下訊息停止安裝,請安裝linux-headers在重新安裝驅動程式即可。

If you are using a Linux 2.4 kernel, please make sure you either have configured kernel sources matching your kernel or the correct set of kernel headers installed on your system.



If you are using a Linux 2.6 kernel, please make sure you have configured kernel sources matching your kernel installed on your system. If you specified a separate output directory using either the “KBUILD_OUTPUT” or the “O” KBUILD parameter, make sure to specify this directory with the SYSOUT environment variable or with the equivalent nvidia-installer mmand line option.



Depending on where and how the kernel sources (or the kernel headers) were installed, you may need to specify their location with the SYSSRC environment variable or the equivalent nvidia-installer command line option.


初次安裝官方驅動程式請執行此指令產生新的xorg.conf設定檔



sudo nvidia-xconfig




參考資料:NVIDIA - ArchWiki

2012年11月6日 星期二

Fix【新版】定時調整音量

這裡是定時調整音量新版,說明請看舊版,這次新加入在晚上自動將音量調小前儲存原本音量,過了設定的週期或重新開機時設回原本音量。





Fix Note:


  1. 取得音量錯誤,無法正確儲存音量。

  2. 比對時間錯誤。


Add Note:


  • 睡眠週期設定:

    _SleepOn=音量調整的開始時間 

    _SleepOff=音量調整的結束時間 

    _SleepVolume=調整音量為此設定值 





Default Useing:



當22點(晚上10點)先儲存你目前音量,而後從22點(晚上10點)至9點(早上9點)音量調整為85%,於10點後(含)恢復先前所儲存的音量設定。



P.S 設定1點到9點前面不用加0,也就是3點就寫成3不要寫成03,這樣無法比對時間。



#!/bin/bash
_Hour=$(date "+%-H")
_Sound=/var/tmp/sound
_SleepOn=22
_SleepOff=9
_SleepVolume=85%
_SAVE(){
_Mono=$(amixer get Master | grep "Mono:" | awk '{print $4}' | tr -d '[]')
_Front=$(amixer get Master | grep "Front Left:" | awk '{print $5}' | tr -d '[]')
if [ "x${_Front}" != "x" ]
then
_Volume=${_Front}
elif [ "x${_Mono}" != "x" ]
then
_Volume=${_Mono}
else
echo "Unknown Volume"
exit
fi
echo "_Default=${_Volume}" >> ${_Sound}
echo "Save Volume: ${_Volume}"
}

echo "The time now: ${_Hour} "
if [[ -f ${_Sound} && ${_Hour} -le ${_SleepOff} || ${_Hour} -ge ${_SleepOn} ]]
then
echo "Now is Sleep Time Change Volume: ${_SleepVolume}"
amixer sset Master ${_SleepVolume} 1>/dev/null
elif [[ ${_Hour} -le ${_SleepOff} || ${_Hour} -ge ${_SleepOn} ]]
then
_SAVE
echo "Now is Sleep Time Change Volume: ${_SleepVolume}"
amixer sset Master ${_SleepVolume} 1>/dev/null
elif [[ -f ${_Sound} && ${_Hour} -gt ${_SleepOff} && ${_Hour} -lt ${_SleepOn} ]]
then
. ${_Sound}
echo "Now the end of the sleep time to restore the volume: ${_Default}"
amixer sset Master ${_Default} 1>/dev/null
rm -f ${_Sound}
fi