Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
LARN
RNA
Software
Commits
5cbea782
Commit
5cbea782
authored
Sep 06, 2017
by
Andreas Schmidt
Browse files
WIP: Resizing.
parent
ec5c8d44
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
build.sh
View file @
5cbea782
#!/bin/bash
apt-get update
apt-get
install
qemu qemu-user-static pixz
-y
apt-get
install
file
qemu qemu-user-static pixz
-y
# Extract
...
...
@@ -9,7 +9,7 @@ pixz -d ubuntu-16.04.2-minimal-odroid-xu4-20170516.img.xz ubuntu-16.04.2-minimal
md5sum
-c
ubuntu-16.04.2-minimal-odroid-xu4-20170516.img.md5
# Resize Image
qemu-img resize ubuntu-16.04.2-minimal-odroid-xu4-20170516.img +10G
#
qemu-img resize ubuntu-16.04.2-minimal-odroid-xu4-20170516.img +10G
# Mount
limit
=
$(
sfdisk
-l
--bytes
ubuntu-16.04.2-minimal-odroid-xu4-20170516.img |
tail
-n
1 |
awk
'{print $2}'
)
...
...
@@ -17,13 +17,14 @@ limit=$(sfdisk -l --bytes ubuntu-16.04.2-minimal-odroid-xu4-20170516.img | tail
# Resize Image
loopdev
=
/dev/loop0
echo
$limit
echo
$loopdev
losetup
--offset
$((
512
*
$limit
))
$loopdev
ubuntu-16.04.2-minimal-odroid-xu4-20170516.img
/bin/bash
e2fsck
-f
$loopdev
/bin/bash
resize2fs
$loopdev
e2fsck
-f
$loopdev
losetup
-d
$loopdev
#losetup --offset $((512 * $limit)) $loopdev ubuntu-16.04.2-minimal-odroid-xu4-20170516.img
#e2fsck -f $loopdev
#resize2fs -f $loopdev
#losetup -d $loopdev
# Mount
dir
=
/mnt/rna
...
...
Write
Preview
Supports
Markdown
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