Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
eepm
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
etersoft
eepm
Commits
e3186389
Commit
e3186389
authored
Oct 06, 2020
by
Vitaly Lipatov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
distr_info: sync with distro_info-1.3
parent
19e98104
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
28 additions
and
4 deletions
+28
-4
distr_info
bin/distr_info
+28
-4
No files found.
bin/distr_info
View file @
e3186389
...
@@ -100,6 +100,7 @@ get_major_version()
...
@@ -100,6 +100,7 @@ get_major_version()
}
}
# Default values
# Default values
PRETTY_NAME
=
""
DISTRIB_ID
=
"Generic"
DISTRIB_ID
=
"Generic"
DISTRIB_RELEASE
=
""
DISTRIB_RELEASE
=
""
DISTRIB_CODENAME
=
""
DISTRIB_CODENAME
=
""
...
@@ -109,6 +110,7 @@ if distro lsb-release ; then
...
@@ -109,6 +110,7 @@ if distro lsb-release ; then
DISTRIB_ID
=
$(
cat
$DISTROFILE
| get_var DISTRIB_ID
)
DISTRIB_ID
=
$(
cat
$DISTROFILE
| get_var DISTRIB_ID
)
DISTRIB_RELEASE
=
$(
cat
$DISTROFILE
| get_var DISTRIB_RELEASE
)
DISTRIB_RELEASE
=
$(
cat
$DISTROFILE
| get_var DISTRIB_RELEASE
)
DISTRIB_CODENAME
=
$(
cat
$DISTROFILE
| get_var DISTRIB_CODENAME
)
DISTRIB_CODENAME
=
$(
cat
$DISTROFILE
| get_var DISTRIB_CODENAME
)
PRETTY_NAME
=
$(
cat
$DISTROFILE
| get_var DISTRIB_DESCRIPTION
)
fi
fi
# ALT Linux based
# ALT Linux based
...
@@ -122,6 +124,8 @@ if distro altlinux-release ; then
...
@@ -122,6 +124,8 @@ if distro altlinux-release ; then
elif
has
"ALT .*8.[0-9]"
;
then
DISTRIB_RELEASE
=
"p8"
elif
has
"ALT .*8.[0-9]"
;
then
DISTRIB_RELEASE
=
"p8"
elif
has
"ALT .*9.[0-9]"
;
then
DISTRIB_RELEASE
=
"p9"
elif
has
"ALT .*9.[0-9]"
;
then
DISTRIB_RELEASE
=
"p9"
elif
has
"ALT p9 "
;
then
DISTRIB_RELEASE
=
"p9"
elif
has
"ALT p9 "
;
then
DISTRIB_RELEASE
=
"p9"
elif
has
"ALT 8 SP "
;
then
DISTRIB_RELEASE
=
"c8"
elif
has
"ALT 9 SP "
;
then
DISTRIB_RELEASE
=
"c9"
elif
has
"Simply Linux 6."
;
then
DISTRIB_RELEASE
=
"p6"
elif
has
"Simply Linux 6."
;
then
DISTRIB_RELEASE
=
"p6"
elif
has
"Simply Linux 7."
;
then
DISTRIB_RELEASE
=
"p7"
elif
has
"Simply Linux 7."
;
then
DISTRIB_RELEASE
=
"p7"
elif
has
"Simply Linux 8."
;
then
DISTRIB_RELEASE
=
"p8"
elif
has
"Simply Linux 8."
;
then
DISTRIB_RELEASE
=
"p8"
...
@@ -138,6 +142,7 @@ if distro altlinux-release ; then
...
@@ -138,6 +142,7 @@ if distro altlinux-release ; then
elif
has
"starter kit"
;
then
DISTRIB_RELEASE
=
"p8"
elif
has
"starter kit"
;
then
DISTRIB_RELEASE
=
"p8"
elif
has Citron
;
then
DISTRIB_RELEASE
=
"2.4"
elif
has Citron
;
then
DISTRIB_RELEASE
=
"2.4"
fi
fi
PRETTY_NAME
=
"
$(
cat
/etc/altlinux-release
)
"
elif
distro gentoo-release
;
then
elif
distro gentoo-release
;
then
DISTRIB_ID
=
"Gentoo"
DISTRIB_ID
=
"Gentoo"
...
@@ -177,7 +182,7 @@ elif distro arch-release ; then
...
@@ -177,7 +182,7 @@ elif distro arch-release ; then
# Elbrus
# Elbrus
elif
distro mcst_version
;
then
elif
distro mcst_version
;
then
DISTRIB_ID
=
"MCST"
DISTRIB_ID
=
"MCST"
DISTRIB_RELEASE
=
$(
cat
"
$DISTROFILE
"
|
grep
"release"
|
sed
-e
"s|.*release
\(
[0-9]*
\)
.*|
\1
|g"
)
DISTRIB_RELEASE
=
$(
cat
"
$DISTROFILE
"
|
grep
"release"
|
sed
-e
"s|.*release
\(
[0-9]*
\)
.*|
\1
|g"
)
#"
# OpenWrt
# OpenWrt
elif
distro openwrt_release
;
then
elif
distro openwrt_release
;
then
...
@@ -460,9 +465,18 @@ get_virt()
...
@@ -460,9 +465,18 @@ get_virt()
[
-z
"
$VIRT
"
]
&&
echo
"(unknown)"
&&
return
[
-z
"
$VIRT
"
]
&&
echo
"(unknown)"
&&
return
echo
"
$VIRT
"
&&
return
echo
"
$VIRT
"
&&
return
fi
fi
if
[
-r
/proc/user_beancounters
]
;
then
# TODO: use virt-what under root
# inspired by virt_what
if
[
-d
"/proc/vz"
-a
!
-d
"/proc/bc"
]
;
then
echo
"openvz"
&&
return
echo
"openvz"
&&
return
fi
fi
if
[
-r
"/sys/bus/xen"
]
;
then
echo
"xen"
&&
return
fi
echo
"(unknown)"
echo
"(unknown)"
# TODO: check for openvz
# TODO: check for openvz
}
}
...
@@ -471,16 +485,22 @@ get_virt()
...
@@ -471,16 +485,22 @@ get_virt()
get_service_manager
()
get_service_manager
()
{
{
[
-d
/run/systemd/system
]
&&
echo
"systemd"
&&
return
[
-d
/run/systemd/system
]
&&
echo
"systemd"
&&
return
[
-d
/usr/share/upstart
]
&&
echo
"upstart"
&&
return
# TODO
#[ -d /usr/share/upstart ] && echo "upstart" && return
[
-d
/etc/init.d
]
&&
echo
"sysvinit"
&&
return
[
-d
/etc/init.d
]
&&
echo
"sysvinit"
&&
return
echo
"(unknown)"
echo
"(unknown)"
}
}
print_pretty_name
()
{
echo
"
$PRETTY_NAME
"
}
print_total_info
()
print_total_info
()
{
{
cat
<<
EOF
cat
<<
EOF
distro_info total information (run with -h to get help):
distro_info total information (run with -h to get help):
Pretty distro name (--pretty):
$(
print_pretty_name
)
Distro name and version (-e):
$(
print_name_version
)
Distro name and version (-e):
$(
print_name_version
)
Packaging system (-p):
$(
pkgtype
)
Packaging system (-p):
$(
pkgtype
)
Running service manager (-y):
$(
get_service_manager
)
Running service manager (-y):
$(
get_service_manager
)
...
@@ -511,7 +531,8 @@ case $1 in
...
@@ -511,7 +531,8 @@ case $1 in
echo
" -o - print base OS name"
echo
" -o - print base OS name"
echo
" -p [SystemName] - print type of the packaging system"
echo
" -p [SystemName] - print type of the packaging system"
echo
" -s [SystemName] - print name of distro for build system (like in the package release name)"
echo
" -s [SystemName] - print name of distro for build system (like in the package release name)"
ecgi
" -y - print running service manager"
echo
" -y - print running service manager"
echo
" --pretty - print pretty distro name"
echo
" -v - print version of distro"
echo
" -v - print version of distro"
echo
" -V - print the utility version"
echo
" -V - print the utility version"
echo
"Run without args to print all information."
echo
"Run without args to print all information."
...
@@ -523,6 +544,9 @@ case $1 in
...
@@ -523,6 +544,9 @@ case $1 in
pkgtype
pkgtype
exit
0
exit
0
;;
;;
--pretty
)
print_pretty_name
;;
-d
)
-d
)
echo
$DISTRIB_ID
echo
$DISTRIB_ID
;;
;;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment