* [DistroKit] [PATCH 2/5] v7a: images: remove redundant size specifications
2021-04-26 6:05 [DistroKit] [PATCH 1/5] v7a: image-vexpress: convert hex numbers to human-readable sizes Roland Hieber
@ 2021-04-26 6:05 ` Roland Hieber
2021-04-26 6:35 ` Robert Schwebel
2021-04-26 6:05 ` [DistroKit] [PATCH 3/5] v7a: barebox: clean up defaultenvs Roland Hieber
` (3 subsequent siblings)
4 siblings, 1 reply; 16+ messages in thread
From: Roland Hieber @ 2021-04-26 6:05 UTC (permalink / raw)
To: distrokit; +Cc: Roland Hieber
For partitions that are filled by another image, it does not make sense
to make partitions larger or smaller than their containing file system.
In those cases, genimage can already determine the partition sizes from
the referenced images, and calculates the partition offsets accordingly,
so in most cases we don't have to keep track of the sizes at all.
(A special case is vexpress.hdimg, which needs to have an empty block at
the end as a workaround for qemu, in which case it is clearer to have
all partition sizes and offsets explicitely in the config file. So don't
touch vexpress.hdimg here.)
Signed-off-by: Roland Hieber <rhi@pengutronix.de>
---
configs/platform-v7a/config/images/at91-sd.config | 2 --
configs/platform-v7a/config/images/beaglebone.config | 2 --
configs/platform-v7a/config/images/gf.config | 2 --
configs/platform-v7a/config/images/riotboard.config | 1 -
configs/platform-v7a/config/images/rpi2.config | 2 --
configs/platform-v7a/config/images/rpi3.config | 2 --
configs/platform-v7a/config/images/rpicm3.config | 2 --
configs/platform-v7a/config/images/sabrelite.config | 1 -
configs/platform-v7a/config/images/stm32mp.config | 1 -
configs/platform-v7a/config/images/udoo-neo.config | 1 -
10 files changed, 16 deletions(-)
diff --git a/configs/platform-v7a/config/images/at91-sd.config b/configs/platform-v7a/config/images/at91-sd.config
index 6108a20b601d..641db071224f 100644
--- a/configs/platform-v7a/config/images/at91-sd.config
+++ b/configs/platform-v7a/config/images/at91-sd.config
@@ -13,14 +13,12 @@ image @IMAGE@ {
}
partition boot {
image = @IMAGE@-boot.vfat
- size = 3M
partition-type = 0xc
bootable = true
}
partition root-A {
image = root.ext2
partition-type = 0x83
- size = 512M
}
partition data {
partition-type = 0x83
diff --git a/configs/platform-v7a/config/images/beaglebone.config b/configs/platform-v7a/config/images/beaglebone.config
index d3e85f2064ff..7b1c41dfc320 100644
--- a/configs/platform-v7a/config/images/beaglebone.config
+++ b/configs/platform-v7a/config/images/beaglebone.config
@@ -13,14 +13,12 @@ image @IMAGE@ {
}
partition boot {
image = beaglebone-boot.vfat
- size = 32M
partition-type = 0xc
bootable = true
}
partition root-A {
image = root.ext2
partition-type = 0x83
- size = 512M
}
partition data {
partition-type = 0x83
diff --git a/configs/platform-v7a/config/images/gf.config b/configs/platform-v7a/config/images/gf.config
index 0b46c215b472..fbaddf15f527 100644
--- a/configs/platform-v7a/config/images/gf.config
+++ b/configs/platform-v7a/config/images/gf.config
@@ -13,14 +13,12 @@ image @IMAGE@ {
}
partition boot {
image = gf-boot.vfat
- size = 32M
partition-type = 0xc
bootable = true
}
partition root-A {
image = root.ext2
partition-type = 0x83
- size = 512M
}
partition data {
partition-type = 0x83
diff --git a/configs/platform-v7a/config/images/riotboard.config b/configs/platform-v7a/config/images/riotboard.config
index fff1f6081aba..9558af38583a 100644
--- a/configs/platform-v7a/config/images/riotboard.config
+++ b/configs/platform-v7a/config/images/riotboard.config
@@ -13,7 +13,6 @@ image @IMAGE@ {
partition root-A {
image = root.ext2
partition-type = 0x83
- size = 512M
}
partition data {
partition-type = 0x83
diff --git a/configs/platform-v7a/config/images/rpi2.config b/configs/platform-v7a/config/images/rpi2.config
index 3e45e1af5e54..f8da7d412e87 100644
--- a/configs/platform-v7a/config/images/rpi2.config
+++ b/configs/platform-v7a/config/images/rpi2.config
@@ -13,14 +13,12 @@ image @IMAGE@ {
}
partition boot {
image = rpi2-boot.vfat
- size = 32M
partition-type = 0xc
bootable = true
}
partition root-A {
image = root.ext2
partition-type = 0x83
- size = 512M
}
partition data {
partition-type = 0x83
diff --git a/configs/platform-v7a/config/images/rpi3.config b/configs/platform-v7a/config/images/rpi3.config
index 7bd1dae8dc46..f87a72743b4d 100644
--- a/configs/platform-v7a/config/images/rpi3.config
+++ b/configs/platform-v7a/config/images/rpi3.config
@@ -13,14 +13,12 @@ image @IMAGE@ {
}
partition boot {
image = rpi3-boot.vfat
- size = 32M
partition-type = 0xc
bootable = true
}
partition root-A {
image = root.ext2
partition-type = 0x83
- size = 512M
}
partition data {
partition-type = 0x83
diff --git a/configs/platform-v7a/config/images/rpicm3.config b/configs/platform-v7a/config/images/rpicm3.config
index 4c10ac4917ca..d0c4c5959e3b 100644
--- a/configs/platform-v7a/config/images/rpicm3.config
+++ b/configs/platform-v7a/config/images/rpicm3.config
@@ -13,14 +13,12 @@ image @IMAGE@ {
}
partition boot {
image = rpicm3-boot.vfat
- size = 32M
partition-type = 0xc
bootable = true
}
partition root-A {
image = root.ext2
partition-type = 0x83
- size = 512M
}
partition data {
partition-type = 0x83
diff --git a/configs/platform-v7a/config/images/sabrelite.config b/configs/platform-v7a/config/images/sabrelite.config
index df979d6fa22c..6fe4da7d9113 100644
--- a/configs/platform-v7a/config/images/sabrelite.config
+++ b/configs/platform-v7a/config/images/sabrelite.config
@@ -13,7 +13,6 @@ image @IMAGE@ {
partition root-A {
image = root.ext2
partition-type = 0x83
- size = 512M
}
partition data {
partition-type = 0x83
diff --git a/configs/platform-v7a/config/images/stm32mp.config b/configs/platform-v7a/config/images/stm32mp.config
index cbf965812626..eb6065c64c1a 100644
--- a/configs/platform-v7a/config/images/stm32mp.config
+++ b/configs/platform-v7a/config/images/stm32mp.config
@@ -21,7 +21,6 @@ image @IMAGE@ {
}
partition root {
image = root.ext2
- size = 512M
}
partition data {
size = 100M
diff --git a/configs/platform-v7a/config/images/udoo-neo.config b/configs/platform-v7a/config/images/udoo-neo.config
index de5aae9be331..6a3a8eb1eb69 100644
--- a/configs/platform-v7a/config/images/udoo-neo.config
+++ b/configs/platform-v7a/config/images/udoo-neo.config
@@ -13,7 +13,6 @@ image @IMAGE@ {
partition root-A {
image = root.ext2
partition-type = 0x83
- size = 512M
}
partition data {
partition-type = 0x83
--
2.29.2
_______________________________________________
DistroKit mailing list
DistroKit@pengutronix.de
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [DistroKit] [PATCH 2/5] v7a: images: remove redundant size specifications
2021-04-26 6:05 ` [DistroKit] [PATCH 2/5] v7a: images: remove redundant size specifications Roland Hieber
@ 2021-04-26 6:35 ` Robert Schwebel
0 siblings, 0 replies; 16+ messages in thread
From: Robert Schwebel @ 2021-04-26 6:35 UTC (permalink / raw)
To: Roland Hieber; +Cc: distrokit
On Mon, Apr 26, 2021 at 08:05:23AM +0200, Roland Hieber wrote:
> For partitions that are filled by another image, it does not make sense
> to make partitions larger or smaller than their containing file system.
> In those cases, genimage can already determine the partition sizes from
> the referenced images, and calculates the partition offsets accordingly,
> so in most cases we don't have to keep track of the sizes at all.
>
> (A special case is vexpress.hdimg, which needs to have an empty block at
> the end as a workaround for qemu, in which case it is clearer to have
> all partition sizes and offsets explicitely in the config file. So don't
> touch vexpress.hdimg here.)
>
> Signed-off-by: Roland Hieber <rhi@pengutronix.de>
> ---
> configs/platform-v7a/config/images/at91-sd.config | 2 --
> configs/platform-v7a/config/images/beaglebone.config | 2 --
> configs/platform-v7a/config/images/gf.config | 2 --
> configs/platform-v7a/config/images/riotboard.config | 1 -
> configs/platform-v7a/config/images/rpi2.config | 2 --
> configs/platform-v7a/config/images/rpi3.config | 2 --
> configs/platform-v7a/config/images/rpicm3.config | 2 --
> configs/platform-v7a/config/images/sabrelite.config | 1 -
> configs/platform-v7a/config/images/stm32mp.config | 1 -
> configs/platform-v7a/config/images/udoo-neo.config | 1 -
> 10 files changed, 16 deletions(-)
Applied to next.
rsc
--
Pengutronix e.K. | Dipl.-Ing. Robert Schwebel |
Steuerwalder Str. 21 | https://www.pengutronix.de/ |
31137 Hildesheim, Germany | Phone: +49-5121-206917-0 |
Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-9 |
_______________________________________________
DistroKit mailing list
DistroKit@pengutronix.de
^ permalink raw reply [flat|nested] 16+ messages in thread
* [DistroKit] [PATCH 3/5] v7a: barebox: clean up defaultenvs
2021-04-26 6:05 [DistroKit] [PATCH 1/5] v7a: image-vexpress: convert hex numbers to human-readable sizes Roland Hieber
2021-04-26 6:05 ` [DistroKit] [PATCH 2/5] v7a: images: remove redundant size specifications Roland Hieber
@ 2021-04-26 6:05 ` Roland Hieber
2021-04-26 6:36 ` Robert Schwebel
2021-04-26 6:05 ` [DistroKit] [PATCH 4/5] v7a: run: remove telnet port forwarding Roland Hieber
` (2 subsequent siblings)
4 siblings, 1 reply; 16+ messages in thread
From: Roland Hieber @ 2021-04-26 6:05 UTC (permalink / raw)
To: distrokit; +Cc: Roland Hieber
* The 9p bootsource is only available for qemu-vexpress
* The bootstate entries were never evaluated because the system0 and
system1 partitions were never set up on any boards
Remove all unneeded variables to keep the defaultenvs lean.
Fixes: ef189b9c3e0c9e3fed89 (2017-07-03, "platform-v7a: rpi2: create own rpi2 barebox defaultenv")
Fixes: 785275ccb99d60da8abb (2017-07-03, "platform-v72: mx6: create own mx6 barebox defaultenv")
Fixes: 26f5cf36862014ee9975 (2017-07-03, "platform-v7a: am335x: create own barebox defaultenv")
Signed-off-by: Roland Hieber <rhi@pengutronix.de>
---
configs/platform-v7a/barebox-am335x-defaultenv/boot/9p | 10 ----------
configs/platform-v7a/barebox-mx6-defaultenv/boot/9p | 10 ----------
configs/platform-v7a/barebox-rpi2-defaultenv/boot/9p | 10 ----------
.../nv/bootstate.system0.priority | 1 -
.../nv/bootstate.system1.priority | 1 -
5 files changed, 32 deletions(-)
delete mode 100644 configs/platform-v7a/barebox-am335x-defaultenv/boot/9p
delete mode 100644 configs/platform-v7a/barebox-mx6-defaultenv/boot/9p
delete mode 100644 configs/platform-v7a/barebox-rpi2-defaultenv/boot/9p
delete mode 100644 configs/platform-v7a/barebox-rpi2-defaultenv/nv/bootstate.system0.priority
delete mode 100644 configs/platform-v7a/barebox-rpi2-defaultenv/nv/bootstate.system1.priority
diff --git a/configs/platform-v7a/barebox-am335x-defaultenv/boot/9p b/configs/platform-v7a/barebox-am335x-defaultenv/boot/9p
deleted file mode 100644
index 264ffeca3e69..000000000000
--- a/configs/platform-v7a/barebox-am335x-defaultenv/boot/9p
+++ /dev/null
@@ -1,10 +0,0 @@
-#!/bin/sh
-
-addpart /dev/nor0 "8M@32M(kernel)"
-addpart /dev/nor0 "512k@40M(dtb)"
-global.bootm.image="/dev/nor0.kernel"
-global.bootm.oftree="/dev/nor0.dtb"
-
-global linux.bootargs.base="console=ttyAMA0,115200 loglevel=5 ptxdist-devel"
-
-global linux.bootargs.root="root=/dev/root rootfstype=9p rootflags=trans=virtio"
\ No newline at end of file
diff --git a/configs/platform-v7a/barebox-mx6-defaultenv/boot/9p b/configs/platform-v7a/barebox-mx6-defaultenv/boot/9p
deleted file mode 100644
index 264ffeca3e69..000000000000
--- a/configs/platform-v7a/barebox-mx6-defaultenv/boot/9p
+++ /dev/null
@@ -1,10 +0,0 @@
-#!/bin/sh
-
-addpart /dev/nor0 "8M@32M(kernel)"
-addpart /dev/nor0 "512k@40M(dtb)"
-global.bootm.image="/dev/nor0.kernel"
-global.bootm.oftree="/dev/nor0.dtb"
-
-global linux.bootargs.base="console=ttyAMA0,115200 loglevel=5 ptxdist-devel"
-
-global linux.bootargs.root="root=/dev/root rootfstype=9p rootflags=trans=virtio"
\ No newline at end of file
diff --git a/configs/platform-v7a/barebox-rpi2-defaultenv/boot/9p b/configs/platform-v7a/barebox-rpi2-defaultenv/boot/9p
deleted file mode 100644
index 264ffeca3e69..000000000000
--- a/configs/platform-v7a/barebox-rpi2-defaultenv/boot/9p
+++ /dev/null
@@ -1,10 +0,0 @@
-#!/bin/sh
-
-addpart /dev/nor0 "8M@32M(kernel)"
-addpart /dev/nor0 "512k@40M(dtb)"
-global.bootm.image="/dev/nor0.kernel"
-global.bootm.oftree="/dev/nor0.dtb"
-
-global linux.bootargs.base="console=ttyAMA0,115200 loglevel=5 ptxdist-devel"
-
-global linux.bootargs.root="root=/dev/root rootfstype=9p rootflags=trans=virtio"
\ No newline at end of file
diff --git a/configs/platform-v7a/barebox-rpi2-defaultenv/nv/bootstate.system0.priority b/configs/platform-v7a/barebox-rpi2-defaultenv/nv/bootstate.system0.priority
deleted file mode 100644
index f599e28b8ab0..000000000000
--- a/configs/platform-v7a/barebox-rpi2-defaultenv/nv/bootstate.system0.priority
+++ /dev/null
@@ -1 +0,0 @@
-10
diff --git a/configs/platform-v7a/barebox-rpi2-defaultenv/nv/bootstate.system1.priority b/configs/platform-v7a/barebox-rpi2-defaultenv/nv/bootstate.system1.priority
deleted file mode 100644
index 209e3ef4b624..000000000000
--- a/configs/platform-v7a/barebox-rpi2-defaultenv/nv/bootstate.system1.priority
+++ /dev/null
@@ -1 +0,0 @@
-20
--
2.29.2
_______________________________________________
DistroKit mailing list
DistroKit@pengutronix.de
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [DistroKit] [PATCH 3/5] v7a: barebox: clean up defaultenvs
2021-04-26 6:05 ` [DistroKit] [PATCH 3/5] v7a: barebox: clean up defaultenvs Roland Hieber
@ 2021-04-26 6:36 ` Robert Schwebel
0 siblings, 0 replies; 16+ messages in thread
From: Robert Schwebel @ 2021-04-26 6:36 UTC (permalink / raw)
To: Roland Hieber; +Cc: distrokit
On Mon, Apr 26, 2021 at 08:05:24AM +0200, Roland Hieber wrote:
> * The 9p bootsource is only available for qemu-vexpress
> * The bootstate entries were never evaluated because the system0 and
> system1 partitions were never set up on any boards
>
> Remove all unneeded variables to keep the defaultenvs lean.
>
> Fixes: ef189b9c3e0c9e3fed89 (2017-07-03, "platform-v7a: rpi2: create own rpi2 barebox defaultenv")
> Fixes: 785275ccb99d60da8abb (2017-07-03, "platform-v72: mx6: create own mx6 barebox defaultenv")
> Fixes: 26f5cf36862014ee9975 (2017-07-03, "platform-v7a: am335x: create own barebox defaultenv")
> Signed-off-by: Roland Hieber <rhi@pengutronix.de>
> ---
> configs/platform-v7a/barebox-am335x-defaultenv/boot/9p | 10 ----------
> configs/platform-v7a/barebox-mx6-defaultenv/boot/9p | 10 ----------
> configs/platform-v7a/barebox-rpi2-defaultenv/boot/9p | 10 ----------
> .../nv/bootstate.system0.priority | 1 -
> .../nv/bootstate.system1.priority | 1 -
> 5 files changed, 32 deletions(-)
> delete mode 100644 configs/platform-v7a/barebox-am335x-defaultenv/boot/9p
> delete mode 100644 configs/platform-v7a/barebox-mx6-defaultenv/boot/9p
> delete mode 100644 configs/platform-v7a/barebox-rpi2-defaultenv/boot/9p
> delete mode 100644 configs/platform-v7a/barebox-rpi2-defaultenv/nv/bootstate.system0.priority
> delete mode 100644 configs/platform-v7a/barebox-rpi2-defaultenv/nv/bootstate.system1.priority
Applied to next.
rsc
--
Pengutronix e.K. | Dipl.-Ing. Robert Schwebel |
Steuerwalder Str. 21 | https://www.pengutronix.de/ |
31137 Hildesheim, Germany | Phone: +49-5121-206917-0 |
Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-9 |
_______________________________________________
DistroKit mailing list
DistroKit@pengutronix.de
^ permalink raw reply [flat|nested] 16+ messages in thread
* [DistroKit] [PATCH 4/5] v7a: run: remove telnet port forwarding
2021-04-26 6:05 [DistroKit] [PATCH 1/5] v7a: image-vexpress: convert hex numbers to human-readable sizes Roland Hieber
2021-04-26 6:05 ` [DistroKit] [PATCH 2/5] v7a: images: remove redundant size specifications Roland Hieber
2021-04-26 6:05 ` [DistroKit] [PATCH 3/5] v7a: barebox: clean up defaultenvs Roland Hieber
@ 2021-04-26 6:05 ` Roland Hieber
2021-04-26 6:36 ` Robert Schwebel
2021-04-26 6:05 ` [DistroKit] [PATCH 5/5] v7a: run: randomise the SSH forwarding port Roland Hieber
2021-04-26 6:35 ` [DistroKit] [PATCH 1/5] v7a: image-vexpress: convert hex numbers to human-readable sizes Robert Schwebel
4 siblings, 1 reply; 16+ messages in thread
From: Roland Hieber @ 2021-04-26 6:05 UTC (permalink / raw)
To: distrokit; +Cc: Roland Hieber
Hopefully nobody uses telnet anymore these days. Our userland certainly
doesn't. Remove the outdated qemu port forwarding.
Signed-off-by: Roland Hieber <rhi@pengutronix.de>
---
configs/platform-v7a/run | 10 +++-------
1 file changed, 3 insertions(+), 7 deletions(-)
diff --git a/configs/platform-v7a/run b/configs/platform-v7a/run
index 1dc4fd645d88..d180ccfa890d 100755
--- a/configs/platform-v7a/run
+++ b/configs/platform-v7a/run
@@ -36,13 +36,9 @@ if [ ! -e "${QEMU_EXEC}" ]; then
exit 1
fi
-# the port a 'telned' would connect to (in the emulated sysem)
-TELNET_INTERNAL_PORT=23
-# port QEMU opens at the host side to give access to the ${TELNET_INTERNAL_PORT}
-TELNET_EXTERNAL_PORT=4444
-
-# dito for ssh
+# the port to which an sshd would connect (in the emulated sysem)
SSH_INTERNAL_PORT=22
+# the port which QEMU opens at the host side to give access to the ${SSH_INTERNAL_PORT}
SSH_EXTERNAL_PORT=4445
# check if vde is available for networking
@@ -62,7 +58,7 @@ fi
# fall back to user network if necessary
if [ -z "${QEMU_NET}" ]; then
- QEMU_NET=(-netdev user,id=net1,hostfwd=tcp:127.0.0.1:${TELNET_EXTERNAL_PORT}-:${TELNET_INTERNAL_PORT},hostfwd=tcp:127.0.0.1:${SSH_EXTERNAL_PORT}-:${SSH_INTERNAL_PORT} )
+ QEMU_NET=(-netdev user,id=net1,hostfwd=tcp:127.0.0.1:${SSH_EXTERNAL_PORT}-:${SSH_INTERNAL_PORT} )
fi
BASE_CMDLINE="console=ttyAMA0,115200 loglevel=5 systemd.log_level=warning systemd.show_status=auto"
--
2.29.2
_______________________________________________
DistroKit mailing list
DistroKit@pengutronix.de
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [DistroKit] [PATCH 4/5] v7a: run: remove telnet port forwarding
2021-04-26 6:05 ` [DistroKit] [PATCH 4/5] v7a: run: remove telnet port forwarding Roland Hieber
@ 2021-04-26 6:36 ` Robert Schwebel
0 siblings, 0 replies; 16+ messages in thread
From: Robert Schwebel @ 2021-04-26 6:36 UTC (permalink / raw)
To: Roland Hieber; +Cc: distrokit
On Mon, Apr 26, 2021 at 08:05:25AM +0200, Roland Hieber wrote:
> Hopefully nobody uses telnet anymore these days. Our userland certainly
> doesn't. Remove the outdated qemu port forwarding.
>
> Signed-off-by: Roland Hieber <rhi@pengutronix.de>
> ---
> configs/platform-v7a/run | 10 +++-------
> 1 file changed, 3 insertions(+), 7 deletions(-)
Applied to next.
rsc
--
Pengutronix e.K. | Dipl.-Ing. Robert Schwebel |
Steuerwalder Str. 21 | https://www.pengutronix.de/ |
31137 Hildesheim, Germany | Phone: +49-5121-206917-0 |
Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-9 |
_______________________________________________
DistroKit mailing list
DistroKit@pengutronix.de
^ permalink raw reply [flat|nested] 16+ messages in thread
* [DistroKit] [PATCH 5/5] v7a: run: randomise the SSH forwarding port
2021-04-26 6:05 [DistroKit] [PATCH 1/5] v7a: image-vexpress: convert hex numbers to human-readable sizes Roland Hieber
` (2 preceding siblings ...)
2021-04-26 6:05 ` [DistroKit] [PATCH 4/5] v7a: run: remove telnet port forwarding Roland Hieber
@ 2021-04-26 6:05 ` Roland Hieber
2021-04-26 6:33 ` Michael Olbrich
2021-04-26 10:07 ` [DistroKit] [PATCH v3] v7a: run: make the SSH forwarding port multiprocess-compatible Roland Hieber
2021-04-26 6:35 ` [DistroKit] [PATCH 1/5] v7a: image-vexpress: convert hex numbers to human-readable sizes Robert Schwebel
4 siblings, 2 replies; 16+ messages in thread
From: Roland Hieber @ 2021-04-26 6:05 UTC (permalink / raw)
To: distrokit; +Cc: Roland Hieber
When multiple ./configs/platform-v7a/run scripts are run at the same
time, the first qemu process will open port 4445, and following runs
will fail. To prevent that, first look at the environment variable
QEMU_SSH_PORT to determine the port to be used (so that users can set
this in their shell to keep the port static), or fall back to a random
port between 1025 and 65025, which should have a good chance of being
unused. Also print the port forwarding before starting qemu, so we don't
have to bother with "ps -Af|grep qemu".
Signed-off-by: Roland Hieber <rhi@pengutronix.de>
---
configs/platform-v7a/run | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/configs/platform-v7a/run b/configs/platform-v7a/run
index d180ccfa890d..cf529e968fb0 100755
--- a/configs/platform-v7a/run
+++ b/configs/platform-v7a/run
@@ -39,7 +39,7 @@ fi
# the port which an sshd would connect to (in the emulated sysem)
SSH_INTERNAL_PORT=22
# the port which QEMU opens at the host side to give access to the ${SSH_INTERNAL_PORT}
-SSH_EXTERNAL_PORT=4445
+SSH_EXTERNAL_PORT=${QEMU_SSH_PORT:-${RANDOM%64000+1025}}
# check if vde is available for networking
if [ -z "${VDE_SOCKET}" ]; then
@@ -59,6 +59,7 @@ fi
# fall back to user network if necessary
if [ -z "${QEMU_NET}" ]; then
QEMU_NET=(-netdev user,id=net1,hostfwd=tcp:127.0.0.1:${SSH_EXTERNAL_PORT}-:${SSH_INTERNAL_PORT} )
+ echo "Forwarding SSH port 127.0.0.1:${SSH_EXTERNAL_PORT} -> qemu:${SSH_INTERNAL_PORT}"
fi
BASE_CMDLINE="console=ttyAMA0,115200 loglevel=5 systemd.log_level=warning systemd.show_status=auto"
--
2.29.2
_______________________________________________
DistroKit mailing list
DistroKit@pengutronix.de
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [DistroKit] [PATCH 5/5] v7a: run: randomise the SSH forwarding port
2021-04-26 6:05 ` [DistroKit] [PATCH 5/5] v7a: run: randomise the SSH forwarding port Roland Hieber
@ 2021-04-26 6:33 ` Michael Olbrich
2021-04-26 8:30 ` Roland Hieber
2021-04-26 10:07 ` [DistroKit] [PATCH v3] v7a: run: make the SSH forwarding port multiprocess-compatible Roland Hieber
1 sibling, 1 reply; 16+ messages in thread
From: Michael Olbrich @ 2021-04-26 6:33 UTC (permalink / raw)
To: Roland Hieber; +Cc: distrokit
On Mon, Apr 26, 2021 at 08:05:26AM +0200, Roland Hieber wrote:
> When multiple ./configs/platform-v7a/run scripts are run at the same
> time, the first qemu process will open port 4445, and following runs
> will fail. To prevent that, first look at the environment variable
> QEMU_SSH_PORT to determine the port to be used (so that users can set
> this in their shell to keep the port static), or fall back to a random
> port between 1025 and 65025, which should have a good chance of being
> unused. Also print the port forwarding before starting qemu, so we don't
> have to bother with "ps -Af|grep qemu".
>
> Signed-off-by: Roland Hieber <rhi@pengutronix.de>
> ---
> configs/platform-v7a/run | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/configs/platform-v7a/run b/configs/platform-v7a/run
> index d180ccfa890d..cf529e968fb0 100755
> --- a/configs/platform-v7a/run
> +++ b/configs/platform-v7a/run
> @@ -39,7 +39,7 @@ fi
> # the port which an sshd would connect to (in the emulated sysem)
> SSH_INTERNAL_PORT=22
> # the port which QEMU opens at the host side to give access to the ${SSH_INTERNAL_PORT}
> -SSH_EXTERNAL_PORT=4445
> +SSH_EXTERNAL_PORT=${QEMU_SSH_PORT:-${RANDOM%64000+1025}}
This means I have to change the ssh command-line whenever I restart qemu.
Not nice. How about '${PPID%64000+1025}'?
Michael
>
> # check if vde is available for networking
> if [ -z "${VDE_SOCKET}" ]; then
> @@ -59,6 +59,7 @@ fi
> # fall back to user network if necessary
> if [ -z "${QEMU_NET}" ]; then
> QEMU_NET=(-netdev user,id=net1,hostfwd=tcp:127.0.0.1:${SSH_EXTERNAL_PORT}-:${SSH_INTERNAL_PORT} )
> + echo "Forwarding SSH port 127.0.0.1:${SSH_EXTERNAL_PORT} -> qemu:${SSH_INTERNAL_PORT}"
> fi
>
> BASE_CMDLINE="console=ttyAMA0,115200 loglevel=5 systemd.log_level=warning systemd.show_status=auto"
> --
> 2.29.2
>
>
> _______________________________________________
> DistroKit mailing list
> DistroKit@pengutronix.de
>
--
Pengutronix e.K. | |
Steuerwalder Str. 21 | http://www.pengutronix.de/ |
31137 Hildesheim, Germany | Phone: +49-5121-206917-0 |
Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |
_______________________________________________
DistroKit mailing list
DistroKit@pengutronix.de
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [DistroKit] [PATCH 5/5] v7a: run: randomise the SSH forwarding port
2021-04-26 6:33 ` Michael Olbrich
@ 2021-04-26 8:30 ` Roland Hieber
2021-04-26 8:35 ` [DistroKit] [PATCH v2] " Roland Hieber
0 siblings, 1 reply; 16+ messages in thread
From: Roland Hieber @ 2021-04-26 8:30 UTC (permalink / raw)
To: distrokit
On Mon, Apr 26, 2021 at 08:33:00AM +0200, Michael Olbrich wrote:
> On Mon, Apr 26, 2021 at 08:05:26AM +0200, Roland Hieber wrote:
> > When multiple ./configs/platform-v7a/run scripts are run at the same
> > time, the first qemu process will open port 4445, and following runs
> > will fail. To prevent that, first look at the environment variable
> > QEMU_SSH_PORT to determine the port to be used (so that users can set
> > this in their shell to keep the port static), or fall back to a random
> > port between 1025 and 65025, which should have a good chance of being
> > unused. Also print the port forwarding before starting qemu, so we don't
> > have to bother with "ps -Af|grep qemu".
> >
> > Signed-off-by: Roland Hieber <rhi@pengutronix.de>
> > ---
> > configs/platform-v7a/run | 3 ++-
> > 1 file changed, 2 insertions(+), 1 deletion(-)
> >
> > diff --git a/configs/platform-v7a/run b/configs/platform-v7a/run
> > index d180ccfa890d..cf529e968fb0 100755
> > --- a/configs/platform-v7a/run
> > +++ b/configs/platform-v7a/run
> > @@ -39,7 +39,7 @@ fi
> > # the port which an sshd would connect to (in the emulated sysem)
> > SSH_INTERNAL_PORT=22
> > # the port which QEMU opens at the host side to give access to the ${SSH_INTERNAL_PORT}
> > -SSH_EXTERNAL_PORT=4445
> > +SSH_EXTERNAL_PORT=${QEMU_SSH_PORT:-${RANDOM%64000+1025}}
>
> This means I have to change the ssh command-line whenever I restart qemu.
> Not nice. How about '${PPID%64000+1025}'?
QEMU_SSH_PORT was meant to take care of that, but PPID should work too.
- Roland
>
> Michael
>
> >
> > # check if vde is available for networking
> > if [ -z "${VDE_SOCKET}" ]; then
> > @@ -59,6 +59,7 @@ fi
> > # fall back to user network if necessary
> > if [ -z "${QEMU_NET}" ]; then
> > QEMU_NET=(-netdev user,id=net1,hostfwd=tcp:127.0.0.1:${SSH_EXTERNAL_PORT}-:${SSH_INTERNAL_PORT} )
> > + echo "Forwarding SSH port 127.0.0.1:${SSH_EXTERNAL_PORT} -> qemu:${SSH_INTERNAL_PORT}"
> > fi
> >
> > BASE_CMDLINE="console=ttyAMA0,115200 loglevel=5 systemd.log_level=warning systemd.show_status=auto"
> > --
> > 2.29.2
> >
> >
> > _______________________________________________
> > DistroKit mailing list
> > DistroKit@pengutronix.de
> >
>
> --
> Pengutronix e.K. | |
> Steuerwalder Str. 21 | http://www.pengutronix.de/ |
> 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 |
> Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |
>
> _______________________________________________
> DistroKit mailing list
> DistroKit@pengutronix.de
>
--
Roland Hieber, Pengutronix e.K. | r.hieber@pengutronix.de |
Steuerwalder Str. 21 | https://www.pengutronix.de/ |
31137 Hildesheim, Germany | Phone: +49-5121-206917-0 |
Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |
_______________________________________________
DistroKit mailing list
DistroKit@pengutronix.de
^ permalink raw reply [flat|nested] 16+ messages in thread
* [DistroKit] [PATCH v2] v7a: run: randomise the SSH forwarding port
2021-04-26 8:30 ` Roland Hieber
@ 2021-04-26 8:35 ` Roland Hieber
2021-04-26 9:02 ` Robert Schwebel
0 siblings, 1 reply; 16+ messages in thread
From: Roland Hieber @ 2021-04-26 8:35 UTC (permalink / raw)
To: distrokit; +Cc: Roland Hieber
When multiple ./configs/platform-v7a/run scripts are run at the same
time, the first qemu process will open port 4445, and following runs
will fail. To prevent that, first look at the environment variable
QEMU_SSH_PORT to determine the port to be used (so that users can set
this in their shell to keep the port static), or fall back to a port
between 1025 and 65025 using the shell's PID as a seed, which should
have a good chance of being unused. Also print the port forwarding
before starting qemu, so we don't have to bother with "ps -Af|grep
qemu".
Signed-off-by: Roland Hieber <rhi@pengutronix.de>
---
v2:
* use PPID instead of RANDOM to make the port reproducable in the same
shell session (Michael Olbrich)
---
configs/platform-v7a/run | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/configs/platform-v7a/run b/configs/platform-v7a/run
index d180ccfa890d..34c9aa017278 100755
--- a/configs/platform-v7a/run
+++ b/configs/platform-v7a/run
@@ -39,7 +39,7 @@ fi
# the port which an sshd would connect to (in the emulated sysem)
SSH_INTERNAL_PORT=22
# the port which QEMU opens at the host side to give access to the ${SSH_INTERNAL_PORT}
-SSH_EXTERNAL_PORT=4445
+SSH_EXTERNAL_PORT=${QEMU_SSH_PORT:-${PPID%64000+1025}}
# check if vde is available for networking
if [ -z "${VDE_SOCKET}" ]; then
@@ -59,6 +59,7 @@ fi
# fall back to user network if necessary
if [ -z "${QEMU_NET}" ]; then
QEMU_NET=(-netdev user,id=net1,hostfwd=tcp:127.0.0.1:${SSH_EXTERNAL_PORT}-:${SSH_INTERNAL_PORT} )
+ echo "Forwarding SSH port 127.0.0.1:${SSH_EXTERNAL_PORT} -> qemu:${SSH_INTERNAL_PORT}"
fi
BASE_CMDLINE="console=ttyAMA0,115200 loglevel=5 systemd.log_level=warning systemd.show_status=auto"
--
2.29.2
_______________________________________________
DistroKit mailing list
DistroKit@pengutronix.de
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [DistroKit] [PATCH v2] v7a: run: randomise the SSH forwarding port
2021-04-26 8:35 ` [DistroKit] [PATCH v2] " Roland Hieber
@ 2021-04-26 9:02 ` Robert Schwebel
2021-04-26 9:03 ` Robert Schwebel
0 siblings, 1 reply; 16+ messages in thread
From: Robert Schwebel @ 2021-04-26 9:02 UTC (permalink / raw)
To: Roland Hieber; +Cc: distrokit
On Mon, Apr 26, 2021 at 10:35:56AM +0200, Roland Hieber wrote:
> When multiple ./configs/platform-v7a/run scripts are run at the same
> time, the first qemu process will open port 4445, and following runs
> will fail. To prevent that, first look at the environment variable
> QEMU_SSH_PORT to determine the port to be used (so that users can set
> this in their shell to keep the port static), or fall back to a port
> between 1025 and 65025 using the shell's PID as a seed, which should
> have a good chance of being unused. Also print the port forwarding
> before starting qemu, so we don't have to bother with "ps -Af|grep
> qemu".
>
> Signed-off-by: Roland Hieber <rhi@pengutronix.de>
>
> ---
> v2:
> * use PPID instead of RANDOM to make the port reproducable in the same
> shell session (Michael Olbrich)
> ---
> configs/platform-v7a/run | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
Could you rebase the patch against next?
rsc
--
Pengutronix e.K. | Dipl.-Ing. Robert Schwebel |
Steuerwalder Str. 21 | https://www.pengutronix.de/ |
31137 Hildesheim, Germany | Phone: +49-5121-206917-0 |
Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-9 |
_______________________________________________
DistroKit mailing list
DistroKit@pengutronix.de
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [DistroKit] [PATCH v2] v7a: run: randomise the SSH forwarding port
2021-04-26 9:02 ` Robert Schwebel
@ 2021-04-26 9:03 ` Robert Schwebel
0 siblings, 0 replies; 16+ messages in thread
From: Robert Schwebel @ 2021-04-26 9:03 UTC (permalink / raw)
To: Roland Hieber; +Cc: distrokit
On Mon, Apr 26, 2021 at 11:02:16AM +0200, Robert Schwebel wrote:
> On Mon, Apr 26, 2021 at 10:35:56AM +0200, Roland Hieber wrote:
> > When multiple ./configs/platform-v7a/run scripts are run at the same
> > time, the first qemu process will open port 4445, and following runs
> > will fail. To prevent that, first look at the environment variable
> > QEMU_SSH_PORT to determine the port to be used (so that users can set
> > this in their shell to keep the port static), or fall back to a port
> > between 1025 and 65025 using the shell's PID as a seed, which should
> > have a good chance of being unused. Also print the port forwarding
> > before starting qemu, so we don't have to bother with "ps -Af|grep
> > qemu".
> >
> > Signed-off-by: Roland Hieber <rhi@pengutronix.de>
> >
> > ---
> > v2:
> > * use PPID instead of RANDOM to make the port reproducable in the same
> > shell session (Michael Olbrich)
> > ---
> > configs/platform-v7a/run | 3 ++-
> > 1 file changed, 2 insertions(+), 1 deletion(-)
>
> Could you rebase the patch against next?
The subject could need some care as well, as it isn't "randomize" any
more with the PPID change.
rsc
--
Pengutronix e.K. | Dipl.-Ing. Robert Schwebel |
Steuerwalder Str. 21 | https://www.pengutronix.de/ |
31137 Hildesheim, Germany | Phone: +49-5121-206917-0 |
Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-9 |
_______________________________________________
DistroKit mailing list
DistroKit@pengutronix.de
^ permalink raw reply [flat|nested] 16+ messages in thread
* [DistroKit] [PATCH v3] v7a: run: make the SSH forwarding port multiprocess-compatible
2021-04-26 6:05 ` [DistroKit] [PATCH 5/5] v7a: run: randomise the SSH forwarding port Roland Hieber
2021-04-26 6:33 ` Michael Olbrich
@ 2021-04-26 10:07 ` Roland Hieber
2021-04-26 10:09 ` Robert Schwebel
1 sibling, 1 reply; 16+ messages in thread
From: Roland Hieber @ 2021-04-26 10:07 UTC (permalink / raw)
To: distrokit; +Cc: Roland Hieber
When multiple ./configs/platform-v7a/run scripts are run at the same
time, the first qemu process will open port 4445, and following runs
will fail. To prevent that, first look at the environment variable
QEMU_SSH_PORT to determine the port to be used (so that users can set
this in their shell to keep the port constant), or fall back to a port
between 1025 and 65025 based on the shell's PID, which should have a
good chance of choosing an unused, but stable port.
Also print the port forwarding before starting qemu, so we don't have to
bother about grepping the process list.
Signed-off-by: Roland Hieber <rhi@pengutronix.de>
---
v3:
* rebase onto next
* adapt subject and log message (Robert Schwebel)
v2:
* use PPID instead of RANDOM to make the port reproducible in the same
shell session (Michael Olbrich)
---
configs/platform-v7a/run | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/configs/platform-v7a/run b/configs/platform-v7a/run
index ed8ab1ba47c3..8af190f11eb4 100755
--- a/configs/platform-v7a/run
+++ b/configs/platform-v7a/run
@@ -39,7 +39,7 @@ fi
# the port to which an sshd would connect (in the emulated sysem)
SSH_INTERNAL_PORT=22
# the port which QEMU opens at the host side to give access to the ${SSH_INTERNAL_PORT}
-SSH_EXTERNAL_PORT=4445
+SSH_EXTERNAL_PORT=${QEMU_SSH_PORT:-${PPID%64000+1025}}
# check if vde is available for networking
if [ -z "${VDE_SOCKET}" ]; then
@@ -59,6 +59,7 @@ fi
# fall back to user network if necessary
if [ -z "${QEMU_NET}" ]; then
QEMU_NET=(-netdev user,id=net1,hostfwd=tcp:127.0.0.1:${SSH_EXTERNAL_PORT}-:${SSH_INTERNAL_PORT} )
+ echo "Forwarding SSH port 127.0.0.1:${SSH_EXTERNAL_PORT} -> qemu:${SSH_INTERNAL_PORT}"
fi
BASE_CMDLINE="console=ttyAMA0,115200 loglevel=5 systemd.log_level=warning systemd.show_status=auto"
--
2.29.2
_______________________________________________
DistroKit mailing list
DistroKit@pengutronix.de
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [DistroKit] [PATCH v3] v7a: run: make the SSH forwarding port multiprocess-compatible
2021-04-26 10:07 ` [DistroKit] [PATCH v3] v7a: run: make the SSH forwarding port multiprocess-compatible Roland Hieber
@ 2021-04-26 10:09 ` Robert Schwebel
0 siblings, 0 replies; 16+ messages in thread
From: Robert Schwebel @ 2021-04-26 10:09 UTC (permalink / raw)
To: Roland Hieber; +Cc: distrokit
On Mon, Apr 26, 2021 at 12:07:15PM +0200, Roland Hieber wrote:
> When multiple ./configs/platform-v7a/run scripts are run at the same
> time, the first qemu process will open port 4445, and following runs
> will fail. To prevent that, first look at the environment variable
> QEMU_SSH_PORT to determine the port to be used (so that users can set
> this in their shell to keep the port constant), or fall back to a port
> between 1025 and 65025 based on the shell's PID, which should have a
> good chance of choosing an unused, but stable port.
>
> Also print the port forwarding before starting qemu, so we don't have to
> bother about grepping the process list.
>
> Signed-off-by: Roland Hieber <rhi@pengutronix.de>
>
> ---
> v3:
> * rebase onto next
> * adapt subject and log message (Robert Schwebel)
> v2:
> * use PPID instead of RANDOM to make the port reproducible in the same
> shell session (Michael Olbrich)
> ---
> configs/platform-v7a/run | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
Applied to next.
rsc
--
Pengutronix e.K. | Dipl.-Ing. Robert Schwebel |
Steuerwalder Str. 21 | https://www.pengutronix.de/ |
31137 Hildesheim, Germany | Phone: +49-5121-206917-0 |
Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-9 |
_______________________________________________
DistroKit mailing list
DistroKit@pengutronix.de
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [DistroKit] [PATCH 1/5] v7a: image-vexpress: convert hex numbers to human-readable sizes
2021-04-26 6:05 [DistroKit] [PATCH 1/5] v7a: image-vexpress: convert hex numbers to human-readable sizes Roland Hieber
` (3 preceding siblings ...)
2021-04-26 6:05 ` [DistroKit] [PATCH 5/5] v7a: run: randomise the SSH forwarding port Roland Hieber
@ 2021-04-26 6:35 ` Robert Schwebel
4 siblings, 0 replies; 16+ messages in thread
From: Robert Schwebel @ 2021-04-26 6:35 UTC (permalink / raw)
To: Roland Hieber; +Cc: distrokit
On Mon, Apr 26, 2021 at 08:05:22AM +0200, Roland Hieber wrote:
> genimage already supports human-readable syntax, which makes the config
> easier to understand.
>
> Signed-off-by: Roland Hieber <rhi@pengutronix.de>
> ---
> configs/platform-v7a/config/images/vexpress-nor.config | 6 +++---
> 1 file changed, 3 insertions(+), 3 deletions(-)
Applied to next.
rsc
--
Pengutronix e.K. | Dipl.-Ing. Robert Schwebel |
Steuerwalder Str. 21 | https://www.pengutronix.de/ |
31137 Hildesheim, Germany | Phone: +49-5121-206917-0 |
Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-9 |
_______________________________________________
DistroKit mailing list
DistroKit@pengutronix.de
^ permalink raw reply [flat|nested] 16+ messages in thread