# These settings were set by the catalyst build script that automatically
# built this stage.
# Please consult /usr/share/portage/config/make.conf.example for a more
# detailed example.
CFLAGS="-march=corei7 -O2 -pipe"
CXXFLAGS="${CFLAGS}"
MAKEOPTS=-j5
# WARNING: Changing your CHOST is not something that should be done lightly.
# Please consult http://www.gentoo.org/doc/en/change-chost.xml before changing.
CHOST="x86_64-pc-linux-gnu"
# These are the USE flags that were used in addition to what is provided by the
# profile used for building.
VIDEO_CARDS="intel i965"
INPUT_DEVICES="evdev synaptics"
USE="systemd bindist mmx sse sse2 sse3 ssse3"
PORTDIR="/usr/portage"
DISTDIR="${PORTDIR}/distfiles"
PKGDIR="${PORTDIR}/packages"
GENTOO_MIRRORS="http://ftp.iij.ad.jp/pub/linux/gentoo/"
mount -t proc proc /mnt/gentoo/proc
mount --rbind /sys /mnt/gentoo/sys
mount --make-rslave /mnt/gentoo/sys
mount --rbind /dev /mnt/gentoo/dev
mount --make-rslave /mnt/gentoo/dev
chroot /mnt/gentoo /bin/bash
source /etc/profile
特に何も選択しない
echo "Tokyo/Asia" > /etc/timezone
emerge --config sys-libs/timezone-data
nano -w /etc/locale.gen
en_US.UTF-8 UTF-8
ja_JP.UTF-8 UTF-8
locale-gen
# eselect locale list
Available targets for the LANG variable:
[1] C
[2] POSIX
[3] en_US.utf8
[4] ja_JP.utf8
[ ] (free form)
# eselect locale set 3
env-update && source /etc/profile
emerge sys-kernel/gentoo-sources
cd /usr/src/linux
起動中のカーネル設定を引き継ぐ
# make localyesconfig
# make menuconfig
https://wiki.gentoo.org/wiki/Systemd
を参考にカーネルconfigをいじる.
Android端末からのUSBテザリングを受けられるようにする
私のThinkPad X201では,以下の設定を行わなければ無線モジュールのロードに失敗した.
Device Drivers ---> Generic Driver Options ---> Fallback user-helper invocation for firmware loading
のGraphicsを参考に設定
# make && make modules_install && make install
# emerge genkernel
# genkernel --install initramfs
# eselect profile list
Available profile symlink targets:
[1] default/linux/amd64/13.0 *
[2] default/linux/amd64/13.0/selinux
[3] default/linux/amd64/13.0/desktop
[4] default/linux/amd64/13.0/desktop/gnome
[5] default/linux/amd64/13.0/desktop/gnome/systemd
[6] default/linux/amd64/13.0/desktop/kde
[7] default/linux/amd64/13.0/desktop/kde/systemd
[8] default/linux/amd64/13.0/desktop/plasma
[9] default/linux/amd64/13.0/desktop/plasma/systemd
[10] default/linux/amd64/13.0/developer
[11] default/linux/amd64/13.0/no-multilib
[12] default/linux/amd64/13.0/systemd
[13] default/linux/amd64/13.0/x32
[14] hardened/linux/amd64
[15] hardened/linux/amd64/selinux
[16] hardened/linux/amd64/no-multilib
[17] hardened/linux/amd64/no-multilib/selinux
[18] hardened/linux/amd64/x32
[19] hardened/linux/musl/amd64
[20] default/linux/uclibc/amd64
[21] hardened/linux/uclibc/amd64
# eselect profile set 12
# emerge -avDN @world
ln -sf /proc/self/mounts /etc/mtab
emerge iproute2
emerge -C net-tools
# emerge dhcpcd
# emerge tmux sudo emacs
systemctl enable sshd.service
emerge sys-kernel/linux-firmware
systemctl enable systemd-networkd.service
systemctl enable systemd-resolved.service
/etc/systemd/network/enp0s25.network に以下を追記
[Match]
Name=enp0s25
[Network]
DHCP=yes
systemctl enable systemd-networkd.service
systemctl start systemd-networkd.service
https://wiki.gentoo.org/wiki/Handbook:X86/Networking/Wireless
# emerge wpa_supplicant net-wireless/wireless-tools
# flaggie wpa_supplicant +dbus
# emerge networkmanager
あとはGUIで頑張る.
emerge sys-power/acpid
systemctl enable acpid.service
systemctl start acpid.service
emerge --ask sys-process/cronie
systemctl enable cronie.service
systemctl start cronie.service
passwd
useradd -m -G users,wheel,audio -s /bin/bash user
passwd user
CapsLock 殺すべし.
sudo emacs /usr/share/keymaps/i386/qwerty/us.map.gz
keycode 58 = Caps_Lock
を
keycode 58 = Control
にする.
次にsystemdの設定をいじって,端末とデスクトップ環境で使うキーマップを選択する.
localectl set-locales LANG=en_US.utf8
localectl set-keymap us
localectl set-x11-keymap us
これだけでは変更が適応されないので,xmodmapで直にいじる.
sudo emerge xmodmap
~/.Xmodmap
に以下を記述
remove Lock = Caps_Lock
keysym Caps_Lock = Control_L
add Control = Control_L
いじる.
emerge sys-boot/grub
/etc/default/grub
の
# GRUB_CMDLINE_LINUX="init=/usr/lib/systemd/systemd"
のコメントアウトを外して
grub2-install /dev/sda
grub2-mkconfig -o /boot/grub/grub.cfg
あとはリブート
exit
cd
umount -l /mnt/gentoo
reboot
sudo emerge –-sync
sudo emerge package
sudo emerge -auDN world
--auto-unmaskしろと言われたら,flaggieを使って解決する.
flaggie +X
emerge xorg-server
emerge x11-misc/slim
emerge lxde-meta
flaggie +gtk
flaggie systemd +gudev +introspection
echo "exec startlxde" >> ~/.xinitrc
systemctl enable slim
systemctl start slim
/etc/slim.confModifying slim.conf
をいじって,slimが ~/.xinitrc
を読んで起動するように設定
# login_cmd exec /bin/sh - ~/.xinitrc %session
login_cmd exec /bin/bash -login ~/.xinitrc %session
# login_cmd exec /bin/bash -login /usr/share/slim/Xsession %session
sudo emerge koruri media-fonts/ja-ipafonts
sudo flaggie mozc +emacs +fcitx
sudo emerge fcitx mozc fcitx-configtool
有効にするには,X起動時に環境変数にセットする必要がある.
~/.xinitrc
の頭に以下を書き込む
export GTK_IM_MODULE=fcitx
export QT_IM_MODULE=fcitx
# fcitx
export XMODIFIERS="@im=fcitx"
# emerge --autounmask-write libreoffice-bin
# dispatch-conf
# emerge --autounmask-write libreoffice-bin
基本は以下を参照して記述
https://wiki.gentoo.org/wiki/ACPI/ThinkPad-special-buttons
ただし,スクリーンロックのところはうまく動かないので,以下のスクリプトを用いる. (TODO: スクリーンロック多重起動の防止)
$ cat actions/FnF2-screenlock.sh
#!/bin/sh
logger "[ACPI] Fn+F2 pressed, start Slimlock for logged-in user"
XUSER=$( ps axo user:20,command | grep dbus-daemon | grep session | awk '{print $1}' | head -n1)
sudo -u $XUSER /usr/bin/slimlock&
http://www.thinkwiki.org/wiki/How_to_configure_the_TrackPoint
evdevを使うのが今風らしい。 /etc/X11/xorg.conf.d/50-evdev.conf に以下を記入してXを再起動する。
Section "InputClass"
Identifier "ThinkPad TrackPoint"
MatchProduct "TPPS/2 IBM TrackPoint"
MatchDevicePath "/dev/input/event*"
Option "EmulateWheel" "true"
Option "EmulateWheelButton" "2"
Option "XAxisMapping" "6 7"
Option "YAxisMapping" "4 5"
EndSection
基本は以下を参照.通常emergeにないアプリ(sublime-textなど)を入れられる.
https://wiki.gentoo.org/wiki/Layman
sudo emerge app-portage/layman
sudo layman -S
sudo layman -s sublime-text
追加したパッケージのインストールは,emergeで行う.
iptablesに変わる,Linuxのファイアウォール. VyOSとか,業務用ルーターっぽい感じでのコマンドで設定できる. 基本は以下を参照
https://wiki.gentoo.org/wiki/Nftables
sudo emerge nftables
nftablesはまだsystemd向けの起動スクリプトがついてこない.自分で作る.
https://forums.gentoo.org/viewtopic-t-1015436.html?sid=1361cbc748ae78326641f542ed17ee32
sudo emerge app-antivirus/clamav
sudo systemctl enable clamd.service
sudo systemctl start clamd.service
sudo freshclam
以下で自動更新
sudo systemctl enable freshclamd.service
sudo systemctl start freshclamd.service
sudo clamscan -r -i --exclude-dir='^/sys|^/proc|^/dev|^/lib|^/bin|^/sbin' /