Fixed build sudo priviliges
This commit is contained in:
parent
cce80e6fde
commit
20e1d72160
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -1,3 +1,4 @@
|
||||||
/build/
|
/build/
|
||||||
parameters.env
|
parameters.env
|
||||||
*.img
|
*.img
|
||||||
|
*.img.*
|
||||||
|
|
|
@ -48,8 +48,10 @@ 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
|
||||||
sudo ./img-config.sh ubuntu-20.04.1-preinstalled-server-arm64+raspi.img
|
./img-config.sh ubuntu-20.04.1-preinstalled-server-arm64+raspi.img
|
||||||
```
|
```
|
||||||
|
|
||||||
## Roadmap
|
## Roadmap
|
||||||
|
|
4
build.sh
4
build.sh
|
@ -16,9 +16,7 @@ $(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/initial-setup.sh build/cloud-init/
|
cp src/*.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,12 +1,15 @@
|
||||||
#!/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
|
||||||
mount -o rw,loop,offset=$OFFSET $1 ./boot-part
|
sudo 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
|
||||||
umount ./boot-part
|
sudo umount ./boot-part
|
||||||
rmdir ./boot-part
|
rmdir ./boot-part
|
||||||
|
rm -rf ./build
|
||||||
|
|
Loading…
Reference in New Issue
Block a user