]> glassweightruler.freedombox.rocks Git - Ventoy.git/blob - IMG/cpio/ventoy/hook/debian/ventoy-hook.sh
1.1.07 release
[Ventoy.git] / IMG / cpio / ventoy / hook / debian / ventoy-hook.sh
1 #!/ventoy/busybox/sh
2 #************************************************************************************
3 # Copyright (c) 2020, longpanda <admin@ventoy.net>
4 #
5 # This program is free software; you can redistribute it and/or
6 # modify it under the terms of the GNU General Public License as
7 # published by the Free Software Foundation; either version 3 of the
8 # License, or (at your option) any later version.
9 #
10 # This program is distributed in the hope that it will be useful, but
11 # WITHOUT ANY WARRANTY; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 # General Public License for more details.
14 #
15 # You should have received a copy of the GNU General Public License
16 # along with this program; if not, see <http://www.gnu.org/licenses/>.
17 #
18 #************************************************************************************
19
20 . $VTOY_PATH/hook/ventoy-os-lib.sh
21
22 ventoy_get_debian_distro() {
23 if [ -d /KNOPPIX ]; then
24 echo 'knoppix'; return
25 elif [ -e /etc/initrd-release ]; then
26 if $EGREP -q "ID=.*antix|ID=.*mx" /etc/initrd-release; then
27 echo 'antix'; return
28 fi
29 elif [ -e /etc/initrd_release ]; then
30 if $EGREP -q "ID=.*antix|ID=.*mx" /etc/initrd_release; then
31 echo 'antix'; return
32 fi
33 fi
34
35 if [ -e /DISTRO_SPECS ]; then
36 if $GREP -q veket /DISTRO_SPECS; then
37 echo 'veket'; return
38 fi
39 fi
40
41 if [ -e /init ]; then
42 if $EGREP -q 'PUPPYSFS|PUPPYFILE' /init; then
43 if $GREP -q VEKETSFS /init; then
44 echo 'veket'; return
45 else
46 echo 'puppy'; return
47 fi
48 elif $GREP -m1 -q 'Minimal.*Linux.*Live' /init; then
49 echo 'mll'; return
50 elif $GREP -m1 -q 'stratodesk.com' /init; then
51 echo 'stratodesk'; return
52 elif $GREP -q "\bPVE\b" /init; then
53 echo 'pve'; return
54 fi
55 fi
56
57 if [ -e /etc/os-release ]; then
58 if $GREP -q 'Tails' /etc/os-release; then
59 echo 'tails'; return
60 fi
61 fi
62
63 if $GREP -q 'slax/' /proc/cmdline; then
64 echo 'slax'; return
65 fi
66
67 if $GREP -q 'minios/' /proc/cmdline; then
68 echo 'minios'; return
69 fi
70
71 if $GREP -q 'PVE ' /proc/version; then
72 echo 'pve'; return
73 fi
74
75 if [ -d /porteus ]; then
76 echo 'porteus'; return
77 fi
78
79 if $GREP -q 'porteus' /proc/version; then
80 echo 'porteus'; return
81 fi
82
83 if $GREP -q 'linuxconsole' /proc/version; then
84 echo 'linuxconsole'; return
85 fi
86
87 if $GREP -q 'vyos' /proc/version; then
88 echo 'vyos'; return
89 fi
90
91 if $GREP -q 'kylin' /proc/version; then
92 echo 'kylin'; return
93 fi
94
95 if [ -f /scripts/00-ver ]; then
96 if $GREP -q 'Bliss-OS' /scripts/00-ver; then
97 echo 'bliss'; return
98 fi
99 fi
100
101 if [ -e /opt/kerio ]; then
102 echo 'kerio'; return
103 fi
104
105 if $GREP -q 'mocaccino' /proc/version; then
106 echo 'mocaccino'; return
107 fi
108
109 if $GREP -q '/pyabr/' /proc/cmdline; then
110 echo 'pyabr'; return
111 fi
112
113 if [ -e /devuan-logo.txt ]; then
114 echo 'devuan'; return
115 fi
116
117 if $GREP -q 'truenas' /proc/version; then
118 echo 'truenas'; return
119 fi
120
121 echo 'default'
122 }
123
124 DISTRO=$(ventoy_get_debian_distro)
125
126 echo "##### distribution = $DISTRO ######" >> $VTLOG
127 . $VTOY_PATH/hook/debian/${DISTRO}-hook.sh
128
129 if [ -f /bin/env2debconf ]; then
130 $SED "1a /bin/sh $VTOY_PATH/hook/debian/ventoy_env2debconf.sh" -i /bin/env2debconf
131 $SED "s#in *\$(set)#in \$(cat /ventoy/envset)#" -i /bin/env2debconf
132 fi
133
134
135
136
137