From 28db949f8e198101b36cbae4257220c78b08da4b Mon Sep 17 00:00:00 2001 From: Frank Brehm Date: Thu, 8 Jun 2017 07:38:58 +0200 Subject: [PATCH] Mit DKMS weitergekommen --- bin/create-grml-image.sh | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/bin/create-grml-image.sh b/bin/create-grml-image.sh index dae3282..fc0a58c 100755 --- a/bin/create-grml-image.sh +++ b/bin/create-grml-image.sh @@ -367,8 +367,13 @@ create_src_img_dev() { unpack_orig() { empty_line if [[ -d "${TGT_DIR}" ]] ; then + debug "Checking for existing mounts ..." + if mount | grep "${TGT_DIR}" >/dev/null ; then + error "Es gibt noch Mounts in '${RED}${TGT_DIR}${NORMAL}'." + exit 8 + fi info "Lösche ${TGT_DIR} ..." - RM -rf "${TGT_DIR}" + rm -rf "${TGT_DIR}" fi info "Unsquashing '${SRC64_SQUASHFS_FILE}' ..." local np="" @@ -571,18 +576,13 @@ add_zfs() { empty_line info "Adding ${GREEN}ZFS${NORMAL} support ..." - CHROOT apt install --yes debootstrap gdisk linux-headers-amd64 dkms + local kv=$( ls -1 ${TGT_DIR}/lib/modules | grep grml |head -n 1 ) + info "Kernel-Version im GRM Image: '${GREEN}${kv}${NORMAL}'." - local kv=$( CHROOT dpkg-query -l 'linux-headers*' | \ - grep '^i' | \ - grep -v linux-headers-amd64 | \ - grep -- '-amd64 ' | \ - sort | \ - tail -n 1 | \ - awk '{print $2}' | \ - sed -e 's/^linux-headers-//' ) + local pkgs="debootstrap gdisk linux-headers-${kv} dkms libc-dev" + debug "Instaliere Pakete: ${pkgs}" - info "Kernel-Version im GRM Image: '${GREEN}${kv}${NORMAL}'." + CHROOT apt install --yes ${pkgs} local spl_version=$( CHROOT apt search spl-dkms 2>/dev/null | grep '^spl-dkms' | awk '{print $2}' | sed -e 's/-[0-9][0-9]*$//' ) info "Version von spl-dkms ist: '${GREEN}${spl_version}${NORMAL}'." @@ -594,8 +594,8 @@ add_zfs() { CP -p ${TGT_DIR}/usr/src/spl-linux-${spl_version}/debian/dkms ${TGT_DIR}/usr/src/spl-linux-${spl_version}/dkms.conf - CHROOT dkms install -m spl-linux -v "${spl_version}" "${kv}" - CHROOT dkms install -m zfs-linux -v "${zfs_version}" "${kv}" + CHROOT dkms install -m spl-linux -v "${spl_version}" -k "${kv}" + CHROOT dkms install -m zfs-linux -v "${zfs_version}" -k "${kv}" # local cmd="apt install --yes" # if [[ "${debian_version}" == "jessie" ]] ; then -- 2.39.5