Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
V
virl-utils-hs-fulda
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Sebastian Rieger
virl-utils-hs-fulda
Commits
8065f549
Commit
8065f549
authored
9 years ago
by
Sebastian Rieger
Browse files
Options
Downloads
Patches
Plain Diff
support for variable VEOS images sizes
parent
274194bb
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
create-arista-veos-image/create-arista-veos-image.sh
+6
-2
6 additions, 2 deletions
create-arista-veos-image/create-arista-veos-image.sh
with
6 additions
and
2 deletions
create-arista-veos-image/create-arista-veos-image.sh
+
6
−
2
View file @
8065f549
...
@@ -10,7 +10,8 @@
...
@@ -10,7 +10,8 @@
# V1.21 checking whether it safe to unmount working directories
# V1.21 checking whether it safe to unmount working directories
# V1.3 added support to delete existing image with the same name and generating the default nova flavor
# V1.3 added support to delete existing image with the same name and generating the default nova flavor
# V1.31 added support for newer glance releases (e.g. kilo) used in VIRL 1.0.0
# V1.31 added support for newer glance releases (e.g. kilo) used in VIRL 1.0.0
# V1.32 changed the extension of the bootloader iso to match the size of the partitions to be injected
# V1.4 support for variable VEOS image sizes (as requested by @Jade_Deane to use custom VEOS images)
# usage
# usage
if
[
!
$#
-eq
3
]
;
then
if
[
!
$#
-eq
3
]
;
then
...
@@ -76,7 +77,6 @@ echo "==========================================================="
...
@@ -76,7 +77,6 @@ echo "==========================================================="
# create a copy of Aboot bootloader and extend it to 3G
# create a copy of Aboot bootloader and extend it to 3G
cp
$1
$TMP_NAME
.raw
cp
$1
$TMP_NAME
.raw
truncate
-s
+3G
$TMP_NAME
.raw
echo
echo
echo
"Extracting partitions from vEOS vmdk..."
echo
"Extracting partitions from vEOS vmdk..."
...
@@ -150,6 +150,10 @@ PART2_START=$(fdisk -l $VEOS_VMDK_BASENAME.raw | grep "\.raw2" | tr -s " " | cut
...
@@ -150,6 +150,10 @@ PART2_START=$(fdisk -l $VEOS_VMDK_BASENAME.raw | grep "\.raw2" | tr -s " " | cut
PART2_END
=
$(
fdisk
-l
$VEOS_VMDK_BASENAME
.raw |
grep
"
\.
raw2"
|
tr
-s
" "
|
cut
-d
' '
-f
3
)
PART2_END
=
$(
fdisk
-l
$VEOS_VMDK_BASENAME
.raw |
grep
"
\.
raw2"
|
tr
-s
" "
|
cut
-d
' '
-f
3
)
PART2_LENGTH
=
$(
expr
$PART2_END
-
$PART2_START
)
PART2_LENGTH
=
$(
expr
$PART2_END
-
$PART2_START
)
# extend the bootloader iso to be able to append the two partitions
EXTENSION_SIZE
=
$(
ls
-lk
$VEOS_VMDK_BASENAME
.raw |
tr
-s
" "
|
cut
-d
" "
-f
5
)
truncate
-s
+
$EXTENSION_SIZE
$TMP_NAME
.raw
# append the two partitions from vmdk in the bootloader iso
# append the two partitions from vmdk in the bootloader iso
echo
-e
"n
echo
-e
"n
p
p
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment