From 12d1e3279cf86aa6fd94a7189437bc049f25eaf4 Mon Sep 17 00:00:00 2001 From: Ben Li-Sauerwine Date: Mon, 14 Feb 2022 03:34:00 -0500 Subject: [PATCH 1/8] Do not build .zip, because the artifacts are zipped up by GitHub anyway after the fact. --- .github/workflows/build.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 0e1aad9..5e7c56a 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -45,6 +45,7 @@ jobs: NOW=$(date +"%Y-%m-%d-%H%M") IMAGE=SimpleAQ-${GITHUB_REF##*/}-$NOW echo IMG_NAME=$IMAGE > config + echo DEPLOY_ZIP=0 >> config echo "::set-output name=image::$IMAGE" # Greatly speed up our build because we don't need a desktop @@ -67,7 +68,7 @@ jobs: cd PiGen cd deploy ls - IMAGE_FILE=$(ls *.zip) + IMAGE_FILE=$(ls *.img) echo "::set-output name=imagefile::$IMAGE_FILE" # The image now exists in deploy/. Let's save it somewhere. From dbbe0b35788dd997fbe3039179b3e4d54599c474 Mon Sep 17 00:00:00 2001 From: Ben Li-Sauerwine Date: Mon, 14 Feb 2022 03:34:48 -0500 Subject: [PATCH 2/8] Progress on documenting creating and mounting a disk. --- README.md | 55 +++++++++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 53 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index f8f88d5..b85661b 100644 --- a/README.md +++ b/README.md @@ -2,6 +2,57 @@ Generic firmware for a Raspberry Pi based SimpleAQ device. -TODO: Where are images stored? -TODO: How to flash an image? +# I Just Want to Image My Device + +## Downloading an Image + +First, you will have to select the image you want. +You can find an image by selecting [Actions](/actions) in this repository, then selecting a successful Build Image run. +Then, at the bottom of the page you will see Artifacts. +Click the artifact to download it. + +## Writing the Image + +You can unzip your image with +```bash +unzip +``` + +Once you have the contained `.img` file, you can write it to your MicroSD card. +First, you will need to find the device corresponding to your MicroSD card. +```bash +sudo fdisk -l | grep MicroSD -B 1 -A 5 +``` + +Now you will have a list of all MicroSD cards attached to your system, whether mounted or not. +The device name will look like `/dev/sdx`, where x is some letter. +It is **critical** that you select the correct device name, or you **will** cause unwanted data loss on your host system. + +Next, we must ensure that the device is not mounted. +```bash +df -h | grep /dev/sdx +``` +where `/dev/sdx/` is the device name for your MicroSD card will show whether your device is mounted. + +For each mounted partition listed, unmount it with +```bash +sudo umount /dev/sdxy +``` +where `x` is your device's letter that you found with `fdisk` and `y` may be a number. + +It may be the case that your drive wasn't mounted at all. +In any event, if your device is mounted, the following step will not work. + +Now we will write your image with +```bash +cat your_image_file.img | sudo dd bs=4M of=/dev/sdx +``` +where `x` is your device's letter that you found with `fdisk` above. +This step may take a while. + +TODO: I don't understand why I'm unable to mount the (ostesnbily ext4) Linux partition now... + + +# TODOs + TODO: Manual configuration of an image for the frontend. From 6edc5b215278bb67fcaf908327848753bae04c89 Mon Sep 17 00:00:00 2001 From: Ben Li-Sauerwine Date: Mon, 14 Feb 2022 04:17:21 -0500 Subject: [PATCH 3/8] Don't use cat to write the image, use if. It's much faster. --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index b85661b..e9cc345 100644 --- a/README.md +++ b/README.md @@ -45,7 +45,7 @@ In any event, if your device is mounted, the following step will not work. Now we will write your image with ```bash -cat your_image_file.img | sudo dd bs=4M of=/dev/sdx +sudo dd bs=4M of=/dev/sdx if=your_image_file.img ``` where `x` is your device's letter that you found with `fdisk` above. This step may take a while. From ec83d985b416606ba28613eaf36163ac8064118f Mon Sep 17 00:00:00 2001 From: Ben Li-Sauerwine Date: Mon, 14 Feb 2022 04:45:14 -0500 Subject: [PATCH 4/8] Try build-docker. Maybe the 64-bit host OS is causing problems. --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 5e7c56a..65343d2 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -59,7 +59,7 @@ jobs: - name: Build Image run: | cd PiGen - sudo ./build.sh + ./build-docker.sh # Pi-Gen does weird things with the image file name, so let's make sure we have it right. - name: Get Image Name From e019a5476de8ad3797782e2086dd3f1ef9d33908 Mon Sep 17 00:00:00 2001 From: Ben Li-Sauerwine Date: Mon, 14 Feb 2022 05:04:37 -0500 Subject: [PATCH 5/8] Exactly how much space DO we have to work with, anyway? --- .github/workflows/build.yml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 65343d2..38c006c 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -10,7 +10,7 @@ jobs: build: runs-on: ubuntu-latest steps: - - name: Maximize build space + - name: Maximize Build Space uses: easimon/maximize-build-space@master with: root-reserve-mb: 512 @@ -19,6 +19,11 @@ jobs: remove-android: 'true' remove-haskell: 'true' + - name: List Available Space + run: | + echo: "Free space:" + df -h + - name: Install Dependencies run: | sudo apt update From c40e7a0461e9447038461e94a311e96d123ccb63 Mon Sep 17 00:00:00 2001 From: Ben Li-Sauerwine Date: Mon, 14 Feb 2022 05:10:00 -0500 Subject: [PATCH 6/8] "echo", not "echo:" --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 38c006c..b57a85d 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -21,7 +21,7 @@ jobs: - name: List Available Space run: | - echo: "Free space:" + echo "Free space:" df -h - name: Install Dependencies From e8303a7f0df16a70075f20deac0475338432bcab Mon Sep 17 00:00:00 2001 From: Ben Li-Sauerwine Date: Mon, 14 Feb 2022 05:14:04 -0500 Subject: [PATCH 7/8] I think maybe the Docker stuff is just running out the root filesystem... --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index b57a85d..030091c 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -13,7 +13,7 @@ jobs: - name: Maximize Build Space uses: easimon/maximize-build-space@master with: - root-reserve-mb: 512 + root-reserve-mb: 10240 swap-size-mb: 1024 remove-dotnet: 'true' remove-android: 'true' From e091f012a5a9f0b044e3e477d373d30673b1fd58 Mon Sep 17 00:00:00 2001 From: Ben Li-Sauerwine Date: Wed, 16 Feb 2022 18:23:40 -0500 Subject: [PATCH 8/8] Update documentation. --- README.md | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index e9cc345..15a77ed 100644 --- a/README.md +++ b/README.md @@ -15,7 +15,7 @@ Click the artifact to download it. You can unzip your image with ```bash -unzip +unzip your_downloaded_image_file.zip ``` Once you have the contained `.img` file, you can write it to your MicroSD card. @@ -50,9 +50,8 @@ sudo dd bs=4M of=/dev/sdx if=your_image_file.img where `x` is your device's letter that you found with `fdisk` above. This step may take a while. -TODO: I don't understand why I'm unable to mount the (ostesnbily ext4) Linux partition now... +You should now be able to mount the `ext4` Linux partition of your written image to inspect the written files. +## Manual Configuration -# TODOs - -TODO: Manual configuration of an image for the frontend. +TODO: How to manually configure the partition using the output from the frontend.