一半君的总结纸

听话只听一半君

Fedora 25 on Thinkpad T450S

因为CentOS 7.0上不了nvidia proprietary driver,xorg 1.17.2版本太低,所以决定换fedora

  • 首先制作安装u盘,在windows下将f25的iso直接拷贝到easy2boot的优盘上的_ISO目录下,然后运行优盘上的Make_This_Drive_Contiguous.cmd

    如果是f25,必须如下操作,不然会在分区的时候遇到 ValueError: Device ‘sdd4’ not in tree 的错误
    从U盘启动后在fedora菜单界面处按tab键,在kernel命令行后添加 rd.live.ram, 启动至桌面后打开Disk程序,unmount优盘的所有分区,弹出优盘,然后再开始安装

  • 安装Nvidia驱动,目前最新版是375.79, 为了达成readme中提到的 Offloading Graphics Display with RandR 1.4 的效果,需要更新kernel到新版(目前repo李的版本是4.10.8-200)
    dnf upgrade kernel
    dnf install kernel-devel
    
    Section "ServerLayout"
        Identifier "layout"
        Screen 0 "nvidia"
        Inactive "intel"
    EndSection
    
    Section "Device"
        Identifier "nvidia"
        Driver "nvidia"
        BusID "PCI:4:0:0"
    EndSection
    
    Section "Screen"
        Identifier "nvidia"
        Device "nvidia"
        Option "AllowEmptyInitialConfiguration"
    EndSection
    
    Section "Device"
        Identifier "intel"
        Driver "modesetting"
    EndSection
    
    Section "Screen"
        Identifier "intel"
        Device "intel"
    EndSection
    

    上面配置文件中的busid是这里来的

    $ lspci
    00:00.0 Host bridge: Intel Corporation Broadwell-U Host Bridge -OPI (rev 09)
    00:02.0 VGA compatible controller: Intel Corporation HD Graphics 5500 (rev 09)
    00:03.0 Audio device: Intel Corporation Broadwell-U Audio Controller (rev 09)
    00:14.0 USB controller: Intel Corporation Wildcat Point-LP USB xHCI Controller (rev 03)
    00:16.0 Communication controller: Intel Corporation Wildcat Point-LP MEI Controller #1 (rev 03)
    00:19.0 Ethernet controller: Intel Corporation Ethernet Connection (3) I218-V (rev 03)
    00:1b.0 Audio device: Intel Corporation Wildcat Point-LP High Definition Audio Controller (rev 03)
    00:1c.0 PCI bridge: Intel Corporation Wildcat Point-LP PCI Express Root Port #6 (rev e3)
    00:1c.1 PCI bridge: Intel Corporation Wildcat Point-LP PCI Express Root Port #3 (rev e3)
    00:1c.4 PCI bridge: Intel Corporation Wildcat Point-LP PCI Express Root Port #5 (rev e3)
    00:1d.0 USB controller: Intel Corporation Wildcat Point-LP USB EHCI Controller (rev 03)
    00:1f.0 ISA bridge: Intel Corporation Wildcat Point-LP LPC Controller (rev 03)
    00:1f.2 SATA controller: Intel Corporation Wildcat Point-LP SATA Controller [AHCI Mode] (rev 03)
    00:1f.3 SMBus: Intel Corporation Wildcat Point-LP SMBus Controller (rev 03)
    00:1f.6 Signal processing controller: Intel Corporation Wildcat Point-LP Thermal Management Controller (rev 03)
    02:00.0 Unassigned class [ff00]: Realtek Semiconductor Co., Ltd. RTS5227 PCI Express Card Reader (rev 01)
    03:00.0 Network controller: Intel Corporation Wireless 7265 (rev 61)
    04:00.0 3D controller: NVIDIA Corporation GM108M [GeForce 940M] (rev a2)
    

    在/etc/gdm/Init/Default的最后一行的exit 0之前加入

    xrandr --setprovideroutputsource modesetting NVIDIA-0
    xrandr --auto
    

    最后375.39的nvidia驱动在4.10 kernel上安装需要下面的patch,不然会找不到fenv.h

    # extract first
    ./NVIDIA-Linux-x86_64-375.39.run -x
    
    # 进入目录后
    patch -p1 < nameofpatchfile.patch
    
    # patch过后再装
    ./nvidia-installer
    
  • enable rmpfusion
    去rpmfusion官网下载配置rpm, 然后安装

    dnf install rpmfusion-free-release-25.noarch.rpm
    
  • install maya 2017

    dnf install libXp-devel libpng12 csh xorg-x11-fonts-ISO8859* gcc-c++ libfame 
    
    # 安装完成后
    ln -s /usr/lib64/libtiff.so.5  /usr/lib64/libtiff.so.3
    ln -s /usr/lib64/libfame-0.9.so.1.0.0 /usr/lib64/libfam.so.0
    
  • install maya 2016
    除了上面那堆以外,还需要

    dnf install gstreamer-plugins-base redhat-lsb
    
  • other setup 如果需要编译安装其他软件,还需要

    dnf groupinstall "Development Tools"
    
  • 神秘文件用的还是2015的,2016的试验了没有成功
    新建如下文件

    [Unit]
    Description=launch flexlm server
      
    [Service]
    ExecStart=/opt/flexnetserver/lmgrd -c /opt/flexnetserver/lic.dat
    Type=forking
      
    [Install]
    WantedBy=multi-user.target
    

    然后

    # 启动新加的service
    systemctl daemon-reload
    systemctl start lmgrd
      
    # 查询下看成功没有
    systemctl status lmgrd
    # 如果出现Active: active (running) since ...的字样说明可以了,可以开Maya验证下是不是可以
      
    # 最后让他自动启动
    systemctl enable lmgrd
    
  • google chrome
    
    cat << EOF > /etc/yum.repos.d/google-chrome.repo
    [google-chrome]
    name=google-chrome - \$basearch
    baseurl=http://dl.google.com/linux/chrome/rpm/stable/\$basearch
    enabled=1
    gpgcheck=1
    gpgkey=https://dl-ssl.google.com/linux/linux_signing_key.pub
    EOF
    
    dnf install google-chrome-stable
    

ps 疑难杂症解决

  • 指纹扫描灯不停闪烁
    临时解决方法,关闭指纹功能

    sudo authconfig-tui
    

    然后把指纹功能关了

  • 关机或重启时满屏幕闪过

    Kernel not configured for semaphores (System V IPC). Not using udev synchronisation code.
    

    暂时无解,原因在此

  • dnf出错, ImportError: dynamic module does not define module export function (PyInit__rpm)
    $ dnf
    Traceback (most recent call last):
      File "/usr/bin/dnf", line 57, in <module>
        from dnf.cli import main
      File "/usr/lib/python3.5/site-packages/dnf/__init__.py", line 31, in <module>
        import dnf.base
      File "/usr/lib/python3.5/site-packages/dnf/base.py", line 30, in <module>
        from dnf.yum import history
      File "/usr/lib/python3.5/site-packages/dnf/yum/history.py", line 31, in <module>
        import dnf.rpm.miscutils
      File "/usr/lib/python3.5/site-packages/dnf/rpm/__init__.py", line 22, in <module>
        from . import transaction
      File "/usr/lib/python3.5/site-packages/dnf/rpm/transaction.py", line 14, in <module>
        import rpm
      File "/usr/lib64/python2.7/site-packages/rpm/__init__.py", line 38, in <module>
        from rpm._rpm import *
    ImportError: dynamic module does not define module export function (PyInit__rpm)
    

    去掉~/.bashrc里面的PYTHONPATH(如果有的话)

gnome 3实在用不习惯,换回kde

dnf install @kde-desktop-environment kdm system-switch-displaymanager
system-switch-displaymanager kdm

# 然后把nvidia驱动需要的xrandr那两行命令加到 /usr/share/config/kdm/Xsetup 里,因为startx会读这个文件
xrandr --setprovideroutputsource modesetting NVIDIA-0
xrandr --auto

不过好像登陆画面的壁纸太小,形成了一个平铺的效果,lz又换回了gdm(没去查如何换)

Install nvidia driver with kernel 4.10.12, Nvidia driver 安装的时候会出现一个 Kernel module load error: Permission denied 的错误提示(见/var/log/nvidia-installer.log),这是因为selinux 版本 3.13.1-225.13.fc25的问题,降级到 3.13.1-224.fc25就可以了

$ uname -r
4.10.12-200.fc25.x86_64

