summaryrefslogtreecommitdiff
blob: b056ade7c4a105d3f0403125e72b066834d08acc (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
72
73
74
75
76
77
78
79
80
81
82
#!/bin/bash

source ${clst_sharedir}/targets/support/functions.sh

# Only put commands in this section that you want every target to execute.
# This is a global default file and will affect every target
case $1 in
	enter)
		${clst_CHROOT} ${clst_chroot_path}
	;;
	pre-kmerge)
		# Sets up the build environment before any kernels are compiled
		exec_in_chroot ${clst_sharedir}/targets/support/pre-kmerge.sh
	;;
	post-kmerge)
		# Cleans up the build environment after the kernels are compiled
		exec_in_chroot ${clst_sharedir}/targets/support/post-kmerge.sh
	;;
	kernel)
		shift
		export clst_kname="$1"
		# If we have our own linuxrc, copy it in
		if [ -n "${clst_linuxrc}" ]
		then
			cp -pPR ${clst_linuxrc} ${clst_chroot_path}/tmp/linuxrc
		fi
		exec_in_chroot ${clst_sharedir}/targets/support/kmerge.sh
		delete_from_chroot tmp/linuxrc
		extract_modules ${clst_chroot_path} ${clst_kname}
		# Do we need this one?
#		extract_kernel ${clst_chroot_path}/boot ${clst_kname}
	;;
	build_packages)
		shift
		export clst_packages="$*"
		exec_in_chroot ${clst_sharedir}/targets/${clst_target}/${clst_target}-chroot.sh
	;;
	preclean)
		exec_in_chroot ${clst_sharedir}/targets/${clst_target}/${clst_target}-preclean-chroot.sh ${clst_root_path}
	;;
	rc-update)
		exec_in_chroot ${clst_sharedir}/targets/support/rc-update.sh
	;;
	fsscript)
		exec_in_chroot ${clst_fsscript}
	;;
	livecd-update)
		# Now, finalize and tweak the livecd fs (inside of the chroot)
		exec_in_chroot ${clst_sharedir}/targets/support/livecdfs-update.sh

		# Move over the xinitrc (if applicable)
		# This is moved here, so we can override any default xinitrc
		if [ -n "${clst_livecd_xinitrc}" ]
		then
			cp -f ${clst_livecd_xinitrc} \
				${clst_chroot_path}/etc/X11/xinit/xinitrc
		fi
	;;
	bootloader)
		exit 0
	;;
	target_image_setup)
		shift
		${clst_sharedir}/targets/support/target_image_setup.sh $1
	;;
	unmerge)
		shift
		export clst_packages="$*"
		exec_in_chroot ${clst_sharedir}/targets/support/unmerge.sh 
	;;
	iso)
		shift
		${clst_sharedir}/targets/support/create-iso.sh $1
	;;
	clean)
		exit 0
	;;
	*)
		exit 1
	;;
esac
exit $?