-
Notifications
You must be signed in to change notification settings - Fork 7
/
install-cifs
executable file
·37 lines (29 loc) · 1.08 KB
/
install-cifs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#!/bin/bash
set -eu
source download-kernel.sh
CIFS_PATCH="${PWD}/cifs.patch"
FS_DIR="/lib/modules/$(uname -r)/updates/fs"
export EXTRAVERSION="-tegra"
export ARCH=arm64
pushd workdir
## config
zcat /proc/config.gz > "${TEGRA_KERNEL_OUT}/.config"
pushd "${TEGRA_KERNEL_OUT}"
patch -p1 -N < "${CIFS_PATCH}"
popd
## build
make -C ${KERNEL_DIR} O=${TEGRA_KERNEL_OUT} EXTRAVERSION=${EXTRAVERSION} modules_prepare
make -C ${KERNEL_DIR} O=${TEGRA_KERNEL_OUT} -j$(( $(nproc) + 1 )) M=fs/cifs
make -C ${KERNEL_DIR} O=${TEGRA_KERNEL_OUT} -j$(( $(nproc) + 1 )) M=fs/fscache
make -C ${KERNEL_DIR} O=${TEGRA_KERNEL_OUT} -j$(( $(nproc) + 1 )) M=fs/cachefiles
## install
sudo modprobe -r cifs && true
sudo modprobe -r fscache && true
sudo modprobe -r cachefiles && true
sudo mkdir -p "${FS_DIR}/cifs" "${FS_DIR}/fscache" "${FS_DIR}/cachefiles"
sudo cp "${TEGRA_KERNEL_OUT}/fs/cifs/cifs.ko" "${FS_DIR}/cifs/"
sudo cp "${TEGRA_KERNEL_OUT}/fs/fscache/fscache.ko" "${FS_DIR}/fscache/"
sudo cp "${TEGRA_KERNEL_OUT}/fs/cachefiles/cachefiles.ko" "${FS_DIR}/cachefiles/"
sudo depmod -a
sudo modprobe cifs && true
popd