From b632fa50514338548a873382263ff818f0ac3cc5 Mon Sep 17 00:00:00 2001 From: Max Fowler Date: Fri, 20 Nov 2020 13:23:19 +0100 Subject: [PATCH 1/2] Add flags to quick_deployment.md --- .gitignore | 1 + src/quick_deployment.md | 7 +++++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index 599bf1a..ce5651b 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ book src/tmp notes +deploy.sh \ No newline at end of file diff --git a/src/quick_deployment.md b/src/quick_deployment.md index f6bfd71..858df20 100644 --- a/src/quick_deployment.md +++ b/src/quick_deployment.md @@ -75,13 +75,16 @@ iface wlan0 inet dhcp ## Scripts The `setup_dev_env.py` script can be executed once your Pi is internet-connected and `git` and `python` have been installed. It takes a `` argument to create a new system user. You will be prompted to enter a password for your newly created user. The script will install system requirements and copy configuration files relating to networking, I2C and RTC. +The i2c and rtc flags are optional and can be removed for installation without the peripheral hardware. -_TODO: Add flags to (de)select I2C, RTC and Rust install & config. Flags should also be added which allow the installer to choose between development environment and release environment configuration._ +_TODO: Add flags to (de)select Rust install & config. Flags should also be added which allow the installer to choose between development environment and release environment configuration._ ```bash apt update apt install git python git clone https://github.com/peachcloud/peach-config.git cd peach-config -python scripts/setup_dev_env.py +python scripts/setup_dev_env.py --i2c --rtc ds3231 ``` + + From 9249bdc1e57350a5f3fa9dc4f375c26b9df1b9f5 Mon Sep 17 00:00:00 2001 From: Max Fowler Date: Fri, 20 Nov 2020 13:26:43 +0100 Subject: [PATCH 2/2] Mirror other README --- src/quick_deployment.md | 29 ++++++++++++++++++++++++----- 1 file changed, 24 insertions(+), 5 deletions(-) diff --git a/src/quick_deployment.md b/src/quick_deployment.md index 858df20..b64adb1 100644 --- a/src/quick_deployment.md +++ b/src/quick_deployment.md @@ -74,17 +74,36 @@ iface wlan0 inet dhcp ## Scripts -The `setup_dev_env.py` script can be executed once your Pi is internet-connected and `git` and `python` have been installed. It takes a `` argument to create a new system user. You will be prompted to enter a password for your newly created user. The script will install system requirements and copy configuration files relating to networking, I2C and RTC. -The i2c and rtc flags are optional and can be removed for installation without the peripheral hardware. - -_TODO: Add flags to (de)select Rust install & config. Flags should also be added which allow the installer to choose between development environment and release environment configuration._ +The `setup_dev_env.py` script can be executed once your Pi is internet-connected and `git` and `python` have been installed. ```bash apt update apt install git python git clone https://github.com/peachcloud/peach-config.git cd peach-config -python scripts/setup_dev_env.py --i2c --rtc ds3231 +# run the script with --i2c and --rtc flags to configure +python scripts/setup_dev_env.py -i -r ds3231 ``` +Running the script with the `-h` flag shows the help menu: +```bash +usage: setup_dev_env.py [-h] [-i] [-r {ds1307,ds3231}] user + +positional arguments: + user username for the default user account + +optional arguments: + -h, --help show this help message and exit + -i, --i2c configure i2c + -r {ds1307,ds3231}, --rtc {ds1307,ds3231} + configure real-time clock +``` + +A `` argument must be supplied to create a new system user. You will be prompted to enter a password for your newly created user. + +The script also allows optional configuration of I2C and real-time clock (RTC) modules. I2C configuration is necessary for the OLED display and physical interface to work correctly. RTC configuration is required for the real-time clock to work correctly. When passing the `-r` flag, the type of real-time clock module must be included (either ds1307 or ds3231). Selecting real-time clock configuration will not work if the I2C flag is not selected (in other words, the real-time clock requires I2C). + +Run the script as follows for a full installation and configuration with I2C and the ds3231 RTC module (username in this case is `peach`): + +`python scripts/setup_dev_env.py -i -r ds3231 peach`