UsingNetworkManagerTogetherWithAwesome

Steps

用于在Ubuntu20.04上开启awesome, 并使用NetworkManager管理网络.

安装必要的包:

$ sudo apt-get install -y awesome sddm net-tools vim network-manager network-manager-gnome ifupdown

配置awesome:

$ sudo cp /etc/xdg/awesome/rc.lua ~/.config/awesome/rc.lua
$ vim ~/.config/awesome/rc.lua
..........
modkey = "Mod4"

--- Just Run Once Programs.
function run_once(cmd)
  findme = cmd
  firstspace = cmd:find(" ")
  if firstspace then
    findme = cmd:sub(0, firstspace-1)
  end
  awful.util.spawn_with_shell("pgrep -u $USER -x " .. findme .. " > /dev/null || (" .. cmd .. ")")
end

run_once("nm-applet &")
.............

配置NetworkManager:

$ sudo vim /etc/NetworkManager/NetworkManager.conf
..........
[ifupdown]
managed=true
.........

更改netplan renderer方式:

$ sudo vim /etc/netplan/00-installer-config.yaml
# This is the network config written by 'subiquity'
network:
  version: 2
  renderer: NetworkManager

现在重启物理机后, 手工配置NetworkManager:

/images/2021_12_03_09_18_42_276x236.jpg

/images/2021_12_03_09_19_03_606x170.jpg

/images/2021_12_03_09_19_29_771x342.jpg

检查可看到配置生效。

WorkingTipsOnSG1OnUbuntu21.10

Info

Displayed system info via:

test@sg1:~$ sudo inxi
CPU: 16x Single Core Intel Xeon (Cascadelake) (-SMP-) speed: 2993 MHz Kernel: 5.13.0-19-generic x86_64 Up: 4m 
Mem: 1352.3/32102.2 MiB (4.2%) Storage: 100 GiB (8.8% used) Procs: 344 Shell: Bash inxi: 3.3.06 
test@sg1:~$ sudo inxi -G
Graphics:  Device-1: Red Hat QXL paravirtual graphic card driver: qxl v: kernel 
           Device-2: Intel SG1 [Server GPU SG-18M] driver: N/A 
           Display: server: X.org 1.20.13 driver: loaded: N/A tty: 190x40 
           Message: Advanced graphics data unavailable in console for root. 
test@sg1:~$ cat /etc/issue
Ubuntu 21.10 \n \l

EnablePulseAudioInSystemMode

目的

在Ubuntu 18.04.6上配置pulseaudio的 system-wide daemon模式,以使得pulseaudio为所有用户可用。

步骤

确保pulseaudio被安装(默认应该是被安装的), 撰写一个systemd服务条目,重新定义其启动方式(做完以下步骤后需要重新启动机器), 需注意需要手动执行usermod一行为所有用户添加到组里:

# vi /etc/systemd/system/pulseaudio.service
[Unit]
Description=PulseAudio Daemon
 
[Install]
WantedBy=multi-user.target
 
[Service]
Type=simple
PrivateTmp=true
ExecStart=/usr/bin/pulseaudio --system --realtime --disallow-exit --no-cpu-limit 
# vi /usr/share/dbus-1/system.d/pulseaudio.conf 
<?xml version="1.0"?> <!--*-nxml-*-->
<!DOCTYPE busconfig PUBLIC "-//freedesktop//DTD D-BUS Bus Configuration 1.0//EN"
 "http://www.freedesktop.org/standards/dbus/1.0/busconfig.dtd">
<busconfig>
    <policy group="pulse">
        <allow own="org.pulseaudio.Server"/>
    </policy>

    <policy context="default">
        <allow send_destination="org.pulseaudio.Server"/>
        <allow receive_sender="org.pulseaudio.Server"/>
    </policy>
</busconfig>
# groupadd --system pulse
# groupadd --system pulse-access
# useradd --system -g pulse -G audio -d /var/run/pulse -m pulse
# usermod -G video,pulse-access root
# usermod -G video,pulse-access test
# usermod -G video,pulse-access seat1
# usermod -G video,pulse-access seat2
# echo "default-server = /var/run/pulse/native" >> /etc/pulse/client.conf
# echo "autospawn = no" >> /etc/pulse/client.conf
# systemctl daemon-reload
# systemctl enable pulseaudio
# reboot

重启后,以ssh登陆到各用户下,在命令行下播放音频,如用mplayer 1.mp3等操作,应该可以看到音频被正确解码,但是此时无声音,应该使用以下命令unmute音道.

开启所有音道:

# pactl set-sink-mute @DEFAULT_SINK@ false

WorkingTipsOnSG1

Steps

Before installing device drivers:

[root@localhost test]# ls /dev/dri
ls: cannot access /dev/dri: No such file or directory

Changes to ubuntu(I think centos will fail)

ChangesInAOSP12Unfinished

aosp修改要点

TBD, 因为这里还没有完全理出来。