$ dnf --showduplicates list selinux-policy
Last metadata expiration check: 19 days, 20:59:58 ago on Mon Apr 10 00:08:51 2017.
Installed Packages
selinux-policy.noarch                                   3.13.1-225.13.fc25                                    @updates
Available Packages
selinux-policy.noarch                                   3.13.1-224.fc25                                       fedora  
selinux-policy.noarch                                   3.13.1-225.11.fc25                                    updates 
selinux-policy.noarch                                   3.13.1-225.13.fc25                                    @updates

$ sudo dnf downgrade selinux-policy --allowerasing
[sudo] password for oglop: 
Last metadata expiration check: 2:10:50 ago on Sat Apr 29 19:31:49 2017.
Dependencies resolved.
==========================================================================================================================
 Package                                Arch                  Version                         Repository             Size
==========================================================================================================================
Downgrading:
 selinux-policy                         noarch                3.13.1-224.fc25                 fedora                481 k
 selinux-policy-targeted                noarch                3.13.1-224.fc25                 fedora                8.7 M

Transaction Summary
==========================================================================================================================
Downgrade  2 Packages

Total download size: 9.1 M
Is this ok [y/N]: y
Downloading Packages:
(1/2): selinux-policy-3.13.1-224.fc25.noarch.rpm                                          942 kB/s | 481 kB     00:00    
(2/2): selinux-policy-targeted-3.13.1-224.fc25.noarch.rpm                                 162 kB/s | 8.7 MB     00:54    
--------------------------------------------------------------------------------------------------------------------------
Total                                                                                     170 kB/s | 9.1 MB     00:55     
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
  Downgrading : selinux-policy-3.13.1-224.fc25.noarch                                                                 1/4 
  Downgrading : selinux-policy-targeted-3.13.1-224.fc25.noarch                                                        2/4 
  Erasing     : selinux-policy-targeted-3.13.1-225.13.fc25.noarch                                                     3/4 
  Erasing     : selinux-policy-3.13.1-225.13.fc25.noarch                                                              4/4 
  Verifying   : selinux-policy-3.13.1-224.fc25.noarch                                                                 1/4 
  Verifying   : selinux-policy-targeted-3.13.1-224.fc25.noarch                                                        2/4 
  Verifying   : selinux-policy-3.13.1-225.13.fc25.noarch                                                              3/4 
  Verifying   : selinux-policy-targeted-3.13.1-225.13.fc25.noarch                                                     4/4 

Downgraded:
  selinux-policy.noarch 3.13.1-224.fc25                   selinux-policy-targeted.noarch 3.13.1-224.fc25                  

Complete!

# and I rebuilt initramfs ( not sure if needed )
## Backup old initramfs nouveau image ##
mv /boot/initramfs-$(uname -r).img /boot/initramfs-$(uname -r)-nouveau.img
 
## Create new initramfs image ##
dracut /boot/initramfs-$(uname -r).img $(uname -r)

GNOME, click System → Preferences → Input Method or
KDE, click Kickoff Application Launcher → Applications → Settings → Input Method
在这两处把默认输入法设置为ibus

dnf install ibus-setup ibus-pinyin ibus-qt

# 如果需要命令行方式重启服务
ibus-daemon -d -r -R

自动开数字键盘

sudo dnf install numlockx

把下面内容加到 /etc/gdm/Init/Default

if [ -x /usr/bin/numlockx ]; then
  /usr/bin/numlockx on
fi

reference:
Accepted Solution Autodesk Maya 2014 Fedora 19 unmet dependency
Installing Free and Nonfree Repositories
Bug 1383873 – ValueError: Device ‘sdd4’ not in tree
Patch for proprietary NVIDIA 375.39 drivers with kernel 4.10
Bug 1365355 – T450s fingerprint LED keeps blinking after authentication
Bug 1385432 – Dracut exhibits numerous AVC denied errors during cleanup, takes long time to power off
How to install KDE 4 on Fedora 25 easily

Fedora 25/24/23 nVidia Drivers Install Guide
DNF Command Examples
PSA: Don’t update selinux-policy today!
https://ask.fedoraproject.org/en/question/69200/why-is-num-lock-always-an-issue-with-each-release-its-2015/
Install Google Chrome on Fedora 25/24, CentOS/RHEL 7.3

Advertisements

发表评论

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / 更改 )

Twitter picture

You are commenting using your Twitter account. Log Out / 更改 )

Facebook photo

You are commenting using your Facebook account. Log Out / 更改 )

Google+ photo

You are commenting using your Google+ account. Log Out / 更改 )

Connecting to %s

%d 博主赞过: