先用Linux Mint的Live開機,然後用rsync對拷資料過去新硬碟(記得先格式化):
rsync -axHAWXS --numeric-ids --info=progress2 /old-disk/ /new-disk/
然後記得修改新碟碟中的/etc/fstab,對應正確的UUID,查UUID的方法:
blkid
Ubuntu搬移至新系統後,開機不正常一般可以用boot-repair來修復:
https://help.ubuntu.com/community/Boot-Repair
選擇reinstall grub就好,不需要purge grub,記得安裝位置及開機位置要選對(都選新碟碟)
開機進新系統後,再修復一下開機選單:
sudo update-grub
sudo update-initramfs -ukall
不過比較令人困擾的是若是選擇purge grub,
memtest86+ 及中文開機選單會不見,因此必須重裝回來:
sudo apt-get purge memtest86+
sudo apt-get memtest86+ language-pack-zh-hant
sudo cp /usr/share/locale-langpack/zh_TW/LC_MESSAGES/grub.mo /boot/grub/locale/zh_TW.mo
Mint 19.3由於新增了開機佈景主題,還需修改一個地方,讓中文顯示正常:
sudo vi /etc/default/grub.d/60_mint-theme.cfg
修改為 GRUB_FONT="/boot/grub/fonts/unicode.pf2"
用locale檢查環境變數(或檢查/etc/default/locale),需為:
LANG=zh_TW.UTF-8
LANGUAGE=zh_TW:zh
若不是請到偏好設定/語言去修改,
或下指令:
sudo update-locale LANG="zh_TW.UTF-8" LANGUAGE="zh_TW:zh"
sudo dpkg-reconfigure locales
sudo locale-gen zh_TW.UTF-8
更新grub:
sudo update-grub
2019-12-23
2019-12-19
SSH X11Forwarding在LInux Mint(Ubuntu)的設定
本機:
加-X表示啟用X11 Forwarding
ssh -X yourname@domain.com
遠端:
vi /etc/ssh/sshd_config
===============
X11Forwarding yes
X11UseLocalhost no
===============
sudo systemctl restart sshd.service
vi ~/.xprofile
===============
export QT_IM_MODULE=fcitx
export GTK_IM_MODULE=fcitx
export XMOIFIERS="@im=fcitx"
===============
vi ~/.profile
===============
source ~/.xprofile
fcitx -d &
===============
再重新登出登入,試試libreoffice,看看是否能正確顯示畫面跟啟用輸入法:
soffice --writer
加-X表示啟用X11 Forwarding
ssh -X yourname@domain.com
遠端:
vi /etc/ssh/sshd_config
===============
X11Forwarding yes
X11UseLocalhost no
===============
sudo systemctl restart sshd.service
vi ~/.xprofile
===============
export QT_IM_MODULE=fcitx
export GTK_IM_MODULE=fcitx
export XMOIFIERS="@im=fcitx"
===============
vi ~/.profile
===============
source ~/.xprofile
fcitx -d &
===============
再重新登出登入,試試libreoffice,看看是否能正確顯示畫面跟啟用輸入法:
soffice --writer
Linux MInt 19 (Ubuntu 18.04) 使用指紋辨識
X61s的指紋辨識器型號是 UPEK/Thomson (0483:2016),可以被thinkfinger或fprint支援,以下安裝fprint
sudo apt install libpam-fprintd fprint-demo
fprintd-enroll //預設右食指,-f參數可指定手指(right-middle-finger, right-ring-finger)
pam-auth-update //fingerprint auth打勾
fprint_demo //測試辨識器是否正常
ref:
https://askubuntu.com/questions/511876/how-do-i-install-a-fingerprint-reader-on-lenovo-thinkpad
https://askubuntu.com/questions/1107755/fingerprint-reader-in-ubuntu-18-04
http://www.thinkwiki.org/wiki/How_to_enable_the_integrated_fingerprint_reader
http://www.thinkwiki.org/wiki/Integrated_Fingerprint_Reader
sudo apt install libpam-fprintd fprint-demo
fprintd-enroll //預設右食指,-f參數可指定手指(right-middle-finger, right-ring-finger)
pam-auth-update //fingerprint auth打勾
fprint_demo //測試辨識器是否正常
ref:
https://askubuntu.com/questions/511876/how-do-i-install-a-fingerprint-reader-on-lenovo-thinkpad
https://askubuntu.com/questions/1107755/fingerprint-reader-in-ubuntu-18-04
http://www.thinkwiki.org/wiki/How_to_enable_the_integrated_fingerprint_reader
http://www.thinkwiki.org/wiki/Integrated_Fingerprint_Reader
2019-12-16
X61/X61s + Linux Mint 19.2 (Ubuntu 18.04) 安裝 Crystal HD (BCM70015) 硬體解壓縮卡
最近淘了台ThinkPad X61s來懷舊,想說這2007年的硬體播放1080p影片可能不太行,於是花了NT.200買了個Broadcom Crystal HD (BCM70015)硬體解壓縮卡來玩玩,不過要注意的是,影片格式、解析度、比特率不能超過以下限制,否則影片透過硬解後可能會撥不出來:
H.264/AVC HP at L 5.1 1080p/1080i, 40 Mbps
SMPTE VC-1 AP at L 3 1080p/1080i, 40 Mbps
WMV9 (VC-1 SP and MP)
MPEG-2 MP @ ML and HL, 80 Mbps
DivX 3.11, 4.1, 5.X, 6.X, XviD
安裝環境:Linux Mint 19.2 (Ubuntu 18.04), kernel 4.18.0-25
0.因為X61/X61s是用GM965/GL960內顯,
因此先更新為最新i915 driver (xserver-xorg-video-intel)
(此步驟可不做,若opengl呼叫有問題,可試著更新內顯驅動):
sudo add-apt-repository ppa:oibaf/graphics-drivers
sudo apt-get update
sudo apt dist-upgrade
1.先安裝crystalhd driver,可選擇用modprobe或dkms的方式:
modprobe方式:
git clone https://github.com/dbason/crystalhd.git
cp -f /usr/src/crystalhd-0.1/driver/linux/20-crystalhd.rules /lib/udev/rules.d/ <--勿省略,以免非root使用者無法開啟設備
2.檢查crystal hd是否有正確載入driver:
lsmod | grep crystalhd
-> crystalhd 110592 0
dmesg | grep crystalhd
->...
->[810.638520] crystalhd 0000:02:00.0 Starting Device:0x1615
3.安裝smplayer, mpv, gstreamer1.0-crystalhd, libcrystalhd3
apt-get install smplayer mpv gstreamer1.0-crystalhd libcrystalhd3
(VLC測試撥放會說 buffer deadlock prevented 而失敗,因此改用smplayer+mpv)
4 .重開機,抓個測試影片來測試:
http://jell.yfish.us/media/jellyfish-40-mbps-hd-h264.mkv
直接先用mpv來撥放(其中--vo=可改gl, sdl, xv試試):
mpv --hwdec=crystalhd --vo=gl jellyfish-40-mbps-hd-h264.mkv
-> DtsDeviceOpen: Opeining HW in mode 0
-> Enable single threaded mode
使用smplayer透過mpv播放:
exit(離開root bash)
smplayer(開啟smplayer)
Options/Preferences/General
General/Multimedia engine: mpv
Options/Preferences/Performance
Allow frame drop 勾選
Allow hard frame drop 勾選
Performance/Decoding/Hardware decoding: crystalhd
再用smplayer播放 jellyfish-40-mbps-hd-h264.mkv
檢視選單 View/Mplayer/mpv log
看看是否有跟mpv播放一樣的log
或者改直接播youtube試試:
sudo curl -L https://yt-dl.org/downloads/latest/youtube-dl -o /usr/local/bin/youtube-dl
sudo chmod a+rx /usr/local/bin/youtube-dl
mpv --hwdec=crystalhd https://www.youtube.com/watch?v=i0p1bmr0EmE
5.若要移除cyrstalhd driver, 可照以下步驟:
H.264/AVC HP at L 5.1 1080p/1080i, 40 Mbps
SMPTE VC-1 AP at L 3 1080p/1080i, 40 Mbps
WMV9 (VC-1 SP and MP)
MPEG-2 MP @ ML and HL, 80 Mbps
DivX 3.11, 4.1, 5.X, 6.X, XviD
安裝環境:Linux Mint 19.2 (Ubuntu 18.04), kernel 4.18.0-25
0.因為X61/X61s是用GM965/GL960內顯,
因此先更新為最新i915 driver (xserver-xorg-video-intel)
(此步驟可不做,若opengl呼叫有問題,可試著更新內顯驅動):
sudo add-apt-repository ppa:oibaf/graphics-drivers
sudo apt-get update
sudo apt dist-upgrade
1.先安裝crystalhd driver,可選擇用modprobe或dkms的方式:
先安裝必要工具:
sudo apt-get install checkinstall git-core autoconf build-essential subversion dpkg-dev fakeroot pbuilder build-essential dh-make debhelper devscripts patchutils quilt git-buildpackage pristine-tar git yasm zlib1g-dev zlib-bin libzip-dev libx11-dev libx11-dev libxv-dev vstream-client-dev libgtk2.0-dev libpulse-dev libxxf86dga-dev x11proto-xf86dga-dev git libgstreamermm-0.10-dev libgstreamer0.10-dev automake libtool python-appindicator
modprobe方式:
git clone https://github.com/dbason/crystalhd.git
cd crystalhd/driver/linux
autoconf
./configure
make
sudo make install
cd ../../linux_lib/libcrystalhd/
make
sudo make install
sudo make -C firmware install
sudo modprobe crystalhd
sudo modprobe crystalhd
dkms方式:
git clone https://github.com/dbason/crystalhd.git /usr/src/
mv /usr/src/crystalhd /usr/src/crystalhd-0.1
mv /usr/src/crystalhd /usr/src/crystalhd-0.1
cd /usr/src/crystalhd-0.1/linux_lib/libcrystalhd/
make
sudo make install
dkms add -m crystalhd -v 0.1
dkms build -m crystalhd -v 0.1
dkms install -m crystalhd -v 0.1
dkms build -m crystalhd -v 0.1
dkms install -m crystalhd -v 0.1
cp -f /usr/src/crystalhd-0.1/driver/linux/20-crystalhd.rules /lib/udev/rules.d/ <--勿省略,以免非root使用者無法開啟設備
2.檢查crystal hd是否有正確載入driver:
lsmod | grep crystalhd
-> crystalhd 110592 0
dmesg | grep crystalhd
->...
->[810.638520] crystalhd 0000:02:00.0 Starting Device:0x1615
3.安裝smplayer, mpv, gstreamer1.0-crystalhd, libcrystalhd3
apt-get install smplayer mpv gstreamer1.0-crystalhd libcrystalhd3
(VLC測試撥放會說 buffer deadlock prevented 而失敗,因此改用smplayer+mpv)
4 .重開機,抓個測試影片來測試:
http://jell.yfish.us/media/jellyfish-40-mbps-hd-h264.mkv
直接先用mpv來撥放(其中--vo=可改gl, sdl, xv試試):
mpv --hwdec=crystalhd --vo=gl jellyfish-40-mbps-hd-h264.mkv
-> DtsDeviceOpen: Opeining HW in mode 0
-> Enable single threaded mode
使用smplayer透過mpv播放:
exit(離開root bash)
smplayer(開啟smplayer)
Options/Preferences/General
General/Multimedia engine: mpv
Options/Preferences/Performance
Allow frame drop 勾選
Allow hard frame drop 勾選
Performance/Decoding/Hardware decoding: crystalhd
再用smplayer播放 jellyfish-40-mbps-hd-h264.mkv
檢視選單 View/Mplayer/mpv log
看看是否有跟mpv播放一樣的log
或者改直接播youtube試試:
sudo curl -L https://yt-dl.org/downloads/latest/youtube-dl -o /usr/local/bin/youtube-dl
sudo chmod a+rx /usr/local/bin/youtube-dl
mpv --hwdec=crystalhd https://www.youtube.com/watch?v=i0p1bmr0EmE
5.若要移除cyrstalhd driver, 可照以下步驟:
modprobe:
modprobe -r crystalhd
dkms:
dkms remove crystalhd/0.1 --all
不過最後發現i915內顯驅動似乎仍有問題,造成opengl輸出的buffer無法建立,因此1080p用硬解後mpv播放反而更卡...後來發現改用smplayer+mplayer播放超順!算了就這樣吧 囧
ref:
https://wiki.archlinux.org/index.php/Intel_graphics
https://gist.github.com/Brainiarc7/aa43570f512906e882ad6cdd835efe57
http://rocksaying.tw/archives/2015/Linux_DKMS_%E6%A9%9F%E5%88%B6%E5%B0%8E%E5%85%A5%E7%AD%86%E8%A8%98.html
https://kodi.wiki/view/Broadcom_Crystal_HD
https://www.pcdvd.com.tw//showthread.php?t=906270&page=1&pp=10
https://github.com/dbason/crystalhd
https://github.com/agx/libcrystalhd/blob/master/src/libcrystalhd_if.c
http://jell.yfish.us/
https://askubuntu.com/questions/1082499/how-to-get-and-install-intel-i915-drivers-on-ubuntu-18-04
https://wiki.archlinux.org/index.php/Mpv_(%E7%AE%80%E4%BD%93%E4%B8%AD%E6%96%87)
https://mpv.io/manual/stable/#video-output-drivers
modprobe -r crystalhd
dkms:
dkms remove crystalhd/0.1 --all
不過最後發現i915內顯驅動似乎仍有問題,造成opengl輸出的buffer無法建立,因此1080p用硬解後mpv播放反而更卡...後來發現改用smplayer+mplayer播放超順!算了就這樣吧 囧
ref:
https://wiki.archlinux.org/index.php/Intel_graphics
https://gist.github.com/Brainiarc7/aa43570f512906e882ad6cdd835efe57
http://rocksaying.tw/archives/2015/Linux_DKMS_%E6%A9%9F%E5%88%B6%E5%B0%8E%E5%85%A5%E7%AD%86%E8%A8%98.html
https://kodi.wiki/view/Broadcom_Crystal_HD
https://www.pcdvd.com.tw//showthread.php?t=906270&page=1&pp=10
https://github.com/dbason/crystalhd
https://github.com/agx/libcrystalhd/blob/master/src/libcrystalhd_if.c
http://jell.yfish.us/
https://askubuntu.com/questions/1082499/how-to-get-and-install-intel-i915-drivers-on-ubuntu-18-04
https://wiki.archlinux.org/index.php/Mpv_(%E7%AE%80%E4%BD%93%E4%B8%AD%E6%96%87)
https://mpv.io/manual/stable/#video-output-drivers
標籤:
bcm70015,
crystal hd,
linux mint,
ubuntu
訂閱:
文章 (Atom)