Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
itminedu
snf-image
Commits
90db2151
Commit
90db2151
authored
Nov 09, 2012
by
Nikos Skalkotos
Browse files
Fix the error messages in helper
parent
9a4838f0
Changes
4
Hide whitespace changes
Inline
Side-by-side
snf-image-helper/common.sh
View file @
90db2151
...
...
@@ -149,7 +149,7 @@ get_partition_table() {
# secondary gpt is not it the end of the disk, and a warning that has to
# do with the "Last Usable LBA" entry in gpt.
if
!
output
=
"
$(
"
$PARTED
"
-s
-m
"
$dev
"
unit s print |
grep
-E
-v
"^(Warning|Error): "
)
"
;
then
log_error
"Unable to read partition table for device
\`
${
dev
}
'"
log_error
"Unable to read partition table for device
\`
${
dev
}
'
. The image seems corrupted.
"
fi
echo
"
$output
"
...
...
snf-image-helper/snf-image-helper.in
View file @
90db2151
...
...
@@ -90,6 +90,14 @@ trap '{ umount "$target"; }' ERR
if
[
-z
"
$SNF_IMAGE_PROPERTY_EXCLUDE_ALL_TASKS
"
]
;
then
if
[
"
$SNF_IMAGE_PROPERTY_OSFAMILY
"
=
""
]
;
then
log_error
"Required image property
\`
OSFAMILY' is missing or empty."
fi
if
[
"
$SNF_IMAGE_PROPERTY_ROOT_PARTITION
"
=
""
]
;
then
log_error
"Required image property
\`
ROOT_PARTITION' is missing or empty."
fi
export
SNF_IMAGE_RESIZE_PART
=
"
$(
get_partition_to_resize
"
$SNF_IMAGE_DEV
"
)
"
if
[[
!
"
$SNF_IMAGE_PROPERTY_OSFAMILY
"
=
~ ^
(
linux|windows
)
$
]]
;
then
...
...
snf-image-helper/tasks/30MountImage.in
View file @
90db2151
...
...
@@ -34,13 +34,15 @@ if [ ! -d "$SNF_IMAGE_TARGET" ]; then
fi
if
[
-z
"
$SNF_IMAGE_PROPERTY_ROOT_PARTITION
"
]
;
then
log_error
"R
oot Partition
image property not defined"
log_error
"R
equired
image property
\`
ROOT_PARTITION'
not defined
or empty
"
fi
rootdev
=
"
${
SNF_IMAGE_DEV
}${
SNF_IMAGE_PROPERTY_ROOT_PARTITION
}
"
if
[
!
-b
"
$rootdev
"
]
;
then
log_error
"Image root partition device:
\`
$rootdev
' is not a block device"
log_error
"Root partition device:
\`
$rootdev
' is not a block device. "
\
"Please check if the value for image property
\`
ROOT_PARTITION' "
\
"(=
$SNF_IMAGE_PROPERTY_ROOT_PARTITION
) is valid."
fi
mount
"
$rootdev
"
"
$SNF_IMAGE_TARGET
"
-o
rw
...
...
snf-image-helper/tasks/50ChangePassword.in
View file @
90db2151
...
...
@@ -40,6 +40,9 @@ windows_password() {
echo
"@echo off"
>
"
$target
/Windows/SnfScripts/ChangeAdminPassword.cmd"
if
[
-z
"
$SNF_IMAGE_PROPERTY_USERS
"
]
;
then
warn
"Image property
\`
USERS' is missing or empty. "
\
"Changing the password for default user:
\`
Administrator'."
SNF_IMAGE_PROPERTY_USERS
=
"Administrator"
fi
...
...
@@ -67,6 +70,8 @@ linux_password() {
users
+
=(
"
$usr
"
)
done
else
warn
"Image property
\`
USERS' is missing or empty. "
\
"Changing the password for default user:
\'
root'."
users
+
=(
"root"
)
fi
...
...
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