summaryrefslogtreecommitdiff
path: root/src/profiles/profile-dieter
blob: 05e03fcc590cf75c8698434334c7f49a4cb533c6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
#!/bin/bash
var_RUNTIME_PACKAGES="svn"

phase_preparation ()
{
	# All things that need to be done manually first
	notify "A few manual things need to happen first..."
	if ask_yesno "Do you want to (re)-configure your networking?"
	then
		#TODO: which function do i need here?
		donetwork #configure network by using library
	else
		notify "Ok. skipping network config"
	fi
	SVN_USERNAME=dieter
	ask_password svn
	SVN="svn --username $SVN_USERNAME --password $SVN_PASSWORD"
	SVN_BASE=https://192.168.1.2/svn/repos
	TARGET_HOST=mbp-santa-rosa #TODO: prompt user for this, or let him pass it as cmdline argument

	#TODO: find something against svn's interactive ssl cert checking.  http://www.7php.net/svn-client-certificate-authentication-cache/ might help

	notify "**** From now on. everything will be automatic. Enjoy the show!" # not true: svn will complain about ssl cert + you need pass for dm_crypt

        execute worker runtime_packages
}

worker_prepare_disks ()
{
	#TODO: integrate this stuff into the functions in the libs + do error checking and handling
	sfdisk /dev/sda << EOF
,10,L,*
,,L
EOF
	modprobe dm-crypt || die_error "Cannot modprobe dm-crypt"
	modprobe aes-x86-64 || modprobe aes-i586 || die_error "Cannot modprobe aes-x86-64 or aes-i586"
	cryptsetup -c aes-xts-plain -y -s 512 luksFormat /dev/sda2
	cryptsetup luksOpen /dev/sda2 sda2_crypt
	pvcreate /dev/mapper/sda2_crypt
	vgcreate cryptpool /dev/mapper/sda2_crypt
	lvcreate -L 2G   -n swap cryptpool
	lvcreate -L 500M -n tmp  cryptpool
	lvcreate -L 10G  -n home cryptpool
	lvcreate -L 10G  -n root cryptpool
	lvcreate -L 3G   -n var  cryptpool
	mke2fs -j /dev/cryptpool/home && mount /dev/cryptpool/home $TARGET_DIR/home
	mke2fs -j /dev/cryptpool/root
	mke2fs -j /dev/cryptpool/tmp
	mke2fs -j /dev/cryptpool/var

	#TODO fstab? auto-add to fstab with libs? auto mkdir's on target_dir?
	true	
}

worker_package_list ()
{
	$SVN export $SVN_BASE/ddm-configs/$TARGET_HOST/trunk/package-list /home/arch/fifa/package-list || die_error "Could not export package list!"
}


worker_configure_home ()
{
	#checkout from svn
	true
}


worker_install_bootloader ()
{
	install-grub /dev/sda
}