Compare commits
	
		
			No commits in common. "20e1d72160f5289cc6d62f21578595da4ebc917e" and "f2fce29d7458838820512cfffb77293ef9c0b5a5" have entirely different histories.
		
	
	
		
			20e1d72160
			...
			f2fce29d74
		
	
		
							
								
								
									
										1
									
								
								.gitignore
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										1
									
								
								.gitignore
									
									
									
									
										vendored
									
									
								
							| 
						 | 
					@ -1,4 +1,3 @@
 | 
				
			||||||
/build/
 | 
					/build/
 | 
				
			||||||
parameters.env
 | 
					parameters.env
 | 
				
			||||||
*.img
 | 
					*.img
 | 
				
			||||||
*.img.*
 | 
					 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -48,10 +48,8 @@ tar -xzvf build/rpi-cloud-init.tgz -C /mnt/rpi-boot
 | 
				
			||||||
Place a decompressed Ubuntu Server `*.img` file in the project directory and
 | 
					Place a decompressed Ubuntu Server `*.img` file in the project directory and
 | 
				
			||||||
use `img-config.sh` to both build the project and dope the boot partition of `*.img` file directly
 | 
					use `img-config.sh` to both build the project and dope the boot partition of `*.img` file directly
 | 
				
			||||||
 | 
					
 | 
				
			||||||
**Note**: Must be run from an account with `sudo` permissions
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
```bash
 | 
					```bash
 | 
				
			||||||
./img-config.sh ubuntu-20.04.1-preinstalled-server-arm64+raspi.img
 | 
					sudo ./img-config.sh ubuntu-20.04.1-preinstalled-server-arm64+raspi.img
 | 
				
			||||||
```
 | 
					```
 | 
				
			||||||
 | 
					
 | 
				
			||||||
## Roadmap
 | 
					## Roadmap
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
							
								
								
									
										4
									
								
								build.sh
									
									
									
									
									
								
							
							
						
						
									
										4
									
								
								build.sh
									
									
									
									
									
								
							| 
						 | 
					@ -16,7 +16,9 @@ $(cat src/user-data)
 | 
				
			||||||
~" > build/cloud-init/user-data
 | 
					~" > build/cloud-init/user-data
 | 
				
			||||||
 | 
					
 | 
				
			||||||
cp src/meta-data build/cloud-init/
 | 
					cp src/meta-data build/cloud-init/
 | 
				
			||||||
cp src/*.sh build/cloud-init/
 | 
					cp src/initial-setup.sh build/cloud-init/
 | 
				
			||||||
 | 
					cp src/install-torch.sh build/cloud-init/
 | 
				
			||||||
 | 
					cp src/torch-agent_0.0.4-1_all.deb build/cloud-init/
 | 
				
			||||||
 | 
					
 | 
				
			||||||
mkdir build/cloud-init/torch-config
 | 
					mkdir build/cloud-init/torch-config
 | 
				
			||||||
cp -r $TORCH_CONFIG_DIR/* build/cloud-init/torch-config/
 | 
					cp -r $TORCH_CONFIG_DIR/* build/cloud-init/torch-config/
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,15 +1,12 @@
 | 
				
			||||||
#!/bin/bash
 | 
					#!/bin/bash
 | 
				
			||||||
 | 
					
 | 
				
			||||||
[ $# -eq 0 ] && { echo "Usage: $0 IMG_FILE"; exit 1; }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
SECTOR_BYTES=512
 | 
					SECTOR_BYTES=512
 | 
				
			||||||
SECTOR_START=2048
 | 
					SECTOR_START=2048
 | 
				
			||||||
OFFSET=$(($SECTOR_BYTES*$SECTOR_START))
 | 
					OFFSET=$(($SECTOR_BYTES*$SECTOR_START))
 | 
				
			||||||
 | 
					
 | 
				
			||||||
./build.sh
 | 
					./build.sh
 | 
				
			||||||
mkdir -p boot-part
 | 
					mkdir -p boot-part
 | 
				
			||||||
sudo mount -o rw,loop,offset=$OFFSET $1 ./boot-part
 | 
					mount -o rw,loop,offset=$OFFSET $1 ./boot-part
 | 
				
			||||||
tar -xzvf build/rpi-cloud-init.tgz -C boot-part
 | 
					tar -xzvf build/rpi-cloud-init.tgz -C boot-part
 | 
				
			||||||
sudo umount ./boot-part
 | 
					umount ./boot-part
 | 
				
			||||||
rmdir ./boot-part
 | 
					rmdir ./boot-part
 | 
				
			||||||
rm -rf ./build
 | 
					 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,5 +1,6 @@
 | 
				
			||||||
#!/bin/sh -e
 | 
					#!/bin/sh -e
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					apt-get -y install /boot/firmware/cloud-init/torch-agent_0.0.4-1_all.deb
 | 
				
			||||||
cp -r /boot/firmware/cloud-init/torch-config/* /etc/torch/
 | 
					cp -r /boot/firmware/cloud-init/torch-config/* /etc/torch/
 | 
				
			||||||
chown torch -R /etc/torch
 | 
					chown torch -R /etc/torch
 | 
				
			||||||
systemctl daemon-reload
 | 
					systemctl daemon-reload
 | 
				
			||||||
							
								
								
									
										
											BIN
										
									
								
								src/torch-agent_0.0.4-1_all.deb
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										
											BIN
										
									
								
								src/torch-agent_0.0.4-1_all.deb
									
									
									
									
									
										Normal file
									
								
							
										
											Binary file not shown.
										
									
								
							| 
						 | 
					@ -14,38 +14,20 @@ users:
 | 
				
			||||||
    ssh_authorized_keys:
 | 
					    ssh_authorized_keys:
 | 
				
			||||||
      - $SSH_PUBKEY
 | 
					      - $SSH_PUBKEY
 | 
				
			||||||
 | 
					
 | 
				
			||||||
apt:
 | 
					 | 
				
			||||||
  sources:
 | 
					 | 
				
			||||||
    rudefox.list:
 | 
					 | 
				
			||||||
      source: "deb https://repo.rudefox.io/repository/apt-release focal main"
 | 
					 | 
				
			||||||
      key: |
 | 
					 | 
				
			||||||
        -----BEGIN PGP PUBLIC KEY BLOCK-----
 | 
					 | 
				
			||||||
        
 | 
					 | 
				
			||||||
        mQENBF98c5oBCADb1LGtaxRg6pCHadJ72XVgkOkdrCBs7TElovYeX1y/pj1kUmSN
 | 
					 | 
				
			||||||
        +RO0Ax0YlHxKpuicIEU3HzL8qJ0FbB9ShGnYXxVhxn4HuVSvVpqcExCK2Dkz2g2+
 | 
					 | 
				
			||||||
        0HpmDsptcsHpvTr0JiPClr4GgbeJuoz5kBOwmE8uQ5NswUysvkOWnlht1ILZMGat
 | 
					 | 
				
			||||||
        wimqQaJbZ57TI+q3GPCRaWc2bwRoFS/bVjQrZ18fkRcdUsWLcy0JuipoBklWbKSP
 | 
					 | 
				
			||||||
        VT1kfwz+akhyjiNO8F9n+5JYDi6vbZIwucQMcsLkZyvhdhLPfd37jjdFFF7EIG4d
 | 
					 | 
				
			||||||
        tsF50JzbpAEt4FfHDvyEgfOTE+CWU52CS5EBABEBAAG0H1RPUmNoLUFnZW50IDxi
 | 
					 | 
				
			||||||
        amR3ZWNrQGdtYWlsLmNvbT6JAU4EEwEKADgWIQQU2IX2LS4EHRNbm77btWA5gL84
 | 
					 | 
				
			||||||
        gwUCX3xzmgIbAwULCQgHAgYVCgkICwIEFgIDAQIeAQIXgAAKCRDbtWA5gL84g5pq
 | 
					 | 
				
			||||||
        B/48M4WZLfoeLNuw39MEDXF7WSDglF5qle7I8AnB0OTxER1WZO8ZiZcHjZChINXY
 | 
					 | 
				
			||||||
        qTglpfdj525cD2s7ClFkFMsvAUy+th/otguac41DZcbiJUQoNAHbu3rAdnEHERxU
 | 
					 | 
				
			||||||
        8at6us1kgou5Cd+zz9a6LbusUte4MCTGx/yAd0mNrZqkMO8v0Rb0VvKZhm658RXp
 | 
					 | 
				
			||||||
        y8ExNfZYRLy1qH5K+ucL78dczAeIMyYlEUXJpFVvR7vgpMOQuIcSA7ez4gXNWmwp
 | 
					 | 
				
			||||||
        rgzJtFxzVo1RGDujlcjqJxH02KXo52KRmkXxfF8gF3Rkt4pNuCgw9v9flvBg9dEb
 | 
					 | 
				
			||||||
        fwqgmqM4gR+TXquJ7e9wnvly
 | 
					 | 
				
			||||||
        =VE78
 | 
					 | 
				
			||||||
        -----END PGP PUBLIC KEY BLOCK-----
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
packages: ['torch-agent']
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
runcmd:
 | 
					runcmd:
 | 
				
			||||||
 | 
					  # Disable optional PAM features for faster SSH login
 | 
				
			||||||
 | 
					#  - 'mv /etc/pam.d/sshd /etc/pam.d/sshd.bak'
 | 
				
			||||||
 | 
					#  - 'sed "s/^session[ \t]\+optional/#\0/" /etc/pam.d/sshd.bak > /etc/pam.d/sshd'
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  # Back up the SSH default config and activate the new config
 | 
				
			||||||
 | 
					#  - 'mv /etc/ssh/sshd_config /etc/ssh/sshd_config.bak'
 | 
				
			||||||
 | 
					#  - 'mv /etc/ssh/sshd_config.new /etc/ssh/sshd_config'
 | 
				
			||||||
 | 
					#  - 'service ssh reload'
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  # Multi-arch support on aarch64
 | 
					  # Multi-arch support on aarch64
 | 
				
			||||||
  - 'dpkg --add-architecture armhf'
 | 
					  - 'dpkg --add-architecture armhf'
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  # Run setup scripts
 | 
					  # Run optional script for additoinal package setup
 | 
				
			||||||
  - '/boot/firmware/cloud-init/initial-setup.sh'
 | 
					  - '/boot/firmware/cloud-init/initial-setup.sh'
 | 
				
			||||||
  - '/boot/firmware/cloud-init/configure-torch.sh'
 | 
					  - '/boot/firmware/cloud-init/install-torch.sh'
 | 
				
			||||||
  - 'reboot now'
 | 
					  - 'reboot now'
 | 
				
			||||||
		Loading…
	
		Reference in New Issue
	
	Block a user