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
8dce0add
Commit
8dce0add
authored
Aug 29, 2020
by
longpanda
Browse files
update for new release
parent
1bf3e733
Changes
110
Hide whitespace changes
Inline
Side-by-side
Showing
20 changed files
with
646 additions
and
62 deletions
+646
-62
IMG/cpio/ventoy/hook/rancher/ventoy-hook.sh
IMG/cpio/ventoy/hook/rancher/ventoy-hook.sh
+21
-0
IMG/cpio/ventoy/hook/slackware/disk_hook.sh
IMG/cpio/ventoy/hook/slackware/disk_hook.sh
+35
-0
IMG/cpio/ventoy/hook/slackware/ventoy-hook.sh
IMG/cpio/ventoy/hook/slackware/ventoy-hook.sh
+6
-2
IMG/cpio/ventoy/hook/smgl/disk_hook.sh
IMG/cpio/ventoy/hook/smgl/disk_hook.sh
+42
-0
IMG/cpio/ventoy/hook/smgl/ventoy-hook.sh
IMG/cpio/ventoy/hook/smgl/ventoy-hook.sh
+45
-0
IMG/cpio/ventoy/hook/smoothwall/cd_list.sh
IMG/cpio/ventoy/hook/smoothwall/cd_list.sh
+33
-0
IMG/cpio/ventoy/hook/smoothwall/disk_hook.sh
IMG/cpio/ventoy/hook/smoothwall/disk_hook.sh
+52
-0
IMG/cpio/ventoy/hook/smoothwall/ventoy-hook.sh
IMG/cpio/ventoy/hook/smoothwall/ventoy-hook.sh
+25
-0
IMG/cpio/ventoy/hook/suse/disk_hook.sh
IMG/cpio/ventoy/hook/suse/disk_hook.sh
+64
-0
IMG/cpio/ventoy/hook/suse/ventoy-hook.sh
IMG/cpio/ventoy/hook/suse/ventoy-hook.sh
+11
-2
IMG/cpio/ventoy/hook/t2/disk_hook.sh
IMG/cpio/ventoy/hook/t2/disk_hook.sh
+47
-0
IMG/cpio/ventoy/hook/t2/ventoy-hook.sh
IMG/cpio/ventoy/hook/t2/ventoy-hook.sh
+24
-0
IMG/cpio/ventoy/hook/ventoy-hook-lib.sh
IMG/cpio/ventoy/hook/ventoy-hook-lib.sh
+33
-2
IMG/cpio/ventoy/hook/vine/dev-listen.sh
IMG/cpio/ventoy/hook/vine/dev-listen.sh
+18
-18
IMG/cpio/ventoy/hook/vine/udev_disk_hook.sh
IMG/cpio/ventoy/hook/vine/udev_disk_hook.sh
+48
-32
IMG/cpio/ventoy/hook/vine/ventoy-hook.sh
IMG/cpio/ventoy/hook/vine/ventoy-hook.sh
+2
-4
IMG/cpio/ventoy/hook/wifislax/disk_hook.sh
IMG/cpio/ventoy/hook/wifislax/disk_hook.sh
+48
-0
IMG/cpio/ventoy/hook/wifislax/ventoy-hook.sh
IMG/cpio/ventoy/hook/wifislax/ventoy-hook.sh
+26
-0
IMG/cpio/ventoy/init_chain
IMG/cpio/ventoy/init_chain
+4
-2
IMG/cpio/ventoy/loop/LibreELEC/ventoy-disk.sh
IMG/cpio/ventoy/loop/LibreELEC/ventoy-disk.sh
+62
-0
No files found.
IMG/cpio/ventoy/hook/rancher/ventoy-hook.sh
0 → 100644
View file @
8dce0add
#!/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
IMG/cpio/ventoy/hook/slackware/disk_hook.sh
0 → 100644
View file @
8dce0add
#!/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
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"
PATH
=
$VTPATH_OLD
IMG/cpio/ventoy/hook/slackware/ventoy-hook.sh
View file @
8dce0add
...
@@ -2,7 +2,11 @@
...
@@ -2,7 +2,11 @@
.
$VTOY_PATH
/hook/ventoy-os-lib.sh
.
$VTOY_PATH
/hook/ventoy-os-lib.sh
ventoy_systemd_udevd_work_around
if
$GREP
'^mediadetected='
/init
;
then
$SED
"/^mediadetected=/i
$BUSYBOX_PATH
/sh
$VTOY_PATH
/hook/slackware/disk_hook.sh"
-i
/init
else
ventoy_systemd_udevd_work_around
ventoy_add_udev_rule
"
$VTOY_PATH
/hook/slackware/udev_disk_hook.sh %k noreplace"
fi
ventoy_add_udev_rule
"
$VTOY_PATH
/hook/slackware/udev_disk_hook.sh %k noreplace"
IMG/cpio/ventoy/hook/smgl/disk_hook.sh
0 → 100644
View file @
8dce0add
#!/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
VTPATH_OLD
=
$PATH
;
PATH
=
$BUSYBOX_PATH
:
$VTOY_PATH
/tool:
$PATH
#exec /ventoy/busybox/sh
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"
blkdev_num
=
$(
$VTOY_PATH
/tool/dmsetup
ls
|
grep
ventoy |
sed
's/.*(\([0-9][0-9]*\),.*\([0-9][0-9]*\).*/\1 \2/'
)
mknod
-m
660 /dev/ventoy b
$blkdev_num
echo
"/dev/ventoy"
>
cdrom.hint
PATH
=
$VTPATH_OLD
IMG/cpio/ventoy/hook/smgl/ventoy-hook.sh
0 → 100644
View file @
8dce0add
#!/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
PATH
=
$PATH
:
$VTOY_PATH
/busybox
mkdir
/ventoy_rdroot
mknod
-m
660 /ram0 b 1 0
dd
if
=
/initrd001
of
=
/ram0
rm
-f
/initrd001
mount /ram0 /ventoy_rdroot
vtSize
=
$(
du
-m
-s
$VTOY_PATH
|
awk
'{print $1}'
)
let
vtSize
=
vtSize+4
mkdir
-p
/ventoy_rdroot/ventoy
mount
-t
tmpfs
-o
size
=
${
vtSize
}
m tmpfs /ventoy_rdroot/ventoy
cp
-a
/ventoy/
*
/ventoy_rdroot/ventoy/
cd
/ventoy_rdroot
sed
"/scan_cdroms *
$/
i
$BUSYBOX_PATH
/sh
$VTOY_PATH
/hook/smgl/disk_hook.sh"
-i
sbin/smgl.init
IMG/cpio/ventoy/hook/smoothwall/cd_list.sh
0 → 100644
View file @
8dce0add
#!/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
VTPATH_OLD
=
$PATH
;
PATH
=
$BUSYBOX_PATH
:
$VTOY_PATH
/tool:
$PATH
blkdev_num
=
$(
$VTOY_PATH
/tool/dmsetup
ls
|
grep
ventoy |
sed
's/.*(\([0-9][0-9]*\),.*\([0-9][0-9]*\).*/\1:\2/'
)
vtDM
=
$(
ventoy_find_dm_id
${
blkdev_num
}
)
vtSize
=
$(
cat
/sys/block/
$vtDM
/size
)
cp
-a
/tmp/cd.list /tmp/cd_new.list
echo
"
$vtDM
$vtSize
UNK_MODEL "
>
/tmp/cd.list
cat
/tmp/cd_new.list
>>
/tmp/cd.list
rm
-f
/tmp/cd_new.list
PATH
=
$VTPATH_OLD
IMG/cpio/ventoy/hook/smoothwall/disk_hook.sh
0 → 100644
View file @
8dce0add
#!/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
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"
blkdev_num
=
$(
$VTOY_PATH
/tool/dmsetup
ls
|
grep
ventoy |
sed
's/.*(\([0-9][0-9]*\),.*\([0-9][0-9]*\).*/\1:\2/'
)
vtDM
=
$(
ventoy_find_dm_id
${
blkdev_num
}
)
if
[
"
$1
"
=
"fakecdrom"
]
;
then
if
[
-e
/dev/sr0
]
;
then
for
i
in
0 1 2 3 4 5 6 7 8
;
do
if
!
[
-e
/dev/sr
$i
]
;
then
mv
/dev/sr0 /dev/sr
$i
cp
-a
/dev/
$vtDM
/dev/sr0
break
fi
done
else
cp
-a
/dev/
$vtDM
/dev/sr0
fi
fi
PATH
=
$VTPATH_OLD
IMG/cpio/ventoy/hook/smoothwall/ventoy-hook.sh
0 → 100644
View file @
8dce0add
#!/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
"/Running installer/i
$BUSYBOX_PATH
/sh
$VTOY_PATH
/hook/smoothwall/disk_hook.sh fakecdrom"
-i
/etc/install.rc
$SED
"/cd
\/
sys
\/
block/a
$BUSYBOX_PATH
/sh
$VTOY_PATH
/hook/smoothwall/disk_hook.sh"
-i
/etc/config-install.rc
$SED
"/wc *-l *
\/
tmp
\/
cd.list/i
$BUSYBOX_PATH
/sh
$VTOY_PATH
/hook/smoothwall/cd_list.sh"
-i
/etc/config-install.rc
IMG/cpio/ventoy/hook/suse/disk_hook.sh
0 → 100644
View file @
8dce0add
#!/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
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/system/squashfs_sys.img
$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 2>>
$VTLOG
umount
$VTOY_PATH
/mnt/iso 2>>
$VTLOG
umount
$VTOY_PATH
/mnt/fuse 2>>
$VTLOG
}
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
modprobe fuse
ventoy_os_install_dmsetup_by_fuse
$vtdiskname
$(
uname
-r
)
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
0660 /dev/ventoy b
$blkdev_num
PATH
=
$VTPATH_OLD
IMG/cpio/ventoy/hook/suse/ventoy-hook.sh
View file @
8dce0add
...
@@ -31,5 +31,14 @@ fi
...
@@ -31,5 +31,14 @@ fi
#echo "install: hd:/?device=/dev/mapper/ventoy" >> /info-ventoy
#echo "install: hd:/?device=/dev/mapper/ventoy" >> /info-ventoy
#$SED "1 iinfo: file:/info-ventoy" -i /linuxrc.config
#$SED "1 iinfo: file:/info-ventoy" -i /linuxrc.config
ventoy_systemd_udevd_work_around
if
[
-e
/etc/initrd.functions
]
&&
$GREP
-q
'HPIP'
/etc/initrd.functions
;
then
ventoy_add_udev_rule
"
$VTOY_PATH
/hook/suse/udev_disk_hook.sh %k"
echo
"HPIP"
>>
$VTLOG
$BUSYBOX_PATH
/mkdir /dev
$BUSYBOX_PATH
/mknod
-m
660 /dev/console b 5 1
$SED
"/CD_DEVICES=/a
$BUSYBOX_PATH
/sh
$VTOY_PATH
/hook/suse/disk_hook.sh"
-i
/etc/initrd.functions
$SED
"/CD_DEVICES=/a CD_DEVICES=
\"
/dev/ventoy
\$
CD_DEVICES
\"
"
-i
/etc/initrd.functions
else
echo
"SUSE"
>>
$VTLOG
ventoy_systemd_udevd_work_around
ventoy_add_udev_rule
"
$VTOY_PATH
/hook/suse/udev_disk_hook.sh %k"
fi
IMG/cpio/ventoy/hook/t2/disk_hook.sh
0 → 100644
View file @
8dce0add
#!/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
VTPATH_OLD
=
$PATH
;
PATH
=
$BUSYBOX_PATH
:
$VTOY_PATH
/tool:
$PATH
modprobe dm-mod
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"
blkdev_num
=
$(
$VTOY_PATH
/tool/dmsetup
ls
|
grep
ventoy |
sed
's/.*(\([0-9][0-9]*\),.*\([0-9][0-9]*\).*/\1 \2/'
)
mknod
-m
0660 /dev/ventoy b
$blkdev_num
PATH
=
$VTPATH_OLD
set_ventoy_hook_finish
IMG/cpio/ventoy/hook/t2/ventoy-hook.sh
0 → 100644
View file @
8dce0add
#!/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
"/getdevice *devicefile/i
$BUSYBOX_PATH
/sh
$VTOY_PATH
/hook/t2/disk_hook.sh"
-i
/init
$SED
"/getdevice *devicefile/a devicefile=/dev/ventoy"
-i
/init
IMG/cpio/ventoy/hook/ventoy-hook-lib.sh
View file @
8dce0add
...
@@ -343,6 +343,37 @@ extract_file_from_line() {
...
@@ -343,6 +343,37 @@ extract_file_from_line() {
fi
fi
}
}
extract_rpm_from_line
()
{
vtlog
"extract_rpm_from_line
$1
disk=#
$2
#"
if
!
[
-b
"
$2
"
]
;
then
vterr
"disk #
$2
# not exist"
return
fi
sector
=
$(
echo
$1
|
$AWK
'{print $(NF-1)}'
)
length
=
$(
echo
$1
|
$AWK
'{print $NF}'
)
vtlog
"sector=
$sector
length=
$length
"
$VTOY_PATH
/tool/vtoydm
-e
-f
$VTOY_PATH
/ventoy_image_map
-d
${
2
}
-s
$sector
-l
$length
-o
/tmp/xxx.rpm
if
[
-e
/tmp/xxx.rpm
]
;
then
vtlog
"extract rpm file from iso success"
else
vterr
"extract rpm file from iso fail"
return
fi
CURPWD
=
$(
$BUSYBOX_PATH
/pwd
)
$BUSYBOX_PATH
/mkdir
-p
$VTOY_PATH
/rpm
cd
$VTOY_PATH
/rpm
vtlog
"extract rpm..."
$BUSYBOX_PATH
/rpm2cpio /tmp/xxx.rpm |
$BUSYBOX_PATH
/cpio
-idm
2>>
$VTLOG
cd
$CURPWD
$BUSYBOX_PATH
/rm
-f
/tmp/xxx.rpm
}
install_rpm_from_line
()
{
install_rpm_from_line
()
{
vtlog
"install_rpm_from_line
$1
disk=#
$2
#"
vtlog
"install_rpm_from_line
$1
disk=#
$2
#"
...
@@ -535,9 +566,9 @@ ventoy_swap_device() {
...
@@ -535,9 +566,9 @@ ventoy_swap_device() {
ventoy_extract_vtloopex
()
{
ventoy_extract_vtloopex
()
{
vtCurPwd
=
$PWD
vtCurPwd
=
$PWD
$BUSYBOX_PATH
/mkdir
-p
$VTOY_PATH
/partmnt
$VTOY_PATH
/vtloopex
$BUSYBOX_PATH
/mkdir
-p
$VTOY_PATH
/partmnt
$VTOY_PATH
/vtloopex
$BUSYBOX_PATH
/mount
-o
ro
-t
vfat
/dev/
${
vtdiskname
#/dev/
}
2
$VTOY_PATH
/partmnt
$BUSYBOX_PATH
/mount
-o
ro
-t
vfat
$1
$VTOY_PATH
/partmnt
cd
$VTOY_PATH
/vtloopex
cd
$VTOY_PATH
/vtloopex
$CAT
$VTOY_PATH
/partmnt/ventoy/vtloopex.cpio |
$BUSYBOX_PATH
/cpio
-idm
$CAT
$VTOY_PATH
/partmnt/ventoy/vtloopex.cpio |
$BUSYBOX_PATH
/cpio
-idm
>>
$VTLOG
2>&1
$BUSYBOX_PATH
/umount
$VTOY_PATH
/partmnt
$BUSYBOX_PATH
/umount
$VTOY_PATH
/partmnt
$BUSYBOX_PATH
/rm
-rf
$VTOY_PATH
/partmnt
$BUSYBOX_PATH
/rm
-rf
$VTOY_PATH
/partmnt
...
...
IMG/cpio/ventoy/hook/vine/dev-listen.sh
View file @
8dce0add
...
@@ -19,21 +19,20 @@
...
@@ -19,21 +19,20 @@
.
/ventoy/hook/ventoy-hook-lib.sh
.
/ventoy/hook/ventoy-hook-lib.sh
while
[
-n
"1"
]
;
do
vine_wait_for_exist
()
{
if
[
-e
/dev/null
]
;
then
while
[
-n
"1"
]
;
do
break
if
[
-e
$1
]
;
then
else
break
$SLEEP
0.5
else
fi
$SLEEP
0.5
done
fi
done
}
vine_wait_for_exist /dev/null
vine_wait_for_exist /sys/block
vine_wait_for_exist /proc/ide
while
[
-n
"1"
]
;
do
if
[
-e
/sys/block
]
;
then
break
else
$SLEEP
0.5
fi
done
while
[
-n
"Y"
]
;
do
while
[
-n
"Y"
]
;
do
vtdiskname
=
$(
get_ventoy_disk_name
)
vtdiskname
=
$(
get_ventoy_disk_name
)
...
@@ -51,13 +50,14 @@ if ! [ -b $vtdiskname ]; then
...
@@ -51,13 +50,14 @@ if ! [ -b $vtdiskname ]; then
$BUSYBOX_PATH
/mknod
-m
0660
$vtdiskname
b
$blkdev
$BUSYBOX_PATH
/mknod
-m
0660
$vtdiskname
b
$blkdev
fi
fi
if
!
[
-b
"
${
vtdiskname
}
1"
]
;
then
blkdev
=
$(
$CAT
/sys/class/block/
${
vtshortdev
}
1/dev |
$SED
's/:/ /g'
)
$BUSYBOX_PATH
/mknod
-m
0660
"
${
vtdiskname
}
1"
b
$blkdev
fi
if
!
[
-b
"
${
vtdiskname
}
2"
]
;
then
if
!
[
-b
"
${
vtdiskname
}
2"
]
;
then
blkdev
=
$(
$CAT
/sys/class/block/
${
vtshortdev
}
2/dev |
$SED
's/:/ /g'
)
blkdev
=
$(
$CAT
/sys/class/block/
${
vtshortdev
}
2/dev |
$SED
's/:/ /g'
)
$BUSYBOX_PATH
/mknod
-m
0660
"
${
vtdiskname
}
2"
b
$blkdev
$BUSYBOX_PATH
/mknod
-m
0660
"
${
vtdiskname
}
2"
b
$blkdev
fi
fi
$BUSYBOX_PATH
/ls /dev/
>
/dev/console
$BUSYBOX_PATH
/sh
$VTOY_PATH
/hook/vine/udev_disk_hook.sh
"
${
vtdiskname
#/dev/
}
2"
$BUSYBOX_PATH
/sh
$VTOY_PATH
/hook/vine/udev_disk_hook.sh
"
${
vtdiskname
#/dev/
}
2"
IMG/cpio/ventoy/hook/vine/udev_disk_hook.sh
View file @
8dce0add
...
@@ -19,10 +19,27 @@
...
@@ -19,10 +19,27 @@
.
/ventoy/hook/ventoy-hook-lib.sh
.
/ventoy/hook/ventoy-hook-lib.sh
vtCheatLoop
=
loop6
ventoy_os_install_dmsetup_by_ko
()
{
vtlog
"ventoy_os_install_dmsetup_by_ko
$1
"
vtVer
=
$(
$BUSYBOX_PATH
/uname
-r
)
if
$BUSYBOX_PATH
/uname
-m
|
$GREP
-q
64
;
then
vtBit
=
64
else
vtBit
=
32
fi
ventoy_extract_vtloopex
$1
vine
vtLoopExDir
=
$VTOY_PATH
/vtloopex/vine/vtloopex
if
[
-e
$vtLoopExDir
/dm-mod/
$vtVer
/
$vtBit
/dm-mod.ko.xz
]
;
then
$BUSYBOX_PATH
/xz
-d
$vtLoopExDir
/dm-mod/
$vtVer
/
$vtBit
/dm-mod.ko.xz
insmod
$vtLoopExDir
/dm-mod/
$vtVer
/
$vtBit
/dm-mod.ko
fi
}
ventoy_os_install_dmsetup
()
{
ventoy_os_install_dmsetup
_by_rpm
()
{
vtlog
"ventoy_os_install_dmsetup
$1
"
vtlog
"ventoy_os_install_dmsetup
_by_rpm
$1
"
vt_usb_disk
=
$1
vt_usb_disk
=
$1
...
@@ -32,48 +49,47 @@ ventoy_os_install_dmsetup() {
...
@@ -32,48 +49,47 @@ ventoy_os_install_dmsetup() {
# install dmsetup
# install dmsetup
LINE
=
$(
$GREP
'kernel-[0-9].*\.rpm'
$VTOY_PATH
/iso_file_list
)
LINE
=
$(
$GREP
'kernel-[0-9].*\.rpm'
$VTOY_PATH
/iso_file_list
)
if
[
$?
-eq
0
]
;
then
if
[
$?
-eq
0
]
;
then
install
_rpm_from_line
"
$LINE
"
${
vt_usb_disk
}
extract
_rpm_from_line
"
$LINE
"
${
vt_usb_disk
}
fi
fi
$BUSYBOX_PATH
/modprobe dm-mod
vtKoName
=
$(
$BUSYBOX_PATH
/find
$VTOY_PATH
/rpm/
-name
dm-mod.ko
*
)
vtlog
"vtKoName=
$vtKoName
"
vtlog
"dmsetup install finish, now check it..."
insmod
$vtKoName
dmsetup_path
=
/ventoy/tool/dmsetup
$BUSYBOX_PATH
/rm
-rf
$VTOY_PATH
/rpm/
if
[
-z
"
$dmsetup_path
"
]
;
then
vterr
"dmsetup still not found after install"
elif
$dmsetup_path
info
>>
$VTLOG
2>&1
;
then
vtlog
"
$dmsetup_path
work ok"
else
vterr
"
$dmsetup_path
not work"
fi
}
}
if
is_ventoy_hook_finished
||
not_ventoy_disk
"
${
1
:0:-1
}
"
;
then
if
is_ventoy_hook_finished
||
not_ventoy_disk
"
${
1
:0:-1
}
"
;
then
# /dev/vtCheatLoop come first
if
[
"
$1
"
=
"
$vtCheatLoop
"
]
&&
[
-b
$VTOY_DM_PATH
]
;
then
ventoy_copy_device_mapper /dev/
$vtCheatLoop
fi
exit
0
exit
0
fi
fi
ventoy_os_install_dmsetup
"/dev/
${
1
:0:-1
}
"
ventoy_os_install_dmsetup_by_ko
"/dev/
$1
"
if
$GREP
-q
'device.mapper'
/proc/devices
;
then
vtlog
"device-mapper module install OK"
else
ventoy_os_install_dmsetup_by_rpm
"/dev/
${
1
:0:-1
}
"
fi
ventoy_udev_disk_common_hook
$*
ventoy_udev_disk_common_hook
$*
"noreplace"
blkdev_num
=
$(
$VTOY_PATH
/tool/dmsetup
ls
|
$GREP
ventoy |
$SED
's/.*(\([0-9][0-9]*\),.*\([0-9][0-9]*\).*/\1:\2/'
)
blkdev_num_dev
=
$(
$VTOY_PATH
/tool/dmsetup
ls
|
$GREP
ventoy |
$SED
's/.*(\([0-9][0-9]*\),.*\([0-9][0-9]*\).*/\1 \2/'
)
vtDM
=
$(
ventoy_find_dm_id
${
blkdev_num
}
)
$BUSYBOX_PATH
/mount
$VTOY_DM_PATH
/mnt/ventoy
[
-b
/dev/
$vtDM
]
||
$BUSYBOX_PATH
/mknod
-m
0660 /dev/
$vtDM
b
$blkdev_num_dev
$BUSYBOX_PATH
/rm
-rf
/dev/mapper
#
#Create a fake IDE-CDROM driver can't be ide-scsi /proc has been patched to /vtoy
# We do a trick for rhel6 series here.
$BUSYBOX_PATH
/mkdir
-p
/vtoy
# Use /dev/$vtCheatLoop and wapper it as a removable cdrom with bind mount.
$BUSYBOX_PATH
/cp
-a
/proc/ide /vtoy/
# Then the anaconda installer will accept /dev/$vtCheatLoop as the install medium.
$BUSYBOX_PATH
/mkdir
-p
/vtoy/ide/aztcd
#
ventoy_copy_device_mapper /dev/
$vtCheatLoop
echo
'ide'
>
/vtoy/ide/aztcd/driver
echo
'cdrom'
>
/vtoy/ide/aztcd/media
$BUSYBOX_PATH
/cp
-a
/sys/devices/virtual/block/
$vtCheatLoop
/tmp/
>>
$VTLOG
2>&1
echo
19
>
/tmp/
$vtCheatLoop
/capability
$BUSYBOX_PATH
/mount
--bind
/tmp/
$vtCheatLoop
/sys/block/
$vtCheatLoop
>>
$VTLOG
2>&1
# OK finish
# OK finish
set_ventoy_hook_finish
set_ventoy_hook_finish
exit
0
IMG/cpio/ventoy/hook/vine/ventoy-hook.sh
View file @
8dce0add
...
@@ -19,10 +19,8 @@
...
@@ -19,10 +19,8 @@
.
$VTOY_PATH
/hook/ventoy-os-lib.sh
.
$VTOY_PATH
/hook/ventoy-os-lib.sh
$BUSYBOX_PATH
/mkdir
-p
/etc/anaconda.repos.d /mnt/ventoy
$BUSYBOX_PATH
/cp
-a
/sbin/loader /sbin/loader_bk
ventoy_print_yum_repo
"ventoy"
"file:///mnt/ventoy"
>
/etc/anaconda.repos.d/ventoy.repo
$VTOY_PATH
/tool/vine_patch_loader /sbin/loader 253
-v
>>
$VTLOG
$BUSYBOX_PATH
/mknod
-m
0660 /dev/null c 1 3
$BUSYBOX_PATH
/mknod
-m
0660 /dev/null c 1 3
$VTOY_PATH
/hook/vine/dev-listen.sh &
$VTOY_PATH
/hook/vine/dev-listen.sh &
IMG/cpio/ventoy/hook/wifislax/disk_hook.sh
0 → 100644
View file @
8dce0add
#!/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
VTPATH_OLD
=
$PATH
;
PATH
=
$BUSYBOX_PATH
:
$VTOY_PATH
/tool:
$PATH
vtlog
"#####
$0
$*
#####"
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"
while
true
;
do
if
blkid |
grep
-q
'/dev/dm'
;
then
vtlog
'Find /dev/dm ...'
break
else
vtlog
'Wait /dev/dm ...'
sleep
0.3
fi
done
PATH
=
$VTPATH_OLD
IMG/cpio/ventoy/hook/wifislax/ventoy-hook.sh
0 → 100644
View file @
8dce0add
#!/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
"/mount.*devtmpfs/a
$BUSYBOX_PATH
/sh
$VTOY_PATH
/hook/wifislax/disk_hook.sh"
-i
/linuxrc
#replace original blkid
$BUSYBOX_PATH
/rm
-f
/usr/bin/blkid
$BUSYBOX_PATH
/cp
-a
$BUSYBOX_PATH
/blkid /usr/bin/blkid
IMG/cpio/ventoy/init_chain
View file @
8dce0add
...
@@ -37,9 +37,11 @@ else
...
@@ -37,9 +37,11 @@ else
fi
fi
ventoy_is_initrd_ramdisk
()
{
ventoy_is_initrd_ramdisk
()
{
#As I known, PCLinuxOS use ramdisk
#As I known, PCLinuxOS
/smgl
use ramdisk
if
echo
$vtkerver
|
grep
-i
-q
'PCLinuxOS'
;
then
if
echo
$vtkerver
|
grep
-i
-q
'PCLinuxOS'
;
then
true
true
elif
echo
$vtkerver
|
grep
-i
-q
'SMGL-'
;
then
true
else
else
false
false
fi
fi
...
@@ -68,7 +70,7 @@ ventoy_unpack_initramfs() {
...
@@ -68,7 +70,7 @@ ventoy_unpack_initramfs() {
return
return
fi
fi
for
vtx
in
'1F8B zcat'
'1F9E zcat'
'425A bzcat'
'5D00 lzcat'
'FD37 xzcat'
'894C lzopcat'
'0221 lz4cat'
'28B5 zstdcat'
'3037 cat'
;
do
for
vtx
in
'1F8B zcat'
'1F9E zcat'
'425A bzcat'
'5D00 lzcat'
'FD37 xzcat'
'894C lzopcat'
'0221 lz4cat'
'28B5 zstdcat'
'3037 cat'
'4C5A lunzip -c'
;
do
if
[
"
${
vtx
:0:4
}
"
=
"
${
vtmagic
:0:4
}
"
]
;
then
if
[
"
${
vtx
:0:4
}
"
=
"
${
vtmagic
:0:4
}
"
]
;
then
echo
"vtx=
$vtx
"
>>
$VTLOG
echo
"vtx=
$vtx
"
>>
$VTLOG
if
[
$vtskip
-eq
0
]
;
then
if
[
$vtskip
-eq
0
]
;
then
...
...
IMG/cpio/ventoy/loop/LibreELEC/ventoy-disk.sh
0 → 100644
View file @
8dce0add
#!/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
vtKerVer
=
$(
uname
-r
)
if
uname
-m
|
grep
-q
64
;
then
vtBit
=
64
else
vtBit
=
32
fi
xz
-d
$VTOY_PATH
/vtloopex/dm-mod/
$vtKerVer
/
$vtBit
/dm-mod.ko.xz
insmod
$VTOY_PATH
/vtloopex/dm-mod/
$vtKerVer
/
$vtBit
/dm-mod.ko
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"
ventoy_create_dev_ventoy_part
mkdir
/ventoy/mnt
mount /dev/ventoy2 /ventoy/mnt
rm
-f
/ventoy/mnt/.please_resize_me
sync
umount /ventoy/mnt
PATH
=
$VTPATH_OLD
set_ventoy_hook_finish
Prev
1
2
3
4
5
6
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