[Buildroot] [PATCH v2 4/9] board: Add Sipeed MAIX-bit support

Arnout Vandecappelle arnout at mind.be
Sat Jul 24 14:53:58 UTC 2021



On 24/07/2021 00:40, Damien Le Moal wrote:
> On 2021/07/24 7:25, Arnout Vandecappelle wrote:
>>
>>
>> On 15/07/2021 02:48, Damien Le Moal wrote:

[snip]
>>> diff --git a/board/canaan/k210-common/rootfs_overlay/usr/sbin/init b/board/canaan/k210-common/rootfs_overlay/usr/sbin/init
>>> new file mode 100755
>>> index 0000000000..286346ddc3
>>> --- /dev/null
>>> +++ b/board/canaan/k210-common/rootfs_overlay/usr/sbin/init
>>
>>  /sbin/init, not /usr/sbin/init. Doesn't matter because you have merged usr, but
>> it's better to follow the standards.
> 
> OK.
> 

[snip]
>>> +BR2_ROOTFS_MERGED_USR=y
>>
>>  Why?
> 
> Without this, the SD card config does not result in the system starting the init
> shell. Not entirely sure why. Will have another look at this.

 Maybe because you put the script in /usr/bin/init instead of /bin/init? :-)

[snip]
>>> +BR2_TARGET_ROOTFS_INITRAMFS=y
>>
>>  This will install another /init script that ends up exec'ing /sbin/init. Maybe
>> it would be better to replace that /init script as well (just symlink /init ->
>> sbin/init).
> 
> Hmm... All the default init stuff is disabled in busybox so I do not get that
> init script/process. Will check again.

 It's not added by busybox, it's added by fs/cpio/cpio.mk
(BR2_TARGET_ROOTFS_CPIO gets selected by _INITRAMFS).

 IIRC the script is not put in output/target/init, only in the temporary
directory from which the cpio is created. On the booted system or in
output/images/rootfs.cpio, you should be able to see it as /init.


 Regards,
 Arnout




More information about the buildroot mailing list