On 10/30/19 9:52 PM, Bhaskar Chowdhury wrote:
Okay,ÂagainÂsomeÂuniformityÂmissingÂinÂtheÂcode,ÂIÂwouldÂlikeÂtoÂyourThatÂ'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.
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.
--Bhaskar
~Randy
Attachment:
signature.asc
Description: PGP signature