If temporary folder is full error message can't be saved and shown to the user which doesn't know what the problem actually is. In this case file is empty and show other message.
Add copyright
Convert to config/functions/die()
Make use of bash default value mechanic
Combine some if tests
Get PKG_BUILD quoted
Replace `` with $()
Signed-off-by: Ian Leonard <antonlacon@gmail.com>
Replace "which" with "command -v", which is part of POSIX.
Make offering to install packages contingent on having the sudo command.
Not every distro uses sudo. It is optional in Gentoo, for example.
Signed-off-by: Ian Leonard <antonlacon@gmail.com>
Squashfs allows configuring a blocksize between 4KB and 1MB. The default is
128KB. Increasing blocksize, in general, increases compression efficiency
at a cost of increased access time. Using 256KB for a blocksize appears to be
a sweet spot balancing the two for gzip and zstd. Blocksize 512KB appears
right for lzo.
Gzip decreases by ~700KB.
Lzo decreases by ~1.25MB.
Zstd decreaes by ~2.5MB.
Signed-off-by: Ian Leonard <antonlacon@gmail.com>
GNU tar can automatically detect the compression format based on
the file name since at least 2006. So just use "tar xf" to extract
all tarballs and drop the redundant cases.
GNU tar can also strip the top level directory from the archive
which allows us to extract it to the directory wanted by the
build system ($PKG_NAME-$PKG_VERSION), so packages don't need to
specify PKG_SOURCE_DIR if the top level dir from that and scripts/unpack
doesn't need to rename the directory.
If PKG_SOURCE_DIR is not set the top level dir is automatically
stripped from the archive and extracted to $BUILD/$PKG_NAME-$PKG_VERSION
If PKG_SOURCE_DIR is set, scripts/extract behaviour is unchanged.
Signed-off-by: Matthias Reichl <hias@horus.com>
For LZO, this saves about 40kb on img.gz size.
For GZIP, this saves about 4kb on img.gz size.
For ZSTD, this saves about 500kb on img.gz size.
Signed-off-by: Ian Leonard <antonlacon@gmail.com>
Switch scripts/git_version for get_pkg_version out of
config/functions. Resolves being unable to report Kodi's version
in RELEASE file.
Signed-off-by: Ian Leonard <antonlacon@gmail.com>
Have IMAGE_NAME check for devel version before applying default
naming.
Generate all the baselayout directories in a for loop instead of
the long list of mkdir -p one after the other.
For 64-bit builds, $INSTALL/usr is already generated for all
arches a few lines previously, so don't repeat here.
There are changes to comments for corrections and clarity.
Unifies code style: $() versus `` and spaces before ;
Signed-off-by: Ian Leonard <antonlacon@gmail.com>