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
ec4b6c2a
Commit
ec4b6c2a
authored
Oct 21, 2021
by
longpanda
Browse files
Fix a bug when booting Porteus 4.0 i586 20170701.iso
parent
be8b6e89
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
53 additions
and
10 deletions
+53
-10
IMG/cpio/ventoy/hook/debian/porteus-hook.sh
IMG/cpio/ventoy/hook/debian/porteus-hook.sh
+24
-9
VtoyTool/vtoydump.c
VtoyTool/vtoydump.c
+29
-1
VtoyTool/vtoytool/00/vtoytool_32
VtoyTool/vtoytool/00/vtoytool_32
+0
-0
VtoyTool/vtoytool/00/vtoytool_64
VtoyTool/vtoytool/00/vtoytool_64
+0
-0
VtoyTool/vtoytool/00/vtoytool_aa64
VtoyTool/vtoytool/00/vtoytool_aa64
+0
-0
VtoyTool/vtoytool/00/vtoytool_m64e
VtoyTool/vtoytool/00/vtoytool_m64e
+0
-0
No files found.
IMG/cpio/ventoy/hook/debian/porteus-hook.sh
View file @
ec4b6c2a
...
@@ -22,9 +22,16 @@ porteus_hook() {
...
@@ -22,9 +22,16 @@ porteus_hook() {
$SED
"/searching *for *
\$
CFG *file/i
\
$BUSYBOX_PATH
/sh
$VTOY_PATH
/hook/debian/porteus-disk.sh"
-i
$1
$SED
"/searching *for *
\$
CFG *file/i
\
$BUSYBOX_PATH
/sh
$VTOY_PATH
/hook/debian/porteus-disk.sh"
-i
$1
}
}
if
$GREP
-q
exfat /proc/filesystems
;
then
vtPath
=
$(
$VTOY_PATH
/tool/vtoydump
-p
$VTOY_PATH
/ventoy_os_param
)
vtPath
=
$(
$VTOY_PATH
/tool/vtoydump
-p
$VTOY_PATH
/ventoy_os_param
)
echo
$vtPath
|
$GREP
-q
" "
_vtRet1
=
$?
$GREP
-q
exfat /proc/filesystems
_vtRet2
=
$?
echo
"_vtRet1=
$_vtRet1
_vtRet2=
$_vtRet2
..."
>>
$VTLOG
if
[
$_vtRet1
-ne
0
-a
$_vtRet2
-eq
0
]
;
then
vtFindFlag
=
0
vtFindFlag
=
0
$GREP
'`value from`'
/usr/
*
-r
|
$AWK
-F
:
'{print $1}'
|
while
read
vtline
;
do
$GREP
'`value from`'
/usr/
*
-r
|
$AWK
-F
:
'{print $1}'
|
while
read
vtline
;
do
echo
"hooking
$vtline
..."
>>
$VTLOG
echo
"hooking
$vtline
..."
>>
$VTLOG
...
@@ -34,11 +41,19 @@ if $GREP -q exfat /proc/filesystems; then
...
@@ -34,11 +41,19 @@ if $GREP -q exfat /proc/filesystems; then
if
[
$vtFindFlag
-eq
0
]
;
then
if
[
$vtFindFlag
-eq
0
]
;
then
if
$GREP
-q
'`value from`'
/linuxrc
;
then
if
$GREP
-q
'`value from`'
/linuxrc
;
then
echo
"hooking linuxrc ..."
>>
$VTLOG
if
$GREP
-q
"searching *for *
\$
CFG *file"
/linuxrc
;
then
$SED
"/searching *for *
\$
CFG *file/i
$BUSYBOX_PATH
/sh
$VTOY_PATH
/hook/debian/porteus-path.sh"
-i
/linuxrc
echo
"hooking linuxrc CFG..."
>>
$VTLOG
$SED
"/searching *for *
\$
CFG *file/iFROM=
\$
(cat /porteus-from)"
-i
/linuxrc
$SED
"/searching *for *
\$
CFG *file/i
$BUSYBOX_PATH
/sh
$VTOY_PATH
/hook/debian/porteus-path.sh"
-i
/linuxrc
$SED
"/searching *for *
\$
CFG *file/iISO=
\$
(cat /porteus-from)"
-i
/linuxrc
$SED
"/searching *for *
\$
CFG *file/iFROM=
\$
(cat /porteus-from)"
-i
/linuxrc
vtFindFlag
=
1
$SED
"/searching *for *
\$
CFG *file/iISO=
\$
(cat /porteus-from)"
-i
/linuxrc
vtFindFlag
=
1
else
echo
"hooking linuxrc SGN..."
>>
$VTLOG
$SED
"/searching *for *
\$
SGN *file/i
$BUSYBOX_PATH
/sh
$VTOY_PATH
/hook/debian/porteus-path.sh"
-i
/linuxrc
$SED
"/searching *for *
\$
SGN *file/iFROM=
\$
(cat /porteus-from)"
-i
/linuxrc
$SED
"/searching *for *
\$
SGN *file/iISO=
\$
(cat /porteus-from)"
-i
/linuxrc
vtFindFlag
=
1
fi
fi
fi
fi
fi
...
@@ -46,7 +61,7 @@ else
...
@@ -46,7 +61,7 @@ else
for
vtfile
in
'/linuxrc'
'/init'
;
do
for
vtfile
in
'/linuxrc'
'/init'
;
do
if
[
-e
$vtfile
]
;
then
if
[
-e
$vtfile
]
;
then
if
!
$GREP
-q
ventoy
$vtfile
;
then
if
!
$GREP
-q
ventoy
$vtfile
;
then
echo
"hooking
$vtfile
..."
>>
$VTLOG
echo
"hooking
disk
$vtfile
..."
>>
$VTLOG
porteus_hook
$vtfile
porteus_hook
$vtfile
fi
fi
fi
fi
...
...
VtoyTool/vtoydump.c
View file @
ec4b6c2a
...
@@ -435,6 +435,24 @@ static int vtoy_printf_iso_path(ventoy_os_param *param)
...
@@ -435,6 +435,24 @@ static int vtoy_printf_iso_path(ventoy_os_param *param)
return
0
;
return
0
;
}
}
static
int
vtoy_printf_fs
(
ventoy_os_param
*
param
)
{
const
char
*
fs
[]
=
{
"exfat"
,
"ntfs"
,
"ext"
,
"xfs"
,
"udf"
,
"fat"
};
if
(
param
->
vtoy_disk_part_type
<
6
)
{
printf
(
"%s
\n
"
,
fs
[
param
->
vtoy_disk_part_type
]);
}
else
{
printf
(
"unknown
\n
"
);
}
return
0
;
}
static
int
vtoy_check_device
(
ventoy_os_param
*
param
,
const
char
*
device
)
static
int
vtoy_check_device
(
ventoy_os_param
*
param
,
const
char
*
device
)
{
{
unsigned
long
long
size
;
unsigned
long
long
size
;
...
@@ -551,12 +569,13 @@ int vtoydump_main(int argc, char **argv)
...
@@ -551,12 +569,13 @@ int vtoydump_main(int argc, char **argv)
int
rc
;
int
rc
;
int
ch
;
int
ch
;
int
print_path
=
0
;
int
print_path
=
0
;
int
print_fs
=
0
;
char
filename
[
256
]
=
{
0
};
char
filename
[
256
]
=
{
0
};
char
diskname
[
256
]
=
{
0
};
char
diskname
[
256
]
=
{
0
};
char
device
[
64
]
=
{
0
};
char
device
[
64
]
=
{
0
};
ventoy_os_param
*
param
=
NULL
;
ventoy_os_param
*
param
=
NULL
;
while
((
ch
=
getopt
(
argc
,
argv
,
"c:f:p:v::"
))
!=
-
1
)
while
((
ch
=
getopt
(
argc
,
argv
,
"c:f:p:
s:
v::"
))
!=
-
1
)
{
{
if
(
ch
==
'f'
)
if
(
ch
==
'f'
)
{
{
...
@@ -575,6 +594,11 @@ int vtoydump_main(int argc, char **argv)
...
@@ -575,6 +594,11 @@ int vtoydump_main(int argc, char **argv)
print_path
=
1
;
print_path
=
1
;
strncpy
(
filename
,
optarg
,
sizeof
(
filename
)
-
1
);
strncpy
(
filename
,
optarg
,
sizeof
(
filename
)
-
1
);
}
}
else
if
(
ch
==
's'
)
{
print_fs
=
1
;
strncpy
(
filename
,
optarg
,
sizeof
(
filename
)
-
1
);
}
else
else
{
{
fprintf
(
stderr
,
"Usage: %s -f datafile [ -v ]
\n
"
,
argv
[
0
]);
fprintf
(
stderr
,
"Usage: %s -f datafile [ -v ]
\n
"
,
argv
[
0
]);
...
@@ -627,6 +651,10 @@ int vtoydump_main(int argc, char **argv)
...
@@ -627,6 +651,10 @@ int vtoydump_main(int argc, char **argv)
{
{
rc
=
vtoy_printf_iso_path
(
param
);
rc
=
vtoy_printf_iso_path
(
param
);
}
}
else
if
(
print_fs
)
{
rc
=
vtoy_printf_fs
(
param
);
}
else
if
(
device
[
0
])
else
if
(
device
[
0
])
{
{
rc
=
vtoy_check_device
(
param
,
device
);
rc
=
vtoy_check_device
(
param
,
device
);
...
...
VtoyTool/vtoytool/00/vtoytool_32
View file @
ec4b6c2a
No preview for this file type
VtoyTool/vtoytool/00/vtoytool_64
View file @
ec4b6c2a
No preview for this file type
VtoyTool/vtoytool/00/vtoytool_aa64
View file @
ec4b6c2a
No preview for this file type
VtoyTool/vtoytool/00/vtoytool_m64e
View file @
ec4b6c2a
No preview for this file type
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