[Repository/Mirror] 關於nopasswdlogin、lightdm、installer、live-config等的建議
Tofloor
poster avatar
dreamcast
deepin
2024-04-19 20:35
Author

以下的建議帶有一定的主觀性,本來我不想給官方開發人員壓力或說三道四的,但由於臨近RC或Preview了,我生怕出來的某些方面與期待的相差太遠,所以只好直接跟各位說一下,我盡量長話短說:

1、首先是 nopasswdlogingroup,不要再用 /usr/share/deepin-installer/tools/deepin-installer-preinit/usr/share/deepin-installer/tools/functions/default_funcs.sh來生成了。請在rootfs生成好後,chroot進去 addgroup --system --firstgid 980 nopasswdlogin。如果不 chroot,也可以把 addgroup這命令放到 lightdm軟件源碼包的中的 postinst腳本。因為是 lightdm需要 nopasswdlogin這個 group而不是 deepin-installer需要它。

lightdm軟件源碼包的 postinst該改的部分:

--- lightdm.postinst.orig
+++ lightdm.postinst
@@ -12,6 +12,11 @@
         addgroup --system lightdm
 fi
 
+# creating nopasswdlogin group if he isn't already there
+if ! getent group nopasswdlogin >/dev/null; then
+        addgroup --system --firstgid 980 nopasswdlogin
+fi
+
 # creating lightdm user if he isn't already there
 if ! getent passwd lightdm >/dev/null; then
         adduser --system --ingroup lightdm --home /var/lib/lightdm lightdm

2、setup_autologin是多餘的,要刪除。setup_live_nopasswdlogin也要刪除,上面第1點解決了生成這個組,下面第5點通過增加它到 LIVE_USER_DEFAULT_GROUPSlive-configLive用戶加到此組。

3、setup_lightdm_auto_login做的 autologin-user部份已經由 live-config做了,而 user-session=dde-x11的部分應該由 dde-session軟件包去實現,這個我第四點再談。

第1至3點該改的deepin-installer部份:

--- /usr/share/deepin-installer/tools/deepin-installer-preinit.orig
+++ /usr/share/deepin-installer/tools/deepin-installer-preinit
@@ -36,13 +36,7 @@
         ## 初始化lightdm
         init_lightdm "deepin-installer"
     else
-        # 设置自动登录
-        setup_autologin
-        # 设置无密码登录
-        setup_live_nopasswdlogin
-
         ## 设置live桌面的install desktop
-        setup_lightdm_auto_login deepin
         setup_live_install_desktop

--- /usr/share/deepin-installer/tools/functions/default_funcs.sh.orig
+++ /usr/share/deepin-installer/tools/functions/default_funcs.sh
@@ -387,24 +387,6 @@
     info "$DI_LIVE_DIR_ENV not empty dir"
 }
 
