Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Another distro compatibility #64

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
8 changes: 7 additions & 1 deletion bootiso
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ set -E
version="4.2.0"
scriptName=$(basename "$0")
bashVersion=$(echo "$BASH_VERSION" | cut -d. -f1)
# Requres for any other distribution, like blackPanther OS
DISTRO=$(lsb_release -si | awk '{print $1}'| tr [:upper:] [:lower:])
Copy link
Owner

@jsamr jsamr Feb 13, 2021

Choose a reason for hiding this comment

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

Woud rather have a name in camelCase, such as systemDistro

Copy link
Owner

Choose a reason for hiding this comment

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

Is there a guarantee lsb_release would be available in any Linux system? I would rather have a graceful handling for when this command is missing, otherwise the console would be polluted.

Copy link
Contributor

Choose a reason for hiding this comment

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

Lots of applications and scripts depends on lsb_release command for compatibility issues. So that shouldn't be a problem.

Copy link
Owner

Choose a reason for hiding this comment

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

I bet you're right. However, since one day this tool might be used on MacOS, I'd rather you replace this shell command with

lsb_release -si 2> /dev/null | awk '{print $1}'| tr [:upper:] [:lower:]


if [ -z "$BASH_VERSION" ] || [ "$bashVersion" -lt 4 ]; then
echo >&2 "You need bash v4+ to run this script. Aborting..."
Expand Down Expand Up @@ -1323,7 +1325,11 @@ function asrt_checkSyslinuxInstall() {
"Your distribution doesn't ship 'extlinux' with the 'syslinux' package." \
"Please install 'extlinux' and try again."
fi
st_foundSyslinuxBiosFolder=$(find "$ct_syslinuxLibRoot" -type d -path '*/bios' -print -quit)
if [ "$DISTRO" = "blackpanther" ];then
st_foundSyslinuxBiosFolder=$(find "$ct_syslinuxLibRoot" -print -quit)
else
st_foundSyslinuxBiosFolder=$(find "$ct_syslinuxLibRoot" -type d -path '*/bios' -print -quit)
fi
st_foundSyslinuxMbrBinary=$(fs_findFileFromPatterns "$ct_syslinuxLibRoot" 'bios/mbr.bin' 'mbr.bin')
if [ -z "$st_foundSyslinuxBiosFolder" ]; then
ps_failAndExit MISSING_DEPENDENCY \
Expand Down