* Partitioning SD cards
@ 2019-10-14 12:13 Andy Pont
2019-10-14 12:31 ` Maciej Pijanowski
0 siblings, 1 reply; 4+ messages in thread
From: Andy Pont @ 2019-10-14 12:13 UTC (permalink / raw)
To: yocto
[-- Attachment #1: Type: text/plain, Size: 1221 bytes --]
Hello,
I am working on a custom platform where U-Boot will be programmed into
an SPI NOR flash device and the ext4 file systems will be in a removable
microSD card. The Linux kernel itself will be stored in the /boot
directory of the root file system.
The customer wants the (16GB) microSD card formatted as 1GB to mount at
/ and the remaining 15GB mounted as /home.
In the recipe for my image I have defined the following to try to create
a suitable image for writing to the microSD card:
IMAGE_FSTYPES_append = " wic"
IMAGE_ROOTFS_SIZE = “1048576”
The image file that is being created is bigger than 1GB even though the
root file system is only a little over 450MB. Looking at the contents
of what gets written to the microSD card this looks as though it is, in
part, because it also includes the ~20MB “boot” partition containing the
boot files.
A couple of questions…
How do I stop the wic generation process including the FAT formatted
“boot” partition?
What is the best strategy for partitioning / formatting / mounting the
second partition as /home? Should it be part of the image build process
or a one-time task run at first boot?
-Andy.
[-- Attachment #2: Type: text/html, Size: 2026 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Partitioning SD cards
2019-10-14 12:13 Partitioning SD cards Andy Pont
@ 2019-10-14 12:31 ` Maciej Pijanowski
2019-10-14 12:53 ` Andy Pont
0 siblings, 1 reply; 4+ messages in thread
From: Maciej Pijanowski @ 2019-10-14 12:31 UTC (permalink / raw)
To: Andy Pont, yocto
[-- Attachment #1.1.1: Type: text/plain, Size: 1863 bytes --]
On 14.10.2019 14:13, Andy Pont wrote:
> Hello,
>
> I am working on a custom platform where U-Boot will be programmed into
> an SPI NOR flash device and the ext4 file systems will be in a
> removable microSD card. The Linux kernel itself will be stored in the
> /boot directory of the root file system.
>
> The customer wants the (16GB) microSD card formatted as 1GB to mount
> at / and the remaining 15GB mounted as /home.
>
> In the recipe for my image I have defined the following to try to
> create a suitable image for writing to the microSD card:
>
> IMAGE_FSTYPES_append = " wic"
> IMAGE_ROOTFS_SIZE = “1048576”
>
> The image file that is being created is bigger than 1GB even though
> the root file system is only a little over 450MB. Looking at the
> contents of what gets written to the microSD card this looks as though
> it is, in part, because it also includes the ~20MB “boot” partition
> containing the boot files.
>
> A couple of questions…
>
> How do I stop the wic generation process including the FAT formatted
> “boot” partition?
This depends on the wic (.wks) file you are using.
>
> What is the best strategy for partitioning / formatting / mounting the
> second partition as /home? Should it be part of the image build
> process or a one-time task run at first boot?
Use --exclude-path and --rootfs-dir flags in the .wks file.
You can look at my example, where I extract one subdir from rootfs
(/storage in this case) on a separate partition.
https://github.com/3mdeb/meta-rte/blob/master/wic/sunxi-mmc-spl.wks
The rootfs parts should be named somewhere, like in distro config:
https://github.com/3mdeb/meta-rte/blob/master/conf/distro/rte.conf#L50
>
> -Andy.
>
>
>
--
Maciej Pijanowski
Embedded Systems Engineer
GPG: F1401D2E1CCB19EF
https://3mdeb.com | @3mdeb_com
[-- Attachment #1.1.2: Type: text/html, Size: 4088 bytes --]
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 817 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Partitioning SD cards
2019-10-14 12:31 ` Maciej Pijanowski
@ 2019-10-14 12:53 ` Andy Pont
2019-10-14 13:26 ` Andy Pont
0 siblings, 1 reply; 4+ messages in thread
From: Andy Pont @ 2019-10-14 12:53 UTC (permalink / raw)
To: Maciej Pijanowski; +Cc: yocto
[-- Attachment #1: Type: text/plain, Size: 1000 bytes --]
Maciej wrote...
>>How do I stop the wic generation process including the FAT formatted
>>“boot” partition?
>This depends on the wic (.wks) file you are using.
I have been using the default one (sdimage-bootpart.wks)?
>>What is the best strategy for partitioning / formatting / mounting the
>>second partition as /home? Should it be part of the image build
>>process or a one-time task run at first boot?
>Use --exclude-path and --rootfs-dir flags in the .wks file.
>You can look at my example, where I extract one subdir from rootfs
>(/storage in this case) on a separate partition.
>https://github.com/3mdeb/meta-rte/blob/master/wic/sunxi-mmc-spl.wks
I have created a “wic” directory in my custom layer and copied
sdimage-bootpart.wks into it as sdimage-project.wks without making any
changes but “wic list image” throws an error with the new .wks file:
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xb0 in position 37:
invalid start byte
-Andy.
[-- Attachment #2: Type: text/html, Size: 2158 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Partitioning SD cards
2019-10-14 12:53 ` Andy Pont
@ 2019-10-14 13:26 ` Andy Pont
0 siblings, 0 replies; 4+ messages in thread
From: Andy Pont @ 2019-10-14 13:26 UTC (permalink / raw)
To: Maciej Pijanowski; +Cc: yocto
[-- Attachment #1: Type: text/plain, Size: 417 bytes --]
I wrote...
>I have created a “wic” directory in my custom layer and copied
>sdimage-bootpart.wks into it as sdimage-project.wks without making any
>changes but “wic list image” throws an error with the new .wks file:
>
>UnicodeDecodeError: 'utf-8' codec can't decode byte 0xb0 in position
>37: invalid start byte
Ignore that, I deleted the directory and tried again and it is OK now!
-Andy.
[-- Attachment #2: Type: text/html, Size: 1387 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2019-10-14 13:26 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-10-14 12:13 Partitioning SD cards Andy Pont
2019-10-14 12:31 ` Maciej Pijanowski
2019-10-14 12:53 ` Andy Pont
2019-10-14 13:26 ` Andy Pont
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.