# full.
#
+sudo?=
+
ifeq ($(INITIAL),)
INITIAL := 1
export QEMU QEMU_FLAGS INITIAL HDD
-SYSLINUX_output-str := $(shell sudo $(SRC)/build-syslinux start \
+SYSLINUX_output-str := $(shell ${sudo} $(SRC)/build-syslinux start \
$(objdir)/bios $(HDD) test.cfg)
SYSLINUX_MOUNT_DIR = $(firstword $(SYSLINUX_output-str))
SYSLINUX_INSTALL_DIR = $(SYSLINUX_MOUNT_DIR)/boot/syslinux
INITIAL="$(INITIAL)" INSTALL_DIR="$(SYSLINUX_INSTALL_DIR)" \
CONFIG_FILE="$(SYSLINUX_CONFIG_FILE)" \
DERIVATIVE=SYSLINUX
- @sudo $(SRC)/build-syslinux stop $(SYSLINUX_MOUNT_DIR) \
+ @${sudo} $(SRC)/build-syslinux stop $(SYSLINUX_MOUNT_DIR) \
$(SYSLINUX_LOOPDEV) test.cfg
pxelinux-tests:
#
define copy-files =
for f in $($@_files); do \
- sudo cp $$f $(INSTALL_DIR) ;\
+ ${sudo} cp $$f $(INSTALL_DIR) ;\
done
sync
endef
# install-config
#
define install-config =
- sudo sh -c 'echo INCLUDE $($@_cfg) >> $(CONFIG_FILE)'
+ ${sudo} sh -c 'echo INCLUDE $($@_cfg) >> $(CONFIG_FILE)'
sync
endef
#
define remove-files =
for f in $($@_files); do \
- sudo rm $(INSTALL_DIR)/$$f ;\
+ ${sudo} rm $(INSTALL_DIR)/$$f ;\
done
endef
# delete-config - remove a test's config file from the master config
#
define delete-config =
- sudo sed -i -e '/INCLUDE $($@_cfg)/d' $(CONFIG_FILE)
+ ${sudo} sed -i -e '/INCLUDE $($@_cfg)/d' $(CONFIG_FILE)
endef
#
$(copy-files)
$(install-config)
- sudo $(QEMU) $(QEMU_FLAGS) -serial file:$@.log
+ ${sudo} $(QEMU) $(QEMU_FLAGS) -serial file:$@.log
$(delete-config)
$(remove-files)
- sudo sort $@.log -o $@.log
+ ${sudo} sort $@.log -o $@.log
if [ `comm -1 -3 $@.log $($@_results) | wc -l` -ne 0 ]; then \
printf " [!] $@ failed\n" ;\
else \