summaryrefslogtreecommitdiff
path: root/src/scripts/23net.sh
blob: 144118363f5e422405c67ae47f45421ee5a517a0 (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
#!/bin/sh

# make-live - utility to build Debian Live systems
#
# Copyright (C) 2006 Daniel Baumann <daniel@debian.org>
# Copyright (C) 2006 Marco Amadori <marco.amadori@gmail.com>
#
# make-live comes with ABSOLUTELY NO WARRANTY; for details see COPYING.
# This is free software, and you are welcome to redistribute it
# under certain conditions; see COPYING for details.

Net ()
{
	# Installing smbfs
	Chroot_exec "apt-get install --yes smbfs"

	if [ "${LIVE_ARCHITECTURE}" = "amd64" ] || [ "${LIVE_ARCHITECTURE}" = "i386" ]
	then
		if [ ! -d "${LIVE_CHROOT}"/etc/initramfs-tools ]
		then 
			mkdir "${LIVE_CHROOT}"/etc/initramfs-tools
		fi
		
		# Configuring initramfs for NFS
cat >> "${LIVE_CHROOT}"/etc/initramfs-tools/initramfs.conf << EOF
MODULES=netboot
BOOT=nfs
NFSROOT=auto
EOF
		Chroot_exec "update-initramfs -tu"
	fi

	# Switching package indices to default
	Indices default
	
	# Generating rootfs image
	Genrootfs

	# Switching package indices to custom
	Indices custom

	# Installing syslinux
	Syslinux net

	# Installing linux-image
	Linuximage net

	# Installing memtest
	Memtest net

	# Creating tarball
	LIVE_BASENAME=`basename "${LIVE_ROOT}"`
	LIVE_BASE_SERVER_PATH=`basename "${LIVE_SERVER_PATH}"`
	cd "${LIVE_ROOT}" && \
	mv image "${LIVE_BASE_SERVER_PATH}" && \
	cd .. && \
	tar cfz netboot.tar.gz "${LIVE_BASENAME}/${LIVE_BASE_SERVER_PATH}" "${LIVE_BASENAME}/tftpboot" && \
	mv netboot.tar.gz "${LIVE_ROOT}" && \
	cd "${OLDPWD}" && \
	mv "${LIVE_BASE_SERVER_PATH}" image
}