<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic LS1046ARDB mount rootfs as tmpfs in Layerscape</title>
    <link>https://community.nxp.com/t5/Layerscape/LS1046ARDB-mount-rootfs-as-tmpfs/m-p/1614880#M12022</link>
    <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;What I want to achieve:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;I want to write bootloaders, kernel, dtb and rootfs on my SD Card (in a later stage I want to do the same with the QSPI-Flash). As a rootfs image I want to use a custom-image I create using yocto, that's inheriting from the&amp;nbsp;core-image-minimal and adds a few additional packages (I attached the custom-image recipe). When booting I want to create my rootfs as a tmpfs so that my system is volatile and completely in RAM. I don't know how to archive this and in which format I need my custom-image (cpio, cpio.gz, tar.gz ...). Or if it's necessary/beneficial to combine my kernel, dts and rootfs in a fitImage? In the documentation(&lt;A href="https://www.nxp.com/docs/en/supporting-information/QORIQ_LS1046A_BSP_V0-4_REV-A.pdf" target="_blank" rel="noopener"&gt;https://www.nxp.com/docs/en/supporting-information/QORIQ_LS1046A_BSP_V0-4_REV-A.pdf&lt;/A&gt;) I found this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;setenv bootargs "root=/dev/ram0 earlycon=uart8250,mmio,0x21c0500 console=ttyS0,115200" &lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;I guess that's a ramdisk approach which is deprecated and it's more modern and efficient to use a tmpfs (&lt;A href="https://www.kernel.org/doc/Documentation/filesystems/ramfs-rootfs-initramfs.txt" target="_blank" rel="noopener"&gt;https://www.kernel.org/doc/Documentation/filesystems/ramfs-rootfs-initramfs.txt&lt;/A&gt;)? But I'm no expert here and maybe I am misunderstanding something here. Please correct me if I'm wrong and if I can achieve it to have a completely RAM based system using this I'm also happy with this root=/dev/ram0 approach but I also don't know how to modify my current workflow to achieve this approach.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;My current workflow having the rootfs as a non volatile SD card partition:&lt;BR /&gt;&lt;/STRONG&gt;Currently I'm programming my SD card like this:&lt;/P&gt;&lt;P&gt;&lt;U&gt;1. Write bootloader files to the SD card&lt;/U&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;cd tmp/deploy/images/ls1046ardb
bl2_sd_file="atf/bl2_sd.pbl"
fip_uboot_file="atf/fip_uboot.bin"
fman_ucode_file="fsl_fman_ucode_ls1046_r1.0_106_4_18.bin"

image="custom-image-ls1046ardb.tar.gz"
kernel="Image"
dtb="fsl-ls1046a-rdb-sdk.dtb"

# write the bootloader files to the SD card
sudo dd if={bl2_sd_file} of=/dev/sdb bs=512 seek=8
sudo dd if={fip_uboot_file} of=/dev/sdb bs=512 seek=2048
sudo dd if={fman_ucode_file} of=/dev/sdb bs=512 seek=18432&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;U&gt;2. Create ext2 partition right behind the bootloader files using fdisk and mkfs.ext2&lt;/U&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;sudo fdisk /dev/sdb
    n # new partiton
    p # primary partition
    1 #partition number 1
    &amp;lt;18432 + number_of_blocks(fsl_fman_ucode_ls1046_r1.0_106_4_18.bin)&amp;gt; # start address
    +200M # partition size
    w
sudo mkfs.ext2 /dev/sdb1&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;U&gt;3. Unpack custom-image.tar.gz to the ext2 partition and copy Image+dtb to /boot directory&lt;/U&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;sudo mount /dev/sdb1 /mnt/sdcard
sudo tar -xzf custom-image-ls1046ardb.tar.gz -C /mnt/sdcard
sudo cp Image /mnt/sdcard/boot
sudo cp fsl-ls1046a-rdb-sdk.dtb /mnt/sdcard/boot&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;U&gt;&amp;nbsp;4. Put SD card in board and switch board on (dip switches are set to SD card boot) and enter uboot prompt&lt;/U&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;setenv bootcmd 'setenv bootargs root=/dev/mmcblk0p1 rw rootdelay=5 console=ttyS0,115200;mmcinfo;ext2load mmc 0:1 0xa0000000 boot/Image;ext2load mmc 0:1 0xb0000000 /boot/fsl-ls1046a-rdb-sdk.dtb;booti 0xa0000000 - 0xb0000000'
boot&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Summary&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;My current workflow works but as already described I want to have my rootfs only in RAM and I don't know what's the best approach to achieve this (not only initramfs, but this would also be ok if it's NOT getting remounted during init process to a rootfs located on SD card). I tried for example using a compressed cpio archive loading it to RAM and passing it as initrd parameter to the booti command but it is not working and I get the error "Wrong Ramdisk Image Format&lt;BR /&gt;Ramdisk image is corrupt or invalid".&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;setenv bootcmd 'setenv bootargs rootfstype=tmpfs rw size=1024M rootdelay=5 console=ttyS0,115200;mmcinfo;ext2load mmc 0:1 0xa0000000 Image;ext2load mmc 0:1 0xb0000000 fsl-ls1046a-rdb-sdk.dtb;ext2load mmc 0:1 0xc0000000 custom-image-initramfs.cpio.gz;booti 0xa0000000 0xc0000000 0xb0000000'
boot&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 14 Mar 2023 13:32:57 GMT</pubDate>
    <dc:creator>srechermann</dc:creator>
    <dc:date>2023-03-14T13:32:57Z</dc:date>
    <item>
      <title>LS1046ARDB mount rootfs as tmpfs</title>
      <link>https://community.nxp.com/t5/Layerscape/LS1046ARDB-mount-rootfs-as-tmpfs/m-p/1614880#M12022</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;What I want to achieve:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;I want to write bootloaders, kernel, dtb and rootfs on my SD Card (in a later stage I want to do the same with the QSPI-Flash). As a rootfs image I want to use a custom-image I create using yocto, that's inheriting from the&amp;nbsp;core-image-minimal and adds a few additional packages (I attached the custom-image recipe). When booting I want to create my rootfs as a tmpfs so that my system is volatile and completely in RAM. I don't know how to archive this and in which format I need my custom-image (cpio, cpio.gz, tar.gz ...). Or if it's necessary/beneficial to combine my kernel, dts and rootfs in a fitImage? In the documentation(&lt;A href="https://www.nxp.com/docs/en/supporting-information/QORIQ_LS1046A_BSP_V0-4_REV-A.pdf" target="_blank" rel="noopener"&gt;https://www.nxp.com/docs/en/supporting-information/QORIQ_LS1046A_BSP_V0-4_REV-A.pdf&lt;/A&gt;) I found this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;setenv bootargs "root=/dev/ram0 earlycon=uart8250,mmio,0x21c0500 console=ttyS0,115200" &lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;I guess that's a ramdisk approach which is deprecated and it's more modern and efficient to use a tmpfs (&lt;A href="https://www.kernel.org/doc/Documentation/filesystems/ramfs-rootfs-initramfs.txt" target="_blank" rel="noopener"&gt;https://www.kernel.org/doc/Documentation/filesystems/ramfs-rootfs-initramfs.txt&lt;/A&gt;)? But I'm no expert here and maybe I am misunderstanding something here. Please correct me if I'm wrong and if I can achieve it to have a completely RAM based system using this I'm also happy with this root=/dev/ram0 approach but I also don't know how to modify my current workflow to achieve this approach.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;My current workflow having the rootfs as a non volatile SD card partition:&lt;BR /&gt;&lt;/STRONG&gt;Currently I'm programming my SD card like this:&lt;/P&gt;&lt;P&gt;&lt;U&gt;1. Write bootloader files to the SD card&lt;/U&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;cd tmp/deploy/images/ls1046ardb
bl2_sd_file="atf/bl2_sd.pbl"
fip_uboot_file="atf/fip_uboot.bin"
fman_ucode_file="fsl_fman_ucode_ls1046_r1.0_106_4_18.bin"

image="custom-image-ls1046ardb.tar.gz"
kernel="Image"
dtb="fsl-ls1046a-rdb-sdk.dtb"

# write the bootloader files to the SD card
sudo dd if={bl2_sd_file} of=/dev/sdb bs=512 seek=8
sudo dd if={fip_uboot_file} of=/dev/sdb bs=512 seek=2048
sudo dd if={fman_ucode_file} of=/dev/sdb bs=512 seek=18432&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;U&gt;2. Create ext2 partition right behind the bootloader files using fdisk and mkfs.ext2&lt;/U&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;sudo fdisk /dev/sdb
    n # new partiton
    p # primary partition
    1 #partition number 1
    &amp;lt;18432 + number_of_blocks(fsl_fman_ucode_ls1046_r1.0_106_4_18.bin)&amp;gt; # start address
    +200M # partition size
    w
sudo mkfs.ext2 /dev/sdb1&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;U&gt;3. Unpack custom-image.tar.gz to the ext2 partition and copy Image+dtb to /boot directory&lt;/U&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;sudo mount /dev/sdb1 /mnt/sdcard
sudo tar -xzf custom-image-ls1046ardb.tar.gz -C /mnt/sdcard
sudo cp Image /mnt/sdcard/boot
sudo cp fsl-ls1046a-rdb-sdk.dtb /mnt/sdcard/boot&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;U&gt;&amp;nbsp;4. Put SD card in board and switch board on (dip switches are set to SD card boot) and enter uboot prompt&lt;/U&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;setenv bootcmd 'setenv bootargs root=/dev/mmcblk0p1 rw rootdelay=5 console=ttyS0,115200;mmcinfo;ext2load mmc 0:1 0xa0000000 boot/Image;ext2load mmc 0:1 0xb0000000 /boot/fsl-ls1046a-rdb-sdk.dtb;booti 0xa0000000 - 0xb0000000'
boot&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Summary&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;My current workflow works but as already described I want to have my rootfs only in RAM and I don't know what's the best approach to achieve this (not only initramfs, but this would also be ok if it's NOT getting remounted during init process to a rootfs located on SD card). I tried for example using a compressed cpio archive loading it to RAM and passing it as initrd parameter to the booti command but it is not working and I get the error "Wrong Ramdisk Image Format&lt;BR /&gt;Ramdisk image is corrupt or invalid".&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;setenv bootcmd 'setenv bootargs rootfstype=tmpfs rw size=1024M rootdelay=5 console=ttyS0,115200;mmcinfo;ext2load mmc 0:1 0xa0000000 Image;ext2load mmc 0:1 0xb0000000 fsl-ls1046a-rdb-sdk.dtb;ext2load mmc 0:1 0xc0000000 custom-image-initramfs.cpio.gz;booti 0xa0000000 0xc0000000 0xb0000000'
boot&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 14 Mar 2023 13:32:57 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Layerscape/LS1046ARDB-mount-rootfs-as-tmpfs/m-p/1614880#M12022</guid>
      <dc:creator>srechermann</dc:creator>
      <dc:date>2023-03-14T13:32:57Z</dc:date>
    </item>
    <item>
      <title>Re: LS1046ARDB mount rootfs as tmpfs</title>
      <link>https://community.nxp.com/t5/Layerscape/LS1046ARDB-mount-rootfs-as-tmpfs/m-p/1615052#M12023</link>
      <description>&lt;P&gt;I tried duplicated the post here&amp;nbsp;&lt;A href="https://community.nxp.com/t5/QorIQ/mount-compressed-rootfs-image-located-on-SD-card-as-tmpfs-in-RAM/m-p/1615047#M11383" target="_blank" rel="noopener"&gt;https://community.nxp.com/t5/QorIQ/mount-compressed-rootfs-image-located-on-SD-card-as-tmpfs-in-RAM/m-p/1615047#M11383&lt;/A&gt;&amp;nbsp;as I think product forums is not the correct location for my question. But it was marked as spam so maybe it's possible for a moderator to move this question to the correct forum (I think QoriIQ Processing Platforms) and delete this one here?&lt;/P&gt;</description>
      <pubDate>Tue, 14 Mar 2023 14:43:39 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Layerscape/LS1046ARDB-mount-rootfs-as-tmpfs/m-p/1615052#M12023</guid>
      <dc:creator>srechermann</dc:creator>
      <dc:date>2023-03-14T14:43:39Z</dc:date>
    </item>
  </channel>
</rss>

