archlinux  設定


<< トッ プページへ

■設定の環境

# uname -a
Linux arch 3.17.6-1-ARCH #1 SMP PREEMPT Sun Dec 7 23:43:32 UTC 2014 x86_64 GNU/Linux

無線LANカードは装着済みでモジュールはロードされている事を前提として説明しています。

■作業

1.日本語表示環境の設定
必要なlocaleを有効にする 現状のlocale を表示するには
# locale -a

/etc/locale.gen の次の行をアンコメント
ja_JP.UTF-8 UTF-8

システムをアップデートします
# locale-gen

面倒なのでシステム全体をja_JP.UTF-8 UTF-8とする。
# vi /etc/locale.conf

# 日本語の UTF-8 を有効にする
LANG="ja_JP.UTF-8"

# デフォルトのソート順を保つ (例えば '.' で始まるファイルは
# ディレクトリのリストで最初に並ぶ)
LC_COLLATE="C"

# 短い月日表示を YYYY-MM-DD に設定 ("date +%c" でテスト)
LC_TIME="ja_JP.UTF-8"

2.無線LANに必要なパッケージをインストールする。
# pacman -S wpa_supplicant

雛形の設定ファイルをコピーして編集する。
# cp /etc/netctl/examples/wireless-wpa-static

cat wireless-wpa-static
Description='WPA encrypted wireless connection using a static IP'
Interface=wlp4s0
Connection=wireless
Security=wpa
ESSID='Buffalo-A-CA80'
Key='xxxxxxxxxxxx'
IP=static
Address='192.168.11.12/24'
Gateway='192.168.11.1'
DNS=('192.168.11.1')
# Uncomment this if your ssid is hidden
#Hidden=yes


設定ファイルを編集する。
$ vi /etc/wpa_supplicant/wpa_supplicant.conf

ctrl_interface=/run/wpa_supplicant
update_config=1

network={
    ssid="Buffalo-G-CA80"
    psk="xxxxxxxxxxxxx"
}


コマンドで無線LANデバイス名を確認して起動させる。
# ip a

---------------省略--------------
5: wlp4s0: <BROADCAST,MULTICAST,UP,LOWER_UP>
mtu 1500 qdisc mq state UP group default qlen 1000
---------------省略--------------

起動してみます。
# wpa_supplicant -B -i interface -c /etc/wpa_supplicant/wpa_supplicant.conf

OKであれば設定します。
# netctl enable wireless-wpa-static
# systemctl enable wpa_supplicant@wlp4s0
# dhcpcd wlp4s0
 

3.MPD 自動起動
# vi /etc/rc.local
 
#!/bin/bash
mpd /root/mpd.conf

# chmod +x /etc/rc.local

# vi /usr/lib/systemd/system/rc-local.service
--------------------------------------------------
[Unit]
Description=/etc/rc.local Compatibility
Wants=network.target

[Service]
Type=oneshot
ExecStart=/etc/rc.local
TimeoutSec=0
#StandardInput=tty
RemainAfterExit=yes

[Install]
WantedBy=multi-user.target
-------------------------------------------------

# ln -s /usr/lib/systemd/system/rc-local.service /etc/systemd/system/multi-user.target.wants/
# systemctl --system daemon-reload
# systemctl enable rc-local.service

4. 操作性の向上(キー操作を減らす)

$ cat .bashrc

# .bashrc

# User specific aliases and functions
#alias stop='shutdown -h now'
alias stop='poweroff'
#alias rm='rm -f'
alias m='more'
alias h='history'
alias la='ls -a'
alias ll='ls -l'
#alias hg='h | grep '
alias lr='ls -lrt'
alias lld='ls -lrt | grep ^d'
alias df='df -h'
alias ipa='ip a | grep 192'

#other
#. $HOME/hostcolor.sh
. $HOME/.hostcolor.sh

#for mpd
#export MPD_HOST=192.168.11.12
#export MPD_HOST=127.0.0.1

#######################################################
hig() {
if [[ $# -gt 0 ]]; then
history | LC_CTYPE=C grep --color=auto "$@"
else
history 50
fi
}
#######################################################
psg() {
if [[ $# -gt 0 ]]; then
ps auxww | LC_CTYPE=C grep --color=auto "$@"
else
ps aux
fi
}
#######################################################
export LANG=ja_JP.UTF-8
irexec -d .lircrc



参考HP:
https://wiki.archlinux.org/index.php/
WPA_supplicant_%28%E6%97%A5%E6%9C%AC%E8%AA%9E%29

https://wiki.archlinux.org/index.php/
Locale_%28%E6%97%A5%E6%9C%AC%E8%AA%9E%29