Skip to contentSkip to conversation

ver_linux: add missing software to checklist

PATCH Superseded Shuah Khan 3 participants 5 messages Jan 10, 2023 – Jan 20, 2023

v1 of 3 Superseded Latest is v3 →

lore
Share & tools
lore

Shuah Khan

author
#0 lore raw

PATCH 1/1 ver_linux: add missing software to checklist

Update to add missing software checks to bring it in sync with the Documentation/Changes list. Make improvements to the output with separator between different sections.

---
 scripts/ver_linux | 29 ++++++++++++++++++++++++++---
 1 file changed, 26 insertions(+), 3 deletions(-)
scripts/ver_linux +26 -3
index 1a8ee4ff0e32..6131f6f1b35b 100755
@@ -6,10 +6,14 @@
 # differ on your system.
 
 BEGIN {
-	usage = "If some fields are empty or look unusual you may have an old version.\n"
-	usage = usage "Compare to the current minimal requirements in Documentation/Changes.\n"
+	usage = "Minimum required software versions to build and run current kernel version.\n"
+	usage = usage "If some fields are empty or look unusual you may have an old version.\n"
+	usage = usage "Compare with the current minimal requirements in Documentation/Changes.\n"
 	print usage
 
+	separator = "===================================================\n"
+
+	print separator
 	system("uname -a")
 	printf("\n")
 
@@ -17,9 +21,15 @@ BEGIN {
 	libc = "libc[.]so[.][0-9]+$"
 	libcpp = "(libg|stdc)[+]+[.]so([.][0-9]+)+$"
 
+	print separator
 	printversion("GNU C", version("gcc -dumpversion"))
+	printversion("Clang/LLVM (optional)", version("clang --version"))
+	printversion("Rust (optional)", version("rustc --version"))
+	printversion("bindgen (optional)", version("bindgen --version"))
 	printversion("GNU Make", version("make --version"))
+	printversion("bash", version("bash --version"))
 	printversion("Binutils", version("ld -v"))
+	printversion("pahole", version("pahole --version"))
 	printversion("Util-linux", version("mount --version"))
 	printversion("Mount", version("mount --version"))
 	printversion("Module-init-tools", version("depmod -V"))
@@ -28,6 +38,8 @@ BEGIN {
 	printversion("Reiserfsprogs", version("reiserfsck -V"))
 	printversion("Reiser4fsprogs", version("fsck.reiser4 -V"))
 	printversion("Xfsprogs", version("xfs_db -V"))
+	printversion("squashfs-tools", version("mksquashfs -version"))
+	printversion("btrfs-progs", version("mkfs.btrfs --version"))
 	printversion("Pcmciautils", version("pccardctl -V"))
 	printversion("Pcmcia-cs", version("cardmgr -V"))
 	printversion("Quota-tools", version("quota -V"))
@@ -36,7 +48,16 @@ BEGIN {
 	printversion("Nfs-utils", version("showmount --version"))
 	printversion("Bison", version("bison --version"))
 	printversion("Flex", version("flex --version"))
+	printversion("Grub", version("grub-install --version"))
+	printversion("mcelog", version("mcelog --version"))
+	printversion("iptables", version("iptables --version"))
+	printversion("openssl & libcrypto", version("openssl version"))
+	printversion("bc", version("bc --version"))
+	printversion("Sphinx (for doc builds)", version("sphinx-build --version"))
+	printversion("cpio", version("cpio --version"))
+	printf("\n")
 
+	print separator
 	while ("ldconfig -p 2>/dev/null" | getline > 0)
 		if ($NF ~ libc || $NF ~ libcpp)
 			if (!seen[ver = version("readlink " $NF)]++)
@@ -50,12 +71,14 @@ BEGIN {
 	printversion("Sh-utils", version("expr --v"))
 	printversion("Udev", version("udevadm --version"))
 	printversion("Wireless-tools", version("iwconfig --version"))
+	printf("\n")
 
+	print separator
 	while ("sort /proc/modules" | getline > 0) {
 		mods = mods sep $1
 		sep = " "
 	}
-	printversion("Modules Loaded", mods)
+	printversion("Modules Loaded:\n", mods)
 }
 
 function version(cmd,    ver) {
Signature · 1 line
2.34.1
#1 lore raw
Quoted 89 lines · Shuah Khan

Update to add missing software checks to bring it in sync with the Documentation/Changes list. Make improvements to the output with separator between different sections.

---
scripts/ver_linux | 29 ++++++++++++++++++++++++++---

1 file changed, 26 insertions(+), 3 deletions(-)
scripts/ver_linux +26 -4
index 1a8ee4ff0e32..6131f6f1b35b 100755
@@ -6,10 +6,14 @@
 # differ on your system.
 
 BEGIN {
-	usage = "If some fields are empty or look unusual you may have an old version.\n"
-	usage = usage "Compare to the current minimal requirements in Documentation/Changes.\n"
+	usage = "Minimum required software versions to build and run current kernel version.\n"
+	usage = usage "If some fields are empty or look unusual you may have an old version.\n"
+	usage = usage "Compare with the current minimal requirements in Documentation/Changes.\n"
 	print usage
 
+	separator = "===================================================\n"
+
+	print separator
 	system("uname -a")
 	printf("\n")
 
@@ -17,9 +21,15 @@ BEGIN {
 	libc = "libc[.]so[.][0-9]+$"
 	libcpp = "(libg|stdc)[+]+[.]so([.][0-9]+)+$"
 
+	print separator
 	printversion("GNU C", version("gcc -dumpversion"))
+	printversion("Clang/LLVM (optional)", version("clang --version"))
+	printversion("Rust (optional)", version("rustc --version"))
+	printversion("bindgen (optional)", version("bindgen --version"))
 	printversion("GNU Make", version("make --version"))
+	printversion("bash", version("bash --version"))
 	printversion("Binutils", version("ld -v"))
+	printversion("pahole", version("pahole --version"))
 	printversion("Util-linux", version("mount --version"))
 	printversion("Mount", version("mount --version"))
 	printversion("Module-init-tools", version("depmod -V"))
@@ -28,6 +38,8 @@ BEGIN {
 	printversion("Reiserfsprogs", version("reiserfsck -V"))
 	printversion("Reiser4fsprogs", version("fsck.reiser4 -V"))
 	printversion("Xfsprogs", version("xfs_db -V"))
+	printversion("squashfs-tools", version("mksquashfs -version"))
+	printversion("btrfs-progs", version("mkfs.btrfs --version"))
 	printversion("Pcmciautils", version("pccardctl -V"))
 	printversion("Pcmcia-cs", version("cardmgr -V"))
 	printversion("Quota-tools", version("quota -V"))
@@ -36,7 +48,16 @@ BEGIN {
 	printversion("Nfs-utils", version("showmount --version"))
 	printversion("Bison", version("bison --version"))
 	printversion("Flex", version("flex --version"))
+	printversion("Grub", version("grub-install --version"))
+	printversion("mcelog", version("mcelog --version"))
+	printversion("iptables", version("iptables --version"))
+	printversion("openssl & libcrypto", version("openssl version"))
+	printversion("bc", version("bc --version"))
+	printversion("Sphinx (for doc builds)", version("sphinx-build --version"))
+	printversion("cpio", version("cpio --version"))
+	printf("\n")
 
+	print separator
 	while ("ldconfig -p 2>/dev/null" | getline > 0)
 		if ($NF ~ libc || $NF ~ libcpp)
 			if (!seen[ver = version("readlink " $NF)]++)
@@ -50,12 +71,14 @@ BEGIN {
 	printversion("Sh-utils", version("expr --v"))
 	printversion("Udev", version("udevadm --version"))
 	printversion("Wireless-tools", version("iwconfig --version"))
+	printf("\n")
 
+	print separator
 	while ("sort /proc/modules" | getline > 0) {
 		mods = mods sep $1
 		sep = " "
 	}
-	printversion("Modules Loaded", mods)
+	printversion("Modules Loaded:\n", mods)
 }
 
 function version(cmd,    ver) {
--
Quoted 2 lines

2.34.1

Hunch....

One, is grub required to compile kernel?

Second, can we please stick to " absolutely required software" than showing optional??

Separator adding is good one.

--
Thanks,
Bhaskar

"Here's looking at you kid"-- Casablanca
https://about.me/unixbhaskar

author
#2 lore raw
Quoted 88 lines · Bhaskar Chowdhury
Quoted 87 lines · Shuah Khan

Update to add missing software checks to bring it in sync with the Documentation/Changes list. Make improvements to the output with separator between different sections.

---
scripts/ver_linux | 29 ++++++++++++++++++++++++++---

1 file changed, 26 insertions(+), 3 deletions(-)
scripts/ver_linux +3 -2
index 1a8ee4ff0e32..6131f6f1b35b 100755
@@ -6,10 +6,14 @@
 # differ on your system.
 
 BEGIN {
-    usage = "If some fields are empty or look unusual you may have an old version.\n"
-    usage = usage "Compare to the current minimal requirements in Documentation/Changes.\n"
+    usage = "Minimum required software versions to build and run current kernel version.\n"
+    usage = usage "If some fields are empty or look unusual you may have an old version.\n"
+    usage = usage "Compare with the current minimal requirements in Documentation/Changes.\n"

    print usage

+    separator = "===================================================\n" +
+    print separator
    system("uname -a")
    printf("\n")

scripts/ver_linux +0 -0
@@ -17,9 +21,15 @@ BEGIN {

    libc = "libc[.]so[.][0-9]+$"
    libcpp = "(libg|stdc)[+]+[.]so([.][0-9]+)+$"

+    print separator
    printversion("GNU C", version("gcc -dumpversion"))
+    printversion("Clang/LLVM (optional)", version("clang --version")) +    printversion("Rust (optional)", version("rustc --version")) +    printversion("bindgen (optional)", version("bindgen --version")) printversion("GNU Make", version("make --version"))
+    printversion("bash", version("bash --version")) printversion("Binutils", version("ld -v"))
+    printversion("pahole", version("pahole --version")) printversion("Util-linux", version("mount --version")) printversion("Mount", version("mount --version")) printversion("Module-init-tools", version("depmod -V"))

scripts/ver_linux +13 -0
@@ -28,6 +38,8 @@ BEGIN {
     printversion("Reiserfsprogs", version("reiserfsck -V"))
     printversion("Reiser4fsprogs", version("fsck.reiser4 -V"))
     printversion("Xfsprogs", version("xfs_db -V"))
+    printversion("squashfs-tools", version("mksquashfs -version"))
+    printversion("btrfs-progs", version("mkfs.btrfs --version"))
     printversion("Pcmciautils", version("pccardctl -V"))
     printversion("Pcmcia-cs", version("cardmgr -V"))
     printversion("Quota-tools", version("quota -V"))
@@ -36,7 +48,16 @@ BEGIN {
     printversion("Nfs-utils", version("showmount --version"))
     printversion("Bison", version("bison --version"))
     printversion("Flex", version("flex --version"))
+    printversion("Grub", version("grub-install --version"))
+    printversion("mcelog", version("mcelog --version"))
+    printversion("iptables", version("iptables --version"))
+    printversion("openssl & libcrypto", version("openssl version"))
+    printversion("bc", version("bc --version"))
+    printversion("Sphinx (for doc builds)", version("sphinx-build --version"))
+    printversion("cpio", version("cpio --version"))
+    printf("\n")
 
+    print separator
     while ("ldconfig -p 2>/dev/null" | getline > 0)
         if ($NF ~ libc || $NF ~ libcpp)
             if (!seen[ver = version("readlink " $NF)]++)
@@ -50,12 +71,14 @@ BEGIN {
     printversion("Sh-utils", version("expr --v"))
     printversion("Udev", version("udevadm --version"))
     printversion("Wireless-tools", version("iwconfig --version"))
+    printf("\n")
 
+    print separator
     while ("sort /proc/modules" | getline > 0) {

        mods = mods sep $1
        sep = " "
    }
-    printversion("Modules Loaded", mods)
+    printversion("Modules Loaded:\n", mods)
}

Quoted 7 lines
Quoted 4 lines

function version(cmd,    ver) {

Signature · 1 line
2.34.1

Hunch....

One, is grub required to compile kernel?

These are minimal requirements to compile and run the kernel. Running requires installing it first and install tools are required. grub is listed in Documentation/Changes.

Quoted 3 lines

Second, can we please stick to " absolutely required software" than showing optional??

This is an attempt sync this ver_linux with Documentation/Changes and print out complete list which includes optional.

Quoted 2 lines

Separator adding is good one.

thanks,
-- Shuah

#3 lore raw
In reply to Shuah Khan
Quoted 16 lines · Shuah Khan

Update to add missing software checks to bring it in sync with the Documentation/Changes list. Make improvements to the output with separator between different sections.

---
 scripts/ver_linux | 29 ++++++++++++++++++++++++++---
 1 file changed, 26 insertions(+), 3 deletions(-)
scripts/ver_linux +0 -0
index 1a8ee4ff0e32..6131f6f1b35b 100755
@@ -6,10 +6,14 @@
 # differ on your system.

scripts/ver_linux line 14

Quoted 10 lines
scripts/ver_linux +4 -2
 
 BEGIN {
-       usage = "If some fields are empty or look unusual you may have an old version.\n"
-       usage = usage "Compare to the current minimal requirements in Documentation/Changes.\n"
+       usage = "Minimum required software versions to build and run current kernel version.\n"
+       usage = usage "If some fields are empty or look unusual you may have an old version.\n"
+       usage = usage "Compare with the current minimal requirements in Documentation/Changes.\n"
        print usage
 
+       separator = "===================================================\n"

Embedding a new line character at the start of the separator string would eliminate the need for the extra printf("\n") statements introduced.

scripts/ver_linux line 18

Quoted 4 lines
scripts/ver_linux +2 -0
+
+       print separator
        system("uname -a")
        printf("\n")

Consequently, this printf could be removed as well.

Quoted 62 lines
scripts/ver_linux +20 -2
@@ -17,9 +21,15 @@ BEGIN {
        libc = "libc[.]so[.][0-9]+$"
        libcpp = "(libg|stdc)[+]+[.]so([.][0-9]+)+$"
 
+       print separator
        printversion("GNU C", version("gcc -dumpversion"))
+       printversion("Clang/LLVM (optional)", version("clang --version"))
+       printversion("Rust (optional)", version("rustc --version"))
+       printversion("bindgen (optional)", version("bindgen --version"))
        printversion("GNU Make", version("make --version"))
+       printversion("bash", version("bash --version"))
        printversion("Binutils", version("ld -v"))
+       printversion("pahole", version("pahole --version"))
        printversion("Util-linux", version("mount --version"))
        printversion("Mount", version("mount --version"))
        printversion("Module-init-tools", version("depmod -V"))
@@ -28,6 +38,8 @@ BEGIN {
        printversion("Reiserfsprogs", version("reiserfsck -V"))
        printversion("Reiser4fsprogs", version("fsck.reiser4 -V"))
        printversion("Xfsprogs", version("xfs_db -V"))
+       printversion("squashfs-tools", version("mksquashfs -version"))
+       printversion("btrfs-progs", version("mkfs.btrfs --version"))
        printversion("Pcmciautils", version("pccardctl -V"))
        printversion("Pcmcia-cs", version("cardmgr -V"))
        printversion("Quota-tools", version("quota -V"))
@@ -36,7 +48,16 @@ BEGIN {
        printversion("Nfs-utils", version("showmount --version"))
        printversion("Bison", version("bison --version"))
        printversion("Flex", version("flex --version"))
+       printversion("Grub", version("grub-install --version"))
+       printversion("mcelog", version("mcelog --version"))
+       printversion("iptables", version("iptables --version"))
+       printversion("openssl & libcrypto", version("openssl version"))
+       printversion("bc", version("bc --version"))
+       printversion("Sphinx (for doc builds)", version("sphinx-build --version"))
+       printversion("cpio", version("cpio --version"))
+       printf("\n")
 
+       print separator
        while ("ldconfig -p 2>/dev/null" | getline > 0)
                if ($NF ~ libc || $NF ~ libcpp)
                        if (!seen[ver = version("readlink " $NF)]++)
@@ -50,12 +71,14 @@ BEGIN {
        printversion("Sh-utils", version("expr --v"))
        printversion("Udev", version("udevadm --version"))
        printversion("Wireless-tools", version("iwconfig --version"))
+       printf("\n")
 
+       print separator
        while ("sort /proc/modules" | getline > 0) {
                mods = mods sep $1
                sep = " "
        }
-       printversion("Modules Loaded", mods)
+       printversion("Modules Loaded:\n", mods)
 }
 
 function version(cmd,    ver) {
--

2.34.1

author
#4 lore raw
Quoted 32 lines · Alexander Kapshuk
Quoted 16 lines · Shuah Khan

Update to add missing software checks to bring it in sync with the Documentation/Changes list. Make improvements to the output with separator between different sections.

---
  scripts/ver_linux | 29 ++++++++++++++++++++++++++---
  1 file changed, 26 insertions(+), 3 deletions(-)
scripts/ver_linux +0 -0
index 1a8ee4ff0e32..6131f6f1b35b 100755
@@ -6,10 +6,14 @@
  # differ on your system.

scripts/ver_linux line 14

Quoted 10 lines
scripts/ver_linux +4 -2
 
  BEGIN {
-       usage = "If some fields are empty or look unusual you may have an old version.\n"
-       usage = usage "Compare to the current minimal requirements in Documentation/Changes.\n"
+       usage = "Minimum required software versions to build and run current kernel version.\n"
+       usage = usage "If some fields are empty or look unusual you may have an old version.\n"
+       usage = usage "Compare with the current minimal requirements in Documentation/Changes.\n"
         print usage
 
+       separator = "===================================================\n"

Embedding a new line character at the start of the separator string would eliminate the need for the extra printf("\n") statements introduced.

Quoted 7 lines

scripts/ver_linux line 18

Quoted 4 lines
scripts/ver_linux +2 -0
+
+       print separator
         system("uname -a")
         printf("\n")

Consequently, this printf could be removed as well.

Thank yo for your review. Will send v2 with your suggestions.

thanks,
-- Shuah