Some checks are pending
		
		
	
	Build / test (push) Waiting to run
				Docs / test (push) Waiting to run
				
		
			
				
	
	
		
			31 lines
		
	
	
	
		
			569 B
		
	
	
	
		
			Bash
		
	
	
		
			Executable file
		
	
	
	
	
			
		
		
	
	
			31 lines
		
	
	
	
		
			569 B
		
	
	
	
		
			Bash
		
	
	
		
			Executable file
		
	
	
	
	
| #!/bin/env sh
 | |
| 
 | |
| grub_config=$(cat <<EOF
 | |
| 
 | |
| set timeout=15
 | |
| set default=0
 | |
| 
 | |
| menuentry "StupidOS" {
 | |
|    echo "verify system integrity"
 | |
|    hashsum --hash sha256 --check /boot/hashfile --prefix /
 | |
|    multiboot /stpdldr.sys
 | |
|    module /vmstupid.sys
 | |
|    boot
 | |
| }
 | |
| 
 | |
| EOF
 | |
| )
 | |
| 
 | |
| gen_iso_file() {
 | |
| 	mkdir -p "$2/boot/grub"
 | |
| 	echo "$grub_config" > "$2/boot/grub/grub.cfg"
 | |
| 	(cd "$2"; 
 | |
| 		sha256sum -b -t "vmstupid.sys" > "boot/hashfile";
 | |
| 		sha256sum -b -t "stpdldr.sys" >> "boot/hashfile"
 | |
| 	)
 | |
| 	grub-file --is-x86-multiboot "$2/stpdldr.sys" || exit 1
 | |
| 
 | |
| 	grub-mkrescue -o $1 $2
 | |
| }
 | |
| 
 | |
| gen_iso_file "$1" "$2"
 |