]>
glassweightruler.freedombox.rocks Git - Ventoy.git/blob - IMG/cpio/ventoy/hook/debian/ventoy-hook.sh
2 #************************************************************************************
3 # Copyright (c) 2020, longpanda <admin@ventoy.net>
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.
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.
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/>.
18 #************************************************************************************
20 .
$VTOY_PATH/hook
/ventoy
-os-lib.sh
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
29 elif [ -e /etc
/initrd_release
]; then
30 if $EGREP -q "ID=.*antix|ID=.*mx" /etc
/initrd_release
; then
35 if [ -e /DISTRO_SPECS
]; then
36 if $GREP -q veket
/DISTRO_SPECS
; then
42 if $EGREP -q 'PUPPYSFS|PUPPYFILE' /init
; then
43 if $GREP -q VEKETSFS
/init
; then
48 elif $GREP -m1 -q 'Minimal.*Linux.*Live' /init
; then
50 elif $GREP -m1 -q 'stratodesk.com' /init
; then
51 echo 'stratodesk'; return
52 elif $GREP -q "\bPVE\b" /init
; then
57 if [ -e /etc
/os
-release ]; then
58 if $GREP -q 'Tails' /etc
/os
-release; then
63 if $GREP -q 'slax/' /proc
/cmdline
; then
67 if $GREP -q 'minios/' /proc
/cmdline
; then
71 if $GREP -q 'PVE ' /proc
/version
; then
75 if [ -d /porteus
]; then
76 echo 'porteus'; return
79 if $GREP -q 'porteus' /proc
/version
; then
80 echo 'porteus'; return
83 if $GREP -q 'linuxconsole' /proc
/version
; then
84 echo 'linuxconsole'; return
87 if $GREP -q 'vyos' /proc
/version
; then
91 if $GREP -q 'kylin' /proc
/version
; then
95 if [ -f /scripts
/00-ver ]; then
96 if $GREP -q 'Bliss-OS' /scripts
/00-ver; then
101 if [ -e /opt
/kerio
]; then
105 if $GREP -q 'mocaccino' /proc
/version
; then
106 echo 'mocaccino'; return
109 if $GREP -q '/pyabr/' /proc
/cmdline
; then
113 if [ -e /devuan
-logo.txt
]; then
114 echo 'devuan'; return
117 if $GREP -q 'truenas' /proc
/version
; then
118 echo 'truenas'; return
124 DISTRO
=$(ventoy_get_debian_distro)
126 echo "##### distribution = $DISTRO ######" >> $VTLOG
127 .
$VTOY_PATH/hook
/debian
/${DISTRO}-hook.sh
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