Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
dadigang
Ventoy
Commits
3ebc610e
Commit
3ebc610e
authored
Apr 29, 2022
by
longpanda
Browse files
fix the lvm issue
parent
60588c84
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
21 additions
and
33 deletions
+21
-33
IMG/cpio/ventoy/hook/gobo/ventoy-inotifyd-hook.sh
IMG/cpio/ventoy/hook/gobo/ventoy-inotifyd-hook.sh
+0
-10
IMG/cpio/ventoy/hook/rhel7/ventoy-hook.sh
IMG/cpio/ventoy/hook/rhel7/ventoy-hook.sh
+5
-5
IMG/cpio/ventoy/hook/rhel7/ventoy-inotifyd-hook.sh
IMG/cpio/ventoy/hook/rhel7/ventoy-inotifyd-hook.sh
+5
-11
IMG/cpio/ventoy/hook/rhel7/ventoy-make-link.sh
IMG/cpio/ventoy/hook/rhel7/ventoy-make-link.sh
+8
-5
IMG/cpio/ventoy/hook/rhel7/ventoy-timeout.sh
IMG/cpio/ventoy/hook/rhel7/ventoy-timeout.sh
+3
-2
No files found.
IMG/cpio/ventoy/hook/gobo/ventoy-inotifyd-hook.sh
View file @
3ebc610e
...
@@ -31,16 +31,6 @@ if is_inotify_ventoy_part $3; then
...
@@ -31,16 +31,6 @@ if is_inotify_ventoy_part $3; then
vtlog
"find ventoy partition
$3
..."
vtlog
"find ventoy partition
$3
..."
$BUSYBOX_PATH
/sh
$VTOY_PATH
/hook/default/udev_disk_hook.sh
$3
noreplace
$BUSYBOX_PATH
/sh
$VTOY_PATH
/hook/default/udev_disk_hook.sh
$3
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 [ "$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
# fi
set_ventoy_hook_finish
set_ventoy_hook_finish
else
else
vtlog
"##### INOTIFYD:
$2
/
$3
is created (NO)..."
vtlog
"##### INOTIFYD:
$2
/
$3
is created (NO)..."
...
...
IMG/cpio/ventoy/hook/rhel7/ventoy-hook.sh
View file @
3ebc610e
...
@@ -28,19 +28,19 @@ else
...
@@ -28,19 +28,19 @@ else
for
vtParam
in
$(
$CAT
/proc/cmdline
)
;
do
for
vtParam
in
$(
$CAT
/proc/cmdline
)
;
do
if
echo
$vtParam
|
$GREP
-q
'inst.ks=hd:LABEL='
;
then
if
echo
$vtParam
|
$GREP
-q
'inst.ks=hd:LABEL='
;
then
vtRawKs
=
$(
echo
$vtParam
|
$AWK
-F
:
'{print $NF}'
)
vtRawKs
=
$(
echo
$vtParam
|
$AWK
-F
:
'{print $NF}'
)
VTKS
=
"inst.ks=hd:/dev/
dm-0
:
$vtRawKs
"
VTKS
=
"inst.ks=hd:/dev/
ventoy
:
$vtRawKs
"
break
break
fi
fi
if
echo
$vtParam
|
$GREP
-q
'^ks=.*:/'
;
then
if
echo
$vtParam
|
$GREP
-q
'^ks=.*:/'
;
then
vtRawKs
=
$(
echo
$vtParam
|
$AWK
-F
:
'{print $NF}'
)
vtRawKs
=
$(
echo
$vtParam
|
$AWK
-F
:
'{print $NF}'
)
VTKS
=
"ks=hd:/dev/
dm-0
:
$vtRawKs
"
VTKS
=
"ks=hd:/dev/
ventoy
:
$vtRawKs
"
break
break
fi
fi
if
echo
$vtParam
|
$GREP
-q
'^inst.ks=.*:/'
;
then
if
echo
$vtParam
|
$GREP
-q
'^inst.ks=.*:/'
;
then
vtRawKs
=
$(
echo
$vtParam
|
$AWK
-F
:
'{print $NF}'
)
vtRawKs
=
$(
echo
$vtParam
|
$AWK
-F
:
'{print $NF}'
)
VTKS
=
"inst.ks=hd:/dev/
dm-0
:
$vtRawKs
"
VTKS
=
"inst.ks=hd:/dev/
ventoy
:
$vtRawKs
"
break
break
fi
fi
done
done
...
@@ -75,9 +75,9 @@ fi
...
@@ -75,9 +75,9 @@ fi
echo
"vtInstDD=
$vtInstDD
"
>>
$VTLOG
echo
"vtInstDD=
$vtInstDD
"
>>
$VTLOG
if
$GREP
-q
'root=live'
/proc/cmdline
;
then
if
$GREP
-q
'root=live'
/proc/cmdline
;
then
$SED
"s#printf
\(
.*
\)\$
CMDLINE#printf
\1\$
CMDLINE root=live:/dev/
dm-0
$VTKS
$VTOVERLAY
$vtInstDD
#"
-i
/lib/dracut-lib.sh
$SED
"s#printf
\(
.*
\)\$
CMDLINE#printf
\1\$
CMDLINE root=live:/dev/
ventoy
$VTKS
$VTOVERLAY
$vtInstDD
#"
-i
/lib/dracut-lib.sh
else
else
$SED
"s#printf
\(
.*
\)\$
CMDLINE#printf
\1\$
CMDLINE inst.stage2=hd:/dev/
dm-0
$VTKS
$VTOVERLAY
$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
fi
fi
ventoy_set_inotify_script rhel7/ventoy-inotifyd-hook.sh
ventoy_set_inotify_script rhel7/ventoy-inotifyd-hook.sh
...
...
IMG/cpio/ventoy/hook/rhel7/ventoy-inotifyd-hook.sh
View file @
3ebc610e
...
@@ -43,14 +43,9 @@ if is_inotify_ventoy_part $3; then
...
@@ -43,14 +43,9 @@ 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/'
)
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
}
)
vtDM
=
$(
ventoy_find_dm_id
${
blkdev_num
}
)
if
[
"
$vtDM
"
=
"dm-0"
]
;
then
cp
-a
/dev/
$vtDM
/dev/ventoy
vtlog
"This is dm-0, OK ..."
$BUSYBOX_PATH
/modprobe isofs
>
/dev/null 2>&1
else
vtlog
"####### This is
$vtDM
####### this is abnormal ..."
ventoy_swap_device /dev/dm-0 /dev/
$vtDM
fi
vtGenRulFile
=
'/etc/udev/rules.d/99-live-squash.rules'
vtGenRulFile
=
'/etc/udev/rules.d/99-live-squash.rules'
if
[
-e
$vtGenRulFile
]
&&
$GREP
-q
dmsquash
$vtGenRulFile
;
then
if
[
-e
$vtGenRulFile
]
&&
$GREP
-q
dmsquash
$vtGenRulFile
;
then
vtScript
=
$(
$GREP
-m1
'RUN.='
$vtGenRulFile
|
$AWK
-F
'RUN.='
'{print $2}'
|
$SED
's/"\(.*\)".*/\1/'
)
vtScript
=
$(
$GREP
-m1
'RUN.='
$vtGenRulFile
|
$AWK
-F
'RUN.='
'{print $2}'
|
$SED
's/"\(.*\)".*/\1/'
)
...
@@ -60,10 +55,9 @@ if is_inotify_ventoy_part $3; then
...
@@ -60,10 +55,9 @@ if is_inotify_ventoy_part $3; then
vtlog
"
$vtGenRulFile
not exist..."
vtlog
"
$vtGenRulFile
not exist..."
fi
fi
if
[
-e
/sbin/anaconda-diskroot
]
;
then
if
[
-e
/sbin/anaconda-diskroot
]
;
then
vtlog
"set anaconda-diskroot ..."
vtlog
"set anaconda-diskroot ..."
/sbin/anaconda-diskroot /dev/
dm-0
/sbin/anaconda-diskroot /dev/
ventoy
fi
fi
set_ventoy_hook_finish
set_ventoy_hook_finish
...
...
IMG/cpio/ventoy/hook/rhel7/ventoy-make-link.sh
View file @
3ebc610e
...
@@ -23,17 +23,20 @@ if [ ! -e /dev/dm-0 ]; then
...
@@ -23,17 +23,20 @@ if [ ! -e /dev/dm-0 ]; then
exit
0
exit
0
fi
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
if
!
[
-e
/dev/mapper/ventoy
]
;
then
vtlog
"link to /dev/mapper/ventoy"
vtlog
"link
/dev/
$vtDM
to /dev/mapper/ventoy"
ln
-s
/dev/
dm-0
/dev/mapper/ventoy
ln
-s
/dev/
$vtDM
/dev/mapper/ventoy
fi
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
"
vtlog
"VTLABEL=
$VTLABEL
"
if
[
-n
"
$VTLABEL
"
]
;
then
if
[
-n
"
$VTLABEL
"
]
;
then
if
!
[
-e
"/dev/disk/by-label/
$VTLABEL
"
]
;
then
if
!
[
-e
"/dev/disk/by-label/
$VTLABEL
"
]
;
then
vtlog
"link to /dev/disk/by-label/
$VTLABEL
"
vtlog
"link
/dev/
$vtDM
to /dev/disk/by-label/
$VTLABEL
"
ln
-s
/dev/
dm-0
"/dev/disk/by-label/
$VTLABEL
"
ln
-s
/dev/
$vtDM
"/dev/disk/by-label/
$VTLABEL
"
fi
fi
fi
fi
IMG/cpio/ventoy/hook/rhel7/ventoy-timeout.sh
View file @
3ebc610e
...
@@ -25,10 +25,11 @@ VTPATH_OLD=$PATH; PATH=$BUSYBOX_PATH:$VTOY_PATH/tool:$PATH
...
@@ -25,10 +25,11 @@ 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/'
)
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
}
)
vtDM
=
$(
ventoy_find_dm_id
${
blkdev_num
}
)
[
-e
/dev/ventoy
]
||
cp
-a
/dev/
$vtDM
/dev/ventoy
if
[
-e
/sbin/anaconda-diskroot
]
;
then
if
[
-e
/sbin/anaconda-diskroot
]
;
then
vtlog
"set anaconda-diskroot ..."
vtlog
"set anaconda-diskroot
/dev/ventoy
..."
/sbin/anaconda-diskroot /dev/
dm-0
/sbin/anaconda-diskroot /dev/
ventoy
fi
fi
PATH
=
$VTPATH_OLD
PATH
=
$VTPATH_OLD
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