2007-09-23 08:05:13 +00:00
|
|
|
#!/bin/sh
|
|
|
|
|
2010-09-02 11:12:37 +00:00
|
|
|
## live-build(7) - System Build Scripts
|
2020-03-11 09:07:21 -01:00
|
|
|
## Copyright (C) 2016-2020 The Debian Live team
|
2015-01-04 18:05:39 -01:00
|
|
|
## Copyright (C) 2006-2015 Daniel Baumann <mail@daniel-baumann.ch>
|
2010-09-02 11:12:37 +00:00
|
|
|
##
|
2012-07-29 23:59:00 +00:00
|
|
|
## This program comes with ABSOLUTELY NO WARRANTY; for details see COPYING.
|
2010-09-02 11:12:37 +00:00
|
|
|
## This is free software, and you are welcome to redistribute it
|
|
|
|
## under certain conditions; see COPYING for details.
|
|
|
|
|
2007-09-23 08:05:13 +00:00
|
|
|
|
2010-12-05 12:27:08 -01:00
|
|
|
Check_architectures ()
|
2007-09-23 08:05:13 +00:00
|
|
|
{
|
|
|
|
ARCHITECTURES="${@}"
|
2020-02-20 05:57:46 -01:00
|
|
|
VALID=false
|
2007-09-23 08:05:13 +00:00
|
|
|
|
|
|
|
for ARCHITECTURE in ${ARCHITECTURES}
|
|
|
|
do
|
2014-12-10 05:39:58 -01:00
|
|
|
if [ "$(echo ${LB_ARCHITECTURES} | grep ${ARCHITECTURE})" ]
|
2007-09-23 08:05:13 +00:00
|
|
|
then
|
2020-02-20 05:57:46 -01:00
|
|
|
VALID=true
|
2007-09-23 08:05:13 +00:00
|
|
|
break
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
|
2011-09-30 22:24:08 +00:00
|
|
|
if [ "${ARCHITECTURES}" = "${LB_BOOTSTRAP_QEMU_ARCHITECTURES}" ]
|
|
|
|
then
|
2020-02-20 05:57:46 -01:00
|
|
|
VALID=true
|
2011-09-30 22:24:08 +00:00
|
|
|
|
|
|
|
if [ ! -e "${LB_BOOTSTRAP_QEMU_STATIC}" ]
|
|
|
|
then
|
|
|
|
Echo_warning "skipping %s, qemu-static binary ${LB_BOOTSTRAP_QEMU_ARCHITECTURES} was not found"
|
2020-02-20 05:57:46 -01:00
|
|
|
VALID=false
|
2011-09-30 22:24:08 +00:00
|
|
|
fi
|
|
|
|
|
|
|
|
if [ ! -x "${LB_BOOTSTRAP_QEMU_STATIC}" ]
|
|
|
|
then
|
|
|
|
Echo_warning "skipping %s, qemu-static binary ${LB_BOOTSTRAP_QEMU_STATIC} is not executable"
|
2020-02-20 05:57:46 -01:00
|
|
|
VALID=false
|
2011-09-30 22:24:08 +00:00
|
|
|
fi
|
|
|
|
|
|
|
|
fi
|
|
|
|
|
2020-02-20 05:57:46 -01:00
|
|
|
if ! $VALID
|
2007-09-23 08:05:13 +00:00
|
|
|
then
|
2010-12-05 12:27:08 -01:00
|
|
|
Echo_warning "skipping %s, foreign architecture(s)." "${0}"
|
2007-09-23 08:05:13 +00:00
|
|
|
exit 0
|
|
|
|
fi
|
|
|
|
}
|
2007-09-23 08:05:14 +00:00
|
|
|
|
2010-12-05 12:27:08 -01:00
|
|
|
Check_crossarchitectures ()
|
2007-10-10 09:39:55 +00:00
|
|
|
{
|
2020-03-12 11:32:06 -01:00
|
|
|
if [ $(which dpkg) ]
|
2007-10-10 09:39:55 +00:00
|
|
|
then
|
|
|
|
HOST="$(dpkg --print-architecture)"
|
|
|
|
else
|
|
|
|
HOST="$(uname -m)"
|
|
|
|
fi
|
|
|
|
|
|
|
|
case "${HOST}" in
|
2009-12-09 19:54:41 -01:00
|
|
|
amd64|i386|x86_64)
|
|
|
|
CROSS="amd64 i386"
|
2007-10-10 09:39:55 +00:00
|
|
|
;;
|
|
|
|
|
|
|
|
powerpc|ppc64)
|
|
|
|
CROSS="powerpc ppc64"
|
|
|
|
;;
|
2008-03-26 08:37:39 -01:00
|
|
|
|
|
|
|
*)
|
|
|
|
CROSS="${HOST}"
|
|
|
|
;;
|
2007-10-10 09:39:55 +00:00
|
|
|
esac
|
|
|
|
|
2014-12-10 05:39:58 -01:00
|
|
|
if [ "${LB_ARCHITECTURES}" = "${LB_BOOTSTRAP_QEMU_ARCHITECTURES}" ]
|
2011-09-30 22:24:08 +00:00
|
|
|
then
|
|
|
|
|
|
|
|
if [ ! -e "${LB_BOOTSTRAP_QEMU_STATIC}" ]
|
|
|
|
then
|
|
|
|
Echo_warning "skipping %s, qemu-static binary ${LB_BOOTSTRAP_QEMU_ARCHITECTURES} was not found"
|
|
|
|
exit 0
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [ ! -x "${LB_BOOTSTRAP_QEMU_STATIC}" ]
|
|
|
|
then
|
|
|
|
Echo_warning "skipping %s, qemu-static binary ${LB_BOOTSTRAP_QEMU_STATIC} is not executable"
|
|
|
|
exit 0
|
|
|
|
fi
|
|
|
|
return
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
2010-12-05 12:27:08 -01:00
|
|
|
Check_architectures "${CROSS}"
|
2007-10-10 09:39:55 +00:00
|
|
|
}
|