首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >如何识别嵌入式Linux发行版?

如何识别嵌入式Linux发行版?
EN

Unix & Linux用户
提问于 2022-08-24 16:08:33
回答 2查看 1.4K关注 0票数 11

我试图识别一个嵌入式Linux发行版。以下是我到目前为止输入的命令:

代码语言:javascript
复制
$ uname -a
Linux LIN-SRV-EMB01 3.10.105 #25556 SMP Sat Aug 28 02:14:22 CST 2021 x86_64 GNU/Linux synology_bromolow_rs3412rpxs

$ lsb_release
-sh: lsb_release: command not found

$ ls /usr/lib/os-release
ls: cannot access /usr/lib/os-release: No such file or directory

$ 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

$ cat /proc/cmdline
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

$ dmesg | grep "Linux version"
[    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
[  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

$ which python2 && python2 -c "import platform;print platform.linux_distribution()[0]"
/bin/python2

$ which python3 && python3 -c "import distro;print(distro.name())"

$ 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:尝试了两个命令:

代码语言:javascript
复制
$ strings $(ps -p 1 -o cmd= | cut -d" " -f1) | egrep -i "ubuntu|debian|centos|redhat" -o | sort -u
-sh: strings: command not found
[remoteserver] $ ssh embedded-linux 'cat $(ps -p 1 -o cmd= | cut -d" " -f1)' | strings | egrep -i "ubuntu|debian|centos|redhat" -o | sort -u
ubuntu

EDIT1:尝试了另外三个命令:

代码语言:javascript
复制
$ which initctl && initctl --version
/sbin/initctl
initctl (upstart 1.13.2)
Copyright (C) 2006-2014 Canonical Ltd., 2011 Scott James Remnant

This is free software; see the source for copying conditions.  There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
$ which systemctl && systemctl --version
$ cat /sys/class/dmi/id/product_name
To be filled by O.E.M.
$

EDIT2:尝试了另一个命令(特定于语法):

代码语言:javascript
复制
$ grep productversion /etc/VERSION
productversion="6.2.4"

EDIT3:以防万一有人想要识别硬件:

代码语言:javascript
复制
$ uname -u # Specific to Synology ?
synology_bromolow_rs3412rpxs

$ sudo dmidecode -t system | grep Product
        Product Name: To be filled by O.E.M.
$

$ cat /sys/devices/virtual/dmi/id/product_name
To be filled by O.E.M.
$

EDIT4 :在另一个语料学上,我得到:

代码语言:javascript
复制
$ uname -u
synology_broadwell_rs3618xs

我想它是基于Ubuntu+upstart的。

我还可以使用哪些其他命令来查看更深一点的内容?

EN

回答 2

Unix & Linux用户

回答已采纳

发布于 2022-08-24 21:22:16

uname -a输出将此标识为语法设备。这样的设备运行语法DiskStation管理器。这是基于Linux的,但它的管理并不像运行“传统”Linux发行版的典型Linux系统那样。它有自己的包管理器synopkg,第三方包由SynoCommunity提供。DiskStation CLI指南描述了DSM中可用的一些管理工具。

如果您对此类设备上的管理任务自动化感兴趣,您可能会发现语音学中央管理系统很有用。

票数 17
EN

Unix & Linux用户

发布于 2022-08-25 10:26:26

还有我的“两分钱”:

代码语言:javascript
复制
$ cat /etc/*release*

有时,与发布相关的文件名中没有破折号。

这将输出到/etc目录下包含文件名中的release字的所有文件的stdout内容。

票数 0
EN
页面原文内容由Unix & Linux提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://unix.stackexchange.com/questions/714742

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档