[2/2] arch: arm64: configs: Enable UBI and UBIFS

Message ID 20230622085349.573942-1-kah.jing.lee@intel.com
State New
Headers
Series [1/2] arch: arm64: boot: dts: Updated QSPI Flash layout for UBIFS |

Commit Message

Lee, Kah Jing June 22, 2023, 8:53 a.m. UTC
  From: Alif Zakuan Yuslaimi <alif.zakuan.yuslaimi@intel.com>

This patch is to enable UBI and UBIFS in Linux defconfig.

Signed-off-by: Alif Zakuan Yuslaimi <alif.zakuan.yuslaimi@intel.com>
Signed-off-by: Kah Jing Lee <kah.jing.lee@intel.com>
---
 arch/arm64/configs/defconfig | 2 ++
 1 file changed, 2 insertions(+)
  

Comments

Krzysztof Kozlowski June 22, 2023, 9:23 a.m. UTC | #1
On 22/06/2023 10:53, kah.jing.lee@intel.com wrote:
> From: Alif Zakuan Yuslaimi <alif.zakuan.yuslaimi@intel.com>
> 
> This patch is to enable UBI and UBIFS in Linux defconfig.

Why? Which board needs it? It's quite unusual to have this on arm64...

> 
> Signed-off-by: Alif Zakuan Yuslaimi <alif.zakuan.yuslaimi@intel.com>
> Signed-off-by: Kah Jing Lee <kah.jing.lee@intel.com>
> ---
>  arch/arm64/configs/defconfig | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/arch/arm64/configs/defconfig b/arch/arm64/configs/defconfig
> index a24609e14d50..23a6ebcb1a9e 100644
> --- a/arch/arm64/configs/defconfig
> +++ b/arch/arm64/configs/defconfig
> @@ -470,6 +470,8 @@ CONFIG_IPMI_DEVICE_INTERFACE=m
>  CONFIG_IPMI_SI=m
>  CONFIG_HW_RANDOM=y
>  CONFIG_HW_RANDOM_VIRTIO=y
> +CONFIG_MTD_UBI=y
> +CONFIG_UBIFS_FS=y

Not modules?

Are you sure you added the lines in appropriate place (matching
savedefconfig)?


Best regards,
Krzysztof
  
Lee, Kah Jing June 22, 2023, 12:21 p.m. UTC | #2
From: Lee, Kah Jing <kah.jing.lee@intel.com>

> 
> >
> > Signed-off-by: Alif Zakuan Yuslaimi <alif.zakuan.yuslaimi@intel.com>
> > Signed-off-by: Kah Jing Lee <kah.jing.lee@intel.com>
> > ---
> >  arch/arm64/configs/defconfig | 2 ++
> >  1 file changed, 2 insertions(+)
> >
> > diff --git a/arch/arm64/configs/defconfig
> > b/arch/arm64/configs/defconfig index a24609e14d50..23a6ebcb1a9e
> 100644
> > --- a/arch/arm64/configs/defconfig
> > +++ b/arch/arm64/configs/defconfig
> > @@ -470,6 +470,8 @@ CONFIG_IPMI_DEVICE_INTERFACE=m
> CONFIG_IPMI_SI=m
> > CONFIG_HW_RANDOM=y  CONFIG_HW_RANDOM_VIRTIO=y
> > +CONFIG_MTD_UBI=y
> > +CONFIG_UBIFS_FS=y
> 
> Not modules?
Yes, we need to boot with rootfs with UBIFS.

> 
> Are you sure you added the lines in appropriate place (matching
> savedefconfig)?
Updated in v2.

> 
> 
> Best regards,
> Krzysztof

Thanks. 

Regards, 
Kah Jing
  
Krzysztof Kozlowski June 22, 2023, 12:49 p.m. UTC | #3
On 22/06/2023 14:21, kah.jing.lee@intel.com wrote:
> From: Lee, Kah Jing <kah.jing.lee@intel.com>
> 
>>

You missed my questions.

>>>
>>> Signed-off-by: Alif Zakuan Yuslaimi <alif.zakuan.yuslaimi@intel.com>
>>> Signed-off-by: Kah Jing Lee <kah.jing.lee@intel.com>
>>> ---
>>>  arch/arm64/configs/defconfig | 2 ++
>>>  1 file changed, 2 insertions(+)
>>>
>>> diff --git a/arch/arm64/configs/defconfig
>>> b/arch/arm64/configs/defconfig index a24609e14d50..23a6ebcb1a9e
>> 100644
>>> --- a/arch/arm64/configs/defconfig
>>> +++ b/arch/arm64/configs/defconfig
>>> @@ -470,6 +470,8 @@ CONFIG_IPMI_DEVICE_INTERFACE=m
>> CONFIG_IPMI_SI=m
>>> CONFIG_HW_RANDOM=y  CONFIG_HW_RANDOM_VIRTIO=y
>>> +CONFIG_MTD_UBI=y
>>> +CONFIG_UBIFS_FS=y
>>
>> Not modules?
> Yes, we need to boot with rootfs with UBIFS.

So you miss init ramdisk.



Best regards,
Krzysztof
  
Lee, Kah Jing June 23, 2023, 10:03 a.m. UTC | #4
> -----Original Message-----
> From: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
> Sent: Thursday, 22 June, 2023 8:49 PM
> To: Lee, Kah Jing <kah.jing.lee@intel.com>; Dinh Nguyen
> <dinguyen@kernel.org>; Rob Herring <robh+dt@kernel.org>; Krzysztof
> Kozlowski <krzysztof.kozlowski+dt@linaro.org>; Conor Dooley
> <conor+dt@kernel.org>; Catalin Marinas <catalin.marinas@arm.com>; Will
> Deacon <will@kernel.org>
> Cc: linux-kernel@vger.kernel.org
> Subject: Re: [PATCH 2/2] arch: arm64: configs: Enable UBI and UBIFS
> 
> On 22/06/2023 14:21, kah.jing.lee@intel.com wrote:
> > From: Lee, Kah Jing <kah.jing.lee@intel.com>
> >
> >>
> 
> You missed my questions.
Sorry, the reply got truncated.

> > On 22/06/2023 10:53, kah.jing.lee@intel.com wrote:
> > From: Alif Zakuan Yuslaimi <alif.zakuan.yuslaimi@intel.com>
> > 
> > This patch is to enable UBI and UBIFS in Linux defconfig.
> Why? Which board needs it? It's quite unusual to have this on arm64...
The ubifs settings is enabled for Agilex and Stratix10 socfpga platform with 
rootfs mounted from QSPI NOR.
> >>>
> >>> Signed-off-by: Alif Zakuan Yuslaimi <alif.zakuan.yuslaimi@intel.com>
> >>> Signed-off-by: Kah Jing Lee <kah.jing.lee@intel.com>
> >>> ---
> >>>  arch/arm64/configs/defconfig | 2 ++
> >>>  1 file changed, 2 insertions(+)
> >>>
> >>> diff --git a/arch/arm64/configs/defconfig
> >>> b/arch/arm64/configs/defconfig index a24609e14d50..23a6ebcb1a9e
> >> 100644
> >>> --- a/arch/arm64/configs/defconfig
> >>> +++ b/arch/arm64/configs/defconfig
> >>> @@ -470,6 +470,8 @@ CONFIG_IPMI_DEVICE_INTERFACE=m
> >> CONFIG_IPMI_SI=m
> >>> CONFIG_HW_RANDOM=y  CONFIG_HW_RANDOM_VIRTIO=y
> >>> +CONFIG_MTD_UBI=y
> >>> +CONFIG_UBIFS_FS=y
> >>
> >> Not modules?
> > Yes, we need to boot with rootfs with UBIFS.
> 
> So you miss init ramdisk.
Currently we are using the bootargs to mount the rootfs from QSPI NOR flash:
[    0.000000] Kernel command line: earlycon panic=-1 ubi.mtd=1 root=ubi0:rootfs rootfstype=ubifs rw rootwait
Is it possible to mount the ubifs rootfs with the ubifs=m config during boot?
Thanks.
> 
> 
> 
> Best regards,
> Krzysztof

Thanks. 

Regards, 
Lee, Kah Jing
  
Krzysztof Kozlowski June 23, 2023, 10:18 a.m. UTC | #5
On 23/06/2023 12:03, Lee, Kah Jing wrote:
>>>>>
>>>>> Signed-off-by: Alif Zakuan Yuslaimi <alif.zakuan.yuslaimi@intel.com>
>>>>> Signed-off-by: Kah Jing Lee <kah.jing.lee@intel.com>
>>>>> ---
>>>>>  arch/arm64/configs/defconfig | 2 ++
>>>>>  1 file changed, 2 insertions(+)
>>>>>
>>>>> diff --git a/arch/arm64/configs/defconfig
>>>>> b/arch/arm64/configs/defconfig index a24609e14d50..23a6ebcb1a9e
>>>> 100644
>>>>> --- a/arch/arm64/configs/defconfig
>>>>> +++ b/arch/arm64/configs/defconfig
>>>>> @@ -470,6 +470,8 @@ CONFIG_IPMI_DEVICE_INTERFACE=m
>>>> CONFIG_IPMI_SI=m
>>>>> CONFIG_HW_RANDOM=y  CONFIG_HW_RANDOM_VIRTIO=y
>>>>> +CONFIG_MTD_UBI=y
>>>>> +CONFIG_UBIFS_FS=y
>>>>
>>>> Not modules?
>>> Yes, we need to boot with rootfs with UBIFS.
>>
>> So you miss init ramdisk.
> Currently we are using the bootargs to mount the rootfs from QSPI NOR flash:
> [    0.000000] Kernel command line: earlycon panic=-1 ubi.mtd=1 root=ubi0:rootfs rootfstype=ubifs rw rootwait
> Is it possible to mount the ubifs rootfs with the ubifs=m config during boot?

I think yes. rootfs devices are for example modules, so filesystem can
be as well.


Best regards,
Krzysztof
  
Lee, Kah Jing June 24, 2023, 3:42 a.m. UTC | #6
> -----Original Message-----
> From: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
> Sent: Friday, 23 June, 2023 6:18 PM
> To: Lee, Kah Jing <kah.jing.lee@intel.com>; Dinh Nguyen
> <dinguyen@kernel.org>; Rob Herring <robh+dt@kernel.org>; Krzysztof
> Kozlowski <krzysztof.kozlowski+dt@linaro.org>; Conor Dooley
> <conor+dt@kernel.org>; Catalin Marinas <catalin.marinas@arm.com>; Will
> Deacon <will@kernel.org>
> Cc: linux-kernel@vger.kernel.org
> Subject: Re: [PATCH 2/2] arch: arm64: configs: Enable UBI and UBIFS
> 
> On 23/06/2023 12:03, Lee, Kah Jing wrote:
> >>>>>
> >>>>> Signed-off-by: Alif Zakuan Yuslaimi
> >>>>> <alif.zakuan.yuslaimi@intel.com>
> >>>>> Signed-off-by: Kah Jing Lee <kah.jing.lee@intel.com>
> >>>>> ---
> >>>>>  arch/arm64/configs/defconfig | 2 ++
> >>>>>  1 file changed, 2 insertions(+)
> >>>>>
> >>>>> diff --git a/arch/arm64/configs/defconfig
> >>>>> b/arch/arm64/configs/defconfig index a24609e14d50..23a6ebcb1a9e
> >>>> 100644
> >>>>> --- a/arch/arm64/configs/defconfig
> >>>>> +++ b/arch/arm64/configs/defconfig
> >>>>> @@ -470,6 +470,8 @@ CONFIG_IPMI_DEVICE_INTERFACE=m
> >>>> CONFIG_IPMI_SI=m
> >>>>> CONFIG_HW_RANDOM=y  CONFIG_HW_RANDOM_VIRTIO=y
> >>>>> +CONFIG_MTD_UBI=y
> >>>>> +CONFIG_UBIFS_FS=y
> >>>>
> >>>> Not modules?
> >>> Yes, we need to boot with rootfs with UBIFS.
> >>
> >> So you miss init ramdisk.
> > Currently we are using the bootargs to mount the rootfs from QSPI NOR
> flash:
> > [    0.000000] Kernel command line: earlycon panic=-1 ubi.mtd=1
> root=ubi0:rootfs rootfstype=ubifs rw rootwait
> > Is it possible to mount the ubifs rootfs with the ubifs=m config during boot?
> 
> I think yes. rootfs devices are for example modules, so filesystem can be as
> well.
Was going through mtd ubifs page - http://www.linux-mtd.infradead.org/faq/ubifs.html
Quoted: 'In order to mount UBIFS as the root file system, you have to compile 
UBIFS into the kernel (instead of compiling it as a kernel module) and specify 
proper kernel boot arguments and make the kernel mount UBIFS on boot.'

It seems like we need UBIFS config to be compiled as kernel built-in.
The kernel module would work if we mounted UBIFS as filesystem device 
after rootfs mounted, but not as rootfs.
Let me know if that understanding is correct.
Thanks.
> 
> 
> Best regards,
> Krzysztof

