diff --git a/scripts/config/686.conf b/scripts/config/686.conf new file mode 100644 index 000000000..f278dfc5c --- /dev/null +++ b/scripts/config/686.conf @@ -0,0 +1,6 @@ +VERSION="" +ARCH="i686" +PACKAGES="/home/ftp/core/os/${ARCH}/packages.txt" +PACKAGEDIR="/home/ftp/core/os/${ARCH}" +###not used atm! +#KERNELDIR="" diff --git a/scripts/config/x86_64.conf b/scripts/config/x86_64.conf new file mode 100644 index 000000000..ef07d75e6 --- /dev/null +++ b/scripts/config/x86_64.conf @@ -0,0 +1,4 @@ +VERSION="" +ARCH="x86_64" +PACKAGES="/home/ftp/core/os/${ARCH}/packages.txt" +PACKAGEDIR="/home/ftp/core/os/${ARCH}" diff --git a/scripts/create-upload-tarball.sh b/scripts/create-upload-tarball.sh new file mode 100755 index 000000000..51ac2a2b3 --- /dev/null +++ b/scripts/create-upload-tarball.sh @@ -0,0 +1,25 @@ +#! /bin/sh +ARCH="$(uname -m)" +NAME="$(date +%Y%m%d)" +mkdir iso-creator-$ARCH +cd iso-creator-$ARCH +mkbootcd -c=/etc/archboot/archbootcd.conf -t=$NAME-$ARCH.tar.bz2 +mkbootcd -c=/etc/archboot/archbootcd-lowmem.conf -t=$NAME-$ARCH-lowmem.tar.bz2 +mkdir normal +mkdir lowmem +tar xvfj $NAME-$ARCH.tar.bz2 +mv tmp normal/ +tar xvfj $NAME-$ARCH-lowmem.tar.bz2 +mv tmp lowmem/ +DIR=$(echo normal/tmp/*) +DIR_LOWMEM=$(echo lowmem/tmp/*) +cp $DIR_LOWMEM/isolinux/boot.msg $DIR/isolinux/boot-lowmem.msg +cp $DIR_LOWMEM/isolinux/initrd.img $DIR/isolinux/lowmem.img +cp $DIR_LOWMEM/isolinux/isolinux.cfg $DIR/isolinux/isolinux-lowmem.cfg +rm -r lowmem/ +mv normal/* ./ +rm -r normal/ +tar cvfj $NAME-$ARCH-upload.tar.bz2 tmp/ +mv $NAME-$ARCH-upload.tar.bz2 ../ +cd .. +rm -r iso-creator-$ARCH/ diff --git a/scripts/generate-isos.sh b/scripts/generate-isos.sh new file mode 100755 index 000000000..f4d1b1adc --- /dev/null +++ b/scripts/generate-isos.sh @@ -0,0 +1,180 @@ +#! /bin/sh +# Created by Tobias Powalowski +# Settings +APPNAME=$(basename "${0}") +IMAGE="" +CONFIG="" +VERSION="" +ARCH="" +PACMAN="" +PACKAGES="" +PACKAGEDIR="" +KERNELDIR="" + +usage () +{ + echo "${APPNAME}: usage" + echo "Needed:" + echo " -i=IMAGE boot IMAGE for ISO creation" + echo " -v=VERSION VERSION name of ISO image" + echo " -a=ARCH architecture name of ISO image" + echo " -P=PACKAGES packages.txt file on ISO image" + echo " -PD=PACKAGEDIR directory with packages included" + echo " -KD=KERNELDIR directory with alternate kernel included" + echo "Optional:" + echo " -c=CONFIG Use CONFIG file with included parameters." + echo " -h this message" + exit 1 +} + +[ "$1" == "" ] && usage + + +while [ $# -gt 0 ]; do + case $1 in + -i=*|--i=*) IMAGE="$(echo $1 | awk -F= '{print $2;}')" ;; + -c=*|--c=*) CONFIG="$(echo $1 | awk -F= '{print $2;}')" ;; + -v=*|--v=*) VERSION="$(echo $1 | awk -F= '{print $2;}')" ;; + -a|--a) ARCH="$(echo $1 | awk -F= '{print $2;}')" ;; + -p|--p) PACMAN="$(echo $1 | awk -F= '{print $2;}')" ;; + -P=*|--P=*) PACKAGES="$(echo $1 | awk -F= '{print $2;}')" ;; + -PD=*|--PD=*) PACKAGEDIR="$(echo $1 | awk -F= '{print $2;}')" ;; + -KD=*|--KD=*) KERNELDIR="$(echo $1 | awk -F= '{print $2;}')" ;; + -h|--h|?) usage ;; + *) usage ;; + esac + shift +done + +. ${CONFIG} +# check for parameters +if ! [ -e "${IMAGE}" ] ; then + echo "Image does not exist, aborting now." + exit 1 +fi +if [ "${VERSION}" = "" -o "${ARCH}" = "" -o "${PACKAGES}" = "" -o "${PACKAGEDIR}" = "" ]; then + echo "One parameter is missing please check your paramters, aborting now" + exit 1 +fi + +if ! [ "$KERNELDIR" = "" ]; then + USE_RC_KERNEL=1 +fi + +# unpack base of installation +tar xfj ${IMAGE} +rm $(echo tmp/*/)isolinux/*lowmem* +# generate ftp iso +! [ -d $ARCH-iso ] && mkdir $ARCH-iso +echo "Generating FTP ${ARCH} ISO ..." +mkisofs -RlDJLV "Arch Linux FTP ${ARCH}" -b isolinux/isolinux.bin -c isolinux/boot.cat -no-emul-boot -boot-load-size 4 -boot-info-table -o $ARCH-iso/Archlinux-${ARCH}-$(date +%Y.%m)-${VERSION}.ftp.iso $(echo tmp/*/) > /dev/null 2>&1 +# generate base iso +#echo "Generating BASE ${ARCH} ISO ..." +#mkdir -p $(echo tmp/*/)arch/pkg/setup +#if [ "$USE_RC_KERNEL" = "1" ]; then +# # make directories and extract db files +# mkdir fake-package +# mkdir -p db/current +# mkdir -p db/kernel +# grep -e base/ -e kernels/ ${PACKAGES} > fake-package/packages.txt +# tar xfz ${PACKAGEDIR}/current.db.tar.gz -C db/current/ +# tar xfz ${KERNELDIR}/kernel.db.tar.gz -C db/kernel/ +# # replace kernel26 with wanted kernel +# sed -i -e "s#$(echo db/current/kernel26* | sed -e's#.*/##g')#$(echo db/kernel/kernel26* | sed -e's#.*/##g')#g" fake-package/packages.txt +# cp fake-package/packages.txt $(echo tmp/*/)arch/pkg/setup/packages.txt +# # change kernel26 in db file +# rm -r db/current/$(echo kernel26*) +# cp -r db/kernel/$(echo kernel26*) db/current/ +# cd db/current +# # regenerate db file +# tar cvfz current.db.tar.gz * +# cd ../../ +# cp db/current/current.db.tar.gz $(echo tmp/*/)arch/pkg/ +# #cleanup db files and packages +# rm -r fake-package/ db/ +# # copy packages +# for i in $(cat $(echo tmp/*/)arch/pkg/setup/packages.txt | sed -e 's#.*/##g'); do +# if ! (echo $i | grep "kernel26*"); then +# cp ${PACKAGEDIR}/$i $(echo tmp/*/)arch/pkg/ || exit 1 +# else +# cp ${KERNELDIR}/$i $(echo tmp/*/)arch/pkg/ || exit 1 +# fi +# done +#else +# grep -e base/ -e kernels/ ${PACKAGES} > $(echo tmp/*/)arch/pkg/setup/packages.txt +# cp ${PACKAGEDIR}/current.db.tar.gz $(echo tmp/*/)arch/pkg/ +# for i in $(cat $(echo tmp/*/)arch/pkg/setup/packages.txt | sed -e 's#.*/##g'); do +# cp ${PACKAGEDIR}/$i $(echo tmp/*/)arch/pkg/ || exit 1 +# done +#fi +#if [ ${PACMAN} = "" ]; then +# for i in $(cat $(echo tmp/*/)arch/pkg/setup/packages.txt | sed -e 's#.*/##g' | grep pacman); do +# cp ${PACKAGEDIR}/$i $(echo tmp/*/)arch/pkg/setup/ || exit 1 +# done +#else +# cp ${PACMAN} $(echo tmp/*/)arch/pkg/setup/ || return 1 +#fi +#mkisofs -RlDJLV "Arch Linux BASE ${ARCH}" -b isolinux/isolinux.bin -c isolinux/boot.cat -no-emul-boot -boot-load-size 4 -boot-info-table -o Archlinux-${ARCH}-$(date +%Y.%m)-${VERSION}.base.iso $(echo tmp/*/) > /dev/null 2>&1 +# generate core +echo "Generating CORE ${ARCH} ISO ..." +mkdir -p $(echo tmp/*/)core/pkg +if [ "$USE_RC_KERNEL" = "1" ] ; then + # make directories and extract db files + mkdir fake-package + mkdir -p db/core + mkdir -p db/kernel + cp ${PACKAGES} fake-package/packages.txt + tar xfz ${PACKAGEDIR}/core.db.tar.gz -C db/core/ + tar xfz ${KERNELDIR}/kernel.db.tar.gz -C db/kernel/ + # replace kernel26 with wanted kernel + sed -i -e "s#$(echo db/core/kernel26* | sed -e's#.*/##g')#$(echo db/kernel/kernel26* | sed -e's#.*/##g')#g" fake-package/packages.txt + cp fake-package/packages.txt $(echo tmp/*/)core/pkg/packages.txt + # change kernel26 in db file + rm -r db/core/$(echo kernel26*) + cp -r db/kernel/$(echo kernel26*) db/core/ + cd db/core + # regenerate db file + tar cvfz core.db.tar.gz * + cd ../../ + cp db/current/core.db.tar.gz $(echo tmp/*/)core/pkg/ + #cleanup db files and packages + rm -r fake-package/ db/ + # copy packages + for i in $(cat $(echo tmp/*/)core/pkg/packages.txt | sed -e 's#.*/##g'); do + if ! (echo $i | grep "kernel26*"); then + cp ${PACKAGEDIR}/$i $(echo tmp/*/)core/pkg/ || exit 1 + else + cp ${KERNELDIR}/$i $(echo tmp/*/)core/pkg/ || exit 1 + fi + done +else + tar xfj ${IMAGE} + cp ${PACKAGES} $(echo tmp/*/)core/pkg/ + cp ${PACKAGEDIR}/core.db.tar.gz $(echo tmp/*/)core/pkg/ + for i in $(cat ${PACKAGES} | sed -e 's#.*/##g'); do + cp ${PACKAGEDIR}/$i $(echo tmp/*/)core/pkg/ || exit 1 + done + cd $(echo tmp/*/)isolinux/ + mv isolinux-lowmem.cfg isolinux.cfg + mv boot-lowmem.msg boot.msg + cd ../../../ +fi +#if [ ${PACMAN} = "" ]; then +# for i in $(cat $(echo tmp/*/)arch/pkg/packages.txt | sed -e 's#.*/##g' | grep pacman); do +# cp ${PACKAGEDIR}/$i $(echo tmp/*/)arch/pkg/ || exit 1 +# done +#else +# cp ${PACMAN} $(echo tmp/*/)arch/pkg/ || return 1 +#fi +! [ -d ${ARCH} ] && mkdir ${ARCH} +mkisofs -RlDJLV "Arch Linux CORE ${ARCH}" -b isolinux/isolinux.bin -c isolinux/boot.cat -no-emul-boot -boot-load-size 4 -boot-info-table -o ${ARCH}/Archlinux-${ARCH}-$(date +%Y.%m)-${VERSION}.core.iso $(echo tmp/*/) > /dev/null 2>&1 +# clean up +rm -r tmp/ +# generate md5sums +echo "Generating md5sums.txt ..." +cd ${ARCH} +for i in *.iso; do md5sum $i >> md5sum.txt; done +# generate torrents +echo "Generating torrent files ..." +maketorrent-console --comment www.archlinux.org http://linuxtracker.org/announce.php * +cd ..