Stripping Python Libs for ME9210 and ESP project customization

Digi and others,

DigiEL-5.0/rootfs/rootfs_extras/python/install_pkg.sh copies all the python libs into rootfs, where the resultant squash file is too large for the ME9210. I stripped out all the libs, built the squash, flashed and ran python from serial console (py complains but shell started).

So my question is, how can I configure my project build files to either

  1. call my version of python install_pkg.sh instead of the ESP version.
  2. call a custom ‘stripper’ script to remove the unwanted libs from my rootfs dir before squash

I don’t want to modify DigiEL-5.0/rootfs/rootfs_extras/python/install_pkg.sh for different python projects. Different projects will have a different lib include set.

Also, this workaround should be clearly documented somewhere for the ME9210, or better yet be clickable configuration in ESP project configuration (select which libs you want).

As it stands now, ESP creates useless python rootfs for ME9210.

Thanks for your time,
Craig

You customize rootfs and preserve changes by modifying add_files.sh
This is executed at the end of the rootfs build process, just before building the images.
This would allow you add or remove customized files. The file is in each project under the config directory.

You find it by unfolding a selected project, select configs and add_files.sh
there you can add some “cp myhome/myfile $ROOTFS/etc/myetc”
or remove by another appropriate command

LeonidM,

Thanks for add_files.sh tip. Here’s my version that saves only the python pyc files that I want in my rootfs.

#!/bin/bash
###############################################################################
##
## @File:       $RCSfile: add_files.sh,v $
## @Author:     Digi International Inc.
## @Revision:   $Revision: 1.2 $
## @Date:       $Date: 2007-03-13 15:57:09 $
##
## @Description:
##
##  Template script available for customers to edit so they can install
##  their own files in the rootfs.
##
##  It is installed in each project so it can be per-project customized.
##  This script has access to following project variables:
##
##      DEL_TOOL_DIR -> Digi Embedded Linux path.
##      DEL_PROJ_DIR -> Project path.
##      DEL_PLATFORM -> Target platform.
##      DEL_TFTP_DIR -> TFTPBOOT path.
##      DEL_NFS_DIR  -> Rootfs nfs-exported path.
##
##  These variables are exported in topdir Makefile.
##
##  Though you can use all above variables, the recommended way is to customize
##  the project rootfs (see ROOTFS_DIR below). Doing this way, your changes
##  will be included in rootfs images and in nfs-exported rootfs as well.
##
###############################################################################

ROOTFS_DIR="${DEL_PROJ_DIR}/build/rootfs"

# set the pyc's you want to save in rootfs
save="
time.pyc
os.pyc
re.pyc
site.pyc
socket.pyc
threading.pyc
traceback.pyc
math.pyc
subprocess.pyc
sys.pyc
getopt.pyc
"

# first check that $ROOTFS_DIR is set to something
# otherwise rm -rf could cause problems on the host
if [ -z ${ROOTFS_DIR} ]; then 
	echo "ROOTFS_DIR isn't set"
	exit 1
fi


for f in `find ${ROOTFS_DIR}/usr/lib/python*/*`; do
	fn=`basename ${f}`
	if [[ ${save} == *${fn}* ]]; then 
		echo saving ${f}
	else
		rm -rf ${f} # be careful here
	fi
done

exit 0

My squash file size is now 1.2M, yeah python on ME9210 for me and others.

I noticed that the Digi EL version of python does not support SSL sockets. Is there any way to recompile the socket library to support SSL?