xentaur
diff build-xenomips-image @ 7:825cd93472de
Dodelal
author | igor |
---|---|
date | Thu Aug 02 20:46:09 2007 +0300 (2007-08-02) |
parents | ab37f0ad70e5 |
children | 3d837efe2d1c |
line diff
1.1 --- a/build-xenomips-image Fri Jul 13 16:57:33 2007 +0300 1.2 +++ b/build-xenomips-image Thu Aug 02 20:46:09 2007 +0300 1.3 @@ -2,24 +2,23 @@ 1.4 1.5 DYNAMIPS_BUILD=yes 1.6 XENOMIPS_FS_BUILD=yes 1.7 -CONFIG_FS_BUILD=no 1.8 +CONFIG_FS_BUILD=yes 1.9 IOS_FS_BUILD=yes 1.10 1.11 +XENOMIPS_DIR="files/" 1.12 +XENOMIPS_IMAGES_DIR="../images/" 1.13 + 1.14 #Xenomips FS 1.15 XENOMIPS_FS_SIZE=2048k # size in 1k blocks 1.16 -XENOMIPS_FS_NAME=xenomips1.img 1.17 +XENOMIPS_FS_NAME=${XENOMIPS_IMAGES_DIR}/xenomips1.img 1.18 1.19 # Config FS 1.20 -CONFIG_FS_SIZE=100k 1.21 -CONFIG_FS_NAME=xenomips-config1.img 1.22 +CONFIG_FS_SIZE=1000k 1.23 +CONFIG_FS_NAME=${XENOMIPS_IMAGES_DIR}/xenomips-config1.img 1.24 1.25 # IOS FS 1.26 IOS_FS_SIZE=2048k 1.27 -IOS_FS_NAME=xenomips-ios1.img 1.28 - 1.29 - 1.30 -XENOMIPS_DIR="files/" 1.31 - 1.32 +IOS_FS_NAME=${XENOMIPS_IMAGES_DIR}/xenomips-ios1.img 1.33 1.34 DEBIAN_MIRROR=http://debian.org.ua/debian 1.35 DISTRO=sid 1.36 @@ -32,6 +31,7 @@ 1.37 IOS_DIR="ios/" 1.38 1.39 WORK_DIR=${XENOMIPS_FS_NAME%%.img} 1.40 +WORK_DIR2=/tmp/xenomips-build 1.41 1.42 build_and_install_dynamips() 1.43 { 1.44 @@ -58,7 +58,7 @@ 1.45 1.46 dd if=/dev/zero of=${XENOMIPS_FS_NAME} count=${XENOMIPS_FS_SIZE} bs=1024 1.47 mkfs.ext3 -F ${XENOMIPS_FS_NAME} 1.48 -mkdir -p ${WORK_DIR} 1.49 +mkdir -p ${WORK_DIR} ${WORK_DIR2} 1.50 mount -o loop ${XENOMIPS_FS_NAME} ${WORK_DIR} 1.51 debootstrap ${DISTRO} ${WORK_DIR} ${DEBIAN_MIRROR} 1.52 cat <<SCRIPT | chroot ${WORK_DIR} sh -s 1.53 @@ -85,11 +85,16 @@ 1.54 cd /etc/rcS.d; ln -s ../init.d/xenomips-init S35xenomips-init 1.55 rm /etc/rc2.d/S*quagga 1.56 1.57 -perl -i -p -e s@C_PATH=/etc/quagga@C_PATH=/xenomips/etc/quagga@ /etc/init.d/quagga 1.58 +#perl -i -p -e s@C_PATH=/etc/quagga@C_PATH=/xenomips/etc/quagga@ /etc/init.d/quagga 1.59 +mv /etc/quagga /etc/quagga.ORIG 1.60 +ln -s /xenomips/config/etc/quagga /etc/quagga 1.61 1.62 -mkdir -p /xenomips/{ios,config,dynamips,etc/quagga} /var/lib/xenomips /root/.ssh 1.63 +mkdir -p /xenomips/{ios,config,dynamips} /var/lib/xenomips /root/.ssh 1.64 1.65 +cat <<PROFILE >> /root/.profile 1.66 +TERM=linux 1.67 screen -ls | grep -q Attached && screen -x || screen -ls | grep -q Detached && screen -r 1.68 +PROFILE 1.69 SCRIPT 1.70 1.71 cp -R /lib/modules/${KERNEL_VERSION} ${WORK_DIR}/lib/modules 1.72 @@ -103,6 +108,7 @@ 1.73 1.74 build_and_install_dynamips 1.75 1.76 +mv ${WORK_DIR}/etc/quagga ${WORK_DIR2} 1.77 umount ${WORK_DIR} 1.78 1.79 if echo $CONFIG_FS_BUILD | grep -qi ^y 1.80 @@ -111,6 +117,9 @@ 1.81 mkfs.ext3 -F ${CONFIG_FS_NAME} 1.82 fi 1.83 1.84 +mount -o loop ${CONFIG_FS_NAME} ${WORK_DIR} 1.85 +mkdir -p ${WORK_DIR}/etc 1.86 +mv ${WORK_DIR2}/quagga ${WORK_DIR}/etc 1.87 1.88 if echo $IOS_FS_BUILD | grep -qi ^y 1.89 then