3 #****************************************************************************
5 # Copyright (c) 2001, 2002 Broadcom Corporation
7 # No portions of this material may be reproduced in any form without the
8 # written permission of:
10 # 16251 Laguna Canyon Road
11 # Irvine, California 92618
12 # All information contained in this document is Broadcom Corporation
13 # company private, proprietary, and trade secret.
15 #****************************************************************************
19 if [ "$MOD_DIR" == "" ] ; then
20 MOD_DIR=$PROFILE/modules
23 if [ "$FSSRC_DIR" == "" ]; then
30 # Create file system dir
33 # Copy files onto root file system
34 echo "Creating target root file system..."
35 cp -av $FSSRC_DIR/* $ROOTFS
36 # Create directories as needed
41 mkdir $ROOTFS/etc/adsl
42 cp -av $BRCMDRIVERS_DIR/broadcom/char/adsl/bcm9$BRCM_CHIP/*.bin $ROOTFS/etc/adsl
43 DEFAULTCFG=`echo $DEFAULTCFG_DIR/$BRCM_DEFAULTCFG|sed -e 's/\"//g'`
44 if [ -f "$DEFAULTCFG" ]; then
45 cp -v $DEFAULTCFG $ROOTFS/etc/default.cfg; chmod a+r $ROOTFS/etc/default.cfg
46 elif [ $BRCM_DEFAULTCFG != '""' ]; then
48 echo " No default run-time config file called $BRCM_DEFAULTCFG in $DEFAULTCFG_DIR"
49 echo " Check your profile setting!"
56 # Create symbolic links
57 ln -s /var/log/log $ROOTFS/dev/log
58 ln -s /var/sysmsg $ROOTFS/etc/sysmsg
59 ln -s /var/passwd $ROOTFS/etc/passwd
60 ln -s /var/group $ROOTFS/etc/group
61 ln -s /var/ppp/pppmsg $ROOTFS/etc/pppmsg
62 ln -s /var/fyi/sys/dns $ROOTFS/etc/resolv.conf
63 ln -s /var/fyi/sys/gateway $ROOTFS/etc/gateway.conf
64 ln -s /var/udhcpd/udhcpd.conf $ROOTFS/etc/udhcpd.conf
65 ln -s /var/udhcpd/udhcpd.leases $ROOTFS/etc/udhcpd.leases
66 ln -s /var/ipsec/ipsec.conf $ROOTFS/etc/ipsec.conf
67 ln -s /var/ipsec/racoon.conf $ROOTFS/etc/racoon.conf
68 ln -s /var/ipsec/psk.txt $ROOTFS/etc/psk.txt
70 if [ -x $PROFILE/special-buildFS ]; then
71 $PROFILE/special-buildFS
74 # Copy proprietary binaries if any
75 FSBIN=`ls $TOP_DIR/fs.bin|wc -l`
76 if [ $FSBIN != 0 ]; then
77 echo "Copying proprietary binaries..."
79 cp -avf fs.bin/* $ROOTFS
82 # Stripping unneeded module symbols
84 cp -a lib $TOP_DIR/$ROOTFS/.
85 chown -R root:root $TOP_DIR/$ROOTFS/lib
86 echo "Stripping kernel modules..."
87 find $TOP_DIR/$ROOTFS/lib/modules -name "*.ko"
88 #Modules that need parameters cannot be stripped
89 #MODS_KEEPSYM='! -name "ip_conntrack_pt.ko" ! -name "ip_nat_pt.ko"'
90 MODS_KEEPSYM='! -name "ip*.ko"'
91 eval "find $TOP_DIR/$ROOTFS/lib/modules -name '*.ko' $MODS_KEEPSYM |xargs $STRIP --strip-unneeded"
93 #delete unwanted module
94 MODULE_CLEAN_UP="wldrv.ko"
95 for f in $MODULE_CLEAN_UP; do \
96 eval "find $TOP_DIR/$ROOTFS/lib/modules -name $f |xargs rm -f";\
99 # Continue to strip user apps and shared libraries using sstrip
100 echo "Stripping userapps and shared libraries more..."
101 $SSTRIP $TOP_DIR/$ROOTFS/bin/* $TOP_DIR/$ROOTFS/lib/*.so*