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

View File

@@ -1,4 +1,4 @@
#!/ventoy/busybox/tmpsh
#!/ventoy/busybox/ash
#************************************************************************************
# Copyright (c) 2020, longpanda <admin@ventoy.net>
#
@@ -36,7 +36,14 @@ export SED=$BUSYBOX_PATH/sed
export SLEEP=$BUSYBOX_PATH/sleep
export HEAD=$BUSYBOX_PATH/head
$BUSYBOX_PATH/tmpxz -d $BUSYBOX_PATH/busybox.xz
if [ -e $BUSYBOX_PATH/64h ]; then
$BUSYBOX_PATH/xzminidec32 < $BUSYBOX_PATH/busybox32.xz > $BUSYBOX_PATH/busybox
$BUSYBOX_PATH/vtchmod32 $BUSYBOX_PATH/busybox
else
$BUSYBOX_PATH/xzminidec64 < $BUSYBOX_PATH/busybox64.xz > $BUSYBOX_PATH/busybox
$BUSYBOX_PATH/vtchmod64 $BUSYBOX_PATH/busybox
fi
$BUSYBOX_PATH/busybox --install $BUSYBOX_PATH
export PATH=$BUSYBOX_PATH/:$VTOY_PATH/tool
@@ -60,9 +67,21 @@ xz -d ventoy_loop.sh.xz
if [ -n "$VTOY_REDT_BUG" ]; then
xz -d -c hook.cpio.xz | cpio -idm
xz -d -c tool.cpio.xz | cpio -idm
xz -d -c loop.cpio.xz | cpio -idm
else
xz -d -c hook.cpio.xz | cpio -idm 2>>$VTLOG
xz -d -c tool.cpio.xz | cpio -idm 2>>$VTLOG
xz -d -c loop.cpio.xz | cpio -idm 2>>$VTLOG
fi
if [ -e $BUSYBOX_PATH/64h ]; then
echo "Use busybox32 toolkit ..." >>$VTLOG
ln -s $BUSYBOX_PATH/xzminidec32 $BUSYBOX_PATH/xzminidec
ln -s $VTOY_PATH/tool/dmsetup32 $VTOY_PATH/tool/dmsetup
else
echo "Use busybox64 toolkit ..." >>$VTLOG
ln -s $BUSYBOX_PATH/xzminidec64 $BUSYBOX_PATH/xzminidec
ln -s $VTOY_PATH/tool/dmsetup64 $VTOY_PATH/tool/dmsetup
fi
rm -f *.xz

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