Skip to content
This repository has been archived by the owner on Aug 15, 2023. It is now read-only.

Linux 下如何找到 Chromium 的二进制 ELF 文件路径 #465

Open
Arondight opened this issue Dec 2, 2021 · 0 comments
Open

Linux 下如何找到 Chromium 的二进制 ELF 文件路径 #465

Arondight opened this issue Dec 2, 2021 · 0 comments
Labels
documentation Improvements or additions to documentation

Comments

@Arondight
Copy link
Owner

Arondight commented Dec 2, 2021

目前已知发行版的 Chromium ELF 路径如下。

发行版 包名 软件源 ELF
CentOS chromium EPEL /usr/lib64/chromium-browser/chromium-browser
Debian 、 Raspbian chromium main /usr/lib/chromium/chromium
Fedora chromium fedora /usr/lib64/chromium-browser/chromium-browser
Ubuntu chromium-browser universe /usr/lib/chromium-browser/chromium-browser
Arch Linux chromium extra /bin/chromium

具体方法如下。


有的发行版比较麻烦,例如 CentOS 。

$ type chromium-browser 
chromium-browser is /bin/chromium-browser

$ file /bin/chromium-browser 
/bin/chromium-browser: symbolic link to /usr/lib64/chromium-browser/chromium-browser.sh

$ file /usr/lib64/chromium-browser/chromium-browser.sh                     
/usr/lib64/chromium-browser/chromium-browser.sh: Bourne-Again shell script, ASCII text executable

$ bash -x /usr/lib64/chromium-browser/chromium-browser.sh                                                 
++ readlink -f /usr/lib64/chromium-browser/chromium-browser.sh
+ export CHROME_WRAPPER=/usr/lib64/chromium-browser/chromium-browser.sh
+ CHROME_WRAPPER=/usr/lib64/chromium-browser/chromium-browser.sh
++ dirname /usr/lib64/chromium-browser/chromium-browser.sh
+ HERE=/usr/lib64/chromium-browser
+ which xdg-settings
+ export PATH=/usr/lib64/chromium-browser:/home/user/bin:/home/user/lib/go/bin:/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:.
+ PATH=/usr/lib64/chromium-browser:/home/user/bin:/home/user/lib/go/bin:/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:.
+ [[ -n '' ]]
+ LD_LIBRARY_PATH=/usr/lib64/chromium-browser:/usr/lib64/chromium-browser/lib
+ export LD_LIBRARY_PATH
+ export 'CHROME_VERSION_EXTRA=Built from source for Red Hat Enterprise Linux release 8.4 (Ootpa)'
+ CHROME_VERSION_EXTRA='Built from source for Red Hat Enterprise Linux release 8.4 (Ootpa)'
+ export GNOME_DISABLE_CRASH_DIALOG=SET_BY_GOOGLE_CHROME
+ GNOME_DISABLE_CRASH_DIALOG=SET_BY_GOOGLE_CHROME
+ export allow_rgb10_configs=false
+ allow_rgb10_configs=false
+ CHROMIUM_DISTRO_FLAGS=' --enable-plugins                         --enable-extensions                         --enable-user-scripts                         --enable-printing                         --enable-gpu-rasterization                         --enable-sync                         --auto-ssl-client-auth '
+ '[' -f /usr/lib64/chromium-browser/PepperFlash/libpepflashplayer.so ']'
+ CHROMIUM_FLASH_FLAGS=
+ exec -a /usr/lib64/chromium-browser/chromium-browser.sh /usr/lib64/chromium-browser/chromium-browser --enable-plugins --enable-extensions --enable-user-scripts --enable-printing --enable-gpu-rasterization --enable-sync --auto-ssl-client-auth
[1383355:1383355:1202/165510.262572:ERROR:browser_main_loop.cc(1400)] Unable to open X display.

$ file /usr/lib64/chromium-browser/chromium-browser
/usr/lib64/chromium-browser/chromium-browser: ELF 64-bit LSB shared object, x86-64, version 1 (GNU/Linux), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, BuildID[sha1]=7577bb7f2ca3102627af85c02c904775d4a77a2d, for GNU/Linux 3.2.0, not stripped

从而确定路径为 /usr/lib64/chromium-browser/chromium-browser


有的发行版比较简单,例如 Arch Linux

$ type chromium 
chromium 是 /bin/chromium

$ file /bin/chromium
/bin/chromium: ELF 64-bit LSB pie executable, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, BuildID[sha1]=b9b52b7c8daa9537a7c763918d4c82a710569578, for GNU/Linux 4.4.0, stripped

从而确定路径为 /bin/chromium

@Arondight Arondight added the documentation Improvements or additions to documentation label Dec 2, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

1 participant