This commit is contained in:
longpanda
2020-08-08 19:39:31 +08:00
parent be50ea69aa
commit 1186caba41
34 changed files with 3002 additions and 166 deletions

BIN
IMG/cpio/ventoy/busybox/64h Normal file

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@@ -23,11 +23,38 @@
# Step 1 : parse kernel debug parameter #
# #
####################################################################
[ -d /proc ] || mkdir /proc; mount -t proc proc /proc
vtoy_cmdline=$(cat /proc/cmdline)
umount /proc; rm -rf /proc
if echo $vtoy_cmdline | grep -q 'rdinit=/vtoy/vtoy'; then
if ! [ -d /proc ]; then
mkdir /proc
vtrmproc='Y'
fi
mount -t proc proc /proc
export vtcmdline=$(cat /proc/cmdline)
export vtkerver=$(cat /proc/version)
umount /proc;
if [ "$vtrmproc" = "Y" ]; then
rm -rf /proc
fi
echo "kenel version=$vtkerver" >>$VTLOG
echo "kenel cmdline=$vtcmdline" >>$VTLOG
#break here for debug
if [ "$VTOY_BREAK_LEVEL" = "01" ] || [ "$VTOY_BREAK_LEVEL" = "11" ]; then
sleep 5
echo -e "\n\n\033[32m ################################################# \033[0m"
echo -e "\033[32m ################ VENTOY DEBUG ################### \033[0m"
echo -e "\033[32m ################################################# \033[0m \n"
if [ "$VTOY_BREAK_LEVEL" = "11" ]; then
cat $VTLOG
fi
exec $BUSYBOX_PATH/sh
fi
if echo $vtcmdline | grep -q 'rdinit=/vtoy/vtoy'; then
echo "handover to init_loop" >>$VTLOG
rm -f /xxxx /vtoyxrc
exec $BUSYBOX_PATH/sh $VTOY_PATH/init_loop

View File

@@ -18,36 +18,9 @@
#************************************************************************************
###################################################################
# #
# Step 1 : parse kernel debug parameter #
# #
####################################################################
[ -d /proc ] || mkdir /proc; mount -t proc proc /proc
vtcmdline=$(cat /proc/cmdline)
vtkerver=$(cat /proc/version)
umount /proc; rm -rf /proc
echo "kenel version=$vtkerver" >>$VTLOG
echo "kenel cmdline=$vtcmdline" >>$VTLOG
#break here for debug
if [ "$VTOY_BREAK_LEVEL" = "01" ] || [ "$VTOY_BREAK_LEVEL" = "11" ]; then
sleep 5
echo -e "\n\n\033[32m ################################################# \033[0m"
echo -e "\033[32m ################ VENTOY DEBUG ################### \033[0m"
echo -e "\033[32m ################################################# \033[0m \n"
if [ "$VTOY_BREAK_LEVEL" = "11" ]; then
cat $VTLOG
fi
exec $BUSYBOX_PATH/sh
fi
####################################################################
# #
# Step 2 : extract real initramfs to / #
# Step 1 : extract real initramfs to / #
# #
####################################################################
cd /

View File

@@ -18,36 +18,9 @@
#************************************************************************************
###################################################################
# #
# Step 1 : parse kernel debug parameter #
# #
####################################################################
[ -d /proc ] || mkdir /proc; mount -t proc proc /proc
vtcmdline=$(cat /proc/cmdline)
vtkerver=$(cat /proc/version)
umount /proc; rm -rf /proc
echo "kenel version=$vtkerver" >>$VTLOG
echo "kenel cmdline=$vtcmdline" >>$VTLOG
#break here for debug
if [ "$VTOY_BREAK_LEVEL" = "01" ] || [ "$VTOY_BREAK_LEVEL" = "11" ]; then
sleep 5
echo -e "\n\n\033[32m ################################################# \033[0m"
echo -e "\033[32m ################ VENTOY DEBUG ################### \033[0m"
echo -e "\033[32m ################################################# \033[0m \n"
if [ "$VTOY_BREAK_LEVEL" = "11" ]; then
cat $VTLOG
fi
exec $BUSYBOX_PATH/sh
fi
####################################################################
# #
# Step 2 : Extract injection archive #
# Step 1 : Extract injection archive #
# #
####################################################################
ventoy_unpack_injection() {

View File

@@ -1,36 +0,0 @@
#!/bin/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/>.
#
#************************************************************************************
cd /ventoy
xzcat tool.cpio.xz | cpio -idmu
/ventoy/tool/vtoytool/00/vtoytool_64 --install
while [ -n "Y" ]; do
line=$(/ventoy/tool/vtoydump -f /ventoy/ventoy_os_param)
if [ $? -eq 0 ]; then
vtdiskname=${line%%#*}
break
else
sleep 1
fi
done
echo "ventoy disk is $vtdiskname" >> /ventoy/log
/ventoy/tool/vtoydm -p -f /ventoy/ventoy_image_map -d $vtdiskname > /ventoy/ventoy_dm_table
dmsetup create ventoy /ventoy/ventoy_dm_table --readonly

View File

@@ -1,21 +0,0 @@
#!/bin/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/>.
#
#************************************************************************************
sed "/^mountroot$/i\\sh /ventoy/loop/deepin/ventoy-disk.sh" -i /init
exec /init

View File

@@ -97,7 +97,7 @@ cd /
unset VTLOG FIND GREP EGREP CAT AWK SED SLEEP HEAD
for vtinit in $user_rdinit /sbin/init /init /linuxrc; do
for vtinit in $user_rdinit /init /sbin/init /linuxrc; do
if [ -d /ventoy_rdroot ]; then
if [ -e "/ventoy_rdroot$vtinit" ]; then
# switch_root will check /init file, this is a cheat code