uefi and bios style boot images with mkisofs
This commit is contained in:
		
							parent
							
								
									0078535118
								
							
						
					
					
						commit
						1868029f7b
					
				
					 1 changed files with 47 additions and 8 deletions
				
			
		
							
								
								
									
										55
									
								
								src/iso.sh
									
										
									
									
									
								
							
							
						
						
									
										55
									
								
								src/iso.sh
									
										
									
									
									
								
							|  | @ -4,29 +4,68 @@ printf '%b\n' "\n\033[1m"WINDOWS_INIT:"\033[0m"" Executing extract_iso.sh" | ||||||
| src/extract_iso.sh | src/extract_iso.sh | ||||||
| EXTRACT="win/" | EXTRACT="win/" | ||||||
| 
 | 
 | ||||||
| printf '%b\n' "\n\033[1m"WINDOWS_INIT:"\033[0m"" Executing bootsect.sh" | #printf '%b\n' "\n\033[1m"WINDOWS_INIT:"\033[0m"" Executing bootsect.sh" | ||||||
| src/bootsect.sh | #./src/bootsect.sh | ||||||
|  | #BOOT="bootsect.bin" | ||||||
| 
 | 
 | ||||||
| # add answerfile | # add answerfile | ||||||
| cp data/autounattend.xml ${EXTRACT} | cp data/autounattend.xml ${EXTRACT} | ||||||
| BOOT="bootsect.bin" | 
 | ||||||
|  | # data for mkisofs | ||||||
|  | BOOT="boot/etfsboot.com" | ||||||
|  | EFI="efi/boot/bootx64.efi" | ||||||
|  | LOAD_SEG="$(dumpet -i Win*.iso \ | ||||||
|  |     | grep "Media load segment: " \ | ||||||
|  |     | cut -d ':' -f2 \ | ||||||
|  |     | cut -d ' ' -f2)" | ||||||
|  | LOAD_SIZE="$(dumpet -i Win*.iso \ | ||||||
|  |     | grep "Load Sectors: " \ | ||||||
|  |     | grep -o "[^:]*$" \ | ||||||
|  |     | cut -d ' ' -f2 \ | ||||||
|  |     | head -1)" | ||||||
|  | LDA="$(dumpet -i Win*.iso \ | ||||||
|  |     | grep "LDA" \ | ||||||
|  |     | tail -n 1 \ | ||||||
|  |     | awk '{printf $3}')" | ||||||
|  | CDROM_SECTOR_SIZE=2048 | ||||||
|  | FLOPPY_SECTOR_SIZE=512 | ||||||
|  | 
 | ||||||
|  | # number of floppy disk sectors | ||||||
|  | dd if=Win*.iso bs=${CDROM_SECTOR_SIZE} skip=${LDA} count=1 > win.dmp | ||||||
|  | FLOPPY_SECTORS="$(file win.dmp \ | ||||||
|  |     | sed -e "s/.*sectors\ //" \ | ||||||
|  |     | awk '{printf $1}')" | ||||||
|  | rm win.dmp | ||||||
|  | 
 | ||||||
|  | CDROM_SECTORS=`expr $FLOPPY_SECTOR_SIZE \ | ||||||
|  |     \* $FLOPPY_SECTORS \ | ||||||
|  |     / $CDROM_SECTOR_SIZE` | ||||||
|  | dd if=Win*.iso bs=${CDROM_SECTOR_SIZE} skip=${LDA} count=${CDROM_SECTORS} of=win_efi_boot.img | ||||||
| 
 | 
 | ||||||
| # install mkisofs | # install mkisofs | ||||||
| # recreate iso | # recreate iso | ||||||
| cd ${EXTRACT} | cd ${EXTRACT} | ||||||
| mkisofs \ | mkisofs \ | ||||||
|     -allow-limited-size \ |     -allow-limited-size \ | ||||||
|     -b ${BOOT} \ |  | ||||||
|     -no-emul-boot \ |     -no-emul-boot \ | ||||||
|     -boot-load-seg 1984 \ |     -b ${BOOT} \ | ||||||
|     -boot-load-size 4 \ |     -boot-load-seg ${LOAD_SEG} \ | ||||||
|  |     -boot-load-size ${LOAD_SIZE} \ | ||||||
|  |     -eltorito-alt-boot \ | ||||||
|  |     -b ${EFI} \ | ||||||
|  |     -eltorito-platform efi \ | ||||||
|     -iso-level 2 \ |     -iso-level 2 \ | ||||||
|     -J -l -D -N -joliet-long -relaxed-filenames \ |     -boot-info-table | ||||||
|  |     -udf | ||||||
|  |     -J -l -joliet-long \ | ||||||
|  |     -D \ | ||||||
|  |     -N \ | ||||||
|  |     -relaxed-filenames \ | ||||||
|     -V "WINSP" \ |     -V "WINSP" \ | ||||||
|     -o winsp.iso \ |     -o winsp.iso \ | ||||||
|     . |     . | ||||||
| 
 | 
 | ||||||
| cp winsp.iso ../ | mv winsp.iso ../ | ||||||
| 
 | 
 | ||||||
| # clean up bootsect and iso extract | # clean up bootsect and iso extract | ||||||
| cd .. | cd .. | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue