Newer
Older
echo "Log: ERROR: npm error in script, review log [cat ${tempdir}/npm-debug.log]..."
exit 1
fi
fi
##Building final tar file...
if [ -d ${DIR}/deploy/${export_filename}/ ] ; then
rm -rf ${DIR}/deploy/${export_filename}/ || true
fi
mkdir -p ${DIR}/deploy/${export_filename}/ || true
cp -v ${DIR}/.project ${DIR}/deploy/${export_filename}/image-builder.project
if [ -n "${chroot_after_hook}" -a -r "${DIR}/${chroot_after_hook}" ] ; then
report_size
echo "Calling chroot_after_hook script: ${chroot_after_hook}"
. "${DIR}/${chroot_after_hook}"
chroot_after_hook=""
fi
#add /boot/uEnv.txt update script
if [ -d ${tempdir}/etc/kernel/postinst.d/ ] ; then
sudo cp -v ${OIB_DIR}/target/other/zz-uenv_txt ${tempdir}/etc/kernel/postinst.d/
sudo chmod +x ${tempdir}/etc/kernel/postinst.d/zz-uenv_txt
if [ -f ${tempdir}/usr/bin/qemu-arm-static ] ; then
sudo rm -f ${tempdir}/usr/bin/qemu-arm-static || true
fi
Robert Nelson
committed
echo "${rfs_username}:${rfs_password}" > /tmp/user_password.list
sudo mv /tmp/user_password.list ${DIR}/deploy/${export_filename}/user_password.list
#Fixes:
if [ -d ${tempdir}/etc/ssh/ -a "x${keep_ssh_keys}" = "x" ] ; then
#Remove pre-generated ssh keys, these will be regenerated on first bootup...
sudo rm -rf ${tempdir}/etc/ssh/ssh_host_* || true
sudo touch ${tempdir}/etc/ssh/ssh.regenerate || true
fi
#extra home, from chroot machine when running npm install xyz:
unset extra_home
extra_home=$(ls -lh ${tempdir}/home/ | grep -v ${rfs_username} | awk '{print $9}' | tail -1 || true)
if [ ! "x${extra_home}" = "x" ] ; then
if [ -d ${tempdir}/home/${extra_home}/ ] ; then
sudo rm -rf ${tempdir}/home/${extra_home}/ || true
fi
fi
#ID.txt:
if [ -f ${tempdir}/etc/dogtag ] ; then
sudo cp ${tempdir}/etc/dogtag ${DIR}/deploy/${export_filename}/ID.txt
fi
report_size
chroot_umount
if [ "x${chroot_COPY_SETUP_SDCARD}" = "xenable" ] ; then
echo "Log: copying setup_sdcard.sh related files"
sudo cp ${DIR}/tools/setup_sdcard.sh ${DIR}/deploy/${export_filename}/
sudo mkdir -p ${DIR}/deploy/${export_filename}/hwpack/
sudo cp ${DIR}/tools/hwpack/*.conf ${DIR}/deploy/${export_filename}/hwpack/
if [ -n "${chroot_uenv_txt}" -a -r "${OIB_DIR}/target/boot/${chroot_uenv_txt}" ] ; then
sudo cp "${OIB_DIR}/target/boot/${chroot_uenv_txt}" ${DIR}/deploy/${export_filename}/uEnv.txt
if [ -n "${chroot_flasher_uenv_txt}" -a -r "${OIB_DIR}/target/boot/${chroot_flasher_uenv_txt}" ] ; then
sudo cp "${OIB_DIR}/target/boot/${chroot_flasher_uenv_txt}" ${DIR}/deploy/${export_filename}/eMMC-flasher.txt
if [ -n "${chroot_post_uenv_txt}" -a -r "${OIB_DIR}/target/boot/${chroot_post_uenv_txt}" ] ; then
sudo cp "${OIB_DIR}/target/boot/${chroot_post_uenv_txt}" ${DIR}/deploy/${export_filename}/post-uEnv.txt
if [ "x${chroot_directory}" = "xenable" ]; then
echo "Log: moving rootfs to directory: [${deb_arch}-rootfs-${deb_distribution}-${deb_codename}]"
sudo mv -v ${tempdir} ${DIR}/deploy/${export_filename}/${deb_arch}-rootfs-${deb_distribution}-${deb_codename}
du -h --max-depth=0 ${DIR}/deploy/${export_filename}/${deb_arch}-rootfs-${deb_distribution}-${deb_codename}
else
cd ${tempdir}
echo "Log: packaging rootfs: [${deb_arch}-rootfs-${deb_distribution}-${deb_codename}.tar]"
sudo LANG=C tar --numeric-owner -cf ${DIR}/deploy/${export_filename}/${deb_arch}-rootfs-${deb_distribution}-${deb_codename}.tar .
cd ${DIR}/
ls -lh ${DIR}/deploy/${export_filename}/${deb_arch}-rootfs-${deb_distribution}-${deb_codename}.tar
fi
sudo chown -R ${USER}:${USER} ${DIR}/deploy/${export_filename}/
if [ "x${chroot_tarball}" = "xenable" ] ; then
echo "Compressing ${export_filename}"
cd ${DIR}/deploy/
tar cvf ${export_filename}.tar ./${export_filename}
cd ${DIR}/
fi