-setup_autologin() {
-    if ! grep -q "^autologin:" /etc/group; then
-        groupadd autologin
-    fi
-    gpasswd -a deepin autologin
-}
-
-setup_live_nopasswdlogin() {
-    local username=$(installer_get "LIVE_USERNAME")
-    # 如果nopasswdlogin组不存在,则创建
-    if ! grep -q "^nopasswdlogin:" /etc/group; then
-        groupadd nopasswdlogin
-    fi
-    # 添加Live用户到nopasswdlogin组
-    usermod -aG nopasswdlogin "$username"
-    info "set nopasswdlogin on $username"
-}
-
 setup_oem_squashfs() {
     if [ -f $DI_LIVE_DIR_ENV/oem.squashfs ]; then
         mount -v $DI_LIVE_DIR_ENV/oem.squashfs $DI_LIVE_DIR_ENV/oem
@@ -424,17 +406,6 @@
     echo -n ${part_path##*[a-zA-Z]}
 }
 
-setup_lightdm_auto_login() {
-    local username=$1
-    local conf_file="/etc/lightdm/lightdm.conf"
-    if [ -f $conf_file ]; then
-        sed -i "s|^[#]*[ ]*autologin-user\([ ]*\)=.*|autologin-user = ${username}|g" $conf_file
-        sed -i 's/user-session=deepin/user-session=dde-x11/g' $conf_file
-    else
-        warning "lightdm.conf not found!"
-    fi
-}
-
 init_check_mode_lightdm() {
     local username=$(installer_get DI_CM_USER)
     local lightdm_conf=/etc/lightdm/lightdm.conf

4、lightdmuser-session值應該由 dde-session軟件包負責設定,因為它包含了你要啟動的 /usr/share/xsessions/dde-x11.desktop/usr/share/lightdm/lightdm.conf.d內的檔案都可以影響 lightdm的設定值,其中的 60-deepin.conf 是屬於 startdde軟件包,startdde軟件包很久以前含一個檔案叫 /usr/share/xsessions/deepin.desktop但現在已經不存在的了,所以 60-deepin.conf裡的 user-session=deepin以前是對的但現在卻不對了,這一行可以刪掉也可以不理(當然刪掉最好),重要是 dde-session軟件包有一個 conf去凌駕它,你要在 dde-session軟件包中加入 /usr/share/lightdm/lightdm.conf.d/61-deepin.conf(注意檔名開頭要大於 60,否則不能凌駕 60-deepin.conf設定的東西。

startdde軟件包要改的東西:

--- /usr/share/lightdm/lightdm.conf.d/60-deepin.conf.orig
+++ /usr/share/lightdm/lightdm.conf.d/60-deepin.conf
@@ -4,7 +4,6 @@
 [Seat:*]
 xserver-command=X -background none
 greeter-session=lightdm-deepin-greeter
-user-session=deepin
 
 # in case ~/.Xauthority changed to root owned.
 session-cleanup-script=/usr/sbin/deepin-fix-xauthority-perm

dde-session軟件包要加入的 /usr/share/lightdm/lightdm.conf.d/61-deepin.conf

[Seat:*]
user-session=dde-x11

最終 lightdm讀入的設定值可以通過 lightdm --show-config命令來檢查的。

5、刪掉 deepin-installer軟件包內的 /etc/live/config.conf.d/deepin-installer-live.conf,改為把它放到鏡像內的 live目錄下的 config.conf檔。(live目錄即存放 filesystem.squashfs那個目錄。)因為用戶如果自制 Live鏡像一般不會安裝佔用400MB的 deepin-installer,所以不應把 LIVE_HOSTNAMELIVE_USERNAME等東西放在 deepin-installer軟件包內。除了 LIVE_HOSTNAMELIVE_USERNAMELIVE_USER_FULLNAME外,這裡也要加上 LIVE_USER_DEFAULT_GROUPS來增加 dailoutnopasswdloginrender三個組。nopasswdlogin就不用說原因了,其餘的會影響用戶連電話網絡和用顯卡的體驗,所以要加上去。

ISO鏡像內的 live/config.conf

LIVE_HOSTNAME="dde-live"
LIVE_USERNAME="iongwu"
LIVE_USER_FULLNAME="Deepin Live User"
LIVE_USER_DEFAULT_GROUPS="${LIVE_USER_DEFAULT_GROUPS} dialout nopasswdlogin render"

希望這建議不要被狗吃了。愿官方程序員和用戶都跳出bug的輪迴少受痛苦!

Reply Favorite View the author
All Replies
1 / 2
To page
HualetWang
deepin
2024-04-19 21:28
#1

建议看起来合理,我找人看看。

Reply View the author
dreamcast
deepin
2024-04-19 22:35
#2
HualetWang

建议看起来合理,我找人看看。

thanks

Reply View the author
该昵称涉嫌违规
deepin
2024-04-19 23:00
#3

大哥香港还是台湾的??繁体字

Reply View the author
dreamcast
deepin
2024-04-19 23:22
#4
该昵称涉嫌违规

大哥香港还是台湾的??繁体字

兄弟,我來自這個地區的:
Reply View the author
fslong
deepin beta test group
2024-04-20 07:41
#5

之前听说lightdm跑路了,不咋维护状态,现在deepin在做的treeland要包含这方面功能,估计兄弟这建议可能...

另外,deepin里好多历史遗留下来的老旧包,不少bug就是旧包在新系统上不对头的锅。

Reply View the author
该昵称涉嫌违规
deepin
2024-04-20 10:53
#6
dreamcast
兄弟,我來自這個地區的:

新葡京joy

Reply View the author
dreamcast
deepin
2024-04-20 13:42
#7
fslong

之前听说lightdm跑路了,不咋维护状态,现在deepin在做的treeland要包含这方面功能,估计兄弟这建议可能...

另外,deepin里好多历史遗留下来的老旧包,不少bug就是旧包在新系统上不对头的锅。

CDE都30年了還沒走路,lightdm要走路的話ubuntu也走吧。

不要用什麼對頭做藉口,這種藉口對Deepin發展沒有任何好處的,是會坑害Deepin的。

Reply View the author
dreamcast
deepin
2024-04-20 14:18
#8
该昵称涉嫌违规

新葡京joy

這是要地域歧視我嗎?

confused doubt

Reply View the author
Lwh2008--听话模式
deepin
2024-04-20 15:11
#9
dreamcast

CDE都30年了還沒走路,lightdm要走路的話ubuntu也走吧。

不要用什麼對頭做藉口,這種藉口對Deepin發展沒有任何好處的,是會坑害Deepin的。

。。。想起来ll里面的同样是奇奇怪怪的。。。(话说deepin在和啥对口?为什么听说是Fedora/Ubuntu???)

Reply View the author
dreamcast
deepin
2024-04-20 15:14
#10
Lwh2008--听话模式

。。。想起来ll里面的同样是奇奇怪怪的。。。(话说deepin在和啥对口?为什么听说是Fedora/Ubuntu???)

Deepin作為OS名,所以被大多數對口Fedora/Ubuntu。我更希望DDE對口CDE/OpenSTEP/NeXTSTEP/KDE/...


他說的是對頭(我理解為對接)。你說的是對口(我理解為對標)。

Reply View the author
Lwh2008--听话模式
deepin
2024-04-20 15:30
#11
dreamcast

Deepin作為OS名,所以被大多數對口Fedora/Ubuntu。我更希望DDE對口CDE/OpenSTEP/NeXTSTEP/KDE/...


他說的是對頭(我理解為對接)。你說的是對口(我理解為對標)。

看了我搞混对头号对口的概念了。。。

不过我感觉我希望的或许要“奇怪”一点点。。。deepin或许可以拿出它的某些特色去成为一个拥有自己特色的发行版(doge)

or:类似于mint这种简单明了的OS(deepin不也是说他们要简单易用嘛)

Reply View the author
dreamcast
deepin
2024-04-20 15:33
#12
Lwh2008--听话模式

看了我搞混对头号对口的概念了。。。

不过我感觉我希望的或许要“奇怪”一点点。。。deepin或许可以拿出它的某些特色去成为一个拥有自己特色的发行版(doge)

or:类似于mint这种简单明了的OS(deepin不也是说他们要简单易用嘛)

怕就怕UOS拿了Deepin就像Apple拿了NeXT那樣,然後Deepin像OpenDarwin一樣消失了。

Reply View the author
mozixun
Moderator
2024-04-20 17:27
#13
dreamcast

CDE都30年了還沒走路,lightdm要走路的話ubuntu也走吧。

不要用什麼對頭做藉口,這種藉口對Deepin發展沒有任何好處的,是會坑害Deepin的。

deepin的treeland窗管会同时接管lightDM的功能

Reply View the author
dreamcast
deepin
2024-04-20 17:46
#14
mozixun

deepin的treeland窗管会同时接管lightDM的功能

好啊,這是我樂見的,最好能早日實現。

Reply View the author
mozixun
Moderator
2024-04-20 17:54
#15
dreamcast

好啊,這是我樂見的,最好能早日實現。

treeland的预览版我已经用过,响应速度超快并的确接管了LightDM的功能,systemd启动后直接就进treeland。但是目前修完treeland那些bug难度不是一般的大,我第一次体验就往github报告了10个严重问题(比如一段时间后屏幕变糊,任务栏图标不能点也不能变,Firefox显示的是GNOME的GTK窗口图标等)。尤其是wlroots宣布对英伟达摆烂后,适配英伟达GBM的重任也在deepin身上😂

Reply View the author
dreamcast
deepin
2024-04-20 17:59
#16
mozixun

treeland的预览版我已经用过,响应速度超快并的确接管了LightDM的功能,systemd启动后直接就进treeland。但是目前修完treeland那些bug难度不是一般的大,我第一次体验就往github报告了10个严重问题(比如一段时间后屏幕变糊,任务栏图标不能点也不能变,Firefox显示的是GNOME的GTK窗口图标等)。尤其是wlroots宣布对英伟达摆烂后,适配英伟达GBM的重任也在deepin身上😂

建議deepin以後不要以年來命名版本,要每個重要底層新功能的理程碑都出一個版本,不要v25或v26這些了。


我的意思是不要想把一切弄好才一次過出來,treeland前出一個正常能用但base、ABI和Toolchain跟開發中的系統一樣的Release。一步一步來!

Reply View the author
mozixun
Moderator
2024-04-20 18:04
#17
dreamcast

建議deepin以後不要以年來命名版本,要每個重要底層新功能的理程碑都出一個版本,不要v25或v26這些了。


我的意思是不要想把一切弄好才一次過出來,treeland前出一個正常能用但base、ABI和Toolchain跟開發中的系統一樣的Release。一步一步來!

deepin虽说以年命名,但每次年之间的版本跳板也的确是因为大规模更新而出新款的。比如deepin15后更新内核和DDE等就是deepin20,deepin20后独立拿apt和dpkg构建上游,引入Wayland渲染器和玲珑二级包管理器而形成deepin23😂

Reply View the author
dreamcast
deepin
2024-04-20 18:14
#18
mozixun

deepin虽说以年命名,但每次年之间的版本跳板也的确是因为大规模更新而出新款的。比如deepin15后更新内核和DDE等就是deepin20,deepin20后独立拿apt和dpkg构建上游,引入Wayland渲染器和玲珑二级包管理器而形成deepin23😂

跨度太大了,而且wayland和玲瓏是分開進行,就不可以先release一個版本帶有其中之一的嗎?


更別說先release一個沒有wayland和玲瓏但ABI和toolchain等底層庫都跟你們開發用一樣的版本。

Reply View the author
mozixun
Moderator
2024-04-20 18:24
#19
dreamcast

跨度太大了,而且wayland和玲瓏是分開進行,就不可以先release一個版本帶有其中之一的嗎?


更別說先release一個沒有wayland和玲瓏但ABI和toolchain等底層庫都跟你們開發用一樣的版本。

其实可以,但是这又会带来一个深度独有的问题,之前我也这么想直到我去体验了一把deepin v20和现在用v23之后😂

deepin v20是直接基于Debian10构建的,所以到22年它的底层已经老态龙钟,跑稍微新一点的deb软件就有大概率报错,要么apt装的时候就报错依赖版本太低,要么装了之后应用内报错甚至打不开。而deepin v23采取了独立上游,LLVM,Clang这些基础组建的版本以及迭代速度自行把控,导致v23的底层比v20的底层新了不止4年,这样一来同时给玲珑,treeland这些组件适配带来了很大矛盾--要么基于v20继续写,要么直接全部推翻重来。然后deepin v23为了适配新设备(LLVM等更新能使AMD Zen4架构等设备更好运行)而选择了后者,导致了v23的正式版迟迟不能发布,因为底层重构的任务就很重了,而且玲珑这些也不是深度一下子推出的,而是之前就在研发了只是消息没放出来

Reply View the author
dreamcast
deepin
2024-04-20 18:35
#20
mozixun

其实可以,但是这又会带来一个深度独有的问题,之前我也这么想直到我去体验了一把deepin v20和现在用v23之后😂

deepin v20是直接基于Debian10构建的,所以到22年它的底层已经老态龙钟,跑稍微新一点的deb软件就有大概率报错,要么apt装的时候就报错依赖版本太低,要么装了之后应用内报错甚至打不开。而deepin v23采取了独立上游,LLVM,Clang这些基础组建的版本以及迭代速度自行把控,导致v23的底层比v20的底层新了不止4年,这样一来同时给玲珑,treeland这些组件适配带来了很大矛盾--要么基于v20继续写,要么直接全部推翻重来。然后deepin v23为了适配新设备(LLVM等更新能使AMD Zen4架构等设备更好运行)而选择了后者,导致了v23的正式版迟迟不能发布,因为底层重构的任务就很重了,而且玲珑这些也不是深度一下子推出的,而是之前就在研发了只是消息没放出来

只要你ABI/toolchain等底層夠新,很多兼容問題就好解決,向後兼容一般都比向前兼容更易。不完全像是你想像的那樣。

Reply View the author
1 / 2
To page