From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id INt5HEviu14icwAA0tVLHw (envelope-from ) for ; Wed, 13 May 2020 12:04:27 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2 with LMTPS id cLfNClriu14/EwAAB5/wlQ (envelope-from ) for ; Wed, 13 May 2020 12:04:42 +0000 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id A84DC940C01 for ; Wed, 13 May 2020 12:04:39 +0000 (UTC) Received: from localhost ([::1]:33548 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jYq7s-0008AM-Im for larch@yhetil.org; Wed, 13 May 2020 08:04:40 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:34346) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jYq7M-0007er-55; Wed, 13 May 2020 08:04:08 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:34793) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jYq7L-0007l1-Py; Wed, 13 May 2020 08:04:07 -0400 Received: from [2001:980:1b4f:1:42d2:832d:bb59:862] (port=51856 helo=dundal.peder.onsbrabantnet.nl) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1jYq7L-0000Jy-8C; Wed, 13 May 2020 08:04:07 -0400 From: Jan Nieuwenhuizen To: bug-hurd@gnu.org Subject: Re: [PATCH] ext2fs: Update to upstream Hurd-reserved xattr index for "gnu.*". Organization: AvatarAcademy.nl References: <87sgg5z1gt.fsf@gnu.org> <20200512142819.fzpeco3kk4ufqnlw@function> X-Url: http://AvatarAcademy.nl Date: Wed, 13 May 2020 14:04:04 +0200 In-Reply-To: <20200512142819.fzpeco3kk4ufqnlw@function> (Samuel Thibault's message of "Tue, 12 May 2020 16:28:19 +0200") Message-ID: <87k11ghwi3.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-BeenThere: guix-devel@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: guix-devel@gnu.org Errors-To: guix-devel-bounces+larch=yhetil.org@gnu.org Sender: "Guix-devel" X-Scanner: scn0 X-Spam-Score: -1.01 Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=none; spf=pass (aspmx1.migadu.com: domain of guix-devel-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=guix-devel-bounces@gnu.org X-Scan-Result: default: False [-1.01 / 13.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; GENERIC_REPUTATION(0.00)[-0.53979709217467]; DWL_DNSWL_FAIL(0.00)[209.51.188.17:server fail]; R_SPF_ALLOW(-0.20)[+ip4:209.51.188.0/24:c]; IP_REPUTATION_HAM(0.00)[asn: 22989(0.06), country: US(-0.00), ip: 209.51.188.17(-0.54)]; TO_DN_NONE(0.00)[]; HAS_ORG_HEADER(0.00)[]; MX_GOOD(-0.50)[cached: eggs.gnu.org]; RCPT_COUNT_TWO(0.00)[2]; MAILLIST(-0.20)[mailman]; FORGED_RECIPIENTS_MAILLIST(0.00)[]; RCVD_IN_DNSWL_FAIL(0.00)[209.51.188.17:server fail]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:22989, ipnet:209.51.188.0/24, country:US]; TAGGED_FROM(0.00)[larch=yhetil.org]; FROM_NEQ_ENVFROM(0.00)[janneke@gnu.org,guix-devel-bounces@gnu.org]; ARC_NA(0.00)[]; RCVD_COUNT_FIVE(0.00)[5]; MID_RHS_MATCH_FROM(0.00)[]; FROM_HAS_DN(0.00)[]; URIBL_BLOCKED(0.00)[lilypond.org:url,gnu.org:email,gitlab.com:url,joyofsource.com:url,avataracademy.com:url]; MIME_GOOD(-0.10)[text/plain]; RCVD_TLS_LAST(0.00)[]; DMARC_NA(0.00)[gnu.org]; HAS_LIST_UNSUB(-0.01)[]; RWL_MAILSPIKE_POSSIBLE(0.00)[209.51.188.17:from]; FORGED_SENDER_MAILLIST(0.00)[] X-TUID: AiPN8zjz4cCx Samuel Thibault writes: Hello Samuel, > Jan Nieuwenhuizen, le mar. 12 mai 2020 16:12:34 +0200, a ecrit: >> setfattr --name=3Dgnu.translator --value=3D'/hurd/pflocal\0' /mnt/server= s/socket/1 > > man setfattr says > > If the given string is enclosed in double quotes, the inner string is > treated as text. In that case, backslashes and double quotes have > special meanings and need to be escaped by a preceding backslash. > > so I guess it needs=20 > > setfattr --name=3Dgnu.translator --value=3D'"/hurd/pflocal\0"' /mnt/serve= rs/socket/1 > > to actually interpret \0 Yes, that's it; thank you! So I've now managed to create a vm-image using Guix that boots the Hurd straight into our Guile RC script, without the need to use Bash for that. See https://gitlab.com/janneke/guix/-/commit/3b4c0dcda783e8c866be154ab46ec9= 5fb581f08f ./pre-inst-env guix system vm-image --target=3Di586-pc-gnu gnu/system/e= xamples/bare-hurd.tmpl and wget https://lilypond.org/janneke/hurd/hurd-xattr.img.gz gunzip hurd-xattr.img.gz guix environment --ad-hoc qemu -- qemu-system-i386 -enable-kvm \ -snapshot -hda hurd-xattr.img -m 2G \ -device rtl8139,netdev=3Dnet0 -netdev user,id=3Dnet0,hostfwd=3Dtcp:127= .0.0.1:10022-:2222 So WDYT, is my patch for the Hurd (the first message in this thread) https://lists.gnu.org/archive/html/bug-hurd/2020-05/msg00016.html OK to apply now? Any ideas or suggestions on my Linux patch? >> --8<---------------cut here---------------start------------->8--- >> fsck --yes --force / >> fsysopts / --writable >> mv /servers/socket/1 /servers/socket/1-linux >> touch /servers/socket/1 >> setfattr --name=3Dgnu.translator --value=3D'/hurd/pflocal\0' /servers/so= cket/1 > > Note that glibc's setxattr, i.e. _hurd_xattr_set, translates that > into a __file_set_translator() RPC call. Did you pass the proper option > to make ext2fs record the translator as xattr instead of passive record? Yes... >> And I guess there must be an incompatibility between Linux and the Hurd >> in how setfattr embeds the xattr attributes into the file system. >>=20 >> How to best "diff" this aspect in the file system; how to proceed? > > debugfs can be used for that. Right, thanks. I was looking for something like that. >> Inspired by Shengyu's GSoC code that simply seemed to use fprintf for >> debbugging, I tried adding some debug printing in inode.c >>=20 >> fprintf (stderr, "gnu.translator[%d,%d]=3D%s\n", datalen, strlen (*n= amep), *namep); > > Printf is the simplest way to make sure things are happening the way one > wants, yes. Note however that in the case of translators even the output = on > stderr is buffered, so you need to flush it with fflush(stderr). Even > safer is to use snprintf + mach_print(). > >> but that does not seem to work, > > More precisely? > I'll assume "does not show up". (that was more precisely exactly what I meant to ask) > If your print doesn't show up, try to put a print in other places which > are definitely to be called such as in diskfs_user_read_node(). If those > come up, then it means the code you put your prints is not even called, > so put prints in code you thought was calling it etc. up to the RPC that > you thought would be called, then jump to libc which was supposed to be > making the RPC call, etc. Thank you! It took me a while to find the right setfattr curse so I dabbled in here some more and can confirm that combining your instructions, e.g., like so --8<---------------cut here---------------start------------->8--- diff --git a/ext2fs/inode.c b/ext2fs/inode.c index a2e804b9..f4e29eb5 100644 --- a/ext2fs/inode.c +++ b/ext2fs/inode.c @@ -700,6 +700,9 @@ diskfs_get_translator (struct node *np, char **namep, u= nsigned *namelen) void *transloc; struct ext2_inode *di; =20 + fprintf (stderr, "diskfs_get_translator\n"); + fflush (stderr); + if (sblock->s_creator_os !=3D EXT2_OS_HURD) return EOPNOTSUPP; --8<---------------cut here---------------end--------------->8--- =20 "just work". That's helpful knowledge to have anyway. Greetings, janneke --=20 Jan Nieuwenhuizen | GNU LilyPond http://lilypond.org Freelance IT http://JoyofSource.com | Avatar=C2=AE http://AvatarAcademy.com