From: Bhaskar Chowdhury <unixbhaskar@gmail.com>
To: Randy Dunlap <rdunlap@infradead.org>
Cc: bfields@fieldses.org, yamada.masahiro@socionext.com,
michal.lkml@markovi.net, linux-kbuild@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] scripts: prune-kernel:remove old kernels and modules dir from system
Date: Thu, 31 Oct 2019 12:48:42 +0530 [thread overview]
Message-ID: <20191031071839.GB3130@Gentoo> (raw)
In-Reply-To: <809aa850-7a22-a7c5-af21-0e88d1c63dd7@infradead.org>
[-- Attachment #1: Type: text/plain, Size: 2019 bytes --]
On 22:27 Wed 30 Oct 2019, Randy Dunlap wrote:
>On 10/30/19 9:52 PM, Bhaskar Chowdhury wrote:
>>>>> That 'rm' doesn't remove any files. Compare what remove_old_kernel() does.
>>>> No,it is not using that function rather take the parameter from the
>>>> commandline and get into boot dir match with it and remove it.
>>>
>>> But it doesn't do that. I tested it. It should be more like what
>>> rmeove_old_kernel() does:
>>>
>>> rm -If vmlinuz-$kernel_ver System.map-$kernel_ver config-$kernel_ver
>>>
>>> and if not, please explain why not.
>> Okay, again some uniformity missing in the code, I would like to your
>> suggested method,i.e call remove_old_kernel to do the job instead of depending on individual kernel.
>
>The simplest thing to do is set kernel_version=$kernel_ver
>and then call remove_old_kernel().
>And set modules_version=$modules_dir_name and call remove_old_modules_dir().
>
>But it would be cleaner to pass a parameter (kernel_version) to the
>remove_old_kernel() function and to pass a parameter (modules_dir) to the
>remove_old_modules_dir() function.
>
Thank you...I have just modified the code and call both the function
under remove option. BTW I didn't set the extra variable $kernel_ver
name it $kernel_version and instead of $modules_dir_name name it $mo
dules_version.
Capturing command line parameter in $kernel_version and $modules_version
Is that fine? Here is a code snippet:
-r | --remove)
if [[ $# -ne 3 ]]; then
printf "You need to provide kernel version and modules directory
name \n"
exit 1
else
remove_old_kernel
remove_old_modules_dir
fi
I have just test it and it works.
And about solitary r option without hypen is ignoring and doing nothing.
Means, if I pass ./scripts/prune-kernel r 5.3.3
it simply ignore and does nothing.Only with the hypen it can work.
>--
>~Randy
>
Bhaskar
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
next prev parent reply other threads:[~2019-10-31 7:18 UTC|newest]
Thread overview: 31+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-10-30 9:54 [PATCH] scripts: prune-kernel:remove old kernels and modules dir from system Bhaskar Chowdhury
2019-10-31 2:33 ` Randy Dunlap
2019-10-31 3:37 ` Bhaskar Chowdhury
2019-10-31 4:32 ` Randy Dunlap
2019-10-31 4:52 ` Bhaskar Chowdhury
2019-10-31 5:27 ` Randy Dunlap
2019-10-31 7:18 ` Bhaskar Chowdhury [this message]
2019-10-31 15:06 ` Randy Dunlap
2019-11-01 4:23 ` Bhaskar Chowdhury
2019-11-01 5:11 ` Bhaskar Chowdhury
2019-11-01 5:45 ` Randy Dunlap
2019-11-02 6:30 [PATCH] scripts:prune-kernel:remove " Bhaskar Chowdhury
2019-11-05 2:03 ` Randy Dunlap
2019-11-05 2:32 ` J. Bruce Fields
2019-11-05 4:39 ` Bhaskar Chowdhury
2019-11-05 4:52 ` Bhaskar Chowdhury
2019-11-06 2:53 ` Masahiro Yamada
2019-11-06 3:10 ` Bhaskar Chowdhury
2019-11-06 4:03 ` Masahiro Yamada
2019-11-06 4:29 ` Bhaskar Chowdhury
2019-11-06 4:31 ` J. Bruce Fields
2019-11-06 4:32 ` Randy Dunlap
2019-11-06 4:42 ` Bhaskar Chowdhury
2019-11-06 19:30 ` J. Bruce Fields
2019-11-06 22:39 ` Bhaskar Chowdhury
2019-11-09 7:25 ` Masahiro Yamada
2019-11-09 11:13 ` Bhaskar Chowdhury
2019-11-15 1:58 ` Masahiro Yamada
2019-11-15 15:21 ` Bhaskar Chowdhury
2019-11-18 7:30 ` Masahiro Yamada
2019-11-05 4:33 ` Bhaskar Chowdhury
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20191031071839.GB3130@Gentoo \
--to=unixbhaskar@gmail.com \
--cc=bfields@fieldses.org \
--cc=linux-kbuild@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=michal.lkml@markovi.net \
--cc=rdunlap@infradead.org \
--cc=yamada.masahiro@socionext.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).