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
5e607b7f
Commit
5e607b7f
authored
Jun 11, 2022
by
longpanda
Browse files
Support EasyOS resize partition at first boot time.
parent
1c0b4ee9
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
48 additions
and
3 deletions
+48
-3
IMG/cpio/ventoy/loop/easyos/ventoy-hook.sh
IMG/cpio/ventoy/loop/easyos/ventoy-hook.sh
+3
-3
IMG/cpio/ventoy/loop/easyos/ventoy-resize.sh
IMG/cpio/ventoy/loop/easyos/ventoy-resize.sh
+45
-0
No files found.
IMG/cpio/ventoy/loop/easyos/ventoy-hook.sh
View file @
5e607b7f
#!/ventoy/busybox/sh
#!/ventoy/busybox/sh
#************************************************************************************
#************************************************************************************
# Copyright (c) 202
0
, longpanda <admin@ventoy.net>
# Copyright (c) 202
2
, longpanda <admin@ventoy.net>
#
#
# This program is free software; you can redistribute it and/or
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
# modify it under the terms of the GNU General Public License as
...
@@ -26,7 +26,7 @@ $SED "1a boot_dev=ventoy1;wkg_dev=ventoy2" -i /init
...
@@ -26,7 +26,7 @@ $SED "1a boot_dev=ventoy1;wkg_dev=ventoy2" -i /init
#check for ssd will read /sys/block/ventoy, will no exist, need a workaround
#check for ssd will read /sys/block/ventoy, will no exist, need a workaround
$SED
"s#/sys/block/
\$
{WKG_DRV}/#/sys/block/
\$
vtDM/#g"
-i
/init
$SED
"s#/sys/block/
\$
{WKG_DRV}/#/sys/block/
\$
vtDM/#g"
-i
/init
#
skip the
resizing process
, can't resizing partition
#resizing process
$SED
"s#
640M#0M
#g"
-i
/init
$SED
"s#
partprobe.*#
$BUSYBOX_PATH
/sh
$VTOY_PATH
/loop/easyos/ventoy-resize.sh
\$
WKG_DEV
#g"
-i
/init
IMG/cpio/ventoy/loop/easyos/ventoy-resize.sh
0 → 100644
View file @
5e607b7f
#!/ventoy/busybox/sh
#************************************************************************************
# Copyright (c) 2022, 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
vtlog
"#######
$0
$*
########"
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/'
)
vtDM0
=
$(
ventoy_find_dm_id
${
blkdev_num
}
)
blkdev_num
=
$(
$VTOY_PATH
/tool/dmsetup
ls
|
grep
ventoy2 |
sed
's/.*(\([0-9][0-9]*\),.*\([0-9][0-9]*\).*/\1:\2/'
)
vtDM2
=
$(
ventoy_find_dm_id
${
blkdev_num
}
)
vtlog
"vtDM0=
$vtDM0
vtDM2=
$vtDM2
"
vtSize
=
$(
cat
/sys/block/
$vtDM0
/size
)
vtSize1
=
$(
sed
-n
"1p"
/vtoy_dm_table |
awk
'{print $2}'
)
vtStart1
=
$(
sed
-n
"1p"
/vtoy_dm_table |
awk
'{print $5}'
)
vtSize2
=
$(
sed
-n
"2p"
/vtoy_dm_table |
awk
'{print $2}'
)
vtNewSize2
=
$(
expr
$vtSize
-
$vtSize1
-
$vtStart1
)
vtlog
"vtSize=
$vtSize
vtSize1=
$vtSize1
vtStart1=
$vtStart1
vtSize2=
$vtSize2
vtNewSize2=
$vtNewSize2
"
sed
-n
"2p"
/vtoy_dm_table
>
/ventoy/resize_table
sed
-i
"s/
$vtSize2
/
$vtNewSize2
/"
/ventoy/resize_table
dmsetup remove ventoy2
dmsetup create ventoy2 /ventoy/resize_table
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