[arch-releng] [PATCH - help needed] archiso2dual: Autodetect whether we can boot x86_64
--- 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? archiso2dual/syslinux.cfg | 88 +++---------------------------------- archiso2dual/syslinux_32only.cfg | 3 + archiso2dual/syslinux_arch32.cfg | 10 ++++ archiso2dual/syslinux_arch64.cfg | 10 ++++ archiso2dual/syslinux_both.cfg | 4 ++ archiso2dual/syslinux_head.cfg | 32 ++++++++++++++ archiso2dual/syslinux_tail.cfg | 29 ++++++++++++ 7 files changed, 96 insertions(+), 80 deletions(-) create mode 100755 archiso2dual/syslinux_32only.cfg create mode 100644 archiso2dual/syslinux_arch32.cfg create mode 100644 archiso2dual/syslinux_arch64.cfg create mode 100755 archiso2dual/syslinux_both.cfg create mode 100644 archiso2dual/syslinux_head.cfg create mode 100644 archiso2dual/syslinux_tail.cfg diff --git a/archiso2dual/syslinux.cfg b/archiso2dual/syslinux.cfg index b53b883..ac92998 100644 --- a/archiso2dual/syslinux.cfg +++ b/archiso2dual/syslinux.cfg @@ -1,84 +1,12 @@ -DEFAULT vesamenu.c32 +DEFAULT choose PROMPT 0 -MENU TITLE Arch Linux -MENU BACKGROUND /boot/splash.png -TIMEOUT 3000 -# TODO: Replace these crappy messages with something useful -F1 boot.txt -F2 options.txt -F3 help.txt +LABEL choose +KERNEL ifcpu64.c32 +APPEND have64 -- nohave64 -MENU WIDTH 78 -MENU MARGIN 4 -MENU ROWS 6 -MENU VSHIFT 10 -MENU TIMEOUTROW 13 -MENU TABMSGROW 11 -MENU CMDLINEROW 11 -MENU HELPMSGROW 16 -MENU HELPMSGENDROW 29 +LABEL have64 +CONFIG syslinux_both.cfg -# Refer to http://syslinux.zytor.com/wiki/index.php/Doc/menu - -MENU COLOR border 30;44 #40ffffff #a0000000 std -MENU COLOR title 1;36;44 #9033ccff #a0000000 std -MENU COLOR sel 7;37;40 #e0ffffff #20ffffff all -MENU COLOR unsel 37;44 #50ffffff #a0000000 std -MENU COLOR help 37;40 #c0ffffff #a0000000 std -MENU COLOR timeout_msg 37;40 #80ffffff #00000000 std -MENU COLOR timeout 1;37;40 #c0ffffff #00000000 std -MENU COLOR msg07 37;40 #90ffffff #a0000000 std -MENU COLOR tabmsg 31;40 #30ffffff #00000000 std - -LABEL arch32 -TEXT HELP -Boot the Arch Linux (i686) live medium. It allows you to install Arch Linux or -perform system maintenance. -ENDTEXT -MENU LABEL Boot Arch Linux (i686) -LINUX /boot/i686/vmlinuz26 -APPEND initrd=/boot/i686/archiso.img archisolabel=XXX rw_branch_size=75% locale=en_US.UTF-8 -# Next line should be uncommented when prepare enviroment to boot from PXE. -#IPAPPEND 3 - -LABEL arch64 -TEXT HELP -Boot the Arch Linux (x86_64) live medium. It allows you to install Arch Linux or -perform system maintenance. -ENDTEXT -MENU LABEL Boot Arch Linux (x86_64) -LINUX /boot/x86_64/vmlinuz26 -APPEND initrd=/boot/x86_64/archiso.img archisolabel=XXX rw_branch_size=75% locale=en_US.UTF-8 -# Next line should be uncommented when prepare enviroment to boot from PXE. -#IPAPPEND 3 - -LABEL existing -TEXT HELP -Boot an existing operating system. Press TAB to edit the disk and partition -number to boot. -ENDTEXT -MENU LABEL Boot existing OS -COM32 chain.c32 -APPEND hd0 0 - -# http://www.memtest.org/ -LABEL memtest -MENU LABEL Run Memtest86+ (RAM test) -LINUX /boot/memtest - -# http://hdt-project.org/ -LABEL hdt -MENU LABEL Hardware Information (HDT) -COM32 hdt.c32 -APPEND modules_alias=hdt/modalias.gz pciids=hdt/pciids.gz - -LABEL reboot -MENU LABEL Reboot -COM32 reboot.c32 - -LABEL poweroff -MENU LABEL Power Off -COMBOOT poweroff.com - -ONTIMEOUT arch32 +LABEL nohave64 +CONFIG syslinux_32only.cfg diff --git a/archiso2dual/syslinux_32only.cfg b/archiso2dual/syslinux_32only.cfg new file mode 100755 index 0000000..c7a452d --- /dev/null +++ b/archiso2dual/syslinux_32only.cfg @@ -0,0 +1,3 @@ +INCLUDE syslinux_head.cfg +INCLUDE syslinux_arch32.cfg +INCLUDE syslinux_tail.cfg diff --git a/archiso2dual/syslinux_arch32.cfg b/archiso2dual/syslinux_arch32.cfg new file mode 100644 index 0000000..29a7745 --- /dev/null +++ b/archiso2dual/syslinux_arch32.cfg @@ -0,0 +1,10 @@ +LABEL arch32 +TEXT HELP +Boot the Arch Linux (i686) live medium. It allows you to install Arch Linux or +perform system maintenance. +ENDTEXT +MENU LABEL Boot Arch Linux (i686) +LINUX /boot/i686/vmlinuz26 +APPEND initrd=/boot/i686/archiso.img archisolabel=XXX rw_branch_size=75% locale=en_US.UTF-8 +# Next line should be uncommented when prepare enviroment to boot from PXE. +#IPAPPEND 3 diff --git a/archiso2dual/syslinux_arch64.cfg b/archiso2dual/syslinux_arch64.cfg new file mode 100644 index 0000000..ac8f764 --- /dev/null +++ b/archiso2dual/syslinux_arch64.cfg @@ -0,0 +1,10 @@ +LABEL arch64 +TEXT HELP +Boot the Arch Linux (x86_64) live medium. It allows you to install Arch Linux or +perform system maintenance. +ENDTEXT +MENU LABEL Boot Arch Linux (x86_64) +LINUX /boot/x86_64/vmlinuz26 +APPEND initrd=/boot/x86_64/archiso.img archisolabel=XXX rw_branch_size=75% locale=en_US.UTF-8 +# Next line should be uncommented when prepare enviroment to boot from PXE. +#IPAPPEND 3 diff --git a/archiso2dual/syslinux_both.cfg b/archiso2dual/syslinux_both.cfg new file mode 100755 index 0000000..9cd1584 --- /dev/null +++ b/archiso2dual/syslinux_both.cfg @@ -0,0 +1,4 @@ +INCLUDE syslinux_head.cfg +INCLUDE syslinux_arch32.cfg +INCLUDE syslinux_arch64.cfg +INCLUDE syslinux_tail.cfg diff --git a/archiso2dual/syslinux_head.cfg b/archiso2dual/syslinux_head.cfg new file mode 100644 index 0000000..246ecef --- /dev/null +++ b/archiso2dual/syslinux_head.cfg @@ -0,0 +1,32 @@ +DEFAULT vesamenu.c32 +PROMPT 0 +MENU TITLE Arch Linux +MENU BACKGROUND /boot/splash.png +TIMEOUT 3000 + +# TODO: Replace these crappy messages with something useful +F1 boot.txt +F2 options.txt +F3 help.txt + +MENU WIDTH 78 +MENU MARGIN 4 +MENU ROWS 6 +MENU VSHIFT 10 +MENU TIMEOUTROW 13 +MENU TABMSGROW 11 +MENU CMDLINEROW 11 +MENU HELPMSGROW 16 +MENU HELPMSGENDROW 29 + +# Refer to http://syslinux.zytor.com/wiki/index.php/Doc/menu + +MENU COLOR border 30;44 #40ffffff #a0000000 std +MENU COLOR title 1;36;44 #9033ccff #a0000000 std +MENU COLOR sel 7;37;40 #e0ffffff #20ffffff all +MENU COLOR unsel 37;44 #50ffffff #a0000000 std +MENU COLOR help 37;40 #c0ffffff #a0000000 std +MENU COLOR timeout_msg 37;40 #80ffffff #00000000 std +MENU COLOR timeout 1;37;40 #c0ffffff #00000000 std +MENU COLOR msg07 37;40 #90ffffff #a0000000 std +MENU COLOR tabmsg 31;40 #30ffffff #00000000 std diff --git a/archiso2dual/syslinux_tail.cfg b/archiso2dual/syslinux_tail.cfg new file mode 100644 index 0000000..4b59e06 --- /dev/null +++ b/archiso2dual/syslinux_tail.cfg @@ -0,0 +1,29 @@ +LABEL existing +TEXT HELP +Boot an existing operating system. Press TAB to edit the disk and partition +number to boot. +ENDTEXT +MENU LABEL Boot existing OS +COM32 chain.c32 +APPEND hd0 0 + +# http://www.memtest.org/ +LABEL memtest +MENU LABEL Run Memtest86+ (RAM test) +LINUX /boot/memtest + +# http://hdt-project.org/ +LABEL hdt +MENU LABEL Hardware Information (HDT) +COM32 hdt.c32 +APPEND modules_alias=hdt/modalias.gz pciids=hdt/pciids.gz + +LABEL reboot +MENU LABEL Reboot +COM32 reboot.c32 + +LABEL poweroff +MENU LABEL Power Off +COMBOOT poweroff.com + +ONTIMEOUT arch32 -- 1.7.3.1
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
Am 17.10.2010 20:14, schrieb Gerardo Exequiel Pozzi:
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):
This looks good, I will think about it. I am still trying to get this done within a single configuration file, but I sort of lost hope for that.
Am Sun, 17 Oct 2010 19:46:37 +0200 schrieb Thomas Bächler <thomas@archlinux.org>:
I'd like to have autodetection for 64 bit CPUs.
I don't like this idea, because I'd like to decide by myself which branch I want to boot and install. There are probably people who want to install the i686 version on an x86_64 system. I'm personally using the x86_64 version as my main system but there are reasons why someone could want to install the i686 version. Heiko
On 10/17/2010 03:41 PM, Heiko Baums wrote:
Am Sun, 17 Oct 2010 19:46:37 +0200 schrieb Thomas Bächler<thomas@archlinux.org>:
I'd like to have autodetection for 64 bit CPUs. I don't like this idea, because I'd like to decide by myself which branch I want to boot and install. There are probably people who want to install the i686 version on an x86_64 system.
I'm personally using the x86_64 version as my main system but there are reasons why someone could want to install the i686 version.
Heiko
This does not enforce. If you boot the with 32 bits CPU you do not have 64 bit option on syslinux. But if you have a 64 cpu you can chose beetwen blue pill or red pill ;) -- Gerardo Exequiel Pozzi \cos^2\alpha + \sin^2\alpha = 1
Am Sun, 17 Oct 2010 15:49:36 -0300 schrieb Gerardo Exequiel Pozzi <vmlinuz386@yahoo.com.ar>:
This does not enforce. If you boot the with 32 bits CPU you do not have 64 bit option on syslinux. But if you have a 64 cpu you can chose beetwen blue pill or red pill ;)
Well, haven't read the complete patch. Then I have no objections. Automation, autodetection and the like sometimes let flash all my warning lights. ;-) Heiko
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?
I merged this with some modifications in my install_dir branch. Is tested and working. -- Gerardo Exequiel Pozzi \cos^2\alpha + \sin^2\alpha = 1
participants (3)
-
Gerardo Exequiel Pozzi
-
Heiko Baums
-
Thomas Bächler