* [meta-raspberrypi][PATCH] wic: add swap partition and set /root and /swap size
@ 2019-11-14 6:04 Hongxu Jia
2019-11-14 6:30 ` Khem Raj
2019-11-14 11:11 ` [meta-raspberrypi][PATCH] wic: add swap partition and set /root and /swap size Paul Barker
0 siblings, 2 replies; 9+ messages in thread
From: Hongxu Jia @ 2019-11-14 6:04 UTC (permalink / raw)
To: yocto, pjtexier
- Add swap partition to workaround memory limitation
- Support to set /root and /swap size, 4G /root and 1G /swap by default
Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
---
conf/machine/include/rpi-base.inc | 5 ++++-
wic/{sdimage-raspberrypi.wks => sdimage-raspberrypi.wks.in} | 3 ++-
2 files changed, 6 insertions(+), 2 deletions(-)
rename wic/{sdimage-raspberrypi.wks => sdimage-raspberrypi.wks.in} (75%)
diff --git a/conf/machine/include/rpi-base.inc b/conf/machine/include/rpi-base.inc
index 36a8daf..de2f366 100644
--- a/conf/machine/include/rpi-base.inc
+++ b/conf/machine/include/rpi-base.inc
@@ -6,7 +6,10 @@ SOC_FAMILY = "rpi"
include conf/machine/include/soc-family.inc
IMAGE_FSTYPES ?= "tar.bz2 ext3 rpi-sdimg"
-WKS_FILE ?= "sdimage-raspberrypi.wks"
+
+PI_WKS_ROOT_SIZE ?= "--size=4096M --overhead-factor 1"
+PI_WKS_SWAP_SIZE ?= "--size=1024M --overhead-factor 1"
+WKS_FILE ?= "sdimage-raspberrypi.wks.in"
XSERVER = " \
xserver-xorg \
diff --git a/wic/sdimage-raspberrypi.wks b/wic/sdimage-raspberrypi.wks.in
similarity index 75%
rename from wic/sdimage-raspberrypi.wks
rename to wic/sdimage-raspberrypi.wks.in
index 01fbaea..81707c7 100644
--- a/wic/sdimage-raspberrypi.wks
+++ b/wic/sdimage-raspberrypi.wks.in
@@ -3,4 +3,5 @@
# Raspberry Pi. Boot files are located in the first vfat partition.
part /boot --source bootimg-partition --ondisk mmcblk0 --fstype=vfat --label boot --active --align 4096 --size 20
-part / --source rootfs --ondisk mmcblk0 --fstype=ext4 --label root --align 4096
+part / --source rootfs --ondisk mmcblk0 --fstype=ext4 --label root --align 4096 ${PI_WKS_ROOT_SIZE}
+part swap --ondisk mmcblk0 --size 44 --label swap --fstype=swap ${PI_WKS_SWAP_SIZE}
--
2.17.1
^ permalink raw reply related [flat|nested] 9+ messages in thread
* Re: [meta-raspberrypi][PATCH] wic: add swap partition and set /root and /swap size
2019-11-14 6:04 [meta-raspberrypi][PATCH] wic: add swap partition and set /root and /swap size Hongxu Jia
@ 2019-11-14 6:30 ` Khem Raj
2019-11-14 7:12 ` Hongxu Jia
` (2 more replies)
2019-11-14 11:11 ` [meta-raspberrypi][PATCH] wic: add swap partition and set /root and /swap size Paul Barker
1 sibling, 3 replies; 9+ messages in thread
From: Khem Raj @ 2019-11-14 6:30 UTC (permalink / raw)
To: Hongxu Jia, yocto, pjtexier
On Thu, 2019-11-14 at 06:04 +0000, Hongxu Jia wrote:
> - Add swap partition to workaround memory limitation
>
> - Support to set /root and /swap size, 4G /root and 1G /swap by
> default
>
> Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
> ---
> conf/machine/include/rpi-base.inc | 5
> ++++-
> wic/{sdimage-raspberrypi.wks => sdimage-raspberrypi.wks.in} | 3 ++-
> 2 files changed, 6 insertions(+), 2 deletions(-)
> rename wic/{sdimage-raspberrypi.wks => sdimage-raspberrypi.wks.in}
> (75%)
>
> diff --git a/conf/machine/include/rpi-base.inc
> b/conf/machine/include/rpi-base.inc
> index 36a8daf..de2f366 100644
> --- a/conf/machine/include/rpi-base.inc
> +++ b/conf/machine/include/rpi-base.inc
> @@ -6,7 +6,10 @@ SOC_FAMILY = "rpi"
> include conf/machine/include/soc-family.inc
>
> IMAGE_FSTYPES ?= "tar.bz2 ext3 rpi-sdimg"
> -WKS_FILE ?= "sdimage-raspberrypi.wks"
> +
> +PI_WKS_ROOT_SIZE ?= "--size=4096M --overhead-factor 1"
this means we need minimum 4G cards.
> +PI_WKS_SWAP_SIZE ?= "--size=1024M --overhead-factor 1"
I think these options should be not set here. if someone wants they
should be injected by local config.
> +WKS_FILE ?= "sdimage-raspberrypi.wks.in"
>
> XSERVER = " \
> xserver-xorg \
> diff --git a/wic/sdimage-raspberrypi.wks b/wic/sdimage-
> raspberrypi.wks.in
> similarity index 75%
> rename from wic/sdimage-raspberrypi.wks
> rename to wic/sdimage-raspberrypi.wks.in
> index 01fbaea..81707c7 100644
> --- a/wic/sdimage-raspberrypi.wks
> +++ b/wic/sdimage-raspberrypi.wks.in
> @@ -3,4 +3,5 @@
> # Raspberry Pi. Boot files are located in the first vfat partition.
>
> part /boot --source bootimg-partition --ondisk mmcblk0 --fstype=vfat
> --label boot --active --align 4096 --size 20
> -part / --source rootfs --ondisk mmcblk0 --fstype=ext4 --label root
> --align 4096
> +part / --source rootfs --ondisk mmcblk0 --fstype=ext4 --label root
> --align 4096 ${PI_WKS_ROOT_SIZE}
> +part swap --ondisk mmcblk0 --size 44 --label swap --fstype=swap
> ${PI_WKS_SWAP_SIZE}
its using --size 44, perhaps thats default if its not set via
PI_WKS_SWAP_SIZE
> --
> 2.17.1
>
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [meta-raspberrypi][PATCH] wic: add swap partition and set /root and /swap size
2019-11-14 6:30 ` Khem Raj
@ 2019-11-14 7:12 ` Hongxu Jia
2019-11-14 7:30 ` [meta-raspberrypi][PATCH V2] wic: support to set /root size and add extra partition Hongxu Jia
2019-11-14 7:33 ` [meta-raspberrypi][PATCH V3] " Hongxu Jia
2 siblings, 0 replies; 9+ messages in thread
From: Hongxu Jia @ 2019-11-14 7:12 UTC (permalink / raw)
To: Khem Raj, yocto, pjtexier
On 11/14/19 2:30 PM, Khem Raj wrote:
> On Thu, 2019-11-14 at 06:04 +0000, Hongxu Jia wrote:
>> - Add swap partition to workaround memory limitation
>>
>> - Support to set /root and /swap size, 4G /root and 1G /swap by
>> default
>>
>> Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
>> ---
>> conf/machine/include/rpi-base.inc | 5
>> ++++-
>> wic/{sdimage-raspberrypi.wks => sdimage-raspberrypi.wks.in} | 3 ++-
>> 2 files changed, 6 insertions(+), 2 deletions(-)
>> rename wic/{sdimage-raspberrypi.wks => sdimage-raspberrypi.wks.in}
>> (75%)
>>
>> diff --git a/conf/machine/include/rpi-base.inc
>> b/conf/machine/include/rpi-base.inc
>> index 36a8daf..de2f366 100644
>> --- a/conf/machine/include/rpi-base.inc
>> +++ b/conf/machine/include/rpi-base.inc
>> @@ -6,7 +6,10 @@ SOC_FAMILY = "rpi"
>> include conf/machine/include/soc-family.inc
>>
>> IMAGE_FSTYPES ?= "tar.bz2 ext3 rpi-sdimg"
>> -WKS_FILE ?= "sdimage-raspberrypi.wks"
>> +
>> +PI_WKS_ROOT_SIZE ?= "--size=4096M --overhead-factor 1"
> this means we need minimum 4G cards.
>
>> +PI_WKS_SWAP_SIZE ?= "--size=1024M --overhead-factor 1"
> I think these options should be not set here. if someone wants they
> should be injected by local config.
OK, I will comments them out as a example
//Hongxu
>> +WKS_FILE ?= "sdimage-raspberrypi.wks.in"
>>
>> XSERVER = " \
>> xserver-xorg \
>> diff --git a/wic/sdimage-raspberrypi.wks b/wic/sdimage-
>> raspberrypi.wks.in
>> similarity index 75%
>> rename from wic/sdimage-raspberrypi.wks
>> rename to wic/sdimage-raspberrypi.wks.in
>> index 01fbaea..81707c7 100644
>> --- a/wic/sdimage-raspberrypi.wks
>> +++ b/wic/sdimage-raspberrypi.wks.in
>> @@ -3,4 +3,5 @@
>> # Raspberry Pi. Boot files are located in the first vfat partition.
>>
>> part /boot --source bootimg-partition --ondisk mmcblk0 --fstype=vfat
>> --label boot --active --align 4096 --size 20
>> -part / --source rootfs --ondisk mmcblk0 --fstype=ext4 --label root
>> --align 4096
>> +part / --source rootfs --ondisk mmcblk0 --fstype=ext4 --label root
>> --align 4096 ${PI_WKS_ROOT_SIZE}
>> +part swap --ondisk mmcblk0 --size 44 --label swap --fstype=swap
>> ${PI_WKS_SWAP_SIZE}
> its using --size 44, perhaps thats default if its not set via
> PI_WKS_SWAP_SIZE
>
>> --
>> 2.17.1
>>
>
^ permalink raw reply [flat|nested] 9+ messages in thread
* [meta-raspberrypi][PATCH V2] wic: support to set /root size and add extra partition
2019-11-14 6:30 ` Khem Raj
2019-11-14 7:12 ` Hongxu Jia
@ 2019-11-14 7:30 ` Hongxu Jia
2019-11-14 7:33 ` [meta-raspberrypi][PATCH V3] " Hongxu Jia
2 siblings, 0 replies; 9+ messages in thread
From: Hongxu Jia @ 2019-11-14 7:30 UTC (permalink / raw)
To: yocto, raj.khem, pjtexier
- Support to add extra partition, such as add swap partition
to workaround memory limitation
- Support to set /root size
Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
---
conf/machine/include/rpi-base.inc | 11 ++++++++++-
...age-raspberrypi.wks => sdimage-raspberrypi.wks.in} | 3 ++-
2 files changed, 12 insertions(+), 2 deletions(-)
rename wic/{sdimage-raspberrypi.wks => sdimage-raspberrypi.wks.in} (85%)
diff --git a/conf/machine/include/rpi-base.inc b/conf/machine/include/rpi-base.inc
index af1418d..9d0b688 100644
--- a/conf/machine/include/rpi-base.inc
+++ b/conf/machine/include/rpi-base.inc
@@ -6,7 +6,16 @@ SOC_FAMILY = "rpi"
include conf/machine/include/soc-family.inc
IMAGE_FSTYPES ?= "tar.bz2 ext3 rpi-sdimg"
-WKS_FILE ?= "sdimage-raspberrypi.wks"
+
+# Set size of /root partition, such as 4G
+# PI_WKS_ROOT_SIZE ?= "--size=4096M --overhead-factor 1"
+PI_WKS_ROOT_SIZE ?= ""
+
+# Add extra partition, such as 1G size /swap
+# PI_WKS_EXTRA_PARTTION = "part swap --ondisk mmcblk0 --size 44 --label swap --fstype=swap --size=1024M --overhead-factor 1"
+PI_WKS_EXTRA_PARTTION ?= ""
+
+WKS_FILE ?= "sdimage-raspberrypi.wks.in"
XSERVER = " \
xserver-xorg \
diff --git a/wic/sdimage-raspberrypi.wks b/wic/sdimage-raspberrypi.wks.in
similarity index 85%
rename from wic/sdimage-raspberrypi.wks
rename to wic/sdimage-raspberrypi.wks.in
index 01fbaea..743d757 100644
--- a/wic/sdimage-raspberrypi.wks
+++ b/wic/sdimage-raspberrypi.wks.in
@@ -3,4 +3,5 @@
# Raspberry Pi. Boot files are located in the first vfat partition.
part /boot --source bootimg-partition --ondisk mmcblk0 --fstype=vfat --label boot --active --align 4096 --size 20
-part / --source rootfs --ondisk mmcblk0 --fstype=ext4 --label root --align 4096
+part / --source rootfs --ondisk mmcblk0 --fstype=ext4 --label root --align 4096 ${PI_WKS_ROOT_SIZE}
+${PI_WKS_EXTRA_PARTTION}
--
2.17.1
^ permalink raw reply related [flat|nested] 9+ messages in thread
* [meta-raspberrypi][PATCH V3] wic: support to set /root size and add extra partition
2019-11-14 6:30 ` Khem Raj
2019-11-14 7:12 ` Hongxu Jia
2019-11-14 7:30 ` [meta-raspberrypi][PATCH V2] wic: support to set /root size and add extra partition Hongxu Jia
@ 2019-11-14 7:33 ` Hongxu Jia
2019-11-14 12:40 ` Paul Barker
2 siblings, 1 reply; 9+ messages in thread
From: Hongxu Jia @ 2019-11-14 7:33 UTC (permalink / raw)
To: yocto, raj.khem, pjtexier
- Support to add extra partition, such as add swap partition
to workaround memory limitation
- Support to set /root size
Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
---
conf/machine/include/rpi-base.inc | 11 ++++++++++-
...age-raspberrypi.wks => sdimage-raspberrypi.wks.in} | 3 ++-
2 files changed, 12 insertions(+), 2 deletions(-)
rename wic/{sdimage-raspberrypi.wks => sdimage-raspberrypi.wks.in} (85%)
diff --git a/conf/machine/include/rpi-base.inc b/conf/machine/include/rpi-base.inc
index af1418d..c4dffd3 100644
--- a/conf/machine/include/rpi-base.inc
+++ b/conf/machine/include/rpi-base.inc
@@ -6,7 +6,16 @@ SOC_FAMILY = "rpi"
include conf/machine/include/soc-family.inc
IMAGE_FSTYPES ?= "tar.bz2 ext3 rpi-sdimg"
-WKS_FILE ?= "sdimage-raspberrypi.wks"
+
+# Set size of /root partition, such as 4G
+# PI_WKS_ROOT_SIZE ?= "--size=4096M --overhead-factor 1"
+PI_WKS_ROOT_SIZE ?= ""
+
+# Add extra partition, such as 1G size /swap
+# PI_WKS_EXTRA_PARTTION = "part swap --ondisk mmcblk0 --label swap --fstype=swap --size=1024M --overhead-factor 1"
+PI_WKS_EXTRA_PARTTION ?= ""
+
+WKS_FILE ?= "sdimage-raspberrypi.wks.in"
XSERVER = " \
xserver-xorg \
diff --git a/wic/sdimage-raspberrypi.wks b/wic/sdimage-raspberrypi.wks.in
similarity index 85%
rename from wic/sdimage-raspberrypi.wks
rename to wic/sdimage-raspberrypi.wks.in
index 01fbaea..743d757 100644
--- a/wic/sdimage-raspberrypi.wks
+++ b/wic/sdimage-raspberrypi.wks.in
@@ -3,4 +3,5 @@
# Raspberry Pi. Boot files are located in the first vfat partition.
part /boot --source bootimg-partition --ondisk mmcblk0 --fstype=vfat --label boot --active --align 4096 --size 20
-part / --source rootfs --ondisk mmcblk0 --fstype=ext4 --label root --align 4096
+part / --source rootfs --ondisk mmcblk0 --fstype=ext4 --label root --align 4096 ${PI_WKS_ROOT_SIZE}
+${PI_WKS_EXTRA_PARTTION}
--
2.17.1
^ permalink raw reply related [flat|nested] 9+ messages in thread
* Re: [meta-raspberrypi][PATCH] wic: add swap partition and set /root and /swap size
2019-11-14 6:04 [meta-raspberrypi][PATCH] wic: add swap partition and set /root and /swap size Hongxu Jia
2019-11-14 6:30 ` Khem Raj
@ 2019-11-14 11:11 ` Paul Barker
2019-11-15 17:34 ` Andrei Gherzan
1 sibling, 1 reply; 9+ messages in thread
From: Paul Barker @ 2019-11-14 11:11 UTC (permalink / raw)
To: Hongxu Jia, Yocto discussion list, pjtexier
On Thu, 14 Nov 2019, at 06:04, Hongxu Jia wrote:
> - Add swap partition to workaround memory limitation
>
> - Support to set /root and /swap size, 4G /root and 1G /swap by default
>
> Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
These settings feel distro-specific to me. They're not required for how many of us use the Raspberry Pi so it's best not to force them on everyone.
Thanks,
--
Paul Barker
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [meta-raspberrypi][PATCH V3] wic: support to set /root size and add extra partition
2019-11-14 7:33 ` [meta-raspberrypi][PATCH V3] " Hongxu Jia
@ 2019-11-14 12:40 ` Paul Barker
2019-11-14 13:16 ` Hongxu Jia
0 siblings, 1 reply; 9+ messages in thread
From: Paul Barker @ 2019-11-14 12:40 UTC (permalink / raw)
To: Yocto discussion list
On Thu, 14 Nov 2019, at 07:33, Hongxu Jia wrote:
> - Support to add extra partition, such as add swap partition
> to workaround memory limitation
>
> - Support to set /root size
>
> Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
If you want to make changes like this in a distro or local configuration, I think it'd be easier to add a new .wks file and override WKS_FILE.
FYI, for meta-raspberrypi we usually take patches through GitHub pull requests at https://github.com/agherzan/meta-raspberrypi/pulls.
--
Paul Barker
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [meta-raspberrypi][PATCH V3] wic: support to set /root size and add extra partition
2019-11-14 12:40 ` Paul Barker
@ 2019-11-14 13:16 ` Hongxu Jia
0 siblings, 0 replies; 9+ messages in thread
From: Hongxu Jia @ 2019-11-14 13:16 UTC (permalink / raw)
To: Paul Barker, Yocto discussion list
On 11/14/19 8:40 PM, Paul Barker wrote:
> On Thu, 14 Nov 2019, at 07:33, Hongxu Jia wrote:
>> - Support to add extra partition, such as add swap partition
>> to workaround memory limitation
>>
>> - Support to set /root size
>>
>> Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
> If you want to make changes like this in a distro or local configuration, I think it'd be easier to add a new .wks file and override WKS_FILE.
>
> FYI, for meta-raspberrypi we usually take patches through GitHub pull requests at https://github.com/agherzan/meta-raspberrypi/pulls.
>
OK, I will do it on our own
//Hongxu
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [meta-raspberrypi][PATCH] wic: add swap partition and set /root and /swap size
2019-11-14 11:11 ` [meta-raspberrypi][PATCH] wic: add swap partition and set /root and /swap size Paul Barker
@ 2019-11-15 17:34 ` Andrei Gherzan
0 siblings, 0 replies; 9+ messages in thread
From: Andrei Gherzan @ 2019-11-15 17:34 UTC (permalink / raw)
To: Paul Barker, Hongxu Jia, Yocto discussion list, pjtexier
Hi,
On 14/11/2019 11:11, Paul Barker wrote:
> On Thu, 14 Nov 2019, at 06:04, Hongxu Jia wrote:
>> - Add swap partition to workaround memory limitation
>>
>> - Support to set /root and /swap size, 4G /root and 1G /swap by default
>>
>> Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
>
> These settings feel distro-specific to me. They're not required for how many of us use the Raspberry Pi so it's best not to force them on everyone.
I tend to agree with Paul. The final SD card configuration is generally
a per project decision (more or less). The BSP provides a bootable
reference and from there sky is the limit.
--
Andrei Gherzan
^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2019-11-15 17:34 UTC | newest]
Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-11-14 6:04 [meta-raspberrypi][PATCH] wic: add swap partition and set /root and /swap size Hongxu Jia
2019-11-14 6:30 ` Khem Raj
2019-11-14 7:12 ` Hongxu Jia
2019-11-14 7:30 ` [meta-raspberrypi][PATCH V2] wic: support to set /root size and add extra partition Hongxu Jia
2019-11-14 7:33 ` [meta-raspberrypi][PATCH V3] " Hongxu Jia
2019-11-14 12:40 ` Paul Barker
2019-11-14 13:16 ` Hongxu Jia
2019-11-14 11:11 ` [meta-raspberrypi][PATCH] wic: add swap partition and set /root and /swap size Paul Barker
2019-11-15 17:34 ` Andrei Gherzan
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.