From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: passt.top; dmarc=none (p=none dis=none) header.from=lgut.eu Authentication-Results: passt.top; dkim=pass (2048-bit key; unprotected) header.d=lgut-eu.20230601.gappssmtp.com header.i=@lgut-eu.20230601.gappssmtp.com header.a=rsa-sha256 header.s=20230601 header.b=y6iYv17w; dkim-atps=neutral Received: from mail-ed1-x52a.google.com (mail-ed1-x52a.google.com [IPv6:2a00:1450:4864:20::52a]) by passt.top (Postfix) with ESMTPS id 05CDC5A0275 for ; Mon, 23 Sep 2024 12:09:14 +0200 (CEST) Received: by mail-ed1-x52a.google.com with SMTP id 4fb4d7f45d1cf-5c5b9bf9d8bso1287302a12.1 for ; Mon, 23 Sep 2024 03:09:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=lgut-eu.20230601.gappssmtp.com; s=20230601; t=1727086153; x=1727690953; darn=passt.top; h=mime-version:user-agent:content-transfer-encoding:references :in-reply-to:date:cc:to:from:subject:message-id:from:to:cc:subject :date:message-id:reply-to; bh=Gq/fkXoF7Dw/aYvkPaBwxo269CUmFHtW/MmpN7zYQQU=; b=y6iYv17wQdARIP1zgs2DQVKfzNLNp8i1t8gkFSOji9lW4AQ0ijP8v5TV1ooQW/vO5V +KVZaTwMN7pVMLLal3lQJWnm6fb44grKFWbFvQwN1E3r+Y5TU9r0FwlSyHViOPn57Fkj XYHhiMRcaA3aLRtIJSOpa259rUVETH73CekkeUtC5bzDN/qTCMKZbtED3N8jv03mHiXL TJCglhjzpcTute0fYzR1z2z2ieJmGTolS8Lk7/7cTH69WI7VIriVTCLJfFL8PCwZ/56Q 9Veq8ynjtcQpqLUpzeXHY0MxXDA/zfX/LFvtwJjnnWqlOF8K469GnwXQkGd1zIXPPORf 6OtQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727086153; x=1727690953; h=mime-version:user-agent:content-transfer-encoding:references :in-reply-to:date:cc:to:from:subject:message-id:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=Gq/fkXoF7Dw/aYvkPaBwxo269CUmFHtW/MmpN7zYQQU=; b=Q1aJP3PWHly0mlewi+7UBdwKAKUQgQyutBDpELUAmcG8YUMQsVQ3Yefr9XmOvpz5g5 00SiK415Lvp5o5pllgs2auRFUG8RSIULj/7rx49lxmNsUQzpQJUYayiXKHLx2AO7PFSL A4XHz5sU7KRcuHp4mKV4rD1Em9JfPg4D7MXUi90TOkfGwbfWU+AN0tEl0Oj1q2mspebM RcWAbYse+AYMZyoFrgTk4UmsCi4K4+dHhKX9PXuRkCDh4s8E6xm96dwWh1Eexxe6Ehqp p5kvAIN9GR6rCUxmHkvHHo13/XgWI8gJXK1Q33KS+iZ72ld0rUSx6Ix1ZVHEzFCapiV/ QzrA== X-Forwarded-Encrypted: i=1; AJvYcCXSGo1nCdYAVTK/q01jvo5qcZOKhd411mb3IpNjwK9kZmNc8VdxIhdT2YfC9fG6HQw0bPG2PPF7Bs4=@passt.top X-Gm-Message-State: AOJu0YxR96FD1ldeyEmcrKQHXXbGCSh0c8utUt5KBhmffhsyGjnevO4Y EGGXjmteI3BZnBacQj/ceJzqF4cP0nMXfk6pqU9ofcS0YXDsEYByfZbe0RKPX1Q= X-Google-Smtp-Source: AGHT+IHLVVyq5lSuKfcZzVQr3YfwSifCf6eyxkhWP3AZ2kJRaxBrBeIEgJ3SWewO5kvuMKBlsKHuWw== X-Received: by 2002:a05:6402:2713:b0:5c3:c296:1bc9 with SMTP id 4fb4d7f45d1cf-5c464a7d174mr13491488a12.29.1727086153435; Mon, 23 Sep 2024 03:09:13 -0700 (PDT) Received: from [192.168.1.135] (ip-046-005-003-117.um12.pools.vodafone-ip.de. [46.5.3.117]) by smtp.gmail.com with ESMTPSA id 4fb4d7f45d1cf-5c4474efb7csm7202396a12.36.2024.09.23.03.09.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 23 Sep 2024 03:09:13 -0700 (PDT) Message-ID: <6a278d810d6226ee5840ad40c3cbd03f7a23a3cc.camel@lgut.eu> Subject: Re: [PATCH v2 2/4] mbuto: Use realpath to copy ld From: Lukasz Gut To: David Gibson Date: Mon, 23 Sep 2024 12:09:12 +0200 In-Reply-To: References: <20240918101532.85299-1-lgut@lgut.eu> <20240918101532.85299-4-lgut@lgut.eu> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.54.0 MIME-Version: 1.0 Message-ID-Hash: JXYTCY2AI3XAREGQ24G57WMNNJXYQK2B X-Message-ID-Hash: JXYTCY2AI3XAREGQ24G57WMNNJXYQK2B X-MailFrom: lgut@lgut.eu X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: sbrivio@redhat.com, sevinj.aghayeva@gmail.com, passt-dev@passt.top X-Mailman-Version: 3.3.8 Precedence: list List-Id: Development discussion and patches for passt Archived-At: Archived-At: List-Archive: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: On Mon, 2024-09-23 at 13:53 +1000, David Gibson wrote: > On Wed, Sep 18, 2024 at 12:12:57PM +0200, Lukasz Gut wrote: > > Place ld in exact physical location as on host, not being confused by > > links. Use realpath, that was already on the list of default PROGS. >=20 > It's not clear to me why this change is necessary. I would like `ld-linux.so` to be copied to the exact same location as in host. Without this change, it was copied to `/usr/lib64` directory. There is no such a directory on the host, but there is a link `lib64 -> lib` inside of `/usr` directory. I thought to: 1. Copy things to exactly the same locations as they are on the host. 2. Recreate necessary links. >=20 > >=20 > > Signed-off-by: Lukasz Gut > > --- > > mbuto | 9 +++++---- > > 1 file changed, 5 insertions(+), 4 deletions(-) > >=20 > > diff --git a/mbuto b/mbuto > > index 1c3b347..1f92bd9 100755 > > --- a/mbuto > > +++ b/mbuto > > @@ -644,12 +644,13 @@ libs_path_add() { > > # libs_copy_ld_so() - Copy run-time linker program, mimic location fro= m host > > # $1: Path to run-time linker > > libs_copy_ld_so() { > > - [ -f "${wd}/${1}" ] && return > > + __srcfile=3D"$("${REALPATH}" "${1}")" > > + __destfile=3D"${wd}""${__srcfile}" > > + [ -f "${__destfile}" ] && return > > =20 > > - __destdir=3D"$("${DIRNAME}" "${wd}/${1}")" > > + __destdir=3D"$("${DIRNAME}" "${__destfile}")" > > "${MKDIR}" -p "${__destdir}" > > - > > - "${CP}" --parents --preserve=3Dall "${1}" "${wd}" > > + "${CP}" --parents --preserve=3Dall "${__srcfile}" "${wd}" > > } > > =20 > > # libs_dlopen_copy() - Recursively copy matching libraries from LIBS_D= LOPEN >=20 -- Lukasz