summaryrefslogtreecommitdiff
path: root/iso32
blob: 8c83afcd3fd30d5a8282b37dc42fde308cb7ded4 (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
#!/usr/bin/env bash

# Vasile needs root privileges and a proper kernel to run

kernelconfig
checkroot

export local mainarch="x86"
export local isoname=""$releasename"-"$releaseversion"-"$mainarch""
export local livedir=""$isoname"/livecd"
export local isoboot=""$livedir"/boot/grub"
export local kernelname="kernel-genkernel-"$mainarch"-"$kernelver""
export local ramfsname="initramfs-genkernel-"$mainarch"-"$kernelver""

makeisox86 () {
	# ISO layout
	mkdir -p "$coremnt"
	mkdir -p "$isoboot"
	# Mount && Sync squashed core (Kogaion stage4) into live environment
	mount -t squashfs "$chrootx86" "$coremnt"
	rsync -aHAXr --progress "$coremnt/" ""$isoname"/livecd/"
	# Put our kernel and initramfs in place
	cp -avx ""$isoname"/livecd/boot/"$kernelname"" ""$isoname"/boot/"$releasename""
	cp -avx ""$isoname"/livecd/boot/"$ramfsname"" ""$isoname"/boot/"$releasename".igz"
	# Checksum the kernel && initramfs
	sha256sum ""$isoname"/boot/"$releasename"" | tee ""$isoname"/boot/"$releasename".sha256"
	sha256sum ""$isoname"/boot/"$releasename.igz"" | tee ""$isoname"/boot/"$releasename".igz.sha256"
	# Squash live environment
	mksquashfs ""$isoname"/livecd" ""$isoname"/livecd.squashfs" -b 1048576 -comp xz -Xdict-size 100%
	# Checksum the live environment
	sha256sum ""$isoname"/livecd.squashfs" | tee ""$isoname"/livecd.squashfs.sha256"
	# Remove live environment directory (we have it squashed now, no longer needed)
	rm -rf ""$isoname"/livecd"
	# Enable liveboot
	touch ""$isoname"/livecd"
	# Umount squashed core (Kogaion stage4)
	umount "$coremnt"
}

main () {
	chrootchecksumx86
	makeisox86
}

main