| 
									
										
										
										
											2020-05-01 19:00:17 -05:00
										 |  |  | #!/bin/bash
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | . CONFIG.sh | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | # set -o xtrace       ## To debug scripts | 
					
						
							|  |  |  | # set -o errexit      ## To exit on error | 
					
						
							|  |  |  | # set -o errunset     ## To exit if a variable is referenced but not set | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | # Debootstrap process | 
					
						
							|  |  |  | function main() { | 
					
						
							| 
									
										
										
										
											2020-05-01 22:03:04 -05:00
										 |  |  |     confirm_dialouge "Launch Xephyr preview window?\n Resolution: ${RESOLUTION} Window ID: ${ID}" | 
					
						
							|  |  |  |     if [[ $? -eq 0 ]]; then | 
					
						
							| 
									
										
										
										
											2020-05-01 20:10:29 -05:00
										 |  |  |         Xephyr -resizeable -screen "${RES}" "${ID}" & | 
					
						
							|  |  |  |     fi | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-05-01 22:03:04 -05:00
										 |  |  |     clear | 
					
						
							|  |  |  |     # Mount stuff | 
					
						
							| 
									
										
										
										
											2020-05-01 22:45:23 -05:00
										 |  |  |     sudo mount --bind /dev "${CHROOT_PTH}"/dev/ | 
					
						
							|  |  |  |     sudo mount -t proc proc "${CHROOT_PTH}"/proc/ | 
					
						
							|  |  |  |     sudo mount -t sysfs sys "${CHROOT_PTH}"/sys/ | 
					
						
							| 
									
										
										
										
											2020-05-01 19:00:17 -05:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-05-01 22:03:04 -05:00
										 |  |  |     # setup some configs stuff for internetz | 
					
						
							| 
									
										
										
										
											2020-05-02 01:30:03 -05:00
										 |  |  |     sudo cp -r COPY_OVER_TO_CHROOT/ "${CHROOT_PTH}" | 
					
						
							| 
									
										
										
										
											2020-05-01 19:00:17 -05:00
										 |  |  |     sudo cp /etc/hosts "${CHROOT_PTH}"/etc/hosts | 
					
						
							|  |  |  |     sudo cp /etc/resolv.conf "${CHROOT_PTH}"/etc/resolv.conf | 
					
						
							| 
									
										
										
										
											2020-05-01 22:03:04 -05:00
										 |  |  |     sudo chown $USER "${CHROOT_PTH}"/etc/apt/sources.list | 
					
						
							| 
									
										
										
										
											2020-05-01 19:00:17 -05:00
										 |  |  |     sudo sed s/$SYSTEM_RELEASE/$RELEASE/ < /etc/apt/sources.list > "${CHROOT_PTH}"/etc/apt/sources.list | 
					
						
							| 
									
										
										
										
											2020-05-01 22:03:04 -05:00
										 |  |  |     sudo chown root "${CHROOT_PTH}"/etc/apt/sources.list | 
					
						
							| 
									
										
										
										
											2020-05-01 19:00:17 -05:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-05-01 22:03:04 -05:00
										 |  |  |     # Enter chroot mode | 
					
						
							|  |  |  |     chroot_big_dump_mesage | 
					
						
							| 
									
										
										
										
											2020-05-01 19:00:17 -05:00
										 |  |  |     sudo chroot "${CHROOT_PTH}" | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-05-01 20:10:29 -05:00
										 |  |  |     # cleanup | 
					
						
							| 
									
										
										
										
											2020-05-02 01:30:03 -05:00
										 |  |  |     sudo rm -rf "${CHROOT_PTH}"/COPY_OVER_TO_CHROOT/ | 
					
						
							| 
									
										
										
										
											2020-05-01 22:45:23 -05:00
										 |  |  |     sudo umount "${CHROOT_PTH}"/dev/ | 
					
						
							| 
									
										
										
										
											2020-05-01 22:03:04 -05:00
										 |  |  |     sudo umount -lf "${CHROOT_PTH}"/proc/ | 
					
						
							|  |  |  |     sudo umount -lf "${CHROOT_PTH}"/sys/ | 
					
						
							| 
									
										
										
										
											2020-05-01 19:00:17 -05:00
										 |  |  | } | 
					
						
							|  |  |  | main $@; |