[arch-releng] Final work about squashfs compression support
All this work is in my experimental branch. Tested and works (gzip only). As plus, there is a patch for support multiple "syslinux.cfg" in archiso2dual. http://github.com/djgera/archiso/compare/master...experimental
Add a note about supported status in Linux versions. Needs squashfs-tools-4.1 (now on extra). Signed-off-by: Gerardo Exequiel Pozzi <vmlinuz386@yahoo.com.ar> --- archiso/mkarchiso | 12 +++++++++--- 1 files changed, 9 insertions(+), 3 deletions(-) diff --git a/archiso/mkarchiso b/archiso/mkarchiso index c7de1da..12ff023 100755 --- a/archiso/mkarchiso +++ b/archiso/mkarchiso @@ -7,6 +7,7 @@ PACCONFIG="/etc/pacman.conf" export LABEL="ARCH_$(date +%Y%m)" PUBLISHER="Arch Linux <http://www.archlinux.org>" APPLICATION="Arch Linux Live/Rescue CD" +COMPRESSION="gzip" CREATE_DEFAULT="n" APPNAME=$(basename "${0}") @@ -22,6 +23,10 @@ usage () echo " -L <label> Set a label for the disk" echo " -P <publisher> Set a publisher for the disk" echo " -A <application> Set an application name for the disk" + echo " -c <compressor> Set SquashFS compression type: gzip, lzma or lzo. Default $COMPRESSION" + echo " NOTES:" + echo " lzma: not officially supported yet by Linux (2.6.36)" + echo " lzo: needs Linux >= 2.6.36" echo " -d Create default user directory /home/arch" echo " -v Enable verbose output" echo " -h This message" @@ -34,13 +39,14 @@ usage () exit $1 } -while getopts 'p:C:L:P:A:dfvh' arg; do +while getopts 'p:C:L:P:A:c:dfvh' arg; do case "${arg}" in p) PKGLIST="${PKGLIST} ${OPTARG}" ;; C) PACCONFIG="${OPTARG}" ;; L) LABEL="${OPTARG}" ;; P) PUBLISHER="${OPTARG}" ;; A) APPLICATION="${OPTARG}" ;; + c) COMPRESSION="${OPTARG}" ;; d) CREATE_DEFAULT="y" ;; f) FORCE="y" ;; v) QUIET="n" ;; @@ -187,9 +193,9 @@ _mksquash () { echo "Creating SquashFS image. This may take some time..." start=$(date +%s) if [ "${QUIET}" = "y" ]; then - mksquashfs "${1}" "${sqimg}" -noappend >/dev/null + mksquashfs "${1}" "${sqimg}" -noappend -comp "${COMPRESSION}" >/dev/null else - mksquashfs "${1}" "${sqimg}" -noappend + mksquashfs "${1}" "${sqimg}" -noappend -comp "${COMPRESSION}" fi minutes=$(echo $start $(date +%s) | awk '{ printf "%0.2f",($2-$1)/60 }') echo "Image creation done in $minutes minutes." -- 1.7.3.1
Add a note about supported status in Linux versions. Needs squashfs-tools-4.1 (now on extra). Signed-off-by: Gerardo Exequiel Pozzi <vmlinuz386@yahoo.com.ar> --- archiso2dual/archiso2dual | 15 ++++++++++++--- 1 files changed, 12 insertions(+), 3 deletions(-) diff --git a/archiso2dual/archiso2dual b/archiso2dual/archiso2dual index c7dafee..1d78e1a 100755 --- a/archiso2dual/archiso2dual +++ b/archiso2dual/archiso2dual @@ -19,6 +19,7 @@ work_dir="/tmp/archiso2dual" isomounts_file="/usr/share/archiso2dual/isomounts" syslinuxcfg_file="/usr/share/archiso2dual/syslinux.cfg" removefiles_file="/usr/share/archiso2dual/removefiles.lst" +compression="gzip" appname=${0##*/} _error="0" _confirm="n" @@ -114,9 +115,9 @@ mksquashfs_image() { arch=${2} rm -f ${work_dir}/iso/${arch}/${img}.sqfs if [ "${quiet}" = "y" ]; then - mksquashfs ${work_dir}/tmp/${arch}/${img} ${work_dir}/iso/${arch}/${img}.sqfs > /dev/null + mksquashfs ${work_dir}/tmp/${arch}/${img} ${work_dir}/iso/${arch}/${img}.sqfs -comp ${compression} > /dev/null else - mksquashfs ${work_dir}/tmp/${arch}/${img} ${work_dir}/iso/${arch}/${img}.sqfs + mksquashfs ${work_dir}/tmp/${arch}/${img} ${work_dir}/iso/${arch}/${img}.sqfs -comp ${compression} fi } @@ -240,6 +241,12 @@ show_help() (default to '${publisher}')" echo " -A <application> Set an application name for the disk (default to '${application}')" + echo " -c <compressor> Set SquashFS compression type: gzip, lzma or lzo + (default to '${compression}')" + echo " NOTES:" + echo " lzma: not officially supported yet by Linux (2.6.36)" + echo " lzo: needs Linux >= 2.6.36" + echo " -y Confirm execution (otherwise only show configuration)" echo " -v Enable verbose output" echo " -h This message" @@ -260,6 +267,7 @@ show_config() { echo " label: ${label}" echo " publisher: ${publisher}" echo " application: ${application}" + echo " compression: ${compression}" echo if [ "${profile_type}" = "full" ]; then echo "These files will be deleted (selected via -R option)" @@ -335,7 +343,7 @@ if [ "$EUID" != "0" ]; then exit 1 fi -while getopts '3:6:o:T:M:S:R:L:P:A:yvh' arg; do +while getopts '3:6:o:T:M:S:R:L:P:A:c:yvh' arg; do case "${arg}" in 3) isofile_i686="${OPTARG}" ;; 6) isofile_x86_64="${OPTARG}" ;; @@ -351,6 +359,7 @@ while getopts '3:6:o:T:M:S:R:L:P:A:yvh' arg; do L) label="${OPTARG}" ;; P) publisher="${OPTARG}" ;; A) application="${OPTARG}" ;; + c) compression="${OPTARG}" ;; w) work_dir="${OPTARG}" ;; y) _confirm="y" ;; v) quiet="n"; _v="-v" ;; -- 1.7.3.1
This allow to have syslinux.cfg splited in multiple .cfg files. Curretly: -S /path/to/syslinux.cfg Changed to: -S /path/where/are/syslinux.cfgs.files/ Signed-off-by: Gerardo Exequiel Pozzi <vmlinuz386@yahoo.com.ar> --- archiso2dual/Makefile | 4 ++-- archiso2dual/archiso2dual | 16 +++++++++------- 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/archiso2dual/Makefile b/archiso2dual/Makefile index c216e11..84540db 100644 --- a/archiso2dual/Makefile +++ b/archiso2dual/Makefile @@ -2,9 +2,9 @@ all: install: all install -D -m 755 archiso2dual $(DESTDIR)/usr/sbin/archiso2dual - install -d -m 755 $(DESTDIR)/usr/share/archiso2dual/ + install -d -m 755 $(DESTDIR)/usr/share/archiso2dual/syslinux install -D -m 644 isomounts $(DESTDIR)/usr/share/archiso2dual/isomounts - install -D -m 644 syslinux.cfg $(DESTDIR)/usr/share/archiso2dual/syslinux.cfg + install -D -m 644 syslinux.cfg $(DESTDIR)/usr/share/archiso2dual/syslinux/syslinux.cfg install -D -m 644 removefiles.lst $(DESTDIR)/usr/share/archiso2dual/removefiles.lst uninstall: diff --git a/archiso2dual/archiso2dual b/archiso2dual/archiso2dual index 1d78e1a..457e902 100755 --- a/archiso2dual/archiso2dual +++ b/archiso2dual/archiso2dual @@ -17,7 +17,7 @@ quiet="y" profile_type="basic" work_dir="/tmp/archiso2dual" isomounts_file="/usr/share/archiso2dual/isomounts" -syslinuxcfg_file="/usr/share/archiso2dual/syslinux.cfg" +syslinuxcfg_dir="/usr/share/archiso2dual/syslinux" removefiles_file="/usr/share/archiso2dual/removefiles.lst" compression="gzip" appname=${0##*/} @@ -62,7 +62,9 @@ syslinux_copy() { syslinuxcfg_copy() { echo "Executing: ${FUNCNAME}" - sed "s|XXX|${label}|g" ${syslinuxcfg_file} > $work_dir/iso/boot/syslinux/syslinux.cfg + for _cfg in ${syslinuxcfg_dir}/*.cfg; do + sed "s|XXX|${label}|g" ${_cfg} > $work_dir/iso/boot/syslinux/$(basename ${_cfg}) + done } isomounts_copy() { @@ -225,7 +227,7 @@ show_help() echo " -M <isomounts> Path to isomounts file (default to '${isomounts_file}'" echo " -S <syslinux> Path to syslinux.cfg file - (default to '${syslinuxcfg_file}'" + (default to '${syslinuxcfg_dir}'" echo " -R <removefiles> Path to removefiles file (default to '${removefiles_file}'" echo " -w <workdir> Set work directory @@ -260,7 +262,7 @@ show_config() { echo " source iso x86_64 image: ${isofile_x86_64}" echo " target iso image: ${imgname}" echo " isomounts file: ${isomounts_file}" - echo " syslinux.cfg file: ${syslinuxcfg_file}" + echo " syslinux.cfg path: ${syslinuxcfg_dir}" echo " removefiles.lst file: ${removefiles_file}" echo " working directory: ${work_dir}" echo " profile: ${profile_type}" @@ -318,8 +320,8 @@ sanity_check() { _error="1" fi - if [ ! -f "${syslinuxcfg_file}" ]; then - echo "*ERROR*: ${syslinuxcfg_file} does not exist, specify one with -S option" + if [ ! -f "${syslinuxcfg_dir}/syslinux.cfg" ]; then + echo "*ERROR*: ${syslinuxcfg_dir}/syslinux.cfg does not exist, specify one with -S option" _error="1" fi @@ -354,7 +356,7 @@ while getopts '3:6:o:T:M:S:R:L:P:A:c:yvh' arg; do esac ;; M) isomounts_file="${OPTARG}" ;; - S) syslinuxcfg_file="${OPTARG}" ;; + S) syslinuxcfg_dir="${OPTARG}" ;; R) removefiles_file="${OPTARG}" ;; L) label="${OPTARG}" ;; P) publisher="${OPTARG}" ;; -- 1.7.3.1
participants (1)
-
Gerardo Exequiel Pozzi