Re: [PATCH] backports: re-introduce make uninstall

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Thanks! Some comments below

On Sat, Jun 8, 2013 at 5:17 PM, ASIC Felix <ic.felix@xxxxxxxxx> wrote:
> Re-introducing make uninstall. It works, but feel more than welcome to
> tidy it up.

Try to avoid development / iteration series comments on the commit
log, instead those could be put right below after the first three
dashes.

> Signed-off-by: Felix Bitterli <ic.felix@xxxxxxxxx>
> ---

Like here.

>  backport/Makefile.real        |   10 ++++++++++
>  backport/scripts/uninstall.sh |   26 ++++++++++++++++++++++++++
>  2 files changed, 36 insertions(+)
>  create mode 100755 backport/scripts/uninstall.sh
>
> diff --git a/backport/Makefile.real b/backport/Makefile.real
> index 2a1f640..40d91bd 100644
> --- a/backport/Makefile.real
> +++ b/backport/Makefile.real
> @@ -101,6 +101,16 @@ install: modules
>  .PHONY: modules_install
>  modules_install: install
>
> +.PHONY: uninstall
> +uninstall:
> +    @./scripts/uninstall.sh
> +    @/sbin/depmod -a
> +    @./scripts/update-initramfs.sh $(KLIB)
> +    @echo
> +    @echo Your backported driver modules should be uninstalled now.
> +    @echo Reboot.
> +    @echo
> +
>  .PHONY: clean
>  clean:
>      @$(MAKE) -f Makefile.build clean
> diff --git a/backport/scripts/uninstall.sh b/backport/scripts/uninstall.sh
> new file mode 100755
> index 0000000..4deb7c1
> --- /dev/null
> +++ b/backport/scripts/uninstall.sh
> @@ -0,0 +1,26 @@
> +#!/bin/bash
> +
> +set -e
> +
> +function mod_filename()
> +{
> +    which modinfo > /dev/null 2>&1
> +    if [[ $? -eq 0 ]]; then
> +        MOD_QUERY="modinfo -F filename"
> +    else
> +        MOD_QUERY="modprobe -l"
> +    fi
> +    mod_path="$($MOD_QUERY $1 | tail -1)"
> +    echo $(basename "$mod_path")
> +}

This is used twice now in two scripts as such perhaps best to stuff
this as a helper in a new file of script helpers,
scripts/mod_helpers.sh and then both this file and
scripts/compress_modules.sh would just:

source ./mod_helpers.sh

> +if test "$(mod_filename mac80211)" = "mac80211.ko.gz" ; then
> +    compr=".ko"

I think what was meant is compr=".gz"

> +else
> +    compr=""
> +fi
> +
> +for driver in $(find -type f -name *.ko); do

and here perhaps you forgot to apply the extension, and perhaps best
to just peg the path in the find from the start, otherwise we end up
removing other kernel's updates as well:

for driver in $(find $KLIB/$KMODDIR -type f -name *.ko${compress} ); do

so then no need for the next mod_name line:

> +    mod_name=$KLIB"updates/"$driver$compr

and instead of:

> +    rm -f $mod_name

rm -f $driver

  Luis
--
To unsubscribe from this list: send the line "unsubscribe backports" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux