[Buildroot] [PATCH 3/3] fs/dracut: new fs type

Arnout Vandecappelle arnout at mind.be
Mon Dec 20 22:02:46 UTC 2021



On 19/12/2021 09:23, Yann E. MORIN wrote:
> Thierry, All,
> 
> On 2021-12-19 07:55 +0100, Thierry Bultel spake thusly:
>>>>>   You should also check then if it gets properly updated by
>>>>> support/misc/relocate-sdk.sh (I think yes).
>>>> I am sorry, but I do not see the point here, would you mind explain
>>>> please ?
>>>
>>>   If there's such a wrapper script that sets the environment variables
>>> correctly, the idea is to be able to use that as part of the SDK. That
>>> also means it must be possible to move it to a different place. Since it
>>> contains hardcoded paths to HOST_DIR, these need to be change when the SDK
>>> is relocated. The relocate-sdk.sh script should do that, but it's
>>> important to check that indeed it does.
>>
>> I probably miss something here. Is it a bad idea to -not- use hardcoded
>> paths in the wrapper script, but environment variables instead ?

  No, I meant to generate a wrapper script that has the paths hardcoded. This 
way, you can call the script externally without having to set up anything in the 
environment. Similar like how you can call cross-gcc to build something and it 
Just Works, thanks to our toolchain wrapper.

  Since the paths would be hardcoded, it needs to be treated by relocate-sdk.sh 
when moving the SDK around.

  However...

>> It should be something like:
>>
>> -------------
>> #!/bin/bash
>> set -e
>>
>> if [ -z "$*" ]; then
>>      echo "No argument supplied"
>>      exit
>> fi
>>
>> DRACUT_LDD=${TARGET_CROSS}ldd \
>> DRACUT_INSTALL="${HOST_DIR}/lib/dracut/dracut-install" \
>> dracutbasedir=${HOST_DIR}/usr/lib/dracut \
>> dracutsysrootdir=${TARGET_DIR} \
>> ${HOST_DIR}/bin/dracut "$@"
>> ----------
> 
> The thing is, with the SDK, those variables are not set.
> 
>    - HOST_DIR can be easily derived; it is: $(dirname $(dirname "${0}"))
>      or a little be simpler: $(dirname "${0%/*}")
> 
>    - TARGET_CROSS can probably be derived somehow, but not even sure...
> 
>    - TAGET_DIR has to be specified explicitly.
> 
> So, I think for now it would be over-engineering to try and catter for
> the SDK; this can be acted upon later...

  ... this is very true. So for the time being, let's not worry about such a 
wrapper script, and instead focus on fs/dracut.

  Regards,
  Arnout


> 
> Regards,
> Yann E. MORIN.
> 
>> So that should not impact the relocation ...
>>
>> By the way, in cpio.mk, I also had to
>>
>> export TARGET_CROSS
>>
>>
>> Regards
>>
>> _______________________________________________
>> buildroot mailing list
>> buildroot at buildroot.org
>> https://lists.buildroot.org/mailman/listinfo/buildroot
> 



More information about the buildroot mailing list