Changeset 6877


Ignore:
Timestamp:
07/26/10 04:16:37 (3 years ago)
Author:
alanbach-guest
Message:
  • Added support for creating ISOs and compressed filesystem for two or more concurrent distros
Location:
scripts/devel
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • scripts/devel/chroot.bash

    r4938 r6877  
    11#!/bin/bash 
    22# Bash script to chroot into Parsix roots 
    3 # Coyright 2005-2008 Alan Baghumian / GNU/GPL 
     3# Coyright 2005-2010 Alan Baghumian / GNU/GPL 
    44 
    55usage() 
    66{ 
    7   echo "Usage: chroot <32|64>" 
     7  echo "Usage: chroot <32|64> <distro>" 
    88  exit 
    99} 
     
    1313fi 
    1414 
     15if [ -z "${2}" ]; then 
     16   usage 
     17fi 
     18 
    1519if [ "${1}" != "32" -a "${1}" != "64" ]; then 
    16     echo "Invalid arch. Usage: chroot <32|64>" 
     20    echo "Invalid arch. Usage: chroot <32|64> <distro>" 
    1721    exit 
    1822fi 
    1923 
    2024# mount needed file systems 
    21 mount -o bind /proc source${1}/PARSIX/proc 
    22 mount -o bind /dev source${1}/PARSIX/dev 
    23 mount -o bind /dev/pts source${1}/PARSIX/dev/pts 
    24 mount -o bind /sys source${1}/PARSIX/sys 
     25mount -o bind /proc source${1}.${2}/PARSIX/proc 
     26mount -o bind /dev/pts source${1}.${2}/PARSIX/dev/pts 
     27mount -o bind /sys source${1}.${2}/PARSIX/sys 
    2528 
    26 chroot source${1}/PARSIX/ 
     29chroot source${1}.${2}/PARSIX/ 
    2730 
    2831# clean-up 
    29 to_purge=`chroot source${1}/PARSIX dpkg -l | grep ^rc | awk '{print $2}'` 
    30 is_orphan=`chroot source${1}/PARSIX deborphan` 
     32to_purge=`chroot source${1}.${2}/PARSIX dpkg -l | grep ^rc | awk '{print $2}'` 
     33is_orphan=`chroot source${1}.${2}/PARSIX deborphan` 
    3134 
    3235if [ ! -z "${to_purge}" ]; then 
    33     chroot source${1}/PARSIX echo "${to_purge}" | xargs dpkg -P 
     36    chroot source${1}.${2}/PARSIX echo "${to_purge}" | xargs dpkg -P 
    3437fi 
    3538 
    3639#if [ ! -z "${is_orphan}" ]; then 
    37 #    chroot source${1}/PARSIX echo "${is_orphan}" | xargs dpkg -P 
     40#    chroot source${1}.${2}/PARSIX echo "${is_orphan}" | xargs dpkg -P 
    3841#fi 
    3942 
    4043# reset logs 
    41 rm source${1}/PARSIX/var/log/dpkg.log &>/dev/null 
    42 rm source${1}/PARSIX/var/log/scrollkeeper.log &>/dev/null 
     44rm source${1}.${2}/PARSIX/var/log/dpkg.log &>/dev/null 
     45rm source${1}.${2}/PARSIX/var/log/scrollkeeper.log &>/dev/null 
    4346 
    44 touch source${1}/PARSIX/var/log/dpkg.log &>/dev/null 
    45 touch source${1}/PARSIX/var/log/scrollkeeper.log &>/dev/null 
     47touch source${1}.${2}/PARSIX/var/log/dpkg.log &>/dev/null 
     48touch source${1}.${2}/PARSIX/var/log/scrollkeeper.log &>/dev/null 
    4649 
    47 chroot source${1}/PARSIX chmod 640 /var/log/dpkg.log 
    48 chroot source${1}/PARSIX chown root:adm /var/log/dpkg.log 
     50chroot source${1}.${2}/PARSIX chmod 640 /var/log/dpkg.log 
     51chroot source${1}.${2}/PARSIX chown root:adm /var/log/dpkg.log 
    4952 
    50 chroot source${1}/PARSIX chmod 644 /var/log/scrollkeeper.log 
    51 chroot source${1}/PARSIX chown root:root /var/log/scrollkeeper.log 
     53chroot source${1}.${2}/PARSIX chmod 644 /var/log/scrollkeeper.log 
     54chroot source${1}.${2}/PARSIX chown root:root /var/log/scrollkeeper.log 
    5255 
    5356# unmount needed file systems 
    54 umount -f source${1}/PARSIX/proc 
    55 umount -f source${1}/PARSIX/dev/pts 
     57umount -f source${1}.${2}/PARSIX/proc 
     58umount -f source${1}.${2}/PARSIX/dev/pts 
     59umount -f source${1}.${2}/PARSIX/sys 
    5660 
  • scripts/devel/compile-iso.bash

    r4803 r6877  
    11#!/bin/bash 
    22# Bash script to compile Parsix ISOs from source 
    3 # Coyright 2005-2009 Alan Baghumian / GNU/GPL 
    4 # Updated: Dec 28, 2008 11:21 -800 
     3# Coyright 2005-2010 Alan Baghumian / GNU/GPL 
     4# Updated: July 25, 2010 14:56 -700 
    55 
    66publisher="Parsix Project" 
     
    1111 
    1212if [ -z "${1}" -o -z "${2}" ]; then 
    13     echo "Argument(s) is missing, Usage: compile-iso.bash [32|64] [version] <--iso> " 
     13    echo "Argument(s) is missing, Usage: compile-iso.bash [32|64] [version] [distro] <--iso> " 
    1414    exit 
    1515fi 
     
    2020fi 
    2121 
    22 if [ ! -z "${3}" ]; then 
    23    if [ "${3}" == "--iso" ]; then 
     22if [ -z "${3}" ]; then 
     23    echo "Invalid distro name." 
     24    exit 
     25fi 
     26 
     27if [ ! -z "${4}" ]; then 
     28   if [ "${4}" == "--iso" ]; then 
    2429       compress="false" 
    2530   else 
     
    3237 
    3338if [ "${1}" == "32" ]; then 
    34      source="source32" 
    35      master="master32" 
     39     source="source32.${3}" 
     40     master="master32.${3}" 
    3641     debdir="deb32" 
    3742     arch="i386" 
    3843else 
    39      source="source64" 
    40      master="master64" 
     44     source="source64.${3}" 
     45     master="master64.${3}" 
    4146     debdir="deb64" 
    4247     arch="amd64" 
     
    97102 
    98103        # SquashFS+Lzma Compression, 512k block 
    99         mksquashfs ${source}/PARSIX/ ${master}/PARSIX/PARSIX -b 524288 
     104        mksquashfs ${source}/PARSIX/ ${master}/PARSIX/PARSIX -b 524288  -comp lzma 
    100105fi 
    101106 
    102107# Update static files 
    103 cp  -r static/* ${master}/ &>/dev/null 
     108cp  -r static.${3}/* ${master}/ &>/dev/null 
     109cp ${source}/PARSIX/boot/vmlinuz* ${master}/boot/linux 
     110cp ${source}/PARSIX/boot/initrd* ${master}/boot/initrd 
     111cp ${source}/PARSIX/boot/parsix-grub2.tga ${master}/boot/parsix-grub2.tga 
    104112sed -i s/"@version@"/"${2}"/g ${master}/README 
    105113sed -i s/"@date@"/"${date_long}"/g ${master}/README 
     
    108116sed -i s/"@date@"/"${date_long}"/g ${master}/ChangeLog 
    109117sed -i s/"@arch@"/"${arch}"/g ${master}/ChangeLog 
    110 sed -i s/"@version@"/"${2}"/g ${master}/boot/isolinux/f1.txt 
    111 sed -i s/"@date@"/"${date_long}"/g ${master}/boot/isolinux/f1.txt 
    112 sed -i s/"@version@"/"${2}"/g ${master}/boot/isolinux/en.hlp 
    113 sed -i s/"@date@"/"${date_long}"/g ${master}/boot/isolinux/en.hlp 
     118sed -i s/"@version@"/"${2}"/g ${master}/boot/grub/grub.cfg 
     119sed -i s/"@date@"/"${date_long}"/g ${master}/boot/grub/grub.cfg 
     120sed -i s/"@arch@"/"${arch}"/g ${master}/boot/grub/grub.cfg 
    114121 
    115122# Generate ISO 
    116123(cd ${master}/ && find -type f -not -name md5sums -not -name boot.cat -not -name isolinux.bin -exec md5sum '{}' \; > md5sums) 
    117124 
    118 mkisofs -pad -l -r -J -v -V "Parsix-${2}-${arch}" -P "${publisher}" -no-emul-boot -boot-load-size 4 -boot-info-table -b boot/isolinux/isolinux.bin -c boot/isolinux/boot.cat -hide-rr-moved -o iso/parsix_${2}-${arch}.iso ${master}/ 
     125#mkisofs -pad -l -r -J -v -V "Parsix-${2}-${arch}" -P "${publisher}" -no-emul-boot -boot-load-size 4 -boot-info-table -b boot/isolinux/isolinux.bin -c boot/isolinux/boot.cat -hide-rr-moved -o iso/parsix_${2}-${arch}.iso ${master}/ 
    119126 
     127#grub-mkrescue --modules="linux ext2 fshelp ls boot pc" --output=iso/parsix_${2}-${arch}.iso ${master}/ 
     128grub-mkrescue --modules="linux ext2 fshelp ls boot pc" --output=iso/parsix_${2}-${arch}.iso ${master}/ 
Note: See TracChangeset for help on using the changeset viewer.