Commit 1186caba authored by longpanda's avatar longpanda
Browse files

update

parent be50ea69
......@@ -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
......
......@@ -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 /
......
......@@ -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() {
......
#!/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
#!/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
......@@ -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
......
......@@ -16,7 +16,7 @@ ln -s sbin/init linuxrc
cd ventoy
cp -a $VENTOY_PATH/DMSETUP/dmsetup tool/
cp -a $VENTOY_PATH/DMSETUP/dmsetup* tool/
cp -a $VENTOY_PATH/SQUASHFS/unsquashfs_* tool/
cp -a $VENTOY_PATH/FUSEISO/vtoy_fuse_iso_* tool/
cp -a $VENTOY_PATH/VtoyTool/vtoytool tool/
......@@ -28,6 +28,10 @@ find ./tool | cpio -o -H newc>tool.cpio
xz tool.cpio
rm -rf tool
find ./loop | cpio -o -H newc>loop.cpio
xz loop.cpio
rm -rf loop
xz ventoy_chain.sh
xz ventoy_loop.sh
......
......@@ -389,7 +389,7 @@ function uefi_linux_menu_func {
loopback loop $1$2
fi
vt_load_cpio ${vtoy_path}/ventoy.cpio $2 $1
vt_load_cpio ${vtoy_path}/ventoy.cpio $2 $1 "busybox=$ventoy_busybox_ver"
vt_linux_clear_initrd
......@@ -594,7 +594,7 @@ function legacy_linux_menu_func {
loopback loop $1$2
fi
vt_load_cpio $vtoy_path/ventoy.cpio $2 $1
vt_load_cpio $vtoy_path/ventoy.cpio $2 $1 "busybox=$ventoy_busybox_ver"
vt_linux_clear_initrd
......@@ -709,32 +709,6 @@ function legacy_iso_memdisk {
boot
}
function iso_deepin_live_proc {
if [ -d (loop)/ ]; then
loopback -d loop
fi
loopback loop ${1}${2}
vt_img_sector ${1}${2}
vt_load_cpio $vtoy_path/ventoy.cpio $2 $1
vt_trailer_cpio $1 $2 noinit
ventoy_debug_pause
vt_set_boot_opt rdinit=/ventoy/loop/deepin/ventoy-init.sh live-media=/dev/mapper/ventoy
set ventoy_loading_tip="Loading files ......"
linux (loop)/live/vmlinuz boot=live components locales=zh_CN.UTF-8 splash quiet
initrd (loop)/live/initrd.img
boot
unset ventoy_loading_tip
vt_unset_boot_opt
}
function iso_endless_os_proc {
if [ -d (loop)/ ]; then
......@@ -744,7 +718,7 @@ function iso_endless_os_proc {
loopback loop ${1}${2}
vt_img_sector ${1}${2}
vt_load_cpio $vtoy_path/ventoy.cpio $2 $1
vt_load_cpio $vtoy_path/ventoy.cpio $2 $1 "busybox=$ventoy_busybox_ver"
vt_trailer_cpio $1 $2 noinit
ventoy_debug_pause
......@@ -765,20 +739,27 @@ function iso_endless_os_proc {
vt_unset_boot_opt
}
function iso_common_menuentry {
unset vt_system_id
unset vt_volume_id
vt_chosen_img_path vt_chosen_path vt_chosen_size
vt_parse_iso_volume ${vtoy_iso_part}${vt_chosen_path} vt_system_id vt_volume_id
function ventoy_iso_busybox_ver {
set ventoy_busybox_ver=32
#special process for deepin-live iso
if [ "$vt_chosen_size" = "403701760" ]; then
if vt_str_begin $vt_chosen_path "/deepin-live"; then
iso_deepin_live_proc $vtoy_iso_part $vt_chosen_path
set ventoy_busybox_ver=64
fi
fi
}
function iso_common_menuentry {
unset vt_system_id
unset vt_volume_id
vt_chosen_img_path vt_chosen_path vt_chosen_size
vt_parse_iso_volume ${vtoy_iso_part}${vt_chosen_path} vt_system_id vt_volume_id
ventoy_iso_busybox_ver
#special process for Endless OS
if vt_str_begin $vt_volume_id "Endless-OS"; then
iso_endless_os_proc $vtoy_iso_part $vt_chosen_path
......@@ -853,8 +834,15 @@ function efi_unsupport_menuentry {
}
function ventoy_img_busybox_ver {
set ventoy_busybox_ver=32
if [ -e (vtimghd,2)/etc/openwrt_release ]; then
if vt_file_strstr (vtimghd,2)/etc/openwrt_release x86_64; then
set ventoy_busybox_ver=64
fi
fi
}
function img_common_menuentry {
......
File suppressed by a .gitattributes entry or the file's encoding is unsupported.
#
# Makefile
#
# Author: Lasse Collin <lasse.collin@tukaani.org>
#
# This file has been put into the public domain.
# You can do whatever you want with this file.
#
CC = /opt/diet64/bin/diet gcc -Os -std=gnu89
BCJ_CPPFLAGS = -DXZ_DEC_X86 -DXZ_DEC_POWERPC -DXZ_DEC_IA64 \
-DXZ_DEC_ARM -DXZ_DEC_ARMTHUMB -DXZ_DEC_SPARC
CPPFLAGS = -DXZ_USE_CRC64 -DXZ_DEC_ANY_CHECK
CFLAGS = -ggdb3 -O2 -pedantic -Wall -Wextra
RM = rm -f
VPATH = ../linux/include/linux ../linux/lib/xz
COMMON_SRCS = xz_crc32.c xz_crc64.c xz_dec_stream.c xz_dec_lzma2.c xz_dec_bcj.c
COMMON_OBJS = $(COMMON_SRCS:.c=.o)
XZMINIDEC_OBJS = xzminidec.o
BYTETEST_OBJS = bytetest.o
BUFTEST_OBJS = buftest.o
BOOTTEST_OBJS = boottest.o
XZ_HEADERS = xz.h xz_private.h xz_stream.h xz_lzma2.h xz_config.h
PROGRAMS = xzminidec bytetest buftest boottest
ALL_CPPFLAGS = -I../linux/include/linux -I. $(BCJ_CPPFLAGS) $(CPPFLAGS)
all: $(PROGRAMS)
%.o: %.c $(XZ_HEADERS)
$(CC) $(ALL_CPPFLAGS) $(CFLAGS) -c -o $@ $<
xzminidec: $(COMMON_OBJS) $(XZMINIDEC_OBJS)
$(CC) $(CFLAGS) $(LDFLAGS) -o $@ $(COMMON_OBJS) $(XZMINIDEC_OBJS)
bytetest: $(COMMON_OBJS) $(BYTETEST_OBJS)
$(CC) $(CFLAGS) $(LDFLAGS) -o $@ $(COMMON_OBJS) $(BYTETEST_OBJS)
buftest: $(COMMON_OBJS) $(BUFTEST_OBJS)
$(CC) $(CFLAGS) $(LDFLAGS) -o $@ $(COMMON_OBJS) $(BUFTEST_OBJS)
boottest: $(BOOTTEST_OBJS) $(COMMON_SRCS)
$(CC) $(ALL_CPPFLAGS) $(CFLAGS) $(LDFLAGS) -o $@ $(BOOTTEST_OBJS)
.PHONY: clean
clean:
-$(RM) $(COMMON_OBJS) $(XZMINIDEC_OBJS) $(BUFTEST_OBJS) \
$(BOOTTEST_OBJS) $(PROGRAMS)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment