diff --git a/hooks/dapper/80-install-modules b/hooks/dapper/80-install-modules index 0e058a9..1ea6379 100755 --- a/hooks/dapper/80-install-modules +++ b/hooks/dapper/80-install-modules @@ -41,18 +41,25 @@ linux_modules_package="linux-modules-$(uname -r)" # Attempt to install that package. This will either work on an Etch # system, or fail on a Sarge/custom kernel. # -if chroot ${prefix} /usr/bin/apt-cache policy ${linux_modules_package} 2>/dev/null; then +if chroot ${prefix} /usr/bin/apt-cache show ${linux_modules_package} >/dev/null 2>/dev/null; then - # - # If it worked then we can install the package. - # - installDebianPackage ${prefix} ${linux_modules_package} + logMessage "Package '${linux_modules_package}' is available - installing" + + # + # If it worked then we can install the package. + # + installDebianPackage ${prefix} ${linux_modules_package} else - # - # Fall back to copying over modules from the host to the new - # system. - mkdir -p ${prefix}/lib/modules - cp -au /lib/modules/$(uname -r) ${prefix}/lib/modules + + # + # Fall back to copying over modules from the host to the new + # system. + # + logMessage "Package '${linux_modules_package}' is not available" + logMessage "Copying modules from /lib/modules/$(uname -r)" + + mkdir -p ${prefix}/lib/modules + cp -au /lib/modules/$(uname -r) ${prefix}/lib/modules fi diff --git a/hooks/debian/80-install-modules b/hooks/debian/80-install-modules index c8e9083..684ca65 100755 --- a/hooks/debian/80-install-modules +++ b/hooks/debian/80-install-modules @@ -41,18 +41,25 @@ linux_modules_package="linux-modules-$(uname -r)" # Attempt to install that package. This will either work on an Etch # system, or fail on a Sarge/custom kernel. # -if chroot ${prefix} /usr/bin/apt-cache policy ${linux_modules_package} 2>/dev/null; then +if chroot ${prefix} /usr/bin/apt-cache show ${linux_modules_package} >/dev/null 2>/dev/null; then - # - # If it worked then we can install the package. - # - installDebianPackage ${prefix} ${linux_modules_package} + logMessage "Package '${linux_modules_package}' is available - installing" + + # + # If it worked then we can install the package. + # + installDebianPackage ${prefix} ${linux_modules_package} else - # - # Fall back to copying over modules from the host to the new - # system. - mkdir -p ${prefix}/lib/modules - cp -au /lib/modules/$(uname -r) ${prefix}/lib/modules + + # + # Fall back to copying over modules from the host to the new + # system. + # + logMessage "Package '${linux_modules_package}' is not available" + logMessage "Copying modules from /lib/modules/$(uname -r)" + + mkdir -p ${prefix}/lib/modules + cp -au /lib/modules/$(uname -r) ${prefix}/lib/modules fi # diff --git a/hooks/edgy/80-install-modules b/hooks/edgy/80-install-modules index 0e058a9..1ea6379 100755 --- a/hooks/edgy/80-install-modules +++ b/hooks/edgy/80-install-modules @@ -41,18 +41,25 @@ linux_modules_package="linux-modules-$(uname -r)" # Attempt to install that package. This will either work on an Etch # system, or fail on a Sarge/custom kernel. # -if chroot ${prefix} /usr/bin/apt-cache policy ${linux_modules_package} 2>/dev/null; then +if chroot ${prefix} /usr/bin/apt-cache show ${linux_modules_package} >/dev/null 2>/dev/null; then - # - # If it worked then we can install the package. - # - installDebianPackage ${prefix} ${linux_modules_package} + logMessage "Package '${linux_modules_package}' is available - installing" + + # + # If it worked then we can install the package. + # + installDebianPackage ${prefix} ${linux_modules_package} else - # - # Fall back to copying over modules from the host to the new - # system. - mkdir -p ${prefix}/lib/modules - cp -au /lib/modules/$(uname -r) ${prefix}/lib/modules + + # + # Fall back to copying over modules from the host to the new + # system. + # + logMessage "Package '${linux_modules_package}' is not available" + logMessage "Copying modules from /lib/modules/$(uname -r)" + + mkdir -p ${prefix}/lib/modules + cp -au /lib/modules/$(uname -r) ${prefix}/lib/modules fi