summaryrefslogtreecommitdiff
path: root/distro/ubuntu/meta
blob: c051049f76c4d1347b26908ccb20e3d00cc5ddfb (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
entry() {
	if test -z "${ubt_kernel}" -o -z "${ubt_initrd}"
	then
		msg "warn: kernel image or initramfs not found."
		msg "      the Ubuntu based entry may not work."
	fi
	isofn="$(basename "$ISOFILE")"
	TITLE="$ISONAME"
	KERNEL="/liveusb-kernel/${KEYWORD}/${ubt_kernel}"
	INITRD="/liveusb-kernel/${KEYWORD}/${ubt_initrd}"
	OPTION="file=/cdrom/preseed/ubuntu.seed boot=casper iso-scan/filename=/liveusb-data/${KEYWORD}/${isofn}"
	X64=y
}

install_live() {
	install -d "$KERNELDIR/${KEYWORD}" "$DATADIR/${KEYWORD}"
	mount_iso
	ubt_kernel=($(find "$ISOMNT/casper/" -maxdepth 1 -name 'vmlinuz*'))
	if [ "${#ubt_kernel[@]}" != 1 ]; then
		fatalerror "panic: more than one kernel image found."
	else
		ubt_kernel="$(basename ${ubt_kernel[0]})"
	fi
	ubt_initrd=($(find "$ISOMNT/casper/" -maxdepth 1 -name 'initrd*'))
	if [ "${#ubt_initrd[@]}" != 1 ]; then
		fatalerror "panic: more than one initramfs image found."
	else
		ubt_initrd="$(basename ${ubt_initrd[0]})"
	fi
	cp "$ISOMNT/casper/${ubt_kernel}" "$ISOMNT/casper/${ubt_initrd}" \
		"$KERNELDIR/${KEYWORD}/"
	umount_iso
	cp "$ISOFILE" "$DATADIR/${KEYWORD}/"
}

entries=(entry)