Skip to content

Commit 04756ea

Browse files
authored
Merge pull request #9 from jimmo/qemu-tftp-arch
Make qemu script work on Arch
2 parents 2a9ff93 + 26eeeef commit 04756ea

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -311,7 +311,7 @@ tftpd_start:
311311
sudo true
312312
@if sudo which atftpd >/dev/null ; then \
313313
echo "Starting aftpd"; \
314-
sudo atftpd --verbose --bind-address $(TFTP_IPRANGE).100 --daemon --logfile /dev/stdout --no-fork --user $(shell whoami) $(TFTPD_DIR) & \
314+
sudo atftpd --verbose --bind-address $(TFTP_IPRANGE).100 --daemon --logfile /dev/stdout --no-fork --user $(shell whoami) --group $(shell id -gn) $(TFTPD_DIR) & \
315315
elif sudo which in.tftpd >/dev/null; then \
316316
echo "Starting in.tftpd"; \
317317
sudo in.tftpd --verbose --listen --address $(TFTP_IPRANGE).100 --user $(shell whoami) -s $(TFTPD_DIR) & \

scripts/build-qemu.sh

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,15 @@ if grep -q ETHMAC_BASE $TARGET_BUILD_DIR/software/include/generated/csr.h; then
129129
exit 1
130130
fi
131131
sudo chown $(whoami) /dev/net/tap0
132-
sudo ifconfig tap0 $TFTP_IPRANGE.100 up
132+
if sudo which ifconifg > /dev/null; then
133+
sudo ifconfig tap0 $TFTP_IPRANGE.100 up
134+
elif sudo which ip > /dev/null; then
135+
sudo ip addr add $TFTP_IPRANGE.100/24 dev tap0
136+
sudo ip link set dev tap0 up
137+
else
138+
echo "Unable to find tool to configure tap0 address"
139+
exit 1
140+
fi
133141
make tftpd_start
134142
fi
135143
EXTRA_ARGS+=("-net nic -net tap,ifname=tap0,script=no,downscript=no")

0 commit comments

Comments
 (0)