Skip to content

Commit

Permalink
Bugfix: PARTUUIDs got rewritten by parted
Browse files Browse the repository at this point in the history
As discussed in Issue #42, parted seems to replace partuuids
in the partition table. The error is well-known but seems not to be
fixed in parted.

Thus parted is replaced by sfdisk, which is an fdisk variant,
to be used in scripts.

Closes #42.
  • Loading branch information
jonashoechst committed Nov 9, 2021
1 parent d873232 commit b5d80cb
Show file tree
Hide file tree
Showing 7 changed files with 12 additions and 8 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
submodules: recursive

- name: Install dependencies
run: sudo apt-get update && sudo apt-get install -y binfmt-support file kpartx lsof p7zip-full parted qemu qemu-user-static unzip wget xz-utils units
run: sudo apt-get update && sudo apt-get install -y binfmt-support fdisk file kpartx lsof p7zip-full qemu qemu-user-static unzip wget xz-utils units
shell: bash

- name: Run pimod OpenWRT example
Expand Down
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

## [0.4.3] - 2021-11-09
### Fixed
- PARTUUIDs got rewritten by parted - replaced by sfdisk

## [0.4.2] - 2021-11-04
### Fixed
- Limitedness of PUMP command
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@ LABEL version="0.2.1"
RUN apt-get update && \
apt-get install -y \
binfmt-support \
fdisk \
file \
kpartx \
lsof \
p7zip-full \
parted \
qemu \
qemu-user-static \
unzip \
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ Options:

### Debian
```bash
sudo apt-get install binfmt-support file kpartx lsof p7zip-full parted qemu qemu-user-static unzip wget xz-utils
sudo apt-get install binfmt-support fdisk file kpartx lsof p7zip-full qemu qemu-user-static unzip wget xz-utils

sudo ./pimod.sh Pifile
```
Expand Down
2 changes: 1 addition & 1 deletion action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ runs:
steps:
- run: sudo apt-get update
shell: bash
- run: sudo apt-get install -y binfmt-support file kpartx parted qemu qemu-user-static unzip p7zip-full wget xz-utils units
- run: sudo apt-get install -y binfmt-support fdisk file kpartx qemu qemu-user-static unzip p7zip-full wget xz-utils units
shell: bash
- run: sudo ${{ github.action_path }}/pimod.sh ${{ inputs.pifile }}
shell: bash
3 changes: 3 additions & 0 deletions examples/Jetson.Pifile
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
FROM https://developer.nvidia.com/jetson-nano-sd-card-image 1

PUMP 100M
5 changes: 1 addition & 4 deletions stages/20-prepare.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,7 @@ PUMP() {

dd if=/dev/zero bs="${BS}" count="${COUNT}" >> "${DEST_IMG}"

# Fix the GPT if necessary and resize the partition afterwards.
# The fix is currently kind of hackish..
echo -e "Fix\n" | parted ---pretend-input-tty "${DEST_IMG}" print
parted -s "${DEST_IMG}" resizepart "${IMG_ROOT}" "100%"
echo ", +" | sfdisk -N "${IMG_ROOT}" "${DEST_IMG}"

local loop
loop=$(mount_image "${DEST_IMG}")
Expand Down

0 comments on commit b5d80cb

Please sign in to comment.