riscvemu: disable package
This package should be replaced by: * qemu-system-riscv32 * qemu-system-riscv64
This commit is contained in:
parent
c6cbc81217
commit
27a42afa3c
@ -1,72 +0,0 @@
|
||||
## Note: riscvemu was renamed to tinyemu.
|
||||
|
||||
TERMUX_PKG_HOMEPAGE=https://bellard.org/tinyemu/
|
||||
TERMUX_PKG_DESCRIPTION="RISC-V system emulator"
|
||||
TERMUX_PKG_LICENSE="custom"
|
||||
TERMUX_PKG_MAINTAINER="Leonid Plyushch <leonid.plyushch@gmail.com> @xeffyr"
|
||||
TERMUX_PKG_VERSION=20180923
|
||||
TERMUX_PKG_REVISION=1
|
||||
TERMUX_PKG_SRCURL=https://bellard.org/tinyemu/tinyemu-2018-09-23.tar.gz
|
||||
TERMUX_PKG_SHA256=9b58d5521df8356c3be09a520387d3e4adcb510cf8d2fd6bdd971287bd57d734
|
||||
TERMUX_PKG_BUILD_IN_SRC=true
|
||||
|
||||
TERMUX_PKG_DEPENDS="libcurl, openssl, sdl"
|
||||
TERMUX_PKG_CONFLICTS="riscvemu-sdl"
|
||||
TERMUX_PKG_REPLACES="riscvemu-sdl"
|
||||
|
||||
termux_step_make() {
|
||||
local RISCV_128BIT_SUPPORT
|
||||
|
||||
if [ "${TERMUX_ARCH}" = "aarch64" ] || [ "${TERMUX_ARCH}" = "x86_64" ]; then
|
||||
RISCV_128BIT_SUPPORT="CONFIG_INT128=y"
|
||||
else
|
||||
RISCV_128BIT_SUPPORT=""
|
||||
fi
|
||||
|
||||
make \
|
||||
CROSS_PREFIX="${TERMUX_HOST_PLATFORM}-" \
|
||||
TERMUX_CFLAGS="${CPPFLAGS} ${CFLAGS}" \
|
||||
TERMUX_LDFLAGS="${LDFLAGS}" \
|
||||
CONFIG_SDL=y \
|
||||
${RISCV_128BIT_SUPPORT}
|
||||
}
|
||||
|
||||
termux_step_make_install() {
|
||||
install -Dm700 ./temu "${TERMUX_PREFIX}/bin/temu"
|
||||
install -Dm700 ./splitimg "${TERMUX_PREFIX}/bin/temu-splitimg"
|
||||
install -Dm700 ./build_filelist "${TERMUX_PREFIX}/bin/temu-build_filelist"
|
||||
|
||||
## Compatibility link.
|
||||
ln -sfr "${TERMUX_PREFIX}/bin/temu" "${TERMUX_PREFIX}/bin/riscvemu"
|
||||
|
||||
## Unpacking and installing samples.
|
||||
mkdir ./sample_files
|
||||
cd ./sample_files && {
|
||||
termux_download \
|
||||
https://bellard.org/tinyemu/diskimage-linux-riscv-2018-09-23.tar.gz \
|
||||
"${TERMUX_PKG_CACHEDIR}/samples.tar.gz" \
|
||||
808ecc1b32efdd76103172129b77b46002a616dff2270664207c291e4fde9e14
|
||||
|
||||
tar xf "${TERMUX_PKG_CACHEDIR}/samples.tar.gz" --strip-components=1
|
||||
|
||||
install -Dm600 bbl32.bin "${TERMUX_PREFIX}/share/riscvemu/bbl32.bin"
|
||||
install -Dm600 bbl64.bin "${TERMUX_PREFIX}/share/riscvemu/bbl64.bin"
|
||||
install -Dm600 kernel-riscv32.bin "${TERMUX_PREFIX}/share/riscvemu/kernel-riscv32.bin"
|
||||
install -Dm600 kernel-riscv64.bin "${TERMUX_PREFIX}/share/riscvemu/kernel-riscv64.bin"
|
||||
install -Dm600 root-riscv32.bin "${TERMUX_PREFIX}/share/riscvemu/root-riscv32.bin"
|
||||
install -Dm600 root-riscv64.bin "${TERMUX_PREFIX}/share/riscvemu/root-riscv64.bin"
|
||||
install -Dm600 root-riscv32.cfg "${TERMUX_PREFIX}/share/riscvemu/root-riscv32.cfg"
|
||||
install -Dm600 root-riscv64.cfg "${TERMUX_PREFIX}/share/riscvemu/root-riscv64.cfg"
|
||||
install -Dm600 root_9p-riscv64.cfg "${TERMUX_PREFIX}/share/riscvemu/root_9p-riscv64.cfg"
|
||||
|
||||
## Use own directory for 9P.
|
||||
sed -i "s@/tmp@${TERMUX_ANDROID_HOME}@g" "${TERMUX_PREFIX}/share/riscvemu/root_9p-riscv64.cfg"
|
||||
|
||||
## Specify kernel image.
|
||||
sed -i '/bios: "bbl64.bin",/ a\ kernel: "kernel-riscv64.bin",' "${TERMUX_PREFIX}/share/riscvemu/root_9p-riscv64.cfg"
|
||||
}
|
||||
}
|
||||
|
||||
termux_step_create_debscripts() {
|
||||
cp "${TERMUX_PKG_BUILDER_DIR}/postinst" ./
|
||||
}
|
@ -1,11 +0,0 @@
|
||||
#!/data/data/com.termux/files/usr/bin/sh
|
||||
|
||||
echo
|
||||
echo "You can find sample configuration files and images"
|
||||
echo "under \${PREFIX}/share/riscvemu directory."
|
||||
echo
|
||||
echo "You can visit https://bellard.org/tinyemu/readme.txt"
|
||||
echo "to view documentation for riscvemu/tinyemu."
|
||||
echo
|
||||
|
||||
exit 0
|
@ -1,39 +0,0 @@
|
||||
diff -uNr tinyemu-2018-09-23/Makefile tinyemu-2018-09-23.mod/Makefile
|
||||
--- tinyemu-2018-09-23/Makefile 2018-09-23 15:17:20.000000000 +0300
|
||||
+++ tinyemu-2018-09-23.mod/Makefile 2018-10-04 18:07:55.647799869 +0300
|
||||
@@ -26,10 +26,10 @@
|
||||
# (openssl) must be installed.
|
||||
CONFIG_FS_NET=y
|
||||
# SDL support (optional)
|
||||
-CONFIG_SDL=y
|
||||
+#CONFIG_SDL=y
|
||||
# if set, compile the 128 bit emulator. Note: the 128 bit target does
|
||||
# not compile if gcc does not support the int128 type (32 bit hosts).
|
||||
-CONFIG_INT128=y
|
||||
+#CONFIG_INT128=y
|
||||
# build x86 emulator
|
||||
CONFIG_X86EMU=y
|
||||
# win32 build (not usable yet)
|
||||
@@ -44,11 +44,11 @@
|
||||
CROSS_PREFIX=
|
||||
EXE=
|
||||
endif
|
||||
-CC=$(CROSS_PREFIX)gcc
|
||||
+CC=$(CROSS_PREFIX)clang
|
||||
STRIP=$(CROSS_PREFIX)strip
|
||||
-CFLAGS=-O2 -Wall -g -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -MMD
|
||||
+CFLAGS=$(TERMUX_CFLAGS) -Wall -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -MMD -I.
|
||||
CFLAGS+=-D_GNU_SOURCE -DCONFIG_VERSION=\"$(shell cat VERSION)\"
|
||||
-LDFLAGS=
|
||||
+LDFLAGS=$(TERMUX_LDFLAGS)
|
||||
|
||||
bindir=/usr/local/bin
|
||||
INSTALL=install
|
||||
@@ -72,7 +72,6 @@
|
||||
|
||||
ifndef CONFIG_WIN32
|
||||
EMU_OBJS+=fs_disk.o
|
||||
-EMU_LIBS=-lrt
|
||||
endif
|
||||
ifdef CONFIG_FS_NET
|
||||
CFLAGS+=-DCONFIG_FS_NET
|
@ -1,20 +0,0 @@
|
||||
diff -uNr tinyemu-2018-09-23/fs.h tinyemu-2018-09-23.mod/fs.h
|
||||
--- tinyemu-2018-09-23/fs.h 2018-09-23 15:17:19.000000000 +0300
|
||||
+++ tinyemu-2018-09-23.mod/fs.h 2018-10-04 18:07:24.360687784 +0300
|
||||
@@ -109,6 +109,16 @@
|
||||
uint64_t path;
|
||||
} FSQID;
|
||||
|
||||
+#ifdef st_atime_nsec
|
||||
+#undef st_atime_nsec
|
||||
+#endif
|
||||
+#ifdef st_mtime_nsec
|
||||
+#undef st_mtime_nsec
|
||||
+#endif
|
||||
+#ifdef st_ctime_nsec
|
||||
+#undef st_ctime_nsec
|
||||
+#endif
|
||||
+
|
||||
typedef struct {
|
||||
FSQID qid;
|
||||
uint32_t st_mode;
|
@ -1,25 +0,0 @@
|
||||
diff -uNr tinyemu-2018-09-23/fs_disk.c tinyemu-2018-09-23.mod/fs_disk.c
|
||||
--- tinyemu-2018-09-23/fs_disk.c 2018-09-23 15:17:19.000000000 +0300
|
||||
+++ tinyemu-2018-09-23.mod/fs_disk.c 2018-10-04 18:07:24.357354402 +0300
|
||||
@@ -290,6 +290,21 @@
|
||||
return 0;
|
||||
}
|
||||
|
||||
+
|
||||
+#ifdef __ANDROID__
|
||||
+struct DIR {
|
||||
+ int fd_;
|
||||
+};
|
||||
+static long telldir(struct DIR *dirp)
|
||||
+{
|
||||
+ return (long) lseek(dirp->fd_, 0, SEEK_CUR);
|
||||
+}
|
||||
+static void seekdir(DIR *dirp, long loc)
|
||||
+{
|
||||
+ (void) lseek(dirp->fd_, loc, SEEK_SET);
|
||||
+}
|
||||
+#endif
|
||||
+
|
||||
static int fs_readdir(FSDevice *fs, FSFile *f, uint64_t offset,
|
||||
uint8_t *buf, int count)
|
||||
{
|
@ -1,21 +0,0 @@
|
||||
diff -uNr tinyemu-2018-09-23/fs_net.c tinyemu-2018-09-23.mod/fs_net.c
|
||||
--- tinyemu-2018-09-23/fs_net.c 2018-09-23 15:17:19.000000000 +0300
|
||||
+++ tinyemu-2018-09-23.mod/fs_net.c 2018-10-04 18:07:24.367354547 +0300
|
||||
@@ -30,6 +30,8 @@
|
||||
#include <sys/time.h>
|
||||
#include <ctype.h>
|
||||
|
||||
+#include "host_config.h"
|
||||
+
|
||||
#include "cutils.h"
|
||||
#include "list.h"
|
||||
#include "fs.h"
|
||||
@@ -2093,7 +2095,7 @@
|
||||
static FSDevice *fs_import_fs;
|
||||
#endif
|
||||
|
||||
-#define DEFAULT_IMPORT_FILE_PATH "/tmp"
|
||||
+#define DEFAULT_IMPORT_FILE_PATH TMP_DIR
|
||||
|
||||
FSDevice *fs_net_init(const char *url, void (*start_cb)(void *opaque),
|
||||
void *start_opaque)
|
@ -1,28 +0,0 @@
|
||||
diff -uNr tinyemu-2018-09-23/host_config.h tinyemu-2018-09-23.mod/host_config.h
|
||||
--- tinyemu-2018-09-23/host_config.h 1970-01-01 03:00:00.000000000 +0300
|
||||
+++ tinyemu-2018-09-23.mod/host_config.h 2018-10-04 18:07:24.374021311 +0300
|
||||
@@ -0,0 +1,24 @@
|
||||
+#ifndef HOST_CONFIG_H
|
||||
+#define HOST_CONFIG_H
|
||||
+
|
||||
+#ifndef PREFIX
|
||||
+# define PREFIX "/usr/local"
|
||||
+#endif
|
||||
+
|
||||
+#ifndef ETC_DIR
|
||||
+# define ETC_DIR PREFIX "/etc"
|
||||
+#endif
|
||||
+
|
||||
+#ifndef TMP_DIR
|
||||
+# define TMP_DIR PREFIX "/tmp"
|
||||
+#endif
|
||||
+
|
||||
+#ifndef TUN_DEVICE
|
||||
+# ifdef __ANDROID__
|
||||
+# define TUN_DEVICE "/dev/tun"
|
||||
+# else
|
||||
+# define TUN_DEVICE "/dev/net/tun"
|
||||
+# endif
|
||||
+#endif
|
||||
+
|
||||
+#endif
|
@ -1,21 +0,0 @@
|
||||
diff -uNr tinyemu-2018-09-23/riscv_cpu.c tinyemu-2018-09-23.mod/riscv_cpu.c
|
||||
--- tinyemu-2018-09-23/riscv_cpu.c 2018-09-23 15:17:19.000000000 +0300
|
||||
+++ tinyemu-2018-09-23.mod/riscv_cpu.c 2018-10-04 18:07:24.377354692 +0300
|
||||
@@ -29,6 +29,8 @@
|
||||
#include <assert.h>
|
||||
#include <fcntl.h>
|
||||
|
||||
+#include "host_config.h"
|
||||
+
|
||||
#include "cutils.h"
|
||||
#include "iomem.h"
|
||||
#include "riscv_cpu.h"
|
||||
@@ -69,7 +71,7 @@
|
||||
static void log_vprintf(const char *fmt, va_list ap)
|
||||
{
|
||||
if (!log_file)
|
||||
- log_file = fopen("/tmp/riscemu.log", "wb");
|
||||
+ log_file = fopen(TMP_DIR "/riscemu.log", "wb");
|
||||
vfprintf(log_file, fmt, ap);
|
||||
}
|
||||
#else
|
@ -1,21 +0,0 @@
|
||||
diff -uNr tinyemu-2018-09-23/riscv_machine.c tinyemu-2018-09-23.mod/riscv_machine.c
|
||||
--- tinyemu-2018-09-23/riscv_machine.c 2018-09-23 15:17:19.000000000 +0300
|
||||
+++ tinyemu-2018-09-23.mod/riscv_machine.c 2018-10-04 18:07:24.380688074 +0300
|
||||
@@ -32,6 +32,8 @@
|
||||
#include <unistd.h>
|
||||
#include <time.h>
|
||||
|
||||
+#include "host_config.h"
|
||||
+
|
||||
#include "cutils.h"
|
||||
#include "iomem.h"
|
||||
#include "riscv_cpu.h"
|
||||
@@ -736,7 +738,7 @@
|
||||
#if 0
|
||||
{
|
||||
FILE *f;
|
||||
- f = fopen("/tmp/riscvemu.dtb", "wb");
|
||||
+ f = fopen(TMP_DIR "/riscvemu.dtb", "wb");
|
||||
fwrite(dst, 1, size, f);
|
||||
fclose(f);
|
||||
}
|
@ -1,30 +0,0 @@
|
||||
diff -uNr tinyemu-2018-09-23/slirp/slirp.c tinyemu-2018-09-23.mod/slirp/slirp.c
|
||||
--- tinyemu-2018-09-23/slirp/slirp.c 2018-09-23 15:17:20.000000000 +0300
|
||||
+++ tinyemu-2018-09-23.mod/slirp/slirp.c 2018-10-04 18:07:24.380688074 +0300
|
||||
@@ -21,6 +21,8 @@
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
* THE SOFTWARE.
|
||||
*/
|
||||
+
|
||||
+#include <host_config.h>
|
||||
#include "slirp.h"
|
||||
|
||||
/* host loopback address */
|
||||
@@ -114,7 +116,7 @@
|
||||
return 0;
|
||||
}
|
||||
old_stat = dns_addr_stat;
|
||||
- if (stat("/etc/resolv.conf", &dns_addr_stat) != 0)
|
||||
+ if (stat(ETC_DIR "/resolv.conf", &dns_addr_stat) != 0)
|
||||
return -1;
|
||||
if ((dns_addr_stat.st_dev == old_stat.st_dev)
|
||||
&& (dns_addr_stat.st_ino == old_stat.st_ino)
|
||||
@@ -125,7 +127,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
- f = fopen("/etc/resolv.conf", "r");
|
||||
+ f = fopen(ETC_DIR "/resolv.conf", "r");
|
||||
if (!f)
|
||||
return -1;
|
||||
|
@ -1,11 +0,0 @@
|
||||
diff -uNr tinyemu-2018-09-23/virtio.h tinyemu-2018-09-23.mod/virtio.h
|
||||
--- tinyemu-2018-09-23/virtio.h 2018-09-23 15:17:19.000000000 +0300
|
||||
+++ tinyemu-2018-09-23.mod/virtio.h 2018-10-04 18:07:24.384021456 +0300
|
||||
@@ -24,6 +24,7 @@
|
||||
#ifndef VIRTIO_H
|
||||
#define VIRTIO_H
|
||||
|
||||
+#include <sys/select.h>
|
||||
#include "iomem.h"
|
||||
#include "pci.h"
|
||||
|
Loading…
Reference in New Issue
Block a user