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
2cd22da8
Commit
2cd22da8
authored
May 31, 2022
by
longpanda
Browse files
Fix a bug when booting latest Alpine linux.
parent
7b70a527
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
32 additions
and
14 deletions
+32
-14
IMG/cpio/ventoy/hook/alpine/insert.sh
IMG/cpio/ventoy/hook/alpine/insert.sh
+4
-0
IMG/cpio/ventoy/hook/alpine/udev_disk_hook.sh
IMG/cpio/ventoy/hook/alpine/udev_disk_hook.sh
+10
-11
IMG/cpio/ventoy/hook/alpine/ventoy-hook.sh
IMG/cpio/ventoy/hook/alpine/ventoy-hook.sh
+14
-3
IMG/cpio/ventoy/hook/debian/default-hook.sh
IMG/cpio/ventoy/hook/debian/default-hook.sh
+4
-0
No files found.
IMG/cpio/ventoy/hook/alpine/insert.sh
0 → 100644
View file @
2cd22da8
for
i
in
1 2
;
do
if
[
$i
-eq
2
]
;
then
/ventoy/busybox/sh /ventoy/hook/alpine/udev_disk_hook.sh
fi
IMG/cpio/ventoy/hook/alpine/udev_disk_hook.sh
View file @
2cd22da8
...
@@ -19,22 +19,17 @@
...
@@ -19,22 +19,17 @@
.
/ventoy/hook/ventoy-hook-lib.sh
.
/ventoy/hook/ventoy-hook-lib.sh
if
[
"
$SUBSYSTEM
"
!=
"block"
]
||
[
"
$DEVTYPE
"
!=
"partition"
]
;
then
PATH
=
$BUSYBOX_PATH
:
$VTOY_PATH
/tool:
$PATH
exit
0
fi
if
[
-b
/dev/
${
MDEV
:0:-1
}
]
;
then
wait_for_usb_disk_ready
vtlog
"/dev/
${
MDEV
:0:-1
}
exist"
else
$SLEEP
2
fi
if
is_ventoy_hook_finished
||
not_ventoy_disk
"
${
MDEV
:0:-1
}
"
;
then
vtdiskname
=
$(
get_ventoy_disk_name
)
if
[
"
$vtdiskname
"
=
"unknown"
]
;
then
vtlog
"ventoy disk not found"
PATH
=
$VTPATH_OLD
exit
0
exit
0
fi
fi
PATH
=
$BUSYBOX_PATH
:
$VTOY_PATH
/tool:
$PATH
#
#
# longpanda:
# longpanda:
# Alpine initramfs doesn't contain dm-mod or fuse module,
# Alpine initramfs doesn't contain dm-mod or fuse module,
...
@@ -47,13 +42,17 @@ PATH=$BUSYBOX_PATH:$VTOY_PATH/tool:$PATH
...
@@ -47,13 +42,17 @@ PATH=$BUSYBOX_PATH:$VTOY_PATH/tool:$PATH
# 3. unmount and delete the squashfs file
# 3. unmount and delete the squashfs file
#
#
MDEV
=
"
${
vtdiskname
#/dev/
}
2"
vtoydm
-i
-f
$VTOY_PATH
/ventoy_image_map
-d
/dev/
${
MDEV
:0:-1
}
>
$VTOY_PATH
/iso_file_list
vtoydm
-i
-f
$VTOY_PATH
/ventoy_image_map
-d
/dev/
${
MDEV
:0:-1
}
>
$VTOY_PATH
/iso_file_list
vtLine
=
$(
grep
'[-][-] modloop-lts '
$VTOY_PATH
/iso_file_list
)
vtLine
=
$(
grep
'[-][-] modloop-lts '
$VTOY_PATH
/iso_file_list
)
sector
=
$(
echo
$vtLine
|
awk
'{print $(NF-1)}'
)
sector
=
$(
echo
$vtLine
|
awk
'{print $(NF-1)}'
)
length
=
$(
echo
$vtLine
|
awk
'{print $NF}'
)
length
=
$(
echo
$vtLine
|
awk
'{print $NF}'
)
echo
-n
"Mounting boot media, please wait ......"
vtoydm
-e
-f
$VTOY_PATH
/ventoy_image_map
-d
/dev/
${
MDEV
:0:-1
}
-s
$sector
-l
$length
-o
/vt_modloop
vtoydm
-e
-f
$VTOY_PATH
/ventoy_image_map
-d
/dev/
${
MDEV
:0:-1
}
-s
$sector
-l
$length
-o
/vt_modloop
echo
"done"
mkdir
-p
$VTOY_PATH
/mnt
mkdir
-p
$VTOY_PATH
/mnt
mount /vt_modloop
$VTOY_PATH
/mnt
mount /vt_modloop
$VTOY_PATH
/mnt
...
...
IMG/cpio/ventoy/hook/alpine/ventoy-hook.sh
View file @
2cd22da8
...
@@ -19,6 +19,17 @@
...
@@ -19,6 +19,17 @@
.
$VTOY_PATH
/hook/ventoy-os-lib.sh
.
$VTOY_PATH
/hook/ventoy-os-lib.sh
echo
"-[-a-z0-9]*2 root:root 0666 @
$BUSYBOX_PATH
/sh
$VTOY_PATH
/hook/alpine/udev_disk_hook.sh"
>>
/mdev.conf
PATH
=
$BUSYBOX_PATH
:
$VTOY_PATH
/tool:
$PATH
$CAT
/etc/mdev.conf
>>
/mdev.conf
$BUSYBOX_PATH
/mv /mdev.conf /etc/mdev.conf
LineBegin
=
$(
grep
-n
"ebegin.*Mounting boot media"
/init |
awk
-F
:
'{print $1}'
)
grep
-n
"^eend"
/init
>
/t.list
while
read
line
;
do
LineEnd
=
$(
echo
$line
|
awk
-F
:
'{print $1}'
)
if
[
$LineEnd
-gt
$LineBegin
]
;
then
sed
"
${
LineEnd
}
i
\d
one"
-i
/init
sed
"
${
LineBegin
}
r /ventoy/hook/alpine/insert.sh"
-i
/init
break
fi
done
< /t.list
rm
-f
/t.list
IMG/cpio/ventoy/hook/debian/default-hook.sh
View file @
2cd22da8
...
@@ -64,6 +64,10 @@ if [ -f $VTOY_PATH/autoinstall ]; then
...
@@ -64,6 +64,10 @@ if [ -f $VTOY_PATH/autoinstall ]; then
$SED
"/^mount
\/
proc/a export file=
$VTOY_PATH
/autoinstall; export auto='true'; export priority='critical'"
-i
/init
$SED
"/^mount
\/
proc/a export file=
$VTOY_PATH
/autoinstall; export auto='true'; export priority='critical'"
-i
/init
fi
fi
fi
fi
# if [ -e /bin/check-missing-firmware ]; then
# $SED "/^#!/a\exit 0" -i /bin/check-missing-firmware
# fi
fi
fi
#for ARMA aka Omoikane
#for ARMA aka Omoikane
...
...
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