From mboxrd@z Thu Jan 1 00:00:00 1970 X-GM-THRID: 6704144668026732544 X-Gmail-Labels: Topic type: DISCUSSION X-Received: by 2002:a17:906:4995:: with SMTP id p21mr106734504eju.140.1560951862633; Wed, 19 Jun 2019 06:44:22 -0700 (PDT) X-BeenThere: isar-users@googlegroups.com Received: by 2002:a17:906:77de:: with SMTP id m30ls557645ejn.10.gmail; Wed, 19 Jun 2019 06:44:22 -0700 (PDT) X-Google-Smtp-Source: APXvYqz/03ckY8v8DVeAf4P9dex7atpgmUSJfRw+eqZ9eF23oHiNogbj/mfx5uTDmslw8dGlfTRC X-Received: by 2002:a17:906:4995:: with SMTP id p21mr106734480eju.140.1560951862271; Wed, 19 Jun 2019 06:44:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1560951862; cv=none; d=google.com; s=arc-20160816; b=ylae7D6x+KjBk3AaAuvcCX8fj21YbMJIO3mxqKZUFlsjnAFGjb99y6lSpM1vr2LU9Q FFBckYZEy9yz+V99/Ccqvj43UQswXgV7RonmGKuPPm+38zk6tc3VOU5lWX4grjIRsLoe TKszKlVpQ/pF0VeHh/yqbHwydpE5vwDy3eY0AOvgM+nwJpCaLBzu2R1YEMuBSOKULwy3 PHdZWuIWRUJKZ9YBZ7soXfc8P9MGqrRnGehPDdURXR06P65+RL4QNXYuHlHwhqntwyPF A+HIO1pH4wcPhWTobBmt4mU7hMHQBVGwzsPfxh5R8MzdIcn/D+KLmkwOE33tpqEW7fwM LmVg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:dkim-signature; bh=NIwBvU/GQFnBxu9tC4DYm69kLd+InFSJ3RJI6ZP9oAM=; b=LrMKHf+3+vp2FIb1fgKMlhQWjKCLb4AJYz7k6Dcg7VTtAAbSZ2TqMq4g4n3eMV1zML dr/hv8q/8afUvc9PbisPZKquU2ONHyh9YYDGFaud+xuItnHKhfcee1fxDeeseKimi9eG GaHQrdTLrGJfSzHKpLPUP0SQmSt6FUQ0N5fsW1RvnRutpOjjUHvggyullPdCmiFoAWbE QcNgjaIbUqeTmxm4wq6xW7vzvddCEXEd7uP2YGGJUplQj+LowkEHNWBFlsYP/eNQ6W36 u0UHWG2TaT8BeDjchjBQ1ct0DV1qi/DO5uPSP1DR6lqF+usBJxKJY3RN2t50E+8ajWpo /KoQ== ARC-Authentication-Results: i=1; gmr-mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=NCER5hfV; spf=pass (google.com: domain of chombourger@gmail.com designates 2a00:1450:4864:20::441 as permitted sender) smtp.mailfrom=chombourger@gmail.com; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from mail-wr1-x441.google.com (mail-wr1-x441.google.com. [2a00:1450:4864:20::441]) by gmr-mx.google.com with ESMTPS id h23si1065671edb.2.2019.06.19.06.44.22 for (version=TLS1_3 cipher=AEAD-AES128-GCM-SHA256 bits=128/128); Wed, 19 Jun 2019 06:44:22 -0700 (PDT) Received-SPF: pass (google.com: domain of chombourger@gmail.com designates 2a00:1450:4864:20::441 as permitted sender) client-ip=2a00:1450:4864:20::441; Authentication-Results: gmr-mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=NCER5hfV; spf=pass (google.com: domain of chombourger@gmail.com designates 2a00:1450:4864:20::441 as permitted sender) smtp.mailfrom=chombourger@gmail.com; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: by mail-wr1-x441.google.com with SMTP id p13so3445032wru.10 for ; Wed, 19 Jun 2019 06:44:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=NIwBvU/GQFnBxu9tC4DYm69kLd+InFSJ3RJI6ZP9oAM=; b=NCER5hfVErcjpvPGPxpprupVYOFfzVuUqp/F/99Ai5jym1S76tulxK7jOPuxnvRTuB 3jkRrtOkzoXvcCoXTGOwKJmn8/Mkx+mcPEPyetcrLwKJ2nFxz7Utw20nDtAjn+eQQffJ hQksFXPshGVT6MovE/6pGJaUdzi9pRBR0q7/HBM0xptKcTw9N1ZB6NfTp7h6SYjHylja CiHhfq/JWdHvaRTpYA3LiNYnLFaZTV6ntNN+hdyhM0CPc/hs+Wu0+J6/d2JwEWFsNHnT GBB4hHdGJ0DdWk2h9FFktTQCXrco+57cpKoqjAzjRzhORvmcL70M3HafBgOWPGZYj1uh FRlA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=NIwBvU/GQFnBxu9tC4DYm69kLd+InFSJ3RJI6ZP9oAM=; b=qbi62ZcBuL0hKEHPq6zCzU1/Gq8BIcjzVtnF4N4qCNbN9VYLj/noUFFFhtwPH5b0h/ md3VSiqVMEAvL5j2xpaHjx0DZfvBrpwwoGxWvSrr5LKQL6M0wI+f3zve6fC+zUz6I2HO 8/6P0tXT4xJhwmY08h46Fnc4o+eA/L82hafEJwwCrSgFhIYkWBL5bz2Qu/1b+CU2Fyf4 zawuXfAZ5hW+fTE/rDef+N3rKCxK53URXH4WO5Fpu+wcKfWjCCRABNK1FGVBILJPaDPn hxuArh3VtTCsnt+Rs3Sel4jfSylWStCvn4LkEWVKEr99Yd5B9YPM5DAwe6gyui1G3xcx v6mw== X-Gm-Message-State: APjAAAXR7HaRiFVi96kD/BIOUvcR7HN5IkNvUUKFZWrodK/juMkncVc6 ufV+cqcK+RhPCZelEWLzxHPCyFW6 X-Received: by 2002:adf:fc91:: with SMTP id g17mr34719269wrr.194.1560951861937; Wed, 19 Jun 2019 06:44:21 -0700 (PDT) Return-Path: Received: from [100.113.157.248] (80.173.185.81.rev.sfr.net. [81.185.173.80]) by smtp.gmail.com with ESMTPSA id x8sm22775826wre.73.2019.06.19.06.44.20 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 19 Jun 2019 06:44:21 -0700 (PDT) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (1.0) Subject: Re: [QUERY] wic running in buildchroot-target From: chombourger@gmail.com X-Mailer: iPhone Mail (16F203) In-Reply-To: <20190619131014.369a3834@md1za8fc.ad001.siemens.net> Date: Wed, 19 Jun 2019 15:44:19 +0200 Cc: "[ext] Jan Kiszka" , isar-users Content-Transfer-Encoding: quoted-printable Message-Id: <5800A8AC-AB11-4A84-A051-4ABBA30028FE@gmail.com> References: <20190619131014.369a3834@md1za8fc.ad001.siemens.net> To: Henning Schild X-TUID: H67qNAtCnsIS Thanks for all the inputs and yes I have been contemplating the idea of gett= ing one of those new little toys (RISC V) but more as a hobby project at thi= s time ;) Sent from a mobile > On 19 Jun 2019, at 13:10, Henning Schild wrot= e: >=20 > Am Wed, 19 Jun 2019 12:28:45 +0200 > schrieb "[ext] Jan Kiszka" : >=20 >>> On 19.06.19 09:45, chombourger@gmail.com wrote: >>> Hello all, >>>=20 >>> I am continuing my journey on the MIPS architecture. >>> I wanted to add wks files for my MIPS target (Creator Ci40) and >=20 > Sweet, we can provide you with a RISC-V board next ;). >=20 >>> do_wic_image failed: >>>=20 >>> INFO: Creating image(s)... >>>=20 >>> -rw-r--r-- 1 root root 697932185 Jun 18 13:34=20 >>> /tmp/development-image-mel-omni-img-creator-ci40.wic/tmp.wic.n3m8x3xo/ro= otfs_platforma.1.ext4 >>> Unsupported ioctl: cmd=3D0x0002 >>> Traceback (most recent call last): >>> File >>> "/home/chombourger/Projects/isar/scripts/lib/wic/filemap.py", line >>> 40, in get_block_size binary_data =3D fcntl.ioctl(file_obj, 2, >>> struct.pack('I', 0)) OSError: [Errno 89] Function not implemented >>>=20 >>> During handling of the above exception, another exception occurred: >>>=20 >>> Traceback (most recent call last): >>> File >>> "/home/chombourger/Projects/isar/scripts/lib/wic/filemap.py", line >>> 103, in __init__ self.block_size =3D get_block_size(self._f_image) >>> File >>> "/home/chombourger/Projects/isar/scripts/lib/wic/filemap.py", line >>> 42, in get_block_size raise IOError("Unable to determine block >>> size") OSError: Unable to determine block size >>>=20 >>> wic appears to be running from buildchroot-target and therefore >>> under qemu--static >>> evidently mips does not implement the FIGETBSZ ioctl >>>=20 >>> My options would be: >>>=20 >>> (1) check if a more recent version of qemu does implement this ioctl >>> (2) add support for this ioctl in qemu-user =20 >>=20 >> Support for that IOCTL seems arch-independent, but maybe the >> qemu-user build was just missing some define: >>=20 >> qemu/linux-user/ioctls.h >> /* emulated ioctl list */ >> ... >> #ifdef FIGETBSZ >> IOCTL(FIGETBSZ, IOC_R, MK_PTR(TYPE_LONG)) >> #endif >>=20 >> But this is better discussed on qemu-devel. You are using qemu from >> buster already, right? >>=20 >>> (3) work-around it in wic with something like: >>>=20 >>> diff --git a/scripts/lib/wic/filemap.py b/scripts/lib/wic/filemap.py >>> index 080668e..1ce3ace 100644 >>> --- a/scripts/lib/wic/filemap.py >>> +++ b/scripts/lib/wic/filemap.py >>> @@ -40,8 +40,13 @@ def get_block_size(file_obj): >>> # Get the block size of the host file-system for the image >>> file by calling # the FIGETBSZ ioctl (number 2). >>> - binary_data =3D ioctl(file_obj, 2, struct.pack('I', 0)) >>> - return struct.unpack('I', binary_data)[0] >>> + try: >>> + binary_data =3D ioctl(file_obj, 2, struct.pack('I', 0)) >>> + return struct.unpack('I', binary_data)[0] >>> + except OSError as err: >>> + if err.errno =3D=3D os.errno.ENOSYS: >>> + return 4096 >>> + raise err >>> class ErrorNotSupp(Exception): >>> """ >>>=20 >>> Ok. =20 >>=20 >> wic patches should go upstream first. We avoid patching it. >=20 > In fact we carry a pretty old version of wic (unpatched), and looking > into updating that is somewhere on the Isar TODO list. That might be > fixed in upstream wic, or might be an issue to bring up there to > motivate the patch. > But upstream wic would never run on mips ... so maybe not. >=20 > Henning >=20 >>>=20 >>> But why are we running wic in buildchroot-target. Comments I have >>> seen in the code only say that it is a prerequisite but do not say >>> why (I should probably check git logs as well) >>> I wonder if it should run in buildchroot-host context instead (so >>> we still use a host environment we control) but avoid the overhead >>> of qemu emulation for DISTRO_ARCH !=3D amd64 >>>=20 >>> What are your thoughts? =20 >>=20 >> I do not remember all details, there might be technical difficulties, >> e.g. when you need to u-boot tools from a custom build, and that >> build is currently not generating native packages. But the killer >> argument is: CROSS_COMPILE is only optional. The default and >> production case is native (via qemu-user). Debian is not a fully >> cross-buildable distro, like most others. >>=20 >> Jan >>=20 >=20