diff options
Diffstat (limited to 'tools')
-rw-r--r-- | tools/Makefile | 25 | ||||
-rwxr-xr-x | tools/make_mdkinst_stage2 | 45 |
2 files changed, 70 insertions, 0 deletions
diff --git a/tools/Makefile b/tools/Makefile new file mode 100644 index 000000000..c76c5fc6d --- /dev/null +++ b/tools/Makefile @@ -0,0 +1,25 @@ +ROOTDEST = /export +BASE = $(ROOTDEST)/Mandrake/base + +ALL = gendepslist rpm2header +.PHONY: clean install + +install: + $(MAKE) gendepslist rpm2header + install make_mdkinst_stage2 gendepslist rpm2header genhdlist $(ROOTDEST)/misc + +gendepslist: %: %.cc + $(CXX) -I/usr/include/rpm $(CFLAGS) $< -lrpm -ldb1 -lz -o $@ + +rpm2header: %: %.c + $(CC) -I/usr/include/rpm $(CFLAGS) $< -lrpm -ldb1 -lz -o $@ + +$(BASE)/depslist: $(BASE)/hdlist gendepslist + ./gendepslist -h $@ $< + +$(BASE)/hdlist: $(RPMS) + $(MAKE) install + ./genhdlist $(ROOTDEST) + +clean: + rm -rf *~ gendepslist rpm2header diff --git a/tools/make_mdkinst_stage2 b/tools/make_mdkinst_stage2 new file mode 100755 index 000000000..724808dd7 --- /dev/null +++ b/tools/make_mdkinst_stage2 @@ -0,0 +1,45 @@ +#!/bin/sh + +[ $# != 2 ] && { + echo "usage: make_mdkinst_stage2 <live dir> <output image>" ; + echo " example: misc/make_mdkinst_stage2 Mandrake/mdkinst Mandrake/base/mdkinst_stage2" + exit +} + +STAGE2TMP=/tmp/stage2_tmp +MKE2FS="/sbin/mke2fs -q -m 0 -F -s 1" +MNTPOINT=/tmp/stage2_img +REP4PMS=/usr/bin/perl-install +DEST=$1 +STAGE2=$2 + +if [ $EUID != "0" ]; then + SUDO="sudo" + PATH="/sbin:/usr/sbin:$PATH" +fi + +$SUDO rm -rf $STAGE2TMP +install -d $STAGE2TMP +$SUDO cp -a $DEST/* $STAGE2TMP + +mkdir -p $MNTPOINT 2>/dev/null +for i in $MNTPOINT $STAGE2; do $SUDO umount $i 2>/dev/null ; done +dd if=/dev/zero of=$STAGE2 bs=1M count=15 +$MKE2FS -N 1000 $STAGE2 +$SUDO mount -t ext2 $STAGE2 $MNTPOINT -o loop + +# hack to reduce the STAGE2 image (do not edit without modifying in DrakX) +rm $STAGE2TMP/usr/X11R6/bin/XF86_VGA16 +for i in /usr/share/locale /usr/share/keymaps /usr/share/xmodmap $REP4PMS/po; do \ + name=`basename $i` ; \ + (cd $STAGE2TMP/$i ; find * | cpio -o 2>/dev/null | bzip2 > ../$name.cpio.bz2 ; cd .. ; rm -rf $name) \ +done +$SUDO cp -a $STAGE2TMP/* $MNTPOINT +$SUDO rm -rf $STAGE2TMP + +$SUDO umount $STAGE2 +rmdir $MNTPOINT + +echo gzipping $STAGE2 + +gzip -f -9 $STAGE2 |