This commit is contained in:
longpanda
2020-08-13 20:20:20 +08:00
parent 062f816020
commit 9962775296
33 changed files with 1016 additions and 39 deletions

View File

@@ -43,6 +43,12 @@ ventoy_os_install_dmsetup() {
# install md-modules
LINE=$($GREP ' md-modules.*\.udeb' $VTOY_PATH/iso_file_list)
if [ $? -eq 0 ]; then
LINTCNT=$($GREP -c ' md-modules.*\.udeb' $VTOY_PATH/iso_file_list)
if [ $LINTCNT -gt 1 ]; then
vtlog "more than one pkgs, need to filter..."
VER=$($BUSYBOX_PATH/uname -r)
LINE=$($GREP ' md-modules.*\.udeb' $VTOY_PATH/iso_file_list | $GREP $VER)
fi
install_udeb_from_line "$LINE" ${vt_usb_disk}
fi
@@ -83,6 +89,8 @@ if is_ventoy_hook_finished || not_ventoy_disk "${1:0:-1}"; then
exit 0
fi
vtlog "==== $0 $* ===="
dmsetup_path=$(ventoy_find_bin_path dmsetup)
if [ -z "$dmsetup_path" ]; then
ventoy_os_install_dmsetup "/dev/${1:0:-1}"

View File

@@ -64,6 +64,10 @@ ventoy_get_debian_distro() {
echo 'linuxconsole'; return
fi
if $GREP -q 'vyos' /proc/version; then
echo 'vyos'; return
fi
echo 'default'
}

View File

@@ -0,0 +1,49 @@
#!/ventoy/busybox/sh
#************************************************************************************
# Copyright (c) 2020, longpanda <admin@ventoy.net>
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
# published by the Free Software Foundation; either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, see <http://www.gnu.org/licenses/>.
#
#************************************************************************************
. /ventoy/hook/ventoy-hook-lib.sh
if is_ventoy_hook_finished; then
exit 0
fi
vtlog "####### $0 $* ########"
VTPATH_OLD=$PATH; PATH=$BUSYBOX_PATH:$VTOY_PATH/tool:$PATH
wait_for_usb_disk_ready
vtdiskname=$(get_ventoy_disk_name)
if [ "$vtdiskname" = "unknown" ]; then
vtlog "ventoy disk not found"
PATH=$VTPATH_OLD
exit 0
fi
mkdir -p /live/vtoyfuse /live/vtoyiso
modprobe fuse
vtoydm -p -f $VTOY_PATH/ventoy_image_map -d $vtdiskname > $VTOY_PATH/ventoy_dm_table
vtoy_fuse_iso -f $VTOY_PATH/ventoy_dm_table -m /live/vtoyfuse
mount -t iso9660 /live/vtoyfuse/ventoy.iso /live/vtoyiso
PATH=$VTPATH_OLD
set_ventoy_hook_finish

View File

@@ -0,0 +1,25 @@
#!/ventoy/busybox/sh
#************************************************************************************
# Copyright (c) 2020, longpanda <admin@ventoy.net>
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
# published by the Free Software Foundation; either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, see <http://www.gnu.org/licenses/>.
#
#************************************************************************************
if [ -e /init ] && $GREP -q '^mountroot$' /init; then
echo "Here before mountroot ..." >> $VTLOG
$SED "/^mountroot$/i\\$BUSYBOX_PATH/sh $VTOY_PATH/hook/debian/vyos-disk.sh" -i /init
$SED "/^mountroot$/i\\export LIVE_MEDIA=/live/vtoyiso" -i /init
#$SED "/^mountroot$/i\\exec /ventoy/busybox/sh" -i /init
fi