Regards, 
Lee, Kah Jing
  
Krzysztof Kozlowski June 24, 2023, 7:30 a.m. UTC | #7
On 24/06/2023 05:42, Lee, Kah Jing wrote:
>>>> So you miss init ramdisk.
>>> Currently we are using the bootargs to mount the rootfs from QSPI NOR
>> flash:
>>> [    0.000000] Kernel command line: earlycon panic=-1 ubi.mtd=1
>> root=ubi0:rootfs rootfstype=ubifs rw rootwait
>>> Is it possible to mount the ubifs rootfs with the ubifs=m config during boot?
>>
>> I think yes. rootfs devices are for example modules, so filesystem can be as
>> well.
> Was going through mtd ubifs page - http://www.linux-mtd.infradead.org/faq/ubifs.html
> Quoted: 'In order to mount UBIFS as the root file system, you have to compile 
> UBIFS into the kernel (instead of compiling it as a kernel module) and specify 
> proper kernel boot arguments and make the kernel mount UBIFS on boot.'

Why? Module loaded by initramfs would also understand cmdline arguments,
right?

Best regards,
Krzysztof
  
Lee, Kah Jing June 26, 2023, 4:16 a.m. UTC | #8
> -----Original Message-----
> From: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
> Sent: Saturday, 24 June, 2023 3:30 PM
> To: Lee, Kah Jing <kah.jing.lee@intel.com>; Dinh Nguyen
> <dinguyen@kernel.org>; Rob Herring <robh+dt@kernel.org>; Krzysztof
> Kozlowski <krzysztof.kozlowski+dt@linaro.org>; Conor Dooley
> <conor+dt@kernel.org>; Catalin Marinas <catalin.marinas@arm.com>; Will
> Deacon <will@kernel.org>
> Cc: linux-kernel@vger.kernel.org
> Subject: Re: [PATCH 2/2] arch: arm64: configs: Enable UBI and UBIFS
> 
> On 24/06/2023 05:42, Lee, Kah Jing wrote:
> >>>> So you miss init ramdisk.
> >>> Currently we are using the bootargs to mount the rootfs from QSPI
> >>> NOR
> >> flash:
> >>> [    0.000000] Kernel command line: earlycon panic=-1 ubi.mtd=1
> >> root=ubi0:rootfs rootfstype=ubifs rw rootwait
> >>> Is it possible to mount the ubifs rootfs with the ubifs=m config during
> boot?
> >>
> >> I think yes. rootfs devices are for example modules, so filesystem
> >> can be as well.
> > Was going through mtd ubifs page -
> > http://www.linux-mtd.infradead.org/faq/ubifs.html
> > Quoted: 'In order to mount UBIFS as the root file system, you have to
> > compile UBIFS into the kernel (instead of compiling it as a kernel
> > module) and specify proper kernel boot arguments and make the kernel
> mount UBIFS on boot.'
> 
> Why? Module loaded by initramfs would also understand cmdline arguments,
> right?
The suggestion is to use initramfs for rootfs -> remount UBIFS as chroot?
The concern is additional initrd image and steps to store in the
limited NOR flash (256MB, Boot data + Uboot - ~66MB, UBIFS image - ~88MB, 
kernel.itb - ~10MB = 164MB).
With the mounting Rootfs from UBIFS volume, we can skip the initrd step, and
save some space for the user operations. 
Let me know if I understands that correctly.
> 
> Best regards,
> Krzysztof

Thanks. 

Regards, 
Lee, Kah Jing
  
