121 lines
4.2 KiB
Plaintext
121 lines
4.2 KiB
Plaintext
|
# Copyright (C) 2023 Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
|
||
|
#
|
||
|
# This program is free software: you can redistribute it and/or modify
|
||
|
# it under the terms of the GNU General Public License as published by
|
||
|
# the Free Software Foundation, either version 3 of the License, or
|
||
|
# (at your option) any later version.
|
||
|
#
|
||
|
# This program is distributed in the hope that it will be useful,
|
||
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||
|
# GNU General Public License for more details.
|
||
|
#
|
||
|
# You should have received a copy of the GNU General Public License
|
||
|
# along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||
|
|
||
|
AC_PREREQ([2.69])
|
||
|
AC_INIT([trisquel-automatic-netinstall-qemu], [0.1],
|
||
|
[GNUtoo@cyberdimension.org])
|
||
|
AC_CONFIG_SRCDIR([configure.ac])
|
||
|
AC_PROG_AWK
|
||
|
AC_PROG_MKDIR_P
|
||
|
AM_INIT_AUTOMAKE([foreign])
|
||
|
|
||
|
AC_SUBST([ENABLE_KVM], [])
|
||
|
AC_SUBST([TRISQUEL_NETINSTALL], [])
|
||
|
|
||
|
AC_ARG_ENABLE(kvm,
|
||
|
[AS_HELP_STRING([--disable-kvm],
|
||
|
[Use Kvm to obtain a public IP address (default=enabled)])],
|
||
|
[kvm="$enableval"],
|
||
|
[kvm="yes"])
|
||
|
|
||
|
AM_CONDITIONAL( [WANT_KVM], [test x"$kvm" = x"yes"])
|
||
|
|
||
|
AC_ARG_WITH(
|
||
|
[trisquel-netinstall],
|
||
|
[AS_HELP_STRING(
|
||
|
[--with-trisquel-netinstall=PATH],
|
||
|
[Path to trisquel netinstall image
|
||
|
(default=trisquel-netinst_11.0_amd64.iso). Note that at the moment
|
||
|
only trisquel-netinst_11.0_amd64.iso is supported. If you use
|
||
|
another image the signature verification will fail.])],
|
||
|
[TRISQUEL_NETINSTALL=$withval],
|
||
|
[TRISQUEL_NETINSTALL=trisquel-netinst_11.0_amd64.iso])
|
||
|
|
||
|
AC_CHECK_PROG([CHMOD], [chmod], [chmod])
|
||
|
AS_IF([test x"$CHMOD" = x""],
|
||
|
[AC_MSG_ERROR([chmod was not found in PATH ($PATH)])])
|
||
|
|
||
|
AC_CHECK_PROG([GPG], [gpg], [gpg])
|
||
|
AS_IF([test x"$GPG" = x""],
|
||
|
[AC_MSG_ERROR([gpg was not found in PATH ($PATH)])])
|
||
|
|
||
|
AC_CHECK_PROG([INSTALL], [install], [install])
|
||
|
AS_IF([test x"$INSTALL" = x""],
|
||
|
[AC_MSG_ERROR([install was not found in PATH ($PATH)])])
|
||
|
|
||
|
AC_CHECK_PROG([RM], [rm], [rm])
|
||
|
AS_IF([test x"$RM" = x""],
|
||
|
[AC_MSG_ERROR([rm was not found in PATH ($PATH)])])
|
||
|
|
||
|
AC_CHECK_PROG([XORRISO], [xorriso], [xorriso])
|
||
|
AS_IF([test x"$XORRISO" = x""],
|
||
|
[AC_MSG_ERROR([xorriso was not found in PATH ($PATH)])])
|
||
|
|
||
|
AC_CHECK_PROG([GRUB_MKRESCUE], [grub-mkrescue], [grub-mkrescue])
|
||
|
AS_IF([test x"$GRUB_MKRESCUE" = x""],
|
||
|
[AC_MSG_ERROR([grub-mkrescue was not found in PATH ($PATH)])])
|
||
|
|
||
|
AC_CHECK_PROG([DD], [dd], [dd])
|
||
|
AS_IF([test x"$DD" = x""],
|
||
|
[AC_MSG_ERROR([dd was not found in PATH ($PATH)])])
|
||
|
|
||
|
AC_CHECK_PROG([MKFS_VFAT], [mkfs.vfat], [mkfs.vfat])
|
||
|
AS_IF([test x"$MKFS_VFAT" = x""],
|
||
|
[AC_MSG_ERROR([mkfs.vfat was not found in PATH ($PATH)])])
|
||
|
|
||
|
AC_CHECK_PROG([MCOPY], [mcopy], [mcopy])
|
||
|
AS_IF([test x"$MCOPY" = x""],
|
||
|
[AC_MSG_ERROR([mcopy was not found in PATH ($PATH)])])
|
||
|
|
||
|
AC_CHECK_PROG([MV], [mv], [mv])
|
||
|
AS_IF([test x"$MV" = x""],
|
||
|
[AC_MSG_ERROR([mv was not found in PATH ($PATH)])])
|
||
|
|
||
|
AC_CHECK_PROG([QEMU_IMG], [qemu-img], [qemu-img])
|
||
|
AS_IF([test x"$QEMU_IMG" = x""],
|
||
|
[AC_MSG_ERROR([qemu-img was not found in PATH ($PATH)])])
|
||
|
|
||
|
AC_CHECK_PROG([QEMU_SYSTEM_X86_64], [qemu-system-x86_64], [qemu-system-x86_64])
|
||
|
AS_IF([test x"$QEMU_SYSTEM_X86_64" = x""],
|
||
|
[AC_MSG_ERROR([qemu-system-x86_64 was not found in PATH ($PATH)])])
|
||
|
|
||
|
# Check for the netinstall iso file
|
||
|
AS_IF([test x"`echo "$TRISQUEL_NETINSTALL" | cut -c1`" = x"~"],
|
||
|
[AC_MSG_ERROR([~ not supported in --with-trisquel-netinstall.
|
||
|
Use paths without '~'.])])
|
||
|
|
||
|
AC_CHECK_FILE([$TRISQUEL_NETINSTALL],
|
||
|
[],
|
||
|
[AC_MSG_ERROR([trisquel-netinst_11.0_amd64.iso was not found in
|
||
|
$TRISQUEL_NETINSTALL])])
|
||
|
|
||
|
AS_IF([test x"$kvm" = x"yes"],
|
||
|
[AS_IF([test -c /dev/kvm], [], AC_MSG_ERROR([/dev/kvm not found.]))
|
||
|
AS_IF([echo quit | qemu-system-x86_64 -display none -vga none -enable-kvm -monitor stdio],
|
||
|
[],
|
||
|
[AC_MSG_ERROR([KVM test with qemu-system-x86_64 failed.
|
||
|
Check permissions on /dev/kvm.])])])
|
||
|
|
||
|
AC_CONFIG_FILES([Makefile])
|
||
|
AC_OUTPUT
|
||
|
|
||
|
echo
|
||
|
echo "Configuration options:"
|
||
|
echo "======================"
|
||
|
AS_IF([test x"$kvm" = x"yes"],
|
||
|
[echo "- Kvm: enabled"],
|
||
|
[echo "- Kvm: disabled"])
|
||
|
echo "- Trisquel netinstall path: $TRISQUEL_NETINSTALL"
|