Skip to content

get_isa() in get-stack.sh does not handle all possible outputs of uname -m #5792

Closed
@mpilgrem

Description

@mpilgrem

get_isa() in get-stack.sh is as follows:

# determines the the CPU's instruction set
get_isa() {
  if uname -m | grep -Eq 'armv[78]l?' ; then
    echo arm
  elif uname -m | grep -q aarch64 ; then
    echo aarch64
  else
    echo x86
  fi
}

get_isa() is used by is_x86_64() which, in turn, is used by do_distro() (called in the 'Linux' limb of do_os()).

get_isa() assumes that if the output of uname -m (the machine hardware name) is not armv6l, armv7l or aarch64 then it is x86_64 (or x86). However, this Wikipedia table indicates that other values are possible when uname -s (the kernel name) is Linux, including arm6l, sparc64,ppc64,i686,ppc,k1om, and 'mips.

It has been suggested that this is a 'bug waiting to happen'.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions