bitkeeper revision 1.953 (40c8a141u6AhH-XX3mAZTtPQdUxzYg)
authoriap10@labyrinth.cl.cam.ac.uk <iap10@labyrinth.cl.cam.ac.uk>
Thu, 10 Jun 2004 17:58:25 +0000 (17:58 +0000)
committeriap10@labyrinth.cl.cam.ac.uk <iap10@labyrinth.cl.cam.ac.uk>
Thu, 10 Jun 2004 17:58:25 +0000 (17:58 +0000)
Fix 'make world' option

Makefile
tools/misc/xen-clone

index 7f51503a39f3d116579dc52e0280b42c1d976f14..acbfb2a23fe3bb2336f5ff81b1a4966742036ee4 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -14,31 +14,42 @@ dist: all
        $(MAKE) prefix=`pwd`/../install dist=yes -C xen install
        $(MAKE) prefix=`pwd`/../install dist=yes -C tools install
 
-LINUX_SRC        ?= ../linux-2.4.26.tar.gz
+LINUX_VER        ?= $(shell ( /bin/ls -ld linux-*-xen-sparse ) 2>/dev/null | sed -e 's!^.*linux-\(.\+\)-xen-sparse!\1!' )
+LINUX_SRC        ?= ../linux-$(LINUX_VER).tar.gz
 LINUX_CONFIG_DIR ?= ../install/config
+
+linux: 
+       # build whatever is in the current linux directory
+       ( cd ../linux-$(LINUX_VER)-xen ; ARCH=xen make bzImage )
+
 world: dist
-       $(RM) ../linux-2.4.26-xen
+       mkdir -p ../install/config
+       $(RM) -rf ../linux-$(LINUX_VER)-xen
+       [ -e $(LINUX_SRC) ] || wget ftp://ftp.kernel.org/pub/linux/kernel/v2.4/linux-$(LINUX_VER).tar.gz -O- > ../linux-$(LINUX_VER).tar.gz
        tar -x -z -C .. -f $(LINUX_SRC)
-       mv ../linux-2.4.26 ../linux-2.4.26-xen
-       cd ../linux-2.4.26-xen
-       cp $(LINUX_CONFIG_DIR)/dom0 .config
-       ARCH=xen make oldconfig; ARCH=xen make dep; ARCH=xen make bzImage
-       install -m0644 arch/xen/boot/bzImage \
-               ../install/boot/vmlinuz-2.4.26-xen0
-       install -m0644 vmlinux ../install/boot/vmlinux-syms-2.4.26-xen0
-       ARCH=xen make mrproper
-       cp $(LINUX_CONFIG_DIR)/unprivileged .config
-       ARCH=xen make oldconfig; ARCH=xen make dep; ARCH=xen make bzImage
-       install -m0644 arch/xen/boot/bzImage \
-               ../install/boot/vmlinuz-2.4.26-xen
-       install -m0644 vmlinux ../install/boot/vmlinux-syms-2.4.26-xen
+       mv ../linux-$(LINUX_VER) ../linux-$(LINUX_VER)-xen
+       ( cd linux-$(LINUX_VER)-xen-sparse ; ./mkbuildtree ../../linux-$(LINUX_VER)-xen )
+       cp $(LINUX_CONFIG_DIR)/dom0 ../linux-$(LINUX_VER)-xen/.config || cp linux-$(LINUX_VER)-xen-sparse/arch/xen/defconfigs/dom0 ../linux-$(LINUX_VER)-xen/.config
+       ( cd ../linux-$(LINUX_VER)-xen; ARCH=xen make oldconfig; ARCH=xen make dep; ARCH=xen make bzImage )
+       install -m0644 ../linux-$(LINUX_VER)-xen/arch/xen/boot/bzImage \
+               ../install/boot/vmlinuz-$(LINUX_VER)-xen0
+       install -m0644 ../linux-$(LINUX_VER)-xen/vmlinux ../install/boot/vmlinux-syms-$(LINUX_VER)-xen0
+       install -m0644 ../linux-$(LINUX_VER)-xen/.config $(LINUX_CONFIG_DIR)/dom0
+       ( cd ../linux-$(LINUX_VER)-xen ; ARCH=xen make mrproper )
+       cp $(LINUX_CONFIG_DIR)/unprivileged ../linux-$(LINUX_VER)-xen/.config || cp linux-$(LINUX_VER)-xen-sparse/arch/xen/defconfigs/unprivileged ../linux-$(LINUX_VER)-xen/.config 
+       ( cd ../linux-$(LINUX_VER)-xen; ARCH=xen make oldconfig; ARCH=xen make dep; ARCH=xen make bzImage )
+       install -m0644 ../linux-$(LINUX_VER)-xen/arch/xen/boot/bzImage \
+               ../install/boot/vmlinuz-$(LINUX_VER)-xen
+       install -m0644 ../linux-$(LINUX_VER)-xen/vmlinux ../install/boot/vmlinux-syms-$(LINUX_VER)-xen
+       install -m0644 ../linux-$(LINUX_VER)-xen/.config $(LINUX_CONFIG_DIR)/unprivileged
 
 clean: delete-symlinks
        $(MAKE) -C xen clean
        $(MAKE) -C tools clean
 
 make-symlinks: delete-symlinks
-       ln -sf linux-2.4.26-xen-sparse linux-xen-sparse
+       ln -sf linux-$(LINUX_VER)-xen-sparse linux-xen-sparse
 
 delete-symlinks:
        $(RM) linux-xen-sparse
\ No newline at end of file
index 0815bf167d44de0d33854bd8b41fc1bf15f3c216..ea3b483316ae09fe4474b6a868c48389ac6a9476 100755 (executable)
@@ -60,41 +60,66 @@ bk pull
 cd ${TOP}
 fi
 
-# identify this version of linux
-LINUX_VER=`( /bin/ls -ld ${DEST_BK_REP}/xenolinux-sparse || /bin/ls -ld ${DEST_BK_REP}/xenolinux-*-sparse ) 2>/dev/null | sed -e 's!^.*xenolinux-\(.\+\)-sparse!\1!'`
 
-if [ -z "${LINUX_VER}" ]
+if [ -d ${DEST_BK_REP}/linux-*-xen-sparse ]
 then
-echo Unable to identify Linux version. Bailing.
-exit -1
-fi
+ # this is a new style Xen repository so building is dead easy
+
+ LINUX_VER=`( /bin/ls -ld ${DEST_BK_REP}/*linux-*-xen-sparse ) 2>/dev/null | sed -e 's!^.*linux-\(.\+\)-xen-sparse!\1!'`
+
+ if [ -e ${LINUX_DIR}/linux-${LINUX_VER}.tar.gz ]  
+  LINUX_SRC=${LINUX_DIR}/linux-${LINUX_VER}.tar.gz
+ elif
+  wget ftp://ftp.kernel.org/pub/linux/kernel/v2.4/linux-${LINUX_VER}.tar.gz -O- > linux-${LINUX_VER}.tar.gz
+  LINUX_SRC=''
+ fi
+
+ cd ${DEST_BK_REP} 
+ make world
+ cd ../install/boot
+ ln -s vmlinux-${LINUX_VER}-xen0 xenolinux.gz
+  
+elif
+ # old style repository without 'make world'
+
+
+ # identify this version of linux
+ LINUX_VER=`( /bin/ls -ld ${DEST_BK_REP}/*xenolinux-sparse || /bin/ls -ld ${DEST_BK_REP}/*xenolinux-*-sparse ) 2>/dev/null | sed -e 's!^.*xenolinux-\(.\+\)-sparse!\1!'`
+
+ if [ -z "${LINUX_VER}" ]
+ then
+ echo Unable to identify Linux version. Bailing.
+ exit -1
+ fi
+
+ # copy in the master Linux tree for this kernel
+ if [ ! -d linux-${LINUX_VER} ]
+ then
+ tar -jxf ${LINUX_DIR}/linux-${LINUX_VER}.tar.bz2 || tar -zxf ${LINUX_DIR}/linux-${LINUX_VER}.tar.gz || tar -zxf ${LINUX_DIR}/linux-${LINUX_VER}.tgz || cp -a ${LINUX_DIR}/linux-${LINUX_VER} . ||  wget ftp://ftp.kernel.org/pub/linux/kernel/v2.4/linux-${LINUX_VER}.tar.gz -O- | tar -zxf - || exit -1
+ fi
+
+ # build and install Xen and tools
+ cd ${DEST_BK_REP}
+ make dist || make install
+
+ # Turn linux into xenolinux then build it
+ cd xenolinux-${LINUX_VER}-sparse
+ ./mkbuildtree ../../linux-${LINUX_VER}
+ cd ../..
+ mv linux-${LINUX_VER} xenolinux-${LINUX_VER}
+ cd xenolinux-${LINUX_VER}
+
+ # cope with the change from ARCH=xeno to ARCH=xen
+ cd arch; XEN=`/bin/ls -d xen*`; cd ..
+
+ # built it all
+ ARCH=$XEN make oldconfig
+ ARCH=$XEN make dep
+ ARCH=$XEN make bzImage
+ ARCH=$XEN make dist || ARCH=xen make install
+ ARCH=$XEN make modules
+ ARCH=$XEN make INSTALL_MOD_PATH=${TOP}/install modules_install
+ cd ..
 
-# copy in the master Linux tree for this kernel
-if [ ! -d linux-${LINUX_VER} ]
-then
-tar -jxf ${LINUX_DIR}/linux-${LINUX_VER}.tar.bz2 || tar -zxf ${LINUX_DIR}/linux-${LINUX_VER}.tar.gz || tar -zxf ${LINUX_DIR}/linux-${LINUX_VER}.tgz || cp -a ${LINUX_DIR}/linux-${LINUX_VER} . ||  wget ftp://ftp.kernel.org/pub/linux/kernel/v2.4/linux-${LINUX_VER}.tar.gz -O- | tar -zxf - || exit -1
 fi
 
-# build and install Xen and tools
-cd ${DEST_BK_REP}
-make dist || make install
-
-# Turn linux into xenolinux then build it
-cd xenolinux-${LINUX_VER}-sparse
-./mkbuildtree ../../linux-${LINUX_VER}
-cd ../..
-mv linux-${LINUX_VER} xenolinux-${LINUX_VER}
-cd xenolinux-${LINUX_VER}
-
-# cope with the change from ARCH=xeno to ARCH=xen
-cd arch; XEN=`/bin/ls -d xen*`; cd ..
-
-# built it all
-ARCH=$XEN make oldconfig
-ARCH=$XEN make dep
-ARCH=$XEN make bzImage
-ARCH=$XEN make dist || ARCH=xen make install
-ARCH=$XEN make modules
-ARCH=$XEN make INSTALL_MOD_PATH=${TOP}/install modules_install
-cd ..
-