t2linux / T2-Debian-and-Ubuntu-Kernel

Ubuntu Kernel for T2 Macs.
130 stars 14 forks source link

remove previous t2 kernels but preserve current version #22

Closed lemmyg closed 1 year ago

lemmyg commented 1 year ago

Updated the remove kernels logic to list current kernels and purge old t2 kernels but preserving current kernel as a backup. This is useful in case there is any bug in any t2 drivers that could prevent the user from start the session.

lemmyg commented 1 year ago

Im working now. Ill reply around 22.00 BST

lemmyg commented 1 year ago

I tested the code it works thanks

lemmyg commented 1 year ago

about -v argument, should not be always on? Why a user would like to run this process silently?

AdityaGarg8 commented 1 year ago

about -v argument, should not be always on? Why a user would like to run this process silently?

Well I was thinking to removing it as well. Actually this script originally was meant to run as a monthly script placed in /etc/cron.monthly, but later I edited it to be run manually.

AdityaGarg8 commented 1 year ago

If you want, you may cleanup the -v completely.

lemmyg commented 1 year ago

I go for it

lemmyg commented 1 year ago

I can remove all this right? if [[ ($1 != -v) && ($2 != -v) ]] then exec 3>&1 4>&2 trap 'exec 2>&4 1>&3' 0 1 2 3 exec 1>/var/log/t2-kernel-update.log 2>&1 fi

and just leave this ($1 = --remove-current)

finally sudo $0 $1

AdityaGarg8 commented 1 year ago

Thanks