Krzysztof Kozlowski June 26, 2023, 8:38 a.m. UTC | #9
On 26/06/2023 06:16, Lee, Kah Jing wrote:
>> -----Original Message-----
>> From: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
>> Sent: Saturday, 24 June, 2023 3:30 PM
>> To: Lee, Kah Jing <kah.jing.lee@intel.com>; Dinh Nguyen
>> <dinguyen@kernel.org>; Rob Herring <robh+dt@kernel.org>; Krzysztof
>> Kozlowski <krzysztof.kozlowski+dt@linaro.org>; Conor Dooley
>> <conor+dt@kernel.org>; Catalin Marinas <catalin.marinas@arm.com>; Will
>> Deacon <will@kernel.org>
>> Cc: linux-kernel@vger.kernel.org
>> Subject: Re: [PATCH 2/2] arch: arm64: configs: Enable UBI and UBIFS
>>
>> On 24/06/2023 05:42, Lee, Kah Jing wrote:
>>>>>> So you miss init ramdisk.
>>>>> Currently we are using the bootargs to mount the rootfs from QSPI
>>>>> NOR
>>>> flash:
>>>>> [    0.000000] Kernel command line: earlycon panic=-1 ubi.mtd=1
>>>> root=ubi0:rootfs rootfstype=ubifs rw rootwait
>>>>> Is it possible to mount the ubifs rootfs with the ubifs=m config during
>> boot?
>>>>
>>>> I think yes. rootfs devices are for example modules, so filesystem
>>>> can be as well.
>>> Was going through mtd ubifs page -
>>> http://www.linux-mtd.infradead.org/faq/ubifs.html
>>> Quoted: 'In order to mount UBIFS as the root file system, you have to
>>> compile UBIFS into the kernel (instead of compiling it as a kernel
>>> module) and specify proper kernel boot arguments and make the kernel
>> mount UBIFS on boot.'
>>
>> Why? Module loaded by initramfs would also understand cmdline arguments,
>> right?
> The suggestion is to use initramfs for rootfs -> remount UBIFS as chroot?
> The concern is additional initrd image and steps to store in the
> limited NOR flash (256MB, Boot data + Uboot - ~66MB, UBIFS image - ~88MB, 
> kernel.itb - ~10MB = 164MB).
> With the mounting Rootfs from UBIFS volume, we can skip the initrd step, and
> save some space for the user operations. 
> Let me know if I understands that correctly.

arm64 defconfig creates huge development config for all platforms, so
why would you ever use it in resource-constrained system? It would
barely fit. defconfig modules take 50 MB alone and you don't need most
of them.

I think you misunderstood the purpose of this defconfig and now try to
apply some arguments for different use cases.

Best regards,
Krzysztof
  
Lee, Kah Jing June 27, 2023, 3:40 a.m. UTC | #10
> -----Original Message-----
> From: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
> Sent: Monday, 26 June, 2023 4:39 PM
> To: Lee, Kah Jing <kah.jing.lee@intel.com>; Dinh Nguyen
> <dinguyen@kernel.org>; Rob Herring <robh+dt@kernel.org>; Krzysztof
> Kozlowski <krzysztof.kozlowski+dt@linaro.org>; Conor Dooley
> <conor+dt@kernel.org>; Catalin Marinas <catalin.marinas@arm.com>; Will
> Deacon <will@kernel.org>
> Cc: linux-kernel@vger.kernel.org
> Subject: Re: [PATCH 2/2] arch: arm64: configs: Enable UBI and UBIFS
> 
> On 26/06/2023 06:16, Lee, Kah Jing wrote:
> >> -----Original Message-----
> >> From: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
> >> Sent: Saturday, 24 June, 2023 3:30 PM
> >> To: Lee, Kah Jing <kah.jing.lee@intel.com>; Dinh Nguyen
> >> <dinguyen@kernel.org>; Rob Herring <robh+dt@kernel.org>; Krzysztof
> >> Kozlowski <krzysztof.kozlowski+dt@linaro.org>; Conor Dooley
> >> <conor+dt@kernel.org>; Catalin Marinas <catalin.marinas@arm.com>;
> >> Will Deacon <will@kernel.org>
> >> Cc: linux-kernel@vger.kernel.org
> >> Subject: Re: [PATCH 2/2] arch: arm64: configs: Enable UBI and UBIFS
> >>
> >> On 24/06/2023 05:42, Lee, Kah Jing wrote:
> >>>>>> So you miss init ramdisk.
> >>>>> Currently we are using the bootargs to mount the rootfs from QSPI
> >>>>> NOR
> >>>> flash:
> >>>>> [    0.000000] Kernel command line: earlycon panic=-1 ubi.mtd=1
> >>>> root=ubi0:rootfs rootfstype=ubifs rw rootwait
> >>>>> Is it possible to mount the ubifs rootfs with the ubifs=m config
> >>>>> during
> >> boot?
> >>>>
> >>>> I think yes. rootfs devices are for example modules, so filesystem
> >>>> can be as well.
> >>> Was going through mtd ubifs page -
> >>> http://www.linux-mtd.infradead.org/faq/ubifs.html
> >>> Quoted: 'In order to mount UBIFS as the root file system, you have
> >>> to compile UBIFS into the kernel (instead of compiling it as a
> >>> kernel
> >>> module) and specify proper kernel boot arguments and make the kernel
> >> mount UBIFS on boot.'
> >>
> >> Why? Module loaded by initramfs would also understand cmdline
> >> arguments, right?
> > The suggestion is to use initramfs for rootfs -> remount UBIFS as chroot?
> > The concern is additional initrd image and steps to store in the
> > limited NOR flash (256MB, Boot data + Uboot - ~66MB, UBIFS image -
> > ~88MB, kernel.itb - ~10MB = 164MB).
> > With the mounting Rootfs from UBIFS volume, we can skip the initrd
> > step, and save some space for the user operations.
> > Let me know if I understands that correctly.
> 
> arm64 defconfig creates huge development config for all platforms, so why
> would you ever use it in resource-constrained system? It would barely fit.
> defconfig modules take 50 MB alone and you don't need most of them.
> 
> I think you misunderstood the purpose of this defconfig and now try to apply
> some arguments for different use cases.
Understood the point. In this case, I would drop this defconfig patch, and
document it for customers to enable through menuconfig. 

Will proceed to send the v3 for only dts changes. 
Thanks for the time.
> 
> Best regards,
> Krzysztof

Regards, 
Lee, Kah Jing
  
Dinh Nguyen June 27, 2023, 5:08 a.m. UTC | #11
On 6/26/23 22:40, Lee, Kah Jing wrote:
>> -----Original Message-----
>> From: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
>> Sent: Monday, 26 June, 2023 4:39 PM
>> To: Lee, Kah Jing <kah.jing.lee@intel.com>; Dinh Nguyen
>> <dinguyen@kernel.org>; Rob Herring <robh+dt@kernel.org>; Krzysztof
>> Kozlowski <krzysztof.kozlowski+dt@linaro.org>; Conor Dooley
>> <conor+dt@kernel.org>; Catalin Marinas <catalin.marinas@arm.com>; Will
>> Deacon <will@kernel.org>
>> Cc: linux-kernel@vger.kernel.org
>> Subject: Re: [PATCH 2/2] arch: arm64: configs: Enable UBI and UBIFS
>>
>> On 26/06/2023 06:16, Lee, Kah Jing wrote:
>>>> -----Original Message-----
>>>> From: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
>>>> Sent: Saturday, 24 June, 2023 3:30 PM
>>>> To: Lee, Kah Jing <kah.jing.lee@intel.com>; Dinh Nguyen
>>>> <dinguyen@kernel.org>; Rob Herring <robh+dt@kernel.org>; Krzysztof
>>>> Kozlowski <krzysztof.kozlowski+dt@linaro.org>; Conor Dooley
>>>> <conor+dt@kernel.org>; Catalin Marinas <catalin.marinas@arm.com>;
>>>> Will Deacon <will@kernel.org>
>>>> Cc: linux-kernel@vger.kernel.org
>>>> Subject: Re: [PATCH 2/2] arch: arm64: configs: Enable UBI and UBIFS
>>>>
>>>> On 24/06/2023 05:42, Lee, Kah Jing wrote:
>>>>>>>> So you miss init ramdisk.
>>>>>>> Currently we are using the bootargs to mount the rootfs from QSPI
>>>>>>> NOR
>>>>>> flash:
>>>>>>> [    0.000000] Kernel command line: earlycon panic=-1 ubi.mtd=1
>>>>>> root=ubi0:rootfs rootfstype=ubifs rw rootwait
>>>>>>> Is it possible to mount the ubifs rootfs with the ubifs=m config
>>>>>>> during
>>>> boot?
>>>>>>
>>>>>> I think yes. rootfs devices are for example modules, so filesystem
>>>>>> can be as well.
>>>>> Was going through mtd ubifs page -
>>>>> http://www.linux-mtd.infradead.org/faq/ubifs.html
>>>>> Quoted: 'In order to mount UBIFS as the root file system, you have
>>>>> to compile UBIFS into the kernel (instead of compiling it as a
>>>>> kernel
>>>>> module) and specify proper kernel boot arguments and make the kernel
>>>> mount UBIFS on boot.'
>>>>
>>>> Why? Module loaded by initramfs would also understand cmdline
>>>> arguments, right?
>>> The suggestion is to use initramfs for rootfs -> remount UBIFS as chroot?
>>> The concern is additional initrd image and steps to store in the
>>> limited NOR flash (256MB, Boot data + Uboot - ~66MB, UBIFS image -
>>> ~88MB, kernel.itb - ~10MB = 164MB).
>>> With the mounting Rootfs from UBIFS volume, we can skip the initrd
>>> step, and save some space for the user operations.
>>> Let me know if I understands that correctly.
>>
>> arm64 defconfig creates huge development config for all platforms, so why
>> would you ever use it in resource-constrained system? It would barely fit.
>> defconfig modules take 50 MB alone and you don't need most of them.
>>
>> I think you misunderstood the purpose of this defconfig and now try to apply
>> some arguments for different use cases.
> Understood the point. In this case, I would drop this defconfig patch, and
> document it for customers to enable through menuconfig.
> 
> Will proceed to send the v3 for only dts changes.
> Thanks for the time.
>>

You can still have the defconfig build them as modules. Then you can 
include them in your initramfs.

Dinh
  
Lee, Kah Jing July 3, 2023, 4:06 a.m. UTC | #12
> >>>> On 24/06/2023 05:42, Lee, Kah Jing wrote:
> >>>>>>>> So you miss init ramdisk.
> >>>>>>> Currently we are using the bootargs to mount the rootfs from
> >>>>>>> QSPI NOR
> >>>>>> flash:
> >>>>>>> [    0.000000] Kernel command line: earlycon panic=-1 ubi.mtd=1
> >>>>>> root=ubi0:rootfs rootfstype=ubifs rw rootwait
> >>>>>>> Is it possible to mount the ubifs rootfs with the ubifs=m config
> >>>>>>> during
> >>>> boot?
> >>>>>>
> >>>>>> I think yes. rootfs devices are for example modules, so
> >>>>>> filesystem can be as well.
> >>>>> Was going through mtd ubifs page -
> >>>>> http://www.linux-mtd.infradead.org/faq/ubifs.html
> >>>>> Quoted: 'In order to mount UBIFS as the root file system, you have
> >>>>> to compile UBIFS into the kernel (instead of compiling it as a
> >>>>> kernel
> >>>>> module) and specify proper kernel boot arguments and make the
> >>>>> kernel
> >>>> mount UBIFS on boot.'
> >>>>
> >>>> Why? Module loaded by initramfs would also understand cmdline
> >>>> arguments, right?
> >>> The suggestion is to use initramfs for rootfs -> remount UBIFS as chroot?
> >>> The concern is additional initrd image and steps to store in the
> >>> limited NOR flash (256MB, Boot data + Uboot - ~66MB, UBIFS image -
> >>> ~88MB, kernel.itb - ~10MB = 164MB).
> >>> With the mounting Rootfs from UBIFS volume, we can skip the initrd
> >>> step, and save some space for the user operations.
> >>> Let me know if I understands that correctly.
> >>
> >> arm64 defconfig creates huge development config for all platforms, so
> >> why would you ever use it in resource-constrained system? It would
> barely fit.
> >> defconfig modules take 50 MB alone and you don't need most of them.
> >>
> >> I think you misunderstood the purpose of this defconfig and now try
> >> to apply some arguments for different use cases.
> > Understood the point. In this case, I would drop this defconfig patch,
> > and document it for customers to enable through menuconfig.
> >
> > Will proceed to send the v3 for only dts changes.
> > Thanks for the time.
> >>
> 
> You can still have the defconfig build them as modules. Then you can include
> them in your initramfs.
Understood, but we can maintain it as the wiki steps since previously for JFFS2
is part of the rocketboard page for users to follow to enable from menuconfig.
Thanks.
> 
> Dinh

Regards, 
Lee, Kah Jing
  

Patch

diff --git a/arch/arm64/configs/defconfig b/arch/arm64/configs/defconfig
index a24609e14d50..23a6ebcb1a9e 100644
--- a/arch/arm64/configs/defconfig
+++ b/arch/arm64/configs/defconfig
@@ -470,6 +470,8 @@  CONFIG_IPMI_DEVICE_INTERFACE=m
 CONFIG_IPMI_SI=m
 CONFIG_HW_RANDOM=y
 CONFIG_HW_RANDOM_VIRTIO=y
+CONFIG_MTD_UBI=y
+CONFIG_UBIFS_FS=y
 CONFIG_TCG_TPM=y
 CONFIG_TCG_TIS=m
 CONFIG_TCG_TIS_SPI=m