Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
dadigang
Ventoy
Commits
d5b829f8
Commit
d5b829f8
authored
Apr 24, 2020
by
longpanda
Browse files
1.0.07 release
parent
d551fc2e
Changes
52
Hide whitespace changes
Inline
Side-by-side
Showing
20 changed files
with
433 additions
and
61 deletions
+433
-61
IMG/cpio/ventoy/hook/debian/pve-hook.sh
IMG/cpio/ventoy/hook/debian/pve-hook.sh
+21
-0
IMG/cpio/ventoy/hook/debian/slax-disk.sh
IMG/cpio/ventoy/hook/debian/slax-disk.sh
+77
-0
IMG/cpio/ventoy/hook/debian/slax-hook.sh
IMG/cpio/ventoy/hook/debian/slax-hook.sh
+20
-0
IMG/cpio/ventoy/hook/debian/tails-hook.sh
IMG/cpio/ventoy/hook/debian/tails-hook.sh
+24
-0
IMG/cpio/ventoy/hook/debian/veket-disk.sh
IMG/cpio/ventoy/hook/debian/veket-disk.sh
+88
-0
IMG/cpio/ventoy/hook/debian/veket-hook.sh
IMG/cpio/ventoy/hook/debian/veket-hook.sh
+22
-0
IMG/cpio/ventoy/hook/pclos/disk_hook.sh
IMG/cpio/ventoy/hook/pclos/disk_hook.sh
+2
-0
IMG/cpio/ventoy/hook/rhel7/ventoy-disk.sh
IMG/cpio/ventoy/hook/rhel7/ventoy-disk.sh
+44
-0
IMG/cpio/ventoy/hook/rhel7/ventoy-hook.sh
IMG/cpio/ventoy/hook/rhel7/ventoy-hook.sh
+3
-1
IMG/cpio/ventoy/hook/ventoy-hook-lib.sh
IMG/cpio/ventoy/hook/ventoy-hook-lib.sh
+2
-2
IMG/cpio/ventoy/hook/ventoy-os-lib.sh
IMG/cpio/ventoy/hook/ventoy-os-lib.sh
+10
-5
IMG/cpio/ventoy/hook/zeroshell/disk_hook.sh
IMG/cpio/ventoy/hook/zeroshell/disk_hook.sh
+42
-0
IMG/cpio/ventoy/hook/zeroshell/ventoy-hook.sh
IMG/cpio/ventoy/hook/zeroshell/ventoy-hook.sh
+24
-0
IMG/cpio/ventoy/init
IMG/cpio/ventoy/init
+36
-53
IMG/cpio/ventoy/tool/vtoytool_install.sh
IMG/cpio/ventoy/tool/vtoytool_install.sh
+9
-0
IMG/cpio/ventoy/tool/xzminidec
IMG/cpio/ventoy/tool/xzminidec
+0
-0
IMG/cpio/ventoy/ventoy.sh
IMG/cpio/ventoy/ventoy.sh
+9
-0
INSTALL/EFI/BOOT/BOOTX64.EFI
INSTALL/EFI/BOOT/BOOTX64.EFI
+0
-0
INSTALL/EFI/BOOT/MokManager.efi
INSTALL/EFI/BOOT/MokManager.efi
+0
-0
INSTALL/EFI/BOOT/grubx64.efi
INSTALL/EFI/BOOT/grubx64.efi
+0
-0
No files found.
IMG/cpio/ventoy/hook/debian/pve-hook.sh
0 → 100644
View file @
d5b829f8
#!/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/>.
#
#************************************************************************************
$SED
"/
\/
sys
\/
block
\/
hd
\*
/i
\
$BUSYBOX_PATH
/sh
$VTOY_PATH
/hook/debian/pve-disk.sh"
-i
/init
$SED
"s#/sys/block/hd
\*
#/sys/block/dm* /sys/block/hd*#"
-i
/init
IMG/cpio/ventoy/hook/debian/slax-disk.sh
0 → 100644
View file @
d5b829f8
#!/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
vtlog
"#######
$0
$*
########"
VTPATH_OLD
=
$PATH
;
PATH
=
$BUSYBOX_PATH
:
$VTOY_PATH
/tool:
$PATH
ventoy_os_install_dmsetup_by_fuse
()
{
vtlog
"ventoy_os_install_dmsetup_by_fuse
$*
"
mkdir
-p
$VTOY_PATH
/mnt/fuse
$VTOY_PATH
/mnt/iso
$VTOY_PATH
/mnt/squashfs
vtoydm
-p
-f
$VTOY_PATH
/ventoy_image_map
-d
$1
>
$VTOY_PATH
/ventoy_dm_table
vtoy_fuse_iso
-f
$VTOY_PATH
/ventoy_dm_table
-m
$VTOY_PATH
/mnt/fuse
mount
-t
iso9660
$VTOY_PATH
/mnt/fuse/ventoy.iso
$VTOY_PATH
/mnt/iso
mount
-t
squashfs
$VTOY_PATH
/mnt/iso/slax/01-core.sb
$VTOY_PATH
/mnt/squashfs
KoName
=
$(
ls
$VTOY_PATH
/mnt/squashfs/lib/modules/
$2
/kernel/drivers/md/dm-mod.ko
*
)
vtlog
"insmod
$KoName
"
insmod
$KoName
umount
$VTOY_PATH
/mnt/squashfs
umount
$VTOY_PATH
/mnt/iso
umount
$VTOY_PATH
/mnt/fuse
}
ventoy_os_install_dmsetup
()
{
vtlog
"ventoy_os_install_dmsetup"
if
grep
-q
'device-mapper'
/proc/devices
;
then
vtlog
"device-mapper module already loaded"
return
;
fi
vtKerVer
=
$(
uname
-r
)
if
modprobe fuse 2>>
$VTLOG
;
then
ventoy_os_install_dmsetup_by_fuse
$1
$vtKerVer
fi
}
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
ventoy_os_install_dmsetup
$vtdiskname
ventoy_udev_disk_common_hook
"
${
vtdiskname
#/dev/
}
2"
"noreplace"
PATH
=
$VTPATH_OLD
IMG/cpio/ventoy/hook/debian/slax-hook.sh
0 → 100644
View file @
d5b829f8
#!/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/>.
#
#************************************************************************************
$SED
"/find_data/i
\
$BUSYBOX_PATH
/sh
$VTOY_PATH
/hook/debian/slax-disk.sh"
-i
/init
IMG/cpio/ventoy/hook/debian/tails-hook.sh
0 → 100644
View file @
d5b829f8
#!/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/>.
#
#************************************************************************************
$SED
"s#.*livefs_root=.*find_livefs.*#
$BUSYBOX_PATH
/mount -t iso9660 /dev/mapper/ventoy
\$
mountpoint; livefs_root=
\$
mountpoint#"
-i
/usr/lib/live/boot/9990-main.sh
$SED
"s#.*livefs_root=.*find_livefs.*#
$BUSYBOX_PATH
/mount -t iso9660 /dev/mapper/ventoy
\$
mountpoint; livefs_root=
\$
mountpoint#"
-i
/usr/bin/boot/9990-main.sh
ventoy_systemd_udevd_work_around
ventoy_add_udev_rule
"
$VTOY_PATH
/hook/debian/udev_disk_hook.sh %k"
IMG/cpio/ventoy/hook/debian/veket-disk.sh
0 → 100644
View file @
d5b829f8
#!/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
ventoy_os_install_dmsetup_by_fuse
()
{
vtlog
"ventoy_os_install_dmsetup_by_fuse
$*
"
mkdir
-p
$VTOY_PATH
/mnt/fuse
$VTOY_PATH
/mnt/iso
$VTOY_PATH
/mnt/squashfs
vtoydm
-p
-f
$VTOY_PATH
/ventoy_image_map
-d
$1
>
$VTOY_PATH
/ventoy_dm_table
vtoy_fuse_iso
-f
$VTOY_PATH
/ventoy_dm_table
-m
$VTOY_PATH
/mnt/fuse
mount
-t
iso9660
$VTOY_PATH
/mnt/fuse/ventoy.iso
$VTOY_PATH
/mnt/iso
sfsfile
=
$(
ls
$VTOY_PATH
/mnt/iso/adrv_veket
*
.sfs
)
mount
-t
squashfs
$sfsfile
$VTOY_PATH
/mnt/squashfs
KoName
=
$(
ls
$VTOY_PATH
/mnt/squashfs/lib/modules/
$2
/kernel/drivers/dax/dax.ko
*
)
vtlog
"insmod
$KoName
"
insmod
$KoName
KoName
=
$(
ls
$VTOY_PATH
/mnt/squashfs/lib/modules/
$2
/kernel/drivers/md/dm-mod.ko
*
)
vtlog
"insmod
$KoName
"
insmod
$KoName
umount
$VTOY_PATH
/mnt/squashfs
umount
$VTOY_PATH
/mnt/iso
umount
$VTOY_PATH
/mnt/fuse
}
ventoy_os_install_dmsetup
()
{
vtlog
"ventoy_os_install_dmsetup"
if
grep
-q
'device-mapper'
/proc/devices
;
then
vtlog
"device-mapper module already loaded"
return
;
fi
vtKerVer
=
$(
uname
-r
)
ventoy_os_install_dmsetup_by_fuse
$1
$vtKerVer
}
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
ventoy_os_install_dmsetup
$vtdiskname
ventoy_udev_disk_common_hook
"
${
vtdiskname
#/dev/
}
2"
"noreplace"
blkdev_num
=
$(
$VTOY_PATH
/tool/dmsetup
ls
|
grep
ventoy |
sed
's/.*(\([0-9][0-9]*\),.*\([0-9][0-9]*\).*/\1 \2/'
)
mknod
-m
0666 /dev/ventoy b
$blkdev_num
PATH
=
$VTPATH_OLD
set_ventoy_hook_finish
IMG/cpio/ventoy/hook/debian/veket-hook.sh
0 → 100644
View file @
d5b829f8
#!/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/>.
#
#************************************************************************************
$SED
'1 apmedia=usbhd'
-i
/init
$SED
"/^ *HAVE_PARTS=/a
\
$BUSYBOX_PATH
/sh
$VTOY_PATH
/hook/debian/veket-disk.sh"
-i
/init
$SED
"/^ *HAVE_PARTS=/a
\
HAVE_PARTS='ventoy|iso9660'"
-i
/init
IMG/cpio/ventoy/hook/pclos/disk_hook.sh
View file @
d5b829f8
...
...
@@ -64,6 +64,8 @@ ventoy_os_install_device_mapper() {
fi
}
wait_for_usb_disk_ready
vtdiskname
=
$(
get_ventoy_disk_name
)
ventoy_os_install_device_mapper
$vtdiskname
...
...
IMG/cpio/ventoy/hook/rhel7/ventoy-disk.sh
0 → 100644
View file @
d5b829f8
#!/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
ventoy_udev_disk_common_hook
"
${
vtdiskname
#/dev/
}
2"
PATH
=
$VTPATH_OLD
set_ventoy_hook_finish
IMG/cpio/ventoy/hook/rhel7/ventoy-hook.sh
View file @
d5b829f8
...
...
@@ -20,10 +20,12 @@
.
$VTOY_PATH
/hook/ventoy-os-lib.sh
ventoy_systemd_udevd_work_around
ventoy_add_udev_rule
"
$VTOY_PATH
/hook/default/udev_disk_hook.sh %k noreplace"
#$BUSYBOX_PATH/cp -a $VTOY_PATH/hook/rhel7/ventoy-disk.sh /lib/dracut/hooks/initqueue/01-ventoy-disk.sh
# suppress write protected mount warning
if
[
-e
/usr/sbin/anaconda-diskroot
]
;
then
$SED
's/^mount $dev $repodir/mount -oro $dev $repodir/'
-i
/usr/sbin/anaconda-diskroot
fi
IMG/cpio/ventoy/hook/ventoy-hook-lib.sh
View file @
d5b829f8
...
...
@@ -226,7 +226,7 @@ wait_for_ventoy_dm_disk_label() {
if
ls
-l
/dev/disk/by-label/ |
$GREP
-q
"
$DM
"
;
then
break
else
$SLEEP
0.3
$SLEEP
1
fi
done
}
...
...
@@ -395,7 +395,7 @@ ventoy_udev_disk_common_hook() {
else
vtlog
"==== create ventoy device mapper failed ===="
$SLEEP
5
$SLEEP
3
if
$GREP
-q
"/dev/
$VTDISK
"
/proc/mounts
;
then
$GREP
"/dev/
$VTDISK
"
/proc/mounts |
while
read
vtLine
;
do
...
...
IMG/cpio/ventoy/hook/ventoy-os-lib.sh
View file @
d5b829f8
...
...
@@ -80,14 +80,19 @@ ventoy_add_udev_rule() {
# https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=869719
#
ventoy_systemd_udevd_work_around
()
{
VTSYSTEMUDEV
=
"
$VT_RULE_DIR_PREFIX
/lib/systemd/system/systemd-udevd.service"
if
[
-e
$VTSYSTEMUDEV
]
;
then
if
$GREP
-q
'SystemCallArchitectures.*native'
$VTSYSTEMUDEV
;
then
$SED
"s/.*
\(
SystemCallArchitectures.*native
\)
/#
\1
/g"
-i
$VTSYSTEMUDEV
for
vtdir
in
'lib'
'usr/lib'
;
do
VTSYSTEMUDEV
=
"
$VT_RULE_DIR_PREFIX
/
$vtdir
/systemd/system/systemd-udevd.service"
if
[
-e
$VTSYSTEMUDEV
]
;
then
if
$GREP
-q
'SystemCallArchitectures.*native'
$VTSYSTEMUDEV
;
then
$SED
"s/.*
\(
SystemCallArchitectures.*native
\)
/#
\1
/g"
-i
$VTSYSTEMUDEV
break
fi
fi
fi
done
}
ventoy_print_yum_repo
()
{
echo
"[
$1
]"
echo
"name=
$1
"
...
...
IMG/cpio/ventoy/hook/zeroshell/disk_hook.sh
0 → 100644
View file @
d5b829f8
#!/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
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
ventoy_udev_disk_common_hook
"
${
vtdiskname
#/dev/
}
2"
"noreplace"
if
!
[
-e
$VTOY_DM_PATH
]
;
then
blkdev_num
=
$(
$VTOY_PATH
/tool/dmsetup
ls
|
grep
ventoy |
sed
's/.*(\([0-9][0-9]*\),.*\([0-9][0-9]*\).*/\1 \2/'
)
mknod
-m
0666
$VTOY_DM_PATH
b
$blkdev_num
fi
PATH
=
$VTPATH_OLD
IMG/cpio/ventoy/hook/zeroshell/ventoy-hook.sh
0 → 100644
View file @
d5b829f8
#!/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/>.
#
#************************************************************************************
.
$VTOY_PATH
/hook/ventoy-os-lib.sh
$SED
"/while.*
\$
device/i
\
device=/dev/mapper/ventoy"
-i
/init
$SED
"/while.*
\$
device/i
\
$BUSYBOX_PATH
/sh
$VTOY_PATH
/hook/zeroshell/disk_hook.sh"
-i
/init
IMG/cpio/ventoy/init
View file @
d5b829f8
...
...
@@ -76,8 +76,19 @@ ventoy_unpack_initramfs() {
for
vtx
in
'1F8B zcat'
'1F9E zcat'
'425A bzcat'
'5D00 lzcat'
'FD37 xzcat'
'894C lzopcat'
'0221 lz4cat'
'28B5 zstdcat'
'3037 cat'
;
do
if
[
"
${
vtx
:0:4
}
"
=
"
${
vtmagic
:0:4
}
"
]
;
then
echo
"vtx=
$vtx
"
>>
$VTLOG
if
[
$vtskip
-eq
0
]
;
then
${
vtx
:5
}
$vtfile
|
(
cpio
-idmu
2>>
$VTLOG
;
cat
>
$vttmp
)
if
[
$vtskip
-eq
0
]
;
then
if
[
"
${
vtx
:5
}
"
=
"xzcat"
]
;
then
rm
-f
$VTOY_PATH
/xzlog
${
vtx
:5
}
$vtfile
2>
$VTOY_PATH
/xzlog |
(
cpio
-idmu
2>>
$VTLOG
;
cat
>
$vttmp
)
if
grep
-q
'corrupted data'
$VTOY_PATH
/xzlog
;
then
echo
'xzcat failed, now try xzminidec...'
>>
$VTLOG
cat
$vtfile
| xzminidec |
(
cpio
-idmu
2>>
$VTLOG
;
cat
>
$vttmp
)
fi
else
${
vtx
:5
}
$vtfile
|
(
cpio
-idmu
2>>
$VTLOG
;
cat
>
$vttmp
)
fi
else
dd
if
=
$vtfile
skip
=
$vtskip
iflag
=
skip_bytes
status
=
none |
${
vtx
:5
}
|
(
cpio
-idmu
2>>
$VTLOG
;
cat
>
$vttmp
)
fi
...
...
@@ -104,64 +115,36 @@ ventoy_unpack_initrd() {
# This export is for busybox cpio command
export
EXTRACT_UNSAFE_SYMLINKS
=
1
# special process
need_xzminidec
()
{
if
[
-e
/initrd001
]
;
then
testmagic
=
$(
hexdump
-n
2
-e
'2/1 "%02X"'
/initrd001
)
else
testmagic
=
'xxxx'
fi
if
[
"FD37"
=
"
${
testmagic
:0:4
}
"
]
;
then
if
echo
$vtkerver
|
grep
-q
'kaspersky'
;
then
true
elif
echo
$vtkerver
|
grep
-q
'kiosk.*Gentoo'
;
then
true
elif
echo
$vtkerver
|
grep
-q
'porteus '
;
then
true
else
false
fi
for
vtfile
in
$(
ls
/initrd
*
)
;
do
#decompress first initrd
vtmagic
=
$(
hexdump
-n
2
-e
'2/1 "%02X"'
$vtfile
)
if
ventoy_is_initrd_ramdisk
;
then
ventoy_unpack_initrd
$vtfile
$vtmagic
${
vtfile
}
_tmp
mv
${
vtfile
}
_tmp
$vtfile
break
else
false
ventoy_unpack_initramfs
$vtfile
0
$vtmagic
${
vtfile
}
_tmp
fi
}
if
need_xzminidec
;
then
echo
"use xzminidec"
>>
$VTLOG
cat
/initrd001 | xzminidec | cpio
-idmu
2>>
$VTLOG
rm
-f
/initrd001
else
for
vtfile
in
$(
ls
/initrd
*
)
;
do
#decompress first initrd
vtmagic
=
$(
hexdump
-n
2
-e
'2/1 "%02X"'
$vtfile
)
if
ventoy_is_initrd_ramdisk
;
then
ventoy_unpack_initrd
$vtfile
$vtmagic
${
vtfile
}
_tmp
mv
${
vtfile
}
_tmp
$vtfile
#only for cpio,cpio,...,initrd sequence, initrd,cpio or initrd,initrd sequence is not supported
while
[
-e
${
vtfile
}
_tmp
]
&&
[
$(
stat
-c
'%s'
${
vtfile
}
_tmp
)
-gt
512
]
;
do
mv
${
vtfile
}
_tmp
$vtfile
vtdump
=
$(
hexdump
-n
512
-e
'512/1 "%02X"'
$vtfile
)
vtmagic
=
$(
echo
$vtdump
|
sed
's/^\(00\)*//'
)
let
vtoffset
=
"(
${#
vtdump
}
-
${#
vtmagic
}
)/2"
if
[
-z
"
$vtmagic
"
]
;
then
echo
"terminate with all zero data file"
>>
$VTLOG
break
else
ventoy_unpack_initramfs
$vtfile
0
$vtmagic
${
vtfile
}
_tmp
fi
#only for cpio,cpio,...,initrd sequence, initrd,cpio or initrd,initrd sequence is not supported
while
[
-e
${
vtfile
}
_tmp
]
&&
[
$(
stat
-c
'%s'
${
vtfile
}
_tmp
)
-gt
512
]
;
do
mv
${
vtfile
}
_tmp
$vtfile
vtdump
=
$(
hexdump
-n
512
-e
'512/1 "%02X"'
$vtfile
)
vtmagic
=
$(
echo
$vtdump
|
sed
's/^\(00\)*//'
)
let
vtoffset
=
"(
${#
vtdump
}
-
${#
vtmagic
}
)/2"
if
[
-z
"
$vtmagic
"
]
;
then
echo
"terminate with all zero data file"
>>
$VTLOG
break
fi
ventoy_unpack_initramfs
$vtfile
$vtoffset
${
vtmagic
:0:4
}
${
vtfile
}
_tmp
done
rm
-f
$vtfile
${
vtfile
}
_tmp
ventoy_unpack_initramfs
$vtfile
$vtoffset
${
vtmagic
:0:4
}
${
vtfile
}
_tmp
done
fi
rm
-f
$vtfile
${
vtfile
}
_tmp
done
#break here for debug
if
[
"
$VTOY_BREAK_LEVEL
"
=
"02"
]
||
[
"
$VTOY_BREAK_LEVEL
"
=
"12"
]
;
then
...
...
IMG/cpio/ventoy/tool/vtoytool_install.sh
View file @
d5b829f8
...
...
@@ -52,3 +52,12 @@ else
$BUSYBOX_PATH
/cp
-a
$VTOY_PATH
/tool/unsquashfs_32
$VTOY_PATH
/tool/vtoy_unsquashfs
fi
if
$VTOY_PATH
/tool/unsquashfs_64
-t
2>>
$VTLOG
;
then
echo
"use unsquashfs_64"
>>
$VTLOG
$BUSYBOX_PATH
/cp
-a
$VTOY_PATH
/tool/unsquashfs_64
$VTOY_PATH
/tool/vtoy_unsquashfs
else
echo
"use unsquashfs_32"
>>
$VTLOG
$BUSYBOX_PATH
/cp
-a
$VTOY_PATH
/tool/unsquashfs_32
$VTOY_PATH
/tool/vtoy_unsquashfs
fi
IMG/cpio/ventoy/tool/xzminidec
0 → 100644
View file @
d5b829f8
File added
IMG/cpio/ventoy/ventoy.sh
View file @
d5b829f8
...
...
@@ -130,6 +130,7 @@ ventoy_get_os_type() {
echo
'xen'
;
return
elif
$GREP
-q
'SUSE '
/etc/os-release
;
then
echo
'suse'
;
return
fi
fi
...
...
@@ -156,6 +157,14 @@ ventoy_get_os_type() {
echo
'debian'
;
return
fi
if
$GREP
-q
'Clear Linux '
/proc/version
;
then
echo
'clear'
;
return
fi
if
$GREP
-q
'artix'
/proc/version
;
then
echo
'arch'
;
return
fi
echo
"default"
}
...
...
INSTALL/EFI/BOOT/BOOTX64.EFI
View file @
d5b829f8
No preview for this file type
INSTALL/EFI/BOOT/MokManager.efi
0 → 100644
View file @
d5b829f8
File added
INSTALL/EFI/BOOT/grubx64.efi
0 → 100644
View file @
d5b829f8
File added
Prev
1
2
3
Next
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment