On sudo status, env variable is possible not to be preserved and
it causes failure on modules_install. So fix to install modules on
non sudo status and then move the directories and files to image
area.
[From repo of tizen rpi3:
89dcbe9b298c scripts: mkbootimg_rpi3.sh: Fix to install modules on non sudo status]
Change-Id: Ie7047c23762b668a08abf387dd76cf9cc8571937
Signed-off-by: Hoegeun Kwon <hoegeun.kwon@samsung.com>
Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
rm -f modules.img
mkdir -p tmp/lib/modules
+mkdir -p tmp_modules
# Create modules.img
dd if=/dev/zero of=modules.img bs=1024 count=20480
mkfs.ext4 -q -F -t ext4 -b 1024 -L modules modules.img
sudo mount -o loop modules.img ./tmp/lib/modules
-sudo make modules_install ARCH=arm INSTALL_MOD_PATH=./tmp INSTALL_MOD_STRIP=1 CROSS_COMPILE=arm-linux-gnueabi-
+make modules_install ARCH=arm INSTALL_MOD_PATH=./tmp_modules INSTALL_MOD_STRIP=1 CROSS_COMPILE=arm-linux-gnueabi-
+sudo mv ./tmp_modules/lib/modules/* ./tmp/lib/modules
sudo -n chown root:root ./tmp/lib/modules -R
sync
sudo umount tmp/lib/modules
-rm -rf tmp
+rm -rf tmp tmp_modules