Commit 5d3735b5 authored by Nikos Skalkotos's avatar Nikos Skalkotos
Browse files

Make sure all tasks contail the vim config line

parent 630610f8
......@@ -22,4 +22,5 @@ if [ "$SNF_IMAGE_TYPE" = "extdump" ]; then
fi
exit 0
# vim: set sta sts=4 shiftwidth=4 sw=4 et ai :
......@@ -20,4 +20,5 @@ fi
mount $SNF_IMAGE_DEV $SNF_IMAGE_TARGET
exit 0
# vim: set sta sts=4 shiftwidth=4 sw=4 et ai :
......@@ -14,15 +14,12 @@ if [ ! -d "$SNF_IMAGE_TARGET" ]; then
log_error "Target dir: \`$SNF_IMAGE_TARGET' is missing"
fi
if [ "$SNF_IMAGE_TYPE" != "ntfsdump" ]; then
exit 0
if [ "$SNF_IMAGE_TYPE" = "ntfsdump" ]; then
# Make sure Unattend.xml is removed after setup has finished
mkdir -p "$SNF_IMAGE_TARGET/Windows/Setup/Scripts"
echo "del /Q /F C:\Unattend.xml" > "$SNF_IMAGE_TARGET/Windows/Setup/Scripts/SetupComplete.cmd"
fi
# Make sure Unattend.xml is removed after setup has finished
mkdir -p "$SNF_IMAGE_TARGET/Windows/Setup/Scripts"
echo "del /Q /F C:\Unattend.xml" > "$SNF_IMAGE_TARGET/Windows/Setup/Scripts/SetupComplete.cmd"
exit 0
# vim: set sta sts=4 shiftwidth=4 sw=4 et ai :
......@@ -13,24 +13,21 @@ if [ ! -d "$SNF_IMAGE_TARGET" ]; then
log_error "Target dir: \`$SNF_IMAGE_TARGET' is missing."
fi
if [ "$SNF_IMAGE_TYPE" != "extdump" ]; then
exit 0
if [ "$SNF_IMAGE_TYPE" = "extdump" ]; then
HOST_KEY="/etc/ssh/ssh_host_key"
RSA_KEY="/etc/ssh/ssh_host_rsa_key"
DSA_KEY="/etc/ssh/ssh_host_dsa_key"
for key in $HOST_KEY $RSA_KEY $DSA_KEY ; do
if [ -f "${SNF_IMAGE_TARGET}/${key}" ] ; then
rm -f ${SNF_IMAGE_TARGET}/${key}*
fi
done
fi
HOST_KEY="/etc/ssh/ssh_host_key"
RSA_KEY="/etc/ssh/ssh_host_rsa_key"
DSA_KEY="/etc/ssh/ssh_host_dsa_key"
for key in $HOST_KEY $RSA_KEY $DSA_KEY ; do
if [ -f "${SNF_IMAGE_TARGET}/${key}" ] ; then
rm -f ${SNF_IMAGE_TARGET}/${key}*
fi
done
cleanup
trap - EXIT
exit 0
# vim: set sta sts=4 shiftwidth=4 sw=4 et ai :
......@@ -23,3 +23,5 @@ if [ -e /usr/share/snf-image/unattend.xml ]; then
fi
exit 0
# vim: set sta sts=4 shiftwidth=4 sw=4 et ai :
......@@ -14,15 +14,17 @@ if [ ! -d "$SNF_IMAGE_TARGET" ]; then
log_error "Target directory \`$SNF_IMAGE_TARGET' is missing"
fi
# Write a diskpart script to %SystemDrive%\Windows\SnfScripts. Sysprep will
# try to execute this script during the specialize pass.
mkdir -p "$SNF_IMAGE_TARGET/Windows/SnfScripts"
cat > "$SNF_IMAGE_TARGET/Windows/SnfScripts/ExtendFilesystem" <<EOF
if [ "$SNF_IMAGE_TYPE" = "ntfsdump" ]; then
# Write a diskpart script to %SystemDrive%\Windows\SnfScripts. Sysprep will
# try to execute this script during the specialize pass.
mkdir -p "$SNF_IMAGE_TARGET/Windows/SnfScripts"
cat > "$SNF_IMAGE_TARGET/Windows/SnfScripts/ExtendFilesystem" <<EOF
select disk 0
select volume 1
extend filesystem
exit
EOF
fi
cleanup
trap - EXIT
......@@ -30,4 +32,3 @@ trap - EXIT
exit 0
# vim: set sta sts=4 shiftwidth=4 sw=4 et ai :
......@@ -14,17 +14,15 @@ if [ ! -d "$SNF_IMAGE_TARGET" ]; then
log_error "Target dir: \`$SNF_IMAGE_TARGET' is missing"
fi
if [ "$SNF_IMAGE_TYPE" != "extdump" ]; then
exit 0
fi
distro=$(get_base_distro $SNF_IMAGE_TARGET)
if [ "$distro" = "redhat" ]; then
# we have to force a filesystem relabeling for SELinux after messing
# around with the filesystem in redhat derived OSs
echo "Enforce an automatic relabeling in the initial boot process..."
touch $SNF_IMAGE_TARGET/.autorelabel
if [ "$SNF_IMAGE_TYPE" = "extdump" ]; then
distro=$(get_base_distro $SNF_IMAGE_TARGET)
if [ "$distro" = "redhat" ]; then
# we have to force a filesystem relabeling for SELinux after messing
# around with the filesystem in redhat derived OSs
echo "Enforce an automatic relabeling in the initial boot process..."
touch $SNF_IMAGE_TARGET/.autorelabel
fi
fi
exit 0
......
......@@ -68,8 +68,6 @@ elif [ "$SNF_IMAGE_TYPE" = "extdump" ]; then
linux_hostname $SNF_IMAGE_TARGET $SNF_IMAGE_HOSTNAME
fi
echo "done"
cleanup
trap - EXIT
......
......@@ -16,4 +16,10 @@ fi
umount $SNF_IMAGE_TARGET
cleanup
trap - EXIT
exit 0
# vim: set sta sts=4 shiftwidth=4 sw=4 et ai :
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment