All of lore.kernel.org
 help / color / mirror / Atom feed
* [tisdk-setup-scripts] [master] [PATCH-V4 0/4] create-sdcard: Fix rootfs tarball search and selection
@ 2021-07-29 12:50 Priya N S
  2021-07-29 12:50 ` [tisdk-setup-scripts] [master] [PATCH-V4 1/4] create-sdcard.sh: fix regex used for rootfs tarball Priya N S
                   ` (4 more replies)
  0 siblings, 5 replies; 7+ messages in thread
From: Priya N S @ 2021-07-29 12:50 UTC (permalink / raw)
  To: meta-arago; +Cc: Priya N S, Sekhar Nori

Hi All,

This series of patches fix the issues observed in the create-sdcard
script.

Changes in V4:
The patch #4 is new in the series. This patch increases the boot
partition size to 128 MB in order to sync with WIC image boot
partition size.

v3:
http://arago-project.org/pipermail/meta-arago/2021-July/013245.html
v2:
http://arago-project.org/pipermail/meta-arago/2021-June/013218.html
v1:
http://arago-project.org/pipermail/meta-arago/2021-June/013197.html


Priya N S (4):
  create-sdcard.sh: fix regex used for rootfs tarball
  create-sdcard: Fix wrong rootfs tarball selection
  create-sdcard.sh: Stop using cylinder as unit for partition size
  create-sdcard: Increase boot partition size to 128 MB

 create-sdcard.sh | 76 ++++++++++++++++++++++++++++++++++++------------
 1 file changed, 58 insertions(+), 18 deletions(-)

-- 
2.19.1.windows.1



^ permalink raw reply	[flat|nested] 7+ messages in thread

* [tisdk-setup-scripts] [master] [PATCH-V4 1/4] create-sdcard.sh: fix regex used for rootfs tarball
  2021-07-29 12:50 [tisdk-setup-scripts] [master] [PATCH-V4 0/4] create-sdcard: Fix rootfs tarball search and selection Priya N S
@ 2021-07-29 12:50 ` Priya N S
  2021-07-29 12:50 ` [tisdk-setup-scripts] [master] [PATCH-V4 2/4] create-sdcard: Fix wrong rootfs tarball selection Priya N S
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 7+ messages in thread
From: Priya N S @ 2021-07-29 12:50 UTC (permalink / raw)
  To: meta-arago; +Cc: Priya N S, Sekhar Nori

Filesystem tarballs present in SDK are in the format
tisdk-<IMAGE_TYPE>-image-<MACHINE>.tar.xz. This is different from
earlier format where 'rootfs' was present in all the filesystem
tarball names. Update regex used for filesystem tarball search to
use "image" as the keyword.

Signed-off-by: Priya N S <priya.ns@ti.com>
Signed-off-by: Sekhar Nori <nsekhar@ti.com>
---
 create-sdcard.sh | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/create-sdcard.sh b/create-sdcard.sh
index 736cd42..264095a 100644
--- a/create-sdcard.sh
+++ b/create-sdcard.sh
@@ -752,10 +752,9 @@ if [ $FILEPATHOPTION -eq 1 ] ; then
 	BOOTUENV=`ls $BOOTFILEPATH | grep uEnv.txt | awk {'print $1'}`
 	#rootfs
 	ROOTFILEPARTH="$PARSEPATH/filesystem"
-	#ROOTFSTAR=`ls  $ROOTFILEPARTH | grep tisdk.*rootfs | awk {'print $1'}`
 
 	#Make sure there is only 1 tar
-	CHECKNUMOFTAR=`ls $ROOTFILEPARTH | grep "tisdk.*rootfs" | grep 'tar.xz' | grep -n '' | grep '2:' | awk {'print $1'}`
+	CHECKNUMOFTAR=`ls $ROOTFILEPARTH | grep "tisdk.*image" | grep 'tar.xz' | grep -n '' | grep '2:' | awk {'print $1'}`
 	if [ -n "$CHECKNUMOFTAR" ]
 	then
 cat << EOM
@@ -767,15 +766,15 @@ cat << EOM
 ################################################################################
 
 EOM
-		ls --sort=size $ROOTFILEPARTH | grep "tisdk.*rootfs" | grep 'tar.xz' | grep -n '' | awk {'print "	" , $1'}
+		ls --sort=size $ROOTFILEPARTH | grep "tisdk.*image" | grep 'tar.xz' | grep -n '' | awk {'print "	" , $1'}
 		echo ""
 		read -p "Enter Number of rootfs Tarball: " TARNUMBER
 		echo " "
-		FOUNDTARFILENAME=`ls --sort=size $ROOTFILEPARTH | grep "rootfs" | grep 'tar.xz' | grep -n '' | grep "${TARNUMBER}:" | cut -c3- | awk {'print$1'}`
+		FOUNDTARFILENAME=`ls --sort=size $ROOTFILEPARTH | grep "image" | grep 'tar.xz' | grep -n '' | grep "${TARNUMBER}:" | cut -c3- | awk {'print$1'}`
 		ROOTFSTAR=$FOUNDTARFILENAME
 
 	else
-		ROOTFSTAR=`ls  $ROOTFILEPARTH | grep "tisdk.*rootfs" | grep 'tar.xz' | awk {'print $1'}`
+		ROOTFSTAR=`ls  $ROOTFILEPARTH | grep "tisdk.*image" | grep 'tar.xz' | awk {'print $1'}`
 	fi
 
 	ROOTFSUSERFILEPATH=$ROOTFILEPARTH/$ROOTFSTAR
-- 
2.19.1.windows.1



^ permalink raw reply	[flat|nested] 7+ messages in thread

* [tisdk-setup-scripts] [master] [PATCH-V4 2/4] create-sdcard: Fix wrong rootfs tarball selection
  2021-07-29 12:50 [tisdk-setup-scripts] [master] [PATCH-V4 0/4] create-sdcard: Fix rootfs tarball search and selection Priya N S
  2021-07-29 12:50 ` [tisdk-setup-scripts] [master] [PATCH-V4 1/4] create-sdcard.sh: fix regex used for rootfs tarball Priya N S
@ 2021-07-29 12:50 ` Priya N S
  2021-07-29 12:50 ` [tisdk-setup-scripts] [master] [PATCH-V4 3/4] create-sdcard.sh: Stop using cylinder as unit for partition size Priya N S
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 7+ messages in thread
From: Priya N S @ 2021-07-29 12:50 UTC (permalink / raw)
  To: meta-arago; +Cc: Priya N S, Sekhar Nori

* Validate user input of rootfs tarball selection.
* This will not allow the user to proceed with wrong rootfs
  tarball selection.

Signed-off-by: Priya N S <priya.ns@ti.com>
Signed-off-by: Sekhar Nori <nsekhar@ti.com>
---
 create-sdcard.sh | 17 +++++++++++++----
 1 file changed, 13 insertions(+), 4 deletions(-)

diff --git a/create-sdcard.sh b/create-sdcard.sh
index 264095a..d052312 100644
--- a/create-sdcard.sh
+++ b/create-sdcard.sh
@@ -766,10 +766,19 @@ cat << EOM
 ################################################################################
 
 EOM
-		ls --sort=size $ROOTFILEPARTH | grep "tisdk.*image" | grep 'tar.xz' | grep -n '' | awk {'print "	" , $1'}
-		echo ""
-		read -p "Enter Number of rootfs Tarball: " TARNUMBER
-		echo " "
+		COUNT=`ls $ROOTFILEPARTH | grep "tisdk.*image" | grep 'tar.xz' | grep -n '' | awk {'print $1'} | wc -l`
+		while :
+		do
+			ls --sort=size $ROOTFILEPARTH | grep "tisdk.*image" | grep 'tar.xz' | grep -n '' | awk {'print "	" , $1'}
+			read -p "Enter Number of rootfs Tarball: " TARNUMBER
+			echo
+			if [ -z "${TARNUMBER//[1-$COUNT]}" ] && [ -n "$TARNUMBER" ] ; then
+				break
+			else
+				echo "Invalid selection: '$TARNUMBER'. Please use values from 1 to $COUNT"
+			fi
+			echo
+		done
 		FOUNDTARFILENAME=`ls --sort=size $ROOTFILEPARTH | grep "image" | grep 'tar.xz' | grep -n '' | grep "${TARNUMBER}:" | cut -c3- | awk {'print$1'}`
 		ROOTFSTAR=$FOUNDTARFILENAME
 
-- 
2.19.1.windows.1



^ permalink raw reply	[flat|nested] 7+ messages in thread

* [tisdk-setup-scripts] [master] [PATCH-V4 3/4] create-sdcard.sh: Stop using cylinder as unit for partition size
  2021-07-29 12:50 [tisdk-setup-scripts] [master] [PATCH-V4 0/4] create-sdcard: Fix rootfs tarball search and selection Priya N S
  2021-07-29 12:50 ` [tisdk-setup-scripts] [master] [PATCH-V4 1/4] create-sdcard.sh: fix regex used for rootfs tarball Priya N S
  2021-07-29 12:50 ` [tisdk-setup-scripts] [master] [PATCH-V4 2/4] create-sdcard: Fix wrong rootfs tarball selection Priya N S
@ 2021-07-29 12:50 ` Priya N S
  2021-07-29 12:50 ` [tisdk-setup-scripts] [master] [PATCH-V4 4/4] create-sdcard: Increase boot partition size to 128 MB Priya N S
  2021-08-02 17:55 ` [EXTERNAL] [tisdk-setup-scripts] [master] [PATCH-V4 0/4] create-sdcard: Fix rootfs tarball search and selection Weaver, Lucas
  4 siblings, 0 replies; 7+ messages in thread
