Linux

如何辨識嵌入式 Linux 發行版?

  • August 25, 2022

我正在嘗試辨識嵌入式 Linux 發行版。以下是我迄今為止輸入的命令:

$ uname -a
Linux PAR-ADN-SYN01 3.10.105 #25556 SMP Sat Aug 28 02:14:22 CST 2021 x86_64 GNU/Linux synology_bromolow_rs3412rpxs

$ cat /proc/version
Linux version 3.10.105 (root@build1) (gcc version 4.9.3 20150311 (prerelease) (crosstool-NG 1.20.0) ) #25556 SMP Sat Aug 28 02:14:22 CST 2021

$ dmesg | egrep -w "Linux version|Command line"
[    0.000000] Linux version 3.10.105 (root@build1) (gcc version 4.9.3 20150311 (prerelease) (crosstool-NG 1.20.0) ) #25556 SMP Sat Aug 28 02:14:22 CST 2021
[    0.000000] Command line: root=/dev/md0 netif_seq=2130 ahci=0 SataPortMap=34443 DiskIdxMap=03060e0a00 SataLedSpecial=1 ihd_num=0 netif_num=4 syno_hw_version=RS3412rpxs  macs=001132109b1e,001132109b1f,001132109b20,001132109b21 sn=LDKKN90098
[  342.396803] Loading modules backported from Linux version v3.18.1-0-g39ca484

$ python -m platform
Linux-3.10.105-x86_64-with-glibc2.2.5

$ python -c "import platform;print(platform.linux_distribution()[0])"

$ more /etc/issue /etc/*-release /etc/*version /boot/config*
more: stat of /etc/issue failed: No such file or directory
more: stat of /etc/*-release failed: No such file or directory
more: stat of /etc/*version failed: No such file or directory
more: stat of /boot/config* failed: No such file or directory

$ zcat /proc/config.gz /usr/src/linux/config.gz | more
gzip: /proc/config.gz: No such file or directory
gzip: /usr/src/linux/config.gz: No such file or directory

$ which dpkg apt apt-get rpm urpmi yum dnf zypper
/bin/dpkg

$ df -h /
Filesystem      Size  Used Avail Use% Mounted on
/dev/md0        2.3G  1.1G  1.1G  50% /

$ sudo parted /dev/md0 print
Password:
Model: Linux Software RAID Array (md)
Disk /dev/md0: 2550MB
Sector size (logical/physical): 512B/512B
Partition Table: loop
Disk Flags:

Number  Start  End     Size    File system  Flags
1      0.00B  2550MB  2550MB  ext4

$ sudo mdadm -Q /dev/md0
/dev/md0: 2.37GiB raid1 10 devices, 0 spares. Use mdadm --detail for more detail.

$ which lsblk lscsci lshw lspci dmidecode
/bin/lspci
/sbin/dmidecode

EDIT0:又試了一個命令:

$ strings $(ps -p 1 -o cmd= | cut -d" " -f1) | egrep -i "ubuntu|debian|centos|redhat" -o | uniq
-sh: strings: command not found

我可以使用哪些其他命令來更深入地查看?

輸出將其uname -a辨識為 Synology 設備。此類設備執行Synology DiskStation Manager。這是基於 Linux 的,但它不像執行“傳統”Linux 發行版的典型 Linux 系統那樣進行管理。它有自己的包管理器,SynoCommunity 為其synopkg提供了第三方包。DiskStation CLI 指南介紹了 DSM 中可用的一些管理工具。

如果您對在此類設備上自動執行管理任務感興趣,您可能會發現Synology 的中央管理系統很有用。

引用自:https://unix.stackexchange.com/questions/714742