ibm-s390-linux / s390-tools

Tools for use with the s390 Linux kernel and device drivers
MIT License
63 stars 60 forks source link

netboot/mk-s390image: Fix size when argument is a symlink #172

Open sertonix opened 1 month ago

sertonix commented 1 month ago

du -b by default returns the size of a symlink when it is passed a symlink. Adding the -L option allows passing symlinks to mk-s390image without resulting in unbootable image.

amyspark commented 1 month ago

Note: see https://gitlab.alpinelinux.org/alpine/aports/-/issues/16310 and https://gitlab.alpinelinux.org/alpine/aports/-/merge_requests/70132#note_426060 for further context.

steffen-eiden commented 2 weeks ago

Thanks for your contribution.

It makes sense to not use the size of a symbolic link.

A nit: Please start with a capital letter in your commit message:

netboot/mk-s390image: Fix size when argument is a symlink

LGTM

steffen-eiden commented 2 weeks ago

While you are at it:

Could you also add the -L to line 138

- parmfile_size=$(du -b $parmfile | cut -f1)
+ parmfile_size=$(du -b -L $parmfile | cut -f1)

Thanks!

sertonix commented 2 weeks ago

I applied all suggestions now

steffen-eiden commented 2 weeks ago

Thank you. I will pick the patch.

Note we do not use GH to apply pull requests.