Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 3 additions & 6 deletions .github/workflows/debos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -132,18 +132,15 @@ jobs:
cp -av dtbs.tar.gz "${dir}"
cp -av disk-ufs.img.gz "${dir}"
cp -av disk-sdcard.img.gz "${dir}"
# TODO: separate flash_* directories between UFS and eMMC
# create tarballs with support for all UFS and all eMMC boards
tar -cvf "${dir}"/flash-ufs.tar.gz \
disk-ufs.img1 \
disk-ufs.img2 \
flash_qcs615-* \
flash_qcs6490-* \
flash_qcs8300-* \
flash_qcs9100-*
$(dirname flash_*/flash-ufs)
tar -cvf "${dir}"/flash-emmc.tar.gz \
disk-sdcard.img1 \
disk-sdcard.img2 \
flash_qrb2210-*
$(dirname flash_*/flash-emmc)

- name: Upload private artifacts
uses: qualcomm-linux/upload-private-artifact-action@v1
Expand Down
12 changes: 6 additions & 6 deletions debos-recipes/qualcomm-linux-debian-rootfs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -340,12 +340,12 @@ actions:
# only in that new kernel, so use the latest dtbs
latest_kernel="$(
ls -d "$ROOTDIR"/usr/lib/linux-image-* | sort -V | tail -1)"
tar -C "${latest_kernel}" -cvzf "$ARTIFACTDIR/dtbs.tar.gz" \
qcom/qcs615-ride.dtb \
qcom/qcs6490-rb3gen2.dtb \
qcom/qcs8300-ride.dtb \
qcom/qcs9100-ride-r3.dtb \
qcom/qrb2210-rb1.dtb
# transform pathnames to strip the leading ./
tar \
-C "${latest_kernel}" \
--transform='s|^\./||' \
-cvzf "$ARTIFACTDIR/dtbs.tar.gz" \
.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This leads to an ugly ./ directory as a tar entry, which seems barely worth the --transform. I guess this is because --transform won't eliminate something entirely.

I'm not sure why you want to strip out ./, but given that you do and assuming you don't mind about missing dotfiles, maybe (cd "${latest_kernel}" && tar -cvzf ... *) instead? To include dotfiles there's either shopt -s dotfiles (but I think that's bash only) or something like (cd "${latest_kernel}" && find -mindepth 1 -print0|cut -zd/ -f2-|tar --verbatim-files-from --files-from=- --null -cvzf ...)

This is probably not worth adjusting unless you want to :)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As you guessed, I added the transform to avoid ./ in pathnames in the tar archive. This is to preserve the same path structure as in the previous version, were specific relative dtb files were specified (without ./).

The dtb pathnames are specified in a different file, flash.yaml, as part of the board specific metadata; it would be ugly to have ./ names in there, but I guess I could also prepend it when calling tar -x. The ./ felt like gratuitous pollution of dtbs.tar.gz, so I found this --transform way of stripping them.

I can switch to cd $dir && tar instead of -C + --transform, I guess this is easier to read but I wanted to avoid relying on globing in case for a weird reason a kernel comes with no dtb (which isn't really an use case, and then perhaps the directory wouldn't exist either).

I don't think there are dotfiles in there to grab; the find | cut | tar would be painful to read.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If the glob is empty, then it will remain by default and the tar will then fail I think - perhaps that's what we want?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, trying to move to cd, the two things that scratch me with these few lines are:

  • ARTIFACTDIR not being documented as absolute in the debos docs (probably it is and will be forever)
  • my desire to use linux-version to list kernel versions (as captured in dtbs.tar.gz should use linux-version list #22), but that requires running a command in chroot: true mode and that prevents access to ARTIFACTDIR and I don't really want to break this sequence in 3 actions

So if you don't mind, I'd prefer keeping tar in the current directory with the slightly unusual --transform, it's confirmed to work by you.

- action: pack
description: Create root filesystem tarball
Expand Down
Loading