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
4d4f9584
Commit
4d4f9584
authored
May 05, 2022
by
longpanda
Browse files
Fix the hardcoded dev/dm-0
parent
3263b64b
Changes
14
Hide whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
88 additions
and
34 deletions
+88
-34
IMG/cpio/ventoy/hook/blackPanther/ventoy-hook.sh
IMG/cpio/ventoy/hook/blackPanther/ventoy-hook.sh
+1
-1
IMG/cpio/ventoy/hook/blackPanther/ventoy-inotifyd-hook.sh
IMG/cpio/ventoy/hook/blackPanther/ventoy-inotifyd-hook.sh
+2
-4
IMG/cpio/ventoy/hook/easystartup/disk_hook.sh
IMG/cpio/ventoy/hook/easystartup/disk_hook.sh
+4
-1
IMG/cpio/ventoy/hook/easystartup/ventoy-hook.sh
IMG/cpio/ventoy/hook/easystartup/ventoy-hook.sh
+1
-1
IMG/cpio/ventoy/hook/lunar/ventoy-hook.sh
IMG/cpio/ventoy/hook/lunar/ventoy-hook.sh
+1
-1
IMG/cpio/ventoy/hook/lunar/ventoy-inotifyd-hook.sh
IMG/cpio/ventoy/hook/lunar/ventoy-inotifyd-hook.sh
+2
-1
IMG/cpio/ventoy/hook/mageia/ventoy-inotifyd-hook.sh
IMG/cpio/ventoy/hook/mageia/ventoy-inotifyd-hook.sh
+1
-1
IMG/cpio/ventoy/hook/openEuler/ventoy-hook.sh
IMG/cpio/ventoy/hook/openEuler/ventoy-hook.sh
+13
-4
IMG/cpio/ventoy/hook/openEuler/ventoy-inotifyd-hook.sh
IMG/cpio/ventoy/hook/openEuler/ventoy-inotifyd-hook.sh
+14
-10
IMG/cpio/ventoy/hook/openEuler/ventoy-make-link.sh
IMG/cpio/ventoy/hook/openEuler/ventoy-make-link.sh
+12
-5
IMG/cpio/ventoy/hook/openEuler/ventoy-timeout.sh
IMG/cpio/ventoy/hook/openEuler/ventoy-timeout.sh
+15
-4
IMG/cpio/ventoy/hook/rhel7/ventoy-hook.sh
IMG/cpio/ventoy/hook/rhel7/ventoy-hook.sh
+4
-1
IMG/cpio/ventoy/hook/rhel7/ventoy-inotifyd-hook.sh
IMG/cpio/ventoy/hook/rhel7/ventoy-inotifyd-hook.sh
+9
-0
IMG/cpio/ventoy/hook/rhel7/ventoy-timeout.sh
IMG/cpio/ventoy/hook/rhel7/ventoy-timeout.sh
+9
-0
No files found.
IMG/cpio/ventoy/hook/blackPanther/ventoy-hook.sh
View file @
4d4f9584
...
...
@@ -22,4 +22,4 @@
ventoy_set_inotify_script blackPanther/ventoy-inotifyd-hook.sh
$BUSYBOX_PATH
/cp
-a
$VTOY_PATH
/hook/blackPanther/ventoy-inotifyd-start.sh /lib/dracut/hooks/pre-udev/00-ventoy-inotifyd-start.sh
$SED
"s#printf
\(
.*
\)\$
CMDLINE#printf
\1
root=/dev/
dm-0
\$
CMDLINE root=/dev/
dm-0
#"
-i
/lib/dracut-lib.sh
$SED
"s#printf
\(
.*
\)\$
CMDLINE#printf
\1
root=/dev/
ventoy
\$
CMDLINE root=/dev/
ventoy
#"
-i
/lib/dracut-lib.sh
IMG/cpio/ventoy/hook/blackPanther/ventoy-inotifyd-hook.sh
View file @
4d4f9584
...
...
@@ -33,10 +33,8 @@ if is_inotify_ventoy_part $3; then
$BUSYBOX_PATH
/sh
$VTOY_PATH
/hook/default/udev_disk_hook.sh
$3
noreplace
blkdev_num_dev
=
$(
$VTOY_PATH
/tool/dmsetup
ls
|
grep
ventoy |
sed
's/.*(\([0-9][0-9]*\),.*\([0-9][0-9]*\).*/\1 \2/'
)
if
!
[
-e
/dev/dm-0
]
;
then
mknod
-m
660 /dev/dm-0 b
$blkdev_num_dev
fi
blackPanther-root /dev/dm-0
mknod
-m
660 /dev/ventoy b
$blkdev_num_dev
blackPanther-root /dev/ventoy
set_ventoy_hook_finish
else
...
...
IMG/cpio/ventoy/hook/easystartup/disk_hook.sh
View file @
4d4f9584
...
...
@@ -78,6 +78,9 @@ fi
ventoy_udev_disk_common_hook
"
${
vtdiskname
#/dev/
}
2"
"noreplace"
ln
-s
/dev/dm-0 /dev/root
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
}
)
cp
-a
/dev/
$vtDM
/dev/ventoy
ln
-s
/dev/
$vtDM
/dev/root
PATH
=
$VTPATH_OLD
IMG/cpio/ventoy/hook/easystartup/ventoy-hook.sh
View file @
4d4f9584
...
...
@@ -19,5 +19,5 @@
.
$VTOY_PATH
/hook/ventoy-os-lib.sh
$SED
"s#^CDROM=.*#CDROM=/dev/
dm-0
#"
-i
/init
$SED
"s#^CDROM=.*#CDROM=/dev/
ventoy
#"
-i
/init
$BUSYBOX_PATH
/cp
-a
$VTOY_PATH
/hook/easystartup/ventoy-initqueue.sh /initqueue/ventoy.sh
IMG/cpio/ventoy/hook/lunar/ventoy-hook.sh
View file @
4d4f9584
...
...
@@ -19,7 +19,7 @@
.
$VTOY_PATH
/hook/ventoy-os-lib.sh
$SED
"s#printf
\(
.*
\)\$
CMDLINE#printf
\1\$
CMDLINE root=/dev/
dm-0
#"
-i
/lib/dracut-lib.sh
$SED
"s#printf
\(
.*
\)\$
CMDLINE#printf
\1\$
CMDLINE root=/dev/
ventoy
#"
-i
/lib/dracut-lib.sh
$BUSYBOX_PATH
/rm
-f
/usr/lib/systemd/system-generators/systemd-fstab-generator /lib/systemd/system-generators/systemd-fstab-generator
...
...
IMG/cpio/ventoy/hook/lunar/ventoy-inotifyd-hook.sh
View file @
4d4f9584
...
...
@@ -35,7 +35,8 @@ if is_inotify_ventoy_part $3; then
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
}
)
mount
-t
iso9660 /dev/
$vtDM
/sysroot
cp
-a
/dev/
$vtDM
/dev/ventoy
mount
-t
iso9660 /dev/ventoy /sysroot
set_ventoy_hook_finish
else
...
...
IMG/cpio/ventoy/hook/mageia/ventoy-inotifyd-hook.sh
View file @
4d4f9584
...
...
@@ -59,7 +59,7 @@ if is_inotify_ventoy_part $3; then
$BUSYBOX_PATH
/cp
-a
$BUSYBOX_PATH
/blkid /sbin/blkid
$BUSYBOX_PATH
/mkdir
-p
/dev/mapper
ln
-s
/dev/
$vtDM
/dev/mapper/ventoy
/sbin/mgalive-root /dev/
dm-0
/sbin/mgalive-root /dev/
$vtDM
fi
set_ventoy_hook_finish
...
...
IMG/cpio/ventoy/hook/openEuler/ventoy-hook.sh
View file @
4d4f9584
...
...
@@ -25,13 +25,19 @@ else
for
vtParam
in
$(
$CAT
/proc/cmdline
)
;
do
if
echo
$vtParam
|
$GREP
-q
'inst.ks=hd:LABEL='
;
then
vtRawKs
=
$(
echo
$vtParam
|
$AWK
-F
:
'{print $NF}'
)
VTKS
=
"inst.ks=hd:/dev/
dm-0
:
$vtRawKs
"
VTKS
=
"inst.ks=hd:/dev/
ventoy
:
$vtRawKs
"
break
fi
if
echo
$vtParam
|
$GREP
-q
'^ks=.*:/'
;
then
vtRawKs
=
$(
echo
$vtParam
|
$AWK
-F
:
'{print $NF}'
)
VTKS
=
"ks=hd:/dev/dm-0:
$vtRawKs
"
VTKS
=
"ks=hd:/dev/ventoy:
$vtRawKs
"
break
fi
if
echo
$vtParam
|
$GREP
-q
'^inst.ks=.*:/'
;
then
vtRawKs
=
$(
echo
$vtParam
|
$AWK
-F
:
'{print $NF}'
)
VTKS
=
"inst.ks=hd:/dev/ventoy:
$vtRawKs
"
break
fi
done
...
...
@@ -54,9 +60,12 @@ if [ -f $VTOY_PATH/ventoy_persistent_map ]; then
$BUSYBOX_PATH
/rm
-rf
$VTOY_PATH
/selinuxfs
fi
echo
"VTKS=
$VTKS
VTOVERLAY=
$VTOVERLAY
"
>>
$VTLOG
if
[
-n
"
$vtRawKs
"
]
;
then
echo
"
$vtRawKs
"
>
$VTOY_PATH
/ventoy_ks_rootpath
fi
if
ls
$VTOY_PATH
|
$GREP
-q
'ventoy_dud[0-9]'
;
then
for
vtDud
in
$(
ls
$VTOY_PATH
/ventoy_dud
*
)
;
do
vtInstDD
=
"
$vtInstDD
inst.dd=file:
$vtDud
"
...
...
@@ -64,7 +73,7 @@ if ls $VTOY_PATH | $GREP -q 'ventoy_dud[0-9]'; then
fi
echo
"vtInstDD=
$vtInstDD
"
>>
$VTLOG
$SED
"s#printf
\(
.*
\)\$
CMDLINE#printf
\1\$
CMDLINE inst.stage2=hd:/dev/
dm-0
$VTKS
$vtInstDD
#"
-i
/lib/dracut-lib.sh
$SED
"s#printf
\(
.*
\)\$
CMDLINE#printf
\1\$
CMDLINE inst.stage2=hd:/dev/
ventoy
$VTKS
$VTOVERLAY
$vtInstDD
#"
-i
/lib/dracut-lib.sh
ventoy_set_inotify_script openEuler/ventoy-inotifyd-hook.sh
...
...
IMG/cpio/ventoy/hook/openEuler/ventoy-inotifyd-hook.sh
View file @
4d4f9584
...
...
@@ -35,19 +35,23 @@ if is_inotify_ventoy_part $3; then
$BUSYBOX_PATH
/sh
$VTOY_PATH
/hook/default/udev_disk_hook.sh
$3
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
[
"
$vtDM
"
=
"dm-0"
]
;
then
vtlog
"This is dm-0, OK ..."
else
vtlog
"####### This is
$vtDM
####### this is abnormal ..."
ventoy_swap_device /dev/dm-0 /dev/
$vtDM
blkdev_num_mknod
=
$(
$VTOY_PATH
/tool/dmsetup
ls
|
$GREP
ventoy |
sed
's/.*(\([0-9][0-9]*\),.*\([0-9][0-9]*\).*/\1 \2/'
)
$BUSYBOX_PATH
/mknod
-m
660 /dev/ventoy b
$blkdev_num_mknod
$BUSYBOX_PATH
/modprobe isofs
>
/dev/null 2>&1
vtlog
"mknod /dev/ventoy
$blkdev_num_mknod
"
if
[
-f
$VTOY_PATH
/ventoy_ks_rootpath
]
;
then
vt_ks_rootpath
=
$(
cat
$VTOY_PATH
/ventoy_ks_rootpath
)
vtlog
"ks rootpath <
$vt_ks_rootpath
>"
if
[
-e
/sbin/fetch-kickstart-disk
]
;
then
vtlog
"fetch-kickstart-disk ..."
/sbin/fetch-kickstart-disk /dev/ventoy
"
$vt_ks_rootpath
"
fi
fi
if
[
-e
/sbin/anaconda-diskroot
]
;
then
vtlog
"set anaconda-diskroot ..."
/sbin/anaconda-diskroot /dev/
dm-0
vtlog
"set anaconda-diskroot ..."
/sbin/anaconda-diskroot /dev/
ventoy
fi
set_ventoy_hook_finish
...
...
IMG/cpio/ventoy/hook/openEuler/ventoy-make-link.sh
View file @
4d4f9584
...
...
@@ -19,17 +19,24 @@
.
/ventoy/hook/ventoy-hook-lib.sh
if
[
!
-e
/dev/dm-0
]
;
then
exit
0
fi
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
!
[
-e
/dev/mapper/ventoy
]
;
then
vtlog
"link to /dev/mapper/ventoy"
ln
-s
/dev/
dm-0
/dev/mapper/ventoy
vtlog
"link
/dev/
$vtDM
to /dev/mapper/ventoy"
ln
-s
/dev/
$vtDM
/dev/mapper/ventoy
fi
VTLABEL
=
$(
$BUSYBOX_PATH
/blkid /dev/
dm-0
|
$SED
's/.*LABEL="\([^"]*\)".*/\1/'
)
VTLABEL
=
$(
$BUSYBOX_PATH
/blkid /dev/
$vtDM
|
$SED
's/.*LABEL="\([^"]*\)".*/\1/'
)
vtlog
"VTLABEL=
$VTLABEL
"
if
[
-n
"
$VTLABEL
"
]
;
then
if
!
[
-e
"/dev/disk/by-label/
$VTLABEL
"
]
;
then
vtlog
"link to /dev/disk/by-label/
$VTLABEL
"
ln
-s
/dev/
dm-0
"/dev/disk/by-label/
$VTLABEL
"
vtlog
"link
/dev/
$vtDM
to /dev/disk/by-label/
$VTLABEL
"
ln
-s
/dev/
$vtDM
"/dev/disk/by-label/
$VTLABEL
"
fi
fi
IMG/cpio/ventoy/hook/openEuler/ventoy-timeout.sh
View file @
4d4f9584
...
...
@@ -23,12 +23,23 @@ vtlog "##### $0 $* ..."
VTPATH_OLD
=
$PATH
;
PATH
=
$BUSYBOX_PATH
:
$VTOY_PATH
/tool:
$PATH
blkdev_num
=
$(
dmsetup
ls
|
grep
ventoy |
sed
's/.*(\([0-9][0-9]*\),.*\([0-9][0-9]*\).*/\1:\2/'
)
vtDM
=
$(
ventoy_find_dm_id
${
blkdev_num
}
)
if
[
!
-e
/dev/ventoy
]
;
then
blkdev_num_mknod
=
$(
dmsetup
ls
|
grep
ventoy |
sed
's/.*(\([0-9][0-9]*\),.*\([0-9][0-9]*\).*/\1 \2/'
)
mknod
-m
660 /dev/ventoy b
$blkdev_num_mknod
fi
if
[
-f
$VTOY_PATH
/ventoy_ks_rootpath
]
;
then
vt_ks_rootpath
=
$(
cat
$VTOY_PATH
/ventoy_ks_rootpath
)
vtlog
"ks rootpath <
$vt_ks_rootpath
>"
if
[
-e
/sbin/fetch-kickstart-disk
]
;
then
vtlog
"fetch-kickstart-disk ..."
/sbin/fetch-kickstart-disk /dev/ventoy
"
$vt_ks_rootpath
"
fi
fi
if
[
-e
/sbin/anaconda-diskroot
]
;
then
vtlog
"set anaconda-diskroot ..."
/sbin/anaconda-diskroot /dev/
dm-0
vtlog
"set anaconda-diskroot
/dev/ventoy
..."
/sbin/anaconda-diskroot /dev/
ventoy
fi
PATH
=
$VTPATH_OLD
IMG/cpio/ventoy/hook/rhel7/ventoy-hook.sh
View file @
4d4f9584
...
...
@@ -64,9 +64,12 @@ if [ -f $VTOY_PATH/ventoy_persistent_map ]; then
$BUSYBOX_PATH
/rm
-rf
$VTOY_PATH
/selinuxfs
fi
echo
"VTKS=
$VTKS
VTOVERLAY=
$VTOVERLAY
"
>>
$VTLOG
if
[
-n
"
$vtRawKs
"
]
;
then
echo
"
$vtRawKs
"
>
$VTOY_PATH
/ventoy_ks_rootpath
fi
if
ls
$VTOY_PATH
|
$GREP
-q
'ventoy_dud[0-9]'
;
then
for
vtDud
in
$(
ls
$VTOY_PATH
/ventoy_dud
*
)
;
do
vtInstDD
=
"
$vtInstDD
inst.dd=file:
$vtDud
"
...
...
IMG/cpio/ventoy/hook/rhel7/ventoy-inotifyd-hook.sh
View file @
4d4f9584
...
...
@@ -54,6 +54,15 @@ if is_inotify_ventoy_part $3; then
vtlog
"
$vtGenRulFile
not exist..."
fi
if
[
-f
$VTOY_PATH
/ventoy_ks_rootpath
]
;
then
vt_ks_rootpath
=
$(
cat
$VTOY_PATH
/ventoy_ks_rootpath
)
vtlog
"ks rootpath <
$vt_ks_rootpath
>"
if
[
-e
/sbin/fetch-kickstart-disk
]
;
then
vtlog
"fetch-kickstart-disk ..."
/sbin/fetch-kickstart-disk /dev/ventoy
"
$vt_ks_rootpath
"
fi
fi
if
[
-e
/sbin/anaconda-diskroot
]
;
then
vtlog
"set anaconda-diskroot ..."
/sbin/anaconda-diskroot /dev/ventoy
...
...
IMG/cpio/ventoy/hook/rhel7/ventoy-timeout.sh
View file @
4d4f9584
...
...
@@ -28,6 +28,15 @@ if [ ! -e /dev/ventoy ]; then
mknod
-m
660 /dev/ventoy b
$blkdev_num_mknod
fi
if
[
-f
$VTOY_PATH
/ventoy_ks_rootpath
]
;
then
vt_ks_rootpath
=
$(
cat
$VTOY_PATH
/ventoy_ks_rootpath
)
vtlog
"ks rootpath <
$vt_ks_rootpath
>"
if
[
-e
/sbin/fetch-kickstart-disk
]
;
then
vtlog
"fetch-kickstart-disk ..."
/sbin/fetch-kickstart-disk /dev/ventoy
"
$vt_ks_rootpath
"
fi
fi
if
[
-e
/sbin/anaconda-diskroot
]
;
then
vtlog
"set anaconda-diskroot /dev/ventoy ..."
/sbin/anaconda-diskroot /dev/ventoy
...
...
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