2016-01-19 19:31:32 +01:00
|
|
|
From c133a037638e8831f61352311a5acbd6241f184b Mon Sep 17 00:00:00 2001
|
2012-06-13 10:19:32 +02:00
|
|
|
From: Alexander Graf <agraf@suse.de>
|
|
|
|
Date: Tue, 12 Jun 2012 04:41:10 +0200
|
|
|
|
Subject: [PATCH] linux-user: Ignore broken loop ioctl
|
2014-07-11 18:51:43 +02:00
|
|
|
MIME-Version: 1.0
|
|
|
|
Content-Type: text/plain; charset=UTF-8
|
|
|
|
Content-Transfer-Encoding: 8bit
|
2012-06-13 10:19:32 +02:00
|
|
|
|
|
|
|
During invocations of losetup, we run into an ioctl that doesn't
|
|
|
|
exist. However, because of that we output an error, which then
|
|
|
|
screws up the kiwi logic around that call.
|
|
|
|
|
|
|
|
So let's silently ignore that bogus ioctl.
|
|
|
|
|
|
|
|
Signed-off-by: Alexander Graf <agraf@suse.de>
|
2014-07-11 18:51:43 +02:00
|
|
|
[AF: Rebased for v2.1.0-rc0]
|
|
|
|
Signed-off-by: Andreas Färber <afaerber@suse.de>
|
2012-06-13 10:19:32 +02:00
|
|
|
---
|
2014-01-17 23:04:30 +01:00
|
|
|
linux-user/ioctls.h | 1 +
|
|
|
|
linux-user/linux_loop.h | 1 +
|
|
|
|
linux-user/syscall.c | 7 +++++++
|
|
|
|
linux-user/syscall_defs.h | 1 +
|
|
|
|
4 files changed, 10 insertions(+)
|
2012-06-13 10:19:32 +02:00
|
|
|
|
|
|
|
diff --git a/linux-user/ioctls.h b/linux-user/ioctls.h
|
2015-01-12 19:27:43 +01:00
|
|
|
index 921d482..c180faf 100644
|
2012-06-13 10:19:32 +02:00
|
|
|
--- a/linux-user/ioctls.h
|
|
|
|
+++ b/linux-user/ioctls.h
|
2015-01-12 19:27:43 +01:00
|
|
|
@@ -331,6 +331,7 @@
|
2012-06-13 10:19:32 +02:00
|
|
|
IOCTL(LOOP_SET_STATUS64, IOC_W, MK_PTR(MK_STRUCT(STRUCT_loop_info64)))
|
|
|
|
IOCTL(LOOP_GET_STATUS64, IOC_W, MK_PTR(MK_STRUCT(STRUCT_loop_info64)))
|
|
|
|
IOCTL(LOOP_CHANGE_FD, 0, TYPE_INT)
|
|
|
|
+ IOCTL_SPECIAL(LOOP_BOGUS_CMD, 0, do_ioctl_fail, TYPE_INT)
|
|
|
|
|
|
|
|
IOCTL(MTIOCTOP, IOC_W, MK_PTR(MK_STRUCT(STRUCT_mtop)))
|
|
|
|
IOCTL(MTIOCGET, IOC_R, MK_PTR(MK_STRUCT(STRUCT_mtget)))
|
|
|
|
diff --git a/linux-user/linux_loop.h b/linux-user/linux_loop.h
|
|
|
|
index 8974caa..810ae61 100644
|
|
|
|
--- a/linux-user/linux_loop.h
|
|
|
|
+++ b/linux-user/linux_loop.h
|
|
|
|
@@ -91,5 +91,6 @@ struct loop_info64 {
|
|
|
|
#define LOOP_SET_STATUS64 0x4C04
|
|
|
|
#define LOOP_GET_STATUS64 0x4C05
|
|
|
|
#define LOOP_CHANGE_FD 0x4C06
|
|
|
|
+#define LOOP_BOGUS_CMD 0x4C82
|
|
|
|
|
|
|
|
#endif
|
|
|
|
diff --git a/linux-user/syscall.c b/linux-user/syscall.c
|
2016-01-19 19:31:32 +01:00
|
|
|
index 6cdbd86..55dfcf9 100644
|
2012-06-13 10:19:32 +02:00
|
|
|
--- a/linux-user/syscall.c
|
|
|
|
+++ b/linux-user/syscall.c
|
2016-01-19 19:31:32 +01:00
|
|
|
@@ -3899,6 +3899,13 @@ static abi_long do_ioctl_kdsigaccept(const IOCTLEntry *ie, uint8_t *buf_temp,
|
2014-07-11 18:51:43 +02:00
|
|
|
return get_errno(ioctl(fd, ie->host_cmd, sig));
|
2012-06-13 10:19:32 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
+static abi_long do_ioctl_fail(const IOCTLEntry *ie, uint8_t *buf_temp, int fd,
|
|
|
|
+ abi_long cmd, abi_long arg)
|
|
|
|
+{
|
|
|
|
+ /* Fail silently */
|
|
|
|
+ return -EINVAL;
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
static IOCTLEntry ioctl_entries[] = {
|
|
|
|
#define IOCTL(cmd, access, ...) \
|
|
|
|
{ TARGET_ ## cmd, cmd, #cmd, access, 0, { __VA_ARGS__ } },
|
|
|
|
diff --git a/linux-user/syscall_defs.h b/linux-user/syscall_defs.h
|
2016-01-19 19:31:32 +01:00
|
|
|
index c2baa9e..4f966b4 100644
|
2012-06-13 10:19:32 +02:00
|
|
|
--- a/linux-user/syscall_defs.h
|
|
|
|
+++ b/linux-user/syscall_defs.h
|
2016-01-19 19:31:32 +01:00
|
|
|
@@ -1085,6 +1085,7 @@ struct target_pollfd {
|
2012-06-13 10:19:32 +02:00
|
|
|
#define TARGET_LOOP_SET_STATUS64 0x4C04
|
|
|
|
#define TARGET_LOOP_GET_STATUS64 0x4C05
|
|
|
|
#define TARGET_LOOP_CHANGE_FD 0x4C06
|
|
|
|
+#define TARGET_LOOP_BOGUS_CMD 0x4C82
|
|
|
|
|
|
|
|
/* fb ioctls */
|
|
|
|
#define TARGET_FBIOGET_VSCREENINFO 0x4600
|