summaryrefslogtreecommitdiff
path: root/adelie-build-cd
diff options
context:
space:
mode:
authorA. Wilcox <AWilcox@Wilcox-Tech.com>2020-02-02 14:49:51 -0600
committerA. Wilcox <AWilcox@Wilcox-Tech.com>2020-02-02 14:49:51 -0600
commit60bd909801c3284bcdad7b04edee209813cc7d4e (patch)
treec6baec185b8e94df21a2747b2d711b6c9623708a /adelie-build-cd
parent8d3d28f85eb68bdb63445aea24d6713414b4e321 (diff)
downloadimage-60bd909801c3284bcdad7b04edee209813cc7d4e.tar.gz
image-60bd909801c3284bcdad7b04edee209813cc7d4e.tar.bz2
image-60bd909801c3284bcdad7b04edee209813cc7d4e.tar.xz
image-60bd909801c3284bcdad7b04edee209813cc7d4e.zip
adelie-build-cd: Final pass of bashism removal
Diffstat (limited to 'adelie-build-cd')
-rwxr-xr-xadelie-build-cd24
1 files changed, 11 insertions, 13 deletions
diff --git a/adelie-build-cd b/adelie-build-cd
index 36967d6..5c48f3d 100755
--- a/adelie-build-cd
+++ b/adelie-build-cd
@@ -32,32 +32,32 @@ fatal() {
ensure_commands() {
- if ! type apk>/dev/null 2>/dev/null; then
+ if ! command -pv apk>/dev/null 2>/dev/null; then
fatal
printf 'You must have apk installed. On Gentoo, see sys-devel/apk-tools.\n'
- exit -1
+ exit 127
fi
- if ! type cpio>/dev/null 2>/dev/null; then
+ if ! command -pv cpio>/dev/null 2>/dev/null; then
fatal
printf 'You must have cpio installed. On Gentoo, see app-arch/cpio.\n'
- exit -1
+ exit 127
fi
- if ! type mksquashfs>/dev/null 2>/dev/null; then
+ if ! command -pv mksquashfs>/dev/null 2>/dev/null; then
fatal
printf 'You must have mksquashfs installed. On Gentoo, see sys-fs/squashfs-tools.\n'
- exit -1
+ exit 127
fi
- if ! type xorriso>/dev/null 2>/dev/null; then
+ if ! command -pv xorriso>/dev/null 2>/dev/null; then
fatal
printf 'You must have xorriso installed:\n\n'
printf '* cdrkit (Alpine, Gentoo) will not generate a usable PPC ISO.\n'
printf '* wodim (Debian) will not generate a usable PPC64 ISO.\n'
printf '* cdrtools (Schily) will overrun the PPC64 ISO and write junk to grubcore.img.\n'
printf '\nSorry, but xorriso really is required.\n'
- exit -1
+ exit 127
fi
}
@@ -101,7 +101,7 @@ while [ -n "$1" ]; do
;;
*)
usage >&2
- exit -1
+ exit 127
;;
esac
shift
@@ -131,7 +131,7 @@ clean_dirs() {
printf 'This will erase all files at the directories %s/cdroot-%s\n' `pwd` $ARCH
printf '%s/initrd-%s and %s/squashroot-%s.\n\n' `pwd` $ARCH `pwd` $ARCH
printf 'When you are ready, press RETURN. To cancel, press Ctrl-C.\n'
- read
+ read dontcare
rm -rf cdroot-$ARCH
rm -rf initrd-$ARCH
@@ -300,9 +300,7 @@ make_initrd() {
header 'Compressing initrd...'
- pushd initrd-$ARCH
- find . | cpio -H newc -o > ../cdroot-$ARCH/initrd
- popd
+ (cd initrd-$ARCH; find . | cpio -H newc -o) > cdroot-$ARCH/initrd
gzip -9 cdroot-$ARCH/initrd
mv cdroot-$ARCH/initrd.gz cdroot-$ARCH/initrd
}