Revision ec728294

b/snf-image-helper/ChangeLog
1 1
2011-11-11, v0.2
2 2
	* Add support for Image Properties
3
	* Add new FixPartitionTable hook
3
	* Add new FixPartitionTable task
4
	* Add new task that disables RDP connections during windows setup
4 5

  
5 6
2011-10-20, v0.1.2
6 7

  
b/snf-image-helper/common.sh
37 37
XMLSTARLET=xmlstarlet
38 38
RESIZE2FS=resize2fs
39 39
PARTED=parted
40
REGLOOKUP=reglookup
41
CHNTPW=chntpw
40 42

  
41 43
CLEANUP=( )
42 44

  
b/snf-image-helper/configure.ac
28 28
  AC_MSG_ERROR([parted not found in $PATH])
29 29
fi
30 30

  
31
AC_PATH_PROG(REGLOOKUP, [reglookup], [], [$PATH:/usr/sbin:/sbin])
32
if test -z "$REGLOOKUP" ; then
33
  AC_MSG_ERROR([reglookup not found in $PATH])
34
fi
35

  
36
AC_PATH_PROG(CHNTPW, [chntpw], [], [$PATH:/usr/sbin:/sbin])
37
if test -z "$CHNTPW" ; then
38
  AC_MSG_ERROR([chntpw not found in $PATH])
39
fi
40

  
31 41
AC_CONFIG_FILES([
32 42
    Makefile
33 43
    tasks/Makefile
b/snf-image-helper/tasks/40DisableRemoteDesktopConnections.in
1
#! /bin/bash
2

  
3
### BEGIN TASK INFO
4
# Provides:		DisableRemoteDesktopConnections
5
# RunBefore:            UmountImage
6
# RunAfter:		MountImage
7
# Short-Description:	Temporary Disable Remote Desktop Connections
8
### END TASK INFO
9

  
10
#
11
# This task will change the value of `fDenyTSConnection' registry key located in
12
# `HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Terminal Server\' to
13
# "true". This will disable RDP connections. The key will change back to "false"
14
# during the specialize pass of the Windows setup.
15
#
16

  
17
set -e
18
. "@commondir@/common.sh"
19

  
20
if [ ! -d "$SNF_IMAGE_TARGET" ]; then
21
    log_error "Target directory \`$SNF_IMAGE_TARGET' is missing"
22
fi
23

  
24
if [ "$SNF_IMAGE_PROPERTY_OSFAMILY" != "windows" ]; then
25
    exit 0
26
fi
27

  
28
hive="$SNF_IMAGE_TARGET/Windows/System32/config/SYSTEM"
29
current=$($REGLOOKUP "$hive" | grep ^/Select/Current | cut -d, -f3)
30

  
31
# Change the key value.
32
# For a stupid reason chntpw returns 2!
33
chntpw -e "$hive" <<EOF || { test $? -eq 2 && chntpw_ret="success"; }
34
cd ControlSet${current: -3}\Control\Terminal Server
35
ed fDenyTSConnections
36
1
37
q
38
y
39
EOF
40

  
41
if [ x"$chntpw_ret" != "xsuccess" ]; then
42
    log_error "$CHNTPW failed"
43
fi
44

  
45
exit 0
46

  
47
# vim: set sta sts=4 shiftwidth=4 sw=4 et ai :
b/snf-image-helper/tasks/Makefile.am
6 6
		30MountImage \
7 7
		40AddDeleteUnattendScript \
8 8
		40DeleteSSHKeys \
9
		40DisableRemoteDesktopConnections \
9 10
		40InstallUnattend \
10 11
		40FilesystemResizeMounted \
11 12
		40SELinuxAutorelabel \
......
29 30
		   $(edit) $${srcdir}$@.in >$@.tmp
30 31
	mv $@.tmp $@
31 32

  
32
CLEANFILES =  \
33
		10FixPartitionTable \
34
		20FilesystemResizeUnmounted \
35
		30MountImage \
36
		40AddDeleteUnattendScript \
37
		40DeleteSSHKeys \
38
		40InstallUnattend \
39
		40FilesystemResizeMounted \
40
		40SELinuxAutorelabel \
41
		50AssignHostname \
42
		50EnforcePersonality \
43
		50ChangePassword \
44
		80UmountImage
33
CLEANFILES = $(dist_tasks_SCRIPTS)
45 34

  
b/snf-image-helper/unattend.xml
21 21
                    <Order>1</Order>
22 22
                    <Path>diskpart.exe /s C:\Windows\SnfScripts\ExtendFilesystem</Path>
23 23
                </RunSynchronousCommand>
24
                <RunSynchronousCommand wcm:action="add">
25
                    <Description>Enable RDP</Description>
26
                    <Order>2</Order>
27
                    <Path>cmd /C reg add "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Terminal Server" /v fDenyTSConnections /t REG_DWORD /d 0 /f</Path>
28
                </RunSynchronousCommand>
24 29
            </RunSynchronous>
25 30
        </component>
26 31
    </settings>
b/snf-image-host/common.sh.in
293 293
: ${HELPER_HARD_TIMEOUT:=5}
294 294
: ${HELPER_USER:="nobody"}
295 295
: ${HELPER_CACHE_FILE:="@HELPER_DIR@/cache.tar"}
296
: ${HELPER_EXTRA_PKGS:="linux-image-amd64,e2fsprogs,ntfs-3g,ntfsprogs,xmlstarlet,python,parted"}
296
: ${HELPER_EXTRA_PKGS:="linux-image-amd64,e2fsprogs,ntfs-3g,ntfsprogs,xmlstarlet,python,parted,reglookup,chntpw"}
297 297
: ${HELPER_MIRROR:=""}
298 298

  
299 299

  
b/snf-image-host/defaults
51 51

  
52 52
# HELPER_EXTRA_PKGS: Extra packages that will need to be supplied
53 53
# to debootstrap to make the resulting helper image workable
54
# HELPER_EXTRA_PKGS="linux-image-amd64,e2fsprogs,ntfs-3g,ntfsprogs,xmlstarlet,python,parted"
54
# HELPER_EXTRA_PKGS="linux-image-amd64,e2fsprogs,ntfs-3g,ntfsprogs,xmlstarlet,python,parted,reglookup,chntpw"
55 55

  
56 56
# HELPER_MIRROR: Debian mirror to use with debootstrap. Using a mirror close to
57 57
# you will speed up the whole debootstraping process. By default we do not

Also available in: Unified diff