From: Priya N S @ 2021-07-29 12:50 UTC (permalink / raw)
  To: meta-arago; +Cc: Priya N S, Sekhar Nori

* Cylinder size of sdcard is manufacturer dependent. To standardize
  sdcard partitioning remove the use of cylinder (cyl) unit.
* While at it shift to using fdisk for the partitioning the sdcard.
  fdisk is already used in the script and this reduces the dependencies
  of this script on available installed applications.
* This fixes cases where already partitioned cards were being detected
  as not partitioned because of size check elsewhere in the script
  failing.

Signed-off-by: Priya N S <priya.ns@ti.com>
Signed-off-by: Sekhar Nori <nsekhar@ti.com>
---
 create-sdcard.sh | 50 +++++++++++++++++++++++++++++++++++++++---------
 1 file changed, 41 insertions(+), 9 deletions(-)

diff --git a/create-sdcard.sh b/create-sdcard.sh
index d052312..546588b 100644
--- a/create-sdcard.sh
+++ b/create-sdcard.sh
@@ -501,11 +501,29 @@ SIZE=`fdisk -l $DRIVE | grep Disk | awk '{print $5}'`
 
 echo DISK SIZE - $SIZE bytes
 
-parted -s $DRIVE mklabel msdos
-parted -s $DRIVE unit cyl mkpart primary fat32 -- 0 9
-parted -s $DRIVE set 1 boot on
-parted -s $DRIVE unit cyl mkpart primary ext2 -- 9 310
-parted -s $DRIVE unit cyl mkpart primary ext2 -- 310 -2
+cat << END | fdisk $DRIVE
+n
+p
+1
+
++75M
+n
+p
+2
+
++2.4G
+n
+p
+3
+
+
+t
+1
+c
+a
+1
+w
+END
 
 
 cat << EOM
@@ -559,10 +577,24 @@ SIZE=`fdisk -l $DRIVE | grep Disk | awk '{print $5}'`
 
 echo DISK SIZE - $SIZE bytes
 
-parted -s $DRIVE mklabel msdos
-parted -s $DRIVE unit cyl mkpart primary fat32 -- 0 9
-parted -s $DRIVE set 1 boot on
-parted -s $DRIVE unit cyl mkpart primary ext2 -- 9 -2
+cat << END | fdisk $DRIVE
+n
+p
+1
+
++75M
+n
+p
+2
+
+
+t
+1
+c
+a
+1
+w
+END
 
 cat << EOM
 
-- 
2.19.1.windows.1



^ permalink raw reply	[flat|nested] 7+ messages in thread

* [tisdk-setup-scripts] [master] [PATCH-V4 4/4] create-sdcard: Increase boot partition size to 128 MB
  2021-07-29 12:50 [tisdk-setup-scripts] [master] [PATCH-V4 0/4] create-sdcard: Fix rootfs tarball search and selection Priya N S
                   ` (2 preceding siblings ...)
  2021-07-29 12:50 ` [tisdk-setup-scripts] [master] [PATCH-V4 3/4] create-sdcard.sh: Stop using cylinder as unit for partition size Priya N S
@ 2021-07-29 12:50 ` Priya N S
  2021-08-02 17:55 ` [EXTERNAL] [tisdk-setup-scripts] [master] [PATCH-V4 0/4] create-sdcard: Fix rootfs tarball search and selection Weaver, Lucas
  4 siblings, 0 replies; 7+ messages in thread
From: Priya N S @ 2021-07-29 12:50 UTC (permalink / raw)
  To: meta-arago; +Cc: Priya N S, Sekhar Nori

Increase the boot partition size of the SD card to 128 MB so that boot
partition size is in sync with the WIC image boot partition size.

Signed-off-by: Priya N S <priya.ns@ti.com>
---
 create-sdcard.sh | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/create-sdcard.sh b/create-sdcard.sh
index 546588b..a647ccd 100644
--- a/create-sdcard.sh
+++ b/create-sdcard.sh
@@ -382,7 +382,7 @@ done
 
 PARTITION="0"
 if [ -n "$SIZE1" -a -n "$SIZE2" ] ; then
-	if  [ "$SIZE1" -gt "72000" -a "$SIZE2" -gt "700000" ]
+	if  [ "$SIZE1" -gt "128000" -a "$SIZE2" -gt "700000" ]
 	then
 		PARTITION=1
 
@@ -506,7 +506,7 @@ n
 p
 1
 
-+75M
++128M
 n
 p
 2
@@ -582,7 +582,7 @@ n
 p
 1
 
-+75M
++128M
 n
 p
 2
-- 
2.19.1.windows.1



^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [EXTERNAL] [tisdk-setup-scripts] [master] [PATCH-V4 0/4] create-sdcard: Fix rootfs tarball search and selection
  2021-07-29 12:50 [tisdk-setup-scripts] [master] [PATCH-V4 0/4] create-sdcard: Fix rootfs tarball search and selection Priya N S
                   ` (3 preceding siblings ...)
  2021-07-29 12:50 ` [tisdk-setup-scripts] [master] [PATCH-V4 4/4] create-sdcard: Increase boot partition size to 128 MB Priya N S
@ 2021-08-02 17:55 ` Weaver, Lucas
  2021-08-02 18:13   ` Siraswar, Yogesh
  4 siblings, 1 reply; 7+ messages in thread
From: Weaver, Lucas @ 2021-08-02 17:55 UTC (permalink / raw)
  To: Priya N S, meta-arago; +Cc: Priya N S, Sekhar Nori



On 7/29/2021 7:50 AM, Priya N S wrote:
> Hi All,
> 
> This series of patches fix the issues observed in the create-sdcard
> script.
> 
> Changes in V4:
> The patch #4 is new in the series. This patch increases the boot
> partition size to 128 MB in order to sync with WIC image boot
> partition size.
> 
> v3:
> http://arago-project.org/pipermail/meta-arago/2021-July/013245.html
> v2:
> http://arago-project.org/pipermail/meta-arago/2021-June/013218.html
> v1:
> http://arago-project.org/pipermail/meta-arago/2021-June/013197.html
> 
> 
> Priya N S (4):
>    create-sdcard.sh: fix regex used for rootfs tarball
>    create-sdcard: Fix wrong rootfs tarball selection
>    create-sdcard.sh: Stop using cylinder as unit for partition size
>    create-sdcard: Increase boot partition size to 128 MB
> 
>   create-sdcard.sh | 76 ++++++++++++++++++++++++++++++++++++------------
>   1 file changed, 58 insertions(+), 18 deletions(-)
> 
Reviewed-by: Lucas Weaver <l-weaver@ti.com>


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [EXTERNAL] [tisdk-setup-scripts] [master] [PATCH-V4 0/4] create-sdcard: Fix rootfs tarball search and selection
  2021-08-02 17:55 ` [EXTERNAL] [tisdk-setup-scripts] [master] [PATCH-V4 0/4] create-sdcard: Fix rootfs tarball search and selection Weaver, Lucas
@ 2021-08-02 18:13   ` Siraswar, Yogesh
  0 siblings, 0 replies; 7+ messages in thread
From: Siraswar, Yogesh @ 2021-08-02 18:13 UTC (permalink / raw)
  To: Weaver, Lucas, Priya N S, meta-arago; +Cc: Priya N S, Sekhar Nori

Thanks. Applied series to master.


On 8/2/2021 12:55 PM, Weaver, Lucas wrote:
> 
> 
> On 7/29/2021 7:50 AM, Priya N S wrote:
>> Hi All,
>>
>> This series of patches fix the issues observed in the create-sdcard
>> script.
>>
>> Changes in V4:
>> The patch #4 is new in the series. This patch increases the boot
>> partition size to 128 MB in order to sync with WIC image boot
>> partition size.
>>
>> v3:
>> http://arago-project.org/pipermail/meta-arago/2021-July/013245.html
>> v2:
>> http://arago-project.org/pipermail/meta-arago/2021-June/013218.html
>> v1:
>> http://arago-project.org/pipermail/meta-arago/2021-June/013197.html
>>
>>
>> Priya N S (4):
>>    create-sdcard.sh: fix regex used for rootfs tarball
>>    create-sdcard: Fix wrong rootfs tarball selection
>>    create-sdcard.sh: Stop using cylinder as unit for partition size
>>    create-sdcard: Increase boot partition size to 128 MB
>>
>>   create-sdcard.sh | 76 ++++++++++++++++++++++++++++++++++++------------
>>   1 file changed, 58 insertions(+), 18 deletions(-)
>>

> Reviewed-by: Lucas Weaver <l-weaver@ti.com>

> _______________________________________________
> meta-arago mailing list
> meta-arago@arago-project.org
> http://arago-project.org/cgi-bin/mailman/listinfo/meta-arago


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2021-08-02 18:13 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-07-29 12:50 [tisdk-setup-scripts] [master] [PATCH-V4 0/4] create-sdcard: Fix rootfs tarball search and selection Priya N S
2021-07-29 12:50 ` [tisdk-setup-scripts] [master] [PATCH-V4 1/4] create-sdcard.sh: fix regex used for rootfs tarball Priya N S
2021-07-29 12:50 ` [tisdk-setup-scripts] [master] [PATCH-V4 2/4] create-sdcard: Fix wrong rootfs tarball selection Priya N S
2021-07-29 12:50 ` [tisdk-setup-scripts] [master] [PATCH-V4 3/4] create-sdcard.sh: Stop using cylinder as unit for partition size Priya N S
2021-07-29 12:50 ` [tisdk-setup-scripts] [master] [PATCH-V4 4/4] create-sdcard: Increase boot partition size to 128 MB Priya N S
2021-08-02 17:55 ` [EXTERNAL] [tisdk-setup-scripts] [master] [PATCH-V4 0/4] create-sdcard: Fix rootfs tarball search and selection Weaver, Lucas
2021-08-02 18:13   ` Siraswar, Yogesh

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.