[arch-releng] [PATCH - help needed] archiso2dual: Autodetect whether we can boot x86_64

Gerardo Exequiel Pozzi vmlinuz386 at yahoo.com.ar
Sun Oct 17 14:14:46 EDT 2010


  On 10/17/2010 02:46 PM, Thomas Bächler wrote:
> ---
>
> I'd like to have autodetection for 64 bit CPUs. I have attached a patch for
> archiso2dual, which works fine - however, as the configuration file is split
> into several files, I don't know how to make this work with archiso2dual's -S
> option. Does anyone have an idea on how to do this?
>
-S option is for a syslinux.cfg file. What I can do is to modify 
behaviour: -S file -> -S directory

So always copy/parse all files on it (needed and not needed) to change 
archisolabel.

agree?

This how can look (not tested):

diff --git a/archiso2dual/archiso2dual b/archiso2dual/archiso2dual
index 5b17b4a..9a966fd 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"
  appname=${0##*/}
  _error="0"
@@ -60,7 +60,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() {
@@ -223,7 +225,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
@@ -252,7 +254,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}"
@@ -309,8 +311,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

@@ -345,7 +347,7 @@ while getopts '3:6:o:T:M:S:R:L:P:A: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}" ;;



-- 
Gerardo Exequiel Pozzi
\cos^2\alpha + \sin^2\alpha = 1




More information about the arch-releng mailing list