auto-biarch (x86_64 + i686) LiveDVD patch + ISO

classic Classic list List threaded Threaded
14 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

auto-biarch (x86_64 + i686) LiveDVD patch + ISO

Jan Kratochvil-3
Hi,

finally created a LiveDVD ISO automatically booting x86_64 OS on x86_64
(and i686 otherwise).  Regular users will not notice there exists any new arch
while they will benefit from the full performance of their PC:
        http://people.redhat.com/jkratoch/x86bilive-2009062000.tar.gz (71KB)

It uses live_dir=LiveOS-x86_64 vs. live_dir=LiveOS-i686 to boot the image.

The syslinux patch provides "default-{x86_64,i386}" keywords in isolinux.cfg.

livecd-iso-to-disk is not patched/compatible with such image.

livecd-creator should create such ISO on a single run, not by merging the
output of two livecd-creator runs by a 3rd party app.


Regards,
Jan

Reasons:

* I still did not understand why I have to carry with me two media - both
  x86_64 and i386 - when all the data perfectly fit on a single media.

* Why I have to try to boot x86_64 first to find out if the specific machine
  is x86_64?  Even common programmers do not know it, "Windows XP works here".

* The OS must "just work", it must be fun and easy.  Requiring a special
  technical decision before even starting the OS download is a showstopper.

* Checked that a regular user will on http://fedoraproject.org/get-fedora
  still download terrible performance degradation of 32-bit OS although her
  hadware is in 70%-95%(?) of cases x86_64.  x86_64 is here for 6 years now.

  * Arguing x86 may be faster than x86_64... I did not find any such case,
    x86_64 is a more modern arch (more registers, PIC for free, better ABI).
    We already hit the 2GB address space limitations.  x86_64 is the future.

* All the friends of mine have 8Mbit+ ADSL and TB disks downloading many DVD
  disks so some several more hundreds of MB are not something to notice.

mkisofs -f -J -r -hide-rr-moved -hide-joliet-trans-tbl -V Fedora-11-x86bi-Live -o ../x86bilive.iso -b isolinux/isolinux.bin -c isolinux/boot.cat -no-emul-boot -boot-info-table -boot-load-size 4 .

mount -r -o loop Fedora-11-x86_64-Live.iso x86_64/
mount -r -o loop Fedora-11-i686-Live.iso i686/

x86bilive:
total 4
lrwxrwxrwx 1 root root   13 2009-06-18 21:10 GPL -> ../x86_64/GPL
lrwxrwxrwx 1 root root   14 2009-06-18 21:11 LiveOS-i686 -> ../i686/LiveOS/
lrwxrwxrwx 1 root root   16 2009-06-18 21:10 LiveOS-x86_64 -> ../x86_64/LiveOS/
lrwxrwxrwx 1 root root   16 2009-06-18 21:10 README -> ../x86_64/README
drwxr-xr-x 2 root root 4096 2009-06-20 21:44 isolinux/

x86bilive/isolinux:
total 184
lrwxrwxrwx 1 root root     30 2009-06-18 21:13 boot.cat -> ../../x86_64/isolinux/boot.cat
lrwxrwxrwx 1 root root     31 2009-06-18 21:17 ii686 -> ../../i686/isolinux/initrd0.img
-rw-r--r-- 1 root root  14336 2009-06-20 21:45 isolinux.bin
-r--r--r-- 1 root root   1411 2009-06-20 21:44 isolinux.cfg
lrwxrwxrwx 1 root root     33 2009-06-18 21:13 ix8664 -> ../../x86_64/isolinux/initrd0.img
lrwxrwxrwx 1 root root     28 2009-06-18 21:17 ki686 -> ../../i686/isolinux/vmlinuz0
lrwxrwxrwx 1 root root     30 2009-06-18 21:13 kx8664 -> ../../x86_64/isolinux/vmlinuz0
lrwxrwxrwx 1 root root     29 2009-06-18 21:13 memtest -> ../../x86_64/isolinux/memtest
lrwxrwxrwx 1 root root     32 2009-06-18 21:13 splash.jpg -> ../../x86_64/isolinux/splash.jpg
-r--r--r-- 1 root root 159888 2009-06-20 20:48 vesamenu.c32

isolinux.cfg:

default vesamenu.c32
timeout 100

menu background splash.jpg
menu title Welcome to Fedora-11-x86bi-Live!
menu color border 0 #ffffffff #00000000
menu color sel 7 #ffffffff #ff000000
menu color title 0 #ffffffff #00000000
menu color tabmsg 0 #ffffffff #00000000
menu color unsel 0 #ffffffff #00000000
menu color hotsel 0 #ff000000 #ffffffff
menu color hotkey 7 #ffffffff #ff000000
menu color timeout_msg 0 #ffffffff #00000000
menu color timeout 0 #ffffffff #00000000
menu color cmdline 0 #ffffffff #00000000
menu hidden
menu hiddenrow 5
label linux0
  menu label x86_64 Boot
  kernel kx8664
  append initrd=ix8664 root=CDLABEL=Fedora-11-x86bi-Live rootfstype=auto live_dir=LiveOS-x86_64 ro liveimg quiet  rhgb
menu default-x86_64
label check0
  menu label x86_64 Verify and Boot
  kernel kx8664
  append initrd=ix8664 root=CDLABEL=Fedora-11-x86bi-Live rootfstype=auto live_dir=LiveOS-x86_64 ro liveimg quiet  rhgb check
label linux1
  menu label i686 Boot
  kernel ki686
  append initrd=ii686 root=CDLABEL=Fedora-11-x86bi-Live rootfstype=auto live_dir=LiveOS-i686 ro liveimg quiet  rhgb
menu default-i386
label check1
  menu label i686 Verify and Boot
  kernel ki686
  append initrd=ii686 root=CDLABEL=Fedora-11-x86bi-Live rootfstype=auto live_dir=LiveOS-i686 ro liveimg quiet  rhgb check
label memtest
  menu label Memory Test
  kernel memtest
label local
  menu label Boot from local drive
  localboot 0xffff

--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ defaults.patch 20 Jun 2009 20:10:46 -0000
@@ -0,0 +1,175 @@
+--- syslinux-3.75-orig/com32/menu/Makefile 2009-04-16 06:42:14.000000000 +0200
++++ syslinux-3.75-defaults/com32/menu/Makefile 2009-06-20 19:21:32.000000000 +0200
+@@ -24,7 +24,7 @@ MODULES  = menu.c32 vesamenu.c32
+ TESTFILES =
+
+ COMMONOBJS = menumain.o readconfig.o passwd.o drain.o printmsg.o colors.o \
+- background.o refstr.o execute.o
++ background.o refstr.o execute.o verify_cpu.o
+
+ all: $(MODULES) $(TESTFILES)
+
+--- syslinux-3.75-orig/com32/menu/menu.h 2009-04-16 06:42:14.000000000 +0200
++++ syslinux-3.75-defaults/com32/menu/menu.h 2009-06-20 19:21:32.000000000 +0200
+@@ -224,4 +224,9 @@ void execute(const char *cmdline, enum k
+ /* drain.c */
+ void drain_keyboard(void);
+
++/* verify_cpu.S */
++#if defined(__i386__) || defined(__x86_64__)
++int verify_cpu(void);
++#endif
++
+ #endif /* MENU_H */
+--- syslinux-3.75-orig/com32/menu/readconfig.c 2009-04-16 06:42:14.000000000 +0200
++++ syslinux-3.75-defaults/com32/menu/readconfig.c 2009-06-20 20:23:24.000000000 +0200
+@@ -656,11 +656,22 @@ static void parse_config_file(FILE *f)
+    m->parent_entry->displayname = refstr_get(m->title);
+  }
+ }
+-      } else if ( looking_at(p, "default") ) {
+- if (ld.label) {
+-  ld.menudefault = 1;
+- } else if (m->parent_entry) {
+-  m->parent->defentry = m->parent_entry->entry;
++      } else if ( looking_at(p, "default")
++#if defined(__i386__) || defined(__x86_64__)
++  || looking_at(p, "default-i386")
++  || looking_at(p, "default-x86_64")
++#endif
++  ) {
++#if defined(__i386__) || defined(__x86_64__)
++        if (! ( ( looking_at(p, "default-i386") && verify_cpu () == 0 ) ||
++        ( looking_at(p, "default-x86_64") && verify_cpu () != 0 ) ) )
++#endif
++ {
++  if (ld.label) {
++    ld.menudefault = 1;
++  } else if (m->parent_entry) {
++    m->parent->defentry = m->parent_entry->entry;
++  }
+ }
+       } else if ( looking_at(p, "hide") ) {
+ ld.menuhide = 1;
+--- syslinux-3.75-orig/com32/menu/verify_cpu.S 1970-01-01 01:00:00.000000000 +0100
++++ syslinux-3.75-defaults/com32/menu/verify_cpu.S 2009-06-20 20:30:27.000000000 +0200
+@@ -0,0 +1,119 @@
++/* https://lists.linux-foundation.org/pipermail/fastboot/2006-November/011885.html */
++#if defined(__i386__) || defined(__x86_64__)
++ .globl verify_cpu
++verify_cpu:
++ push %ebx
++ push %esi
++ push %edi
++ push %ebp
++ call Xverify_cpu
++ pop %ebp
++ pop %edi
++ pop %esi
++ pop %ebx
++ ret
++
++/*
++ *
++ * verify_cpu.S
++ *
++ * 14 Nov 2006  Vivek Goyal: Created the file
++ *
++ * This is a common code for verification whether CPU supports
++ * long mode and SSE or not. It is not called directly instead this
++ * file is included at various places and compiled in that context.
++ * Following are the current usage.
++ *
++ * This file is included by both 16bit and 32bit code.
++ *
++ * arch/x86_64/boot/setup.S : Boot cpu verification (16bit)
++ * arch/x86_64/boot/compressed/head.S: Boot cpu verification (32bit)
++ * arch/x86_64/kernel/trampoline.S: secondary processor verfication (16bit)
++ * arch/x86_64/kernel/acpi/wakeup.S:Verfication at resume (16bit)
++ *
++ * verify_cpu, returns the status of cpu check in register %eax.
++ * 0: Success    1: Failure
++ *
++ * The caller needs to check for the error code and take the action
++ * appropriately. Either display a message or halt.
++ */
++
++Xverify_cpu:
++
++ pushfl # Save caller passed flags
++ pushl $0 # Kill any dangerous flags
++ popfl
++
++ /* minimum CPUID flags for x86-64 */
++ /* see http://www.x86-64.org/lists/discuss/msg02971.html */
++#define SSE_MASK ((1<<25)|(1<<26))
++#define REQUIRED_MASK1 ((1<<0)|(1<<3)|(1<<4)|(1<<5)|(1<<6)|(1<<8)|\
++   (1<<13)|(1<<15)|(1<<24))
++#define REQUIRED_MASK2 (1<<29)
++ pushfl # standard way to check for cpuid
++ popl %eax
++ movl %eax,%ebx
++ xorl $0x200000,%eax
++ pushl %eax
++ popfl
++ pushfl
++ popl %eax
++ cmpl %eax,%ebx
++ jz verify_cpu_no_longmode # cpu has no cpuid
++
++ movl $0x0,%eax # See if cpuid 1 is implemented
++ cpuid
++ cmpl $0x1,%eax
++ jb verify_cpu_no_longmode # no cpuid 1
++
++ xor %di,%di
++ cmpl $0x68747541,%ebx # AuthenticAMD
++ jnz verify_cpu_noamd
++ cmpl $0x69746e65,%edx
++ jnz verify_cpu_noamd
++ cmpl $0x444d4163,%ecx
++ jnz verify_cpu_noamd
++ mov $1,%di # cpu is from AMD
++
++verify_cpu_noamd:
++ movl    $0x1,%eax # Does the cpu have what it takes
++ cpuid
++ andl $REQUIRED_MASK1,%edx
++ xorl $REQUIRED_MASK1,%edx
++ jnz verify_cpu_no_longmode
++
++ movl    $0x80000000,%eax # See if extended cpuid is implemented
++ cpuid
++ cmpl    $0x80000001,%eax
++ jb      verify_cpu_no_longmode # no extended cpuid
++
++ movl    $0x80000001,%eax # Does the cpu have what it takes
++ cpuid
++ andl    $REQUIRED_MASK2,%edx
++ xorl    $REQUIRED_MASK2,%edx
++ jnz     verify_cpu_no_longmode
++
++verify_cpu_sse_test:
++ movl $1,%eax
++ cpuid
++ andl $SSE_MASK,%edx
++ cmpl $SSE_MASK,%edx
++ je verify_cpu_sse_ok
++ test %di,%di
++ jz verify_cpu_no_longmode # only try to force SSE on AMD
++ movl $0xc0010015,%ecx # HWCR
++ rdmsr
++ btr $15,%eax # enable SSE
++ wrmsr
++ xor %di,%di # don't loop
++ jmp verify_cpu_sse_test # try again
++
++verify_cpu_no_longmode:
++ popfl # Restore caller passed flags
++ movl $1,%eax
++ ret
++verify_cpu_sse_ok:
++ popfl # Restore caller passed flags
++ xorl %eax, %eax
++ ret
++#endif
--- syslinux.spec 16 Apr 2009 18:11:30 -0000 1.59
+++ syslinux.spec 20 Jun 2009 20:10:46 -0000
@@ -7,6 +7,7 @@ License: GPLv2+
 Group: Applications/System
 URL: http://syslinux.zytor.com/
 Source0: ftp://ftp.kernel.org/pub/linux/utils/boot/syslinux/%{name}-%{tarball_version}.tar.bz2
+Patch9: defaults.patch
 ExclusiveArch: %{ix86} x86_64
 Buildroot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
 BuildRequires: nasm >= 0.98.38-1, perl, netpbm-progs
@@ -33,12 +34,18 @@ MEMDISK, which loads legacy operating sy
 
 %prep
 %setup -q -n syslinux-%{tarball_version}
+%patch9 -p1
 
 %build
 CFLAGS="-Werror -Wno-unused -finline-limit=2000"
 export CFLAGS
 # If you make clean here, we lose the provided syslinux.exe
 #make clean
+rm -f com32/menu/vesamenu.c32
+make -C com32/lib libcom32.a
+make -C com32/gpllib libcom32gpl.a
+make -C com32/menu vesamenu.c32
+test -f com32/menu/vesamenu.c32
 make installer
 make -C sample tidy
 

--
Fedora-livecd-list mailing list
[hidden email]
https://www.redhat.com/mailman/listinfo/fedora-livecd-list
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: auto-biarch (x86_64 + i686) LiveDVD patch + ISO

Jeroen van Meeuwen-2
On 06/21/2009 12:05 PM, Jan Kratochvil wrote:

> Hi,
>
> finally created a LiveDVD ISO automatically booting x86_64 OS on x86_64
> (and i686 otherwise).  Regular users will not notice there exists any new arch
> while they will benefit from the full performance of their PC:
> http://people.redhat.com/jkratoch/x86bilive-2009062000.tar.gz (71KB)
>
> It uses live_dir=LiveOS-x86_64 vs. live_dir=LiveOS-i686 to boot the image.
>
> The syslinux patch provides "default-{x86_64,i386}" keywords in isolinux.cfg.
>
> livecd-iso-to-disk is not patched/compatible with such image.
>
> livecd-creator should create such ISO on a single run, not by merging the
> output of two livecd-creator runs by a 3rd party app.
>

It does not make much sense to me, so maybe you can explain it:

Isn't syslinux 3.72 or later itself capable of choosing one or the other
menu entry using ifcpu64.c32?

Would that not be a better option?

-Jeroen

--
Fedora-livecd-list mailing list
[hidden email]
https://www.redhat.com/mailman/listinfo/fedora-livecd-list
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: auto-biarch (x86_64 + i686) LiveDVD patch + ISO

Jan Kratochvil-3
On Sun, 21 Jun 2009 19:53:58 +0200, Jeroen van Meeuwen wrote:
> On 06/21/2009 12:05 PM, Jan Kratochvil wrote:
>> The syslinux patch provides "default-{x86_64,i386}" keywords in isolinux.cfg.
...
> It does not make much sense to me, so maybe you can explain it:
>
> Isn't syslinux 3.72 or later itself capable of choosing one or the other  
> menu entry using ifcpu64.c32?
>
> Would that not be a better option?

yes, definitely, my syslinux patch is useless.

I did not expect such option exists when such ISO still has not been released
while waiting for it the recent years.


Thanks for the notice,
Jan

--
Fedora-livecd-list mailing list
[hidden email]
https://www.redhat.com/mailman/listinfo/fedora-livecd-list
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: auto-biarch (x86_64 + i686) LiveDVD patch + ISO

Jane Dogalt
In reply to this post by Jan Kratochvil-3

Very cool.  Now if only you can go tri-arch with ppc.  Actually I'm just kidding, I don't care about that unless I can get fixstars to hire me, or someone to give me a ps3.

Out of curiosity- has anybody yet mastered a good spin that also plays video when inserted into a typical dvd player?  I don't think there are any issues with that, but wonder why I haven't seen that before.  It seems like packing in a kickass intro-to-fedora video that people could play on their DVD player, would be a great feature, that might help a certain class of new users feel more comfortable with the process.  I.e. it feels pretty safe to watch a DVD, versus running some strange software on your computer.

Thanks again Jan, very cool feature.

-dmc

--- On Sun, 6/21/09, Jan Kratochvil <[hidden email]> wrote:

> From: Jan Kratochvil <[hidden email]>
> Subject: [Fedora-livecd-list] auto-biarch (x86_64 + i686) LiveDVD patch + ISO
> To: [hidden email]
> Date: Sunday, June 21, 2009, 5:05 AM
> Hi,
>
> finally created a LiveDVD ISO automatically booting x86_64
> OS on x86_64
> (and i686 otherwise).  Regular users will not notice
> there exists any new arch
> while they will benefit from the full performance of their
> PC:
>     http://people.redhat.com/jkratoch/x86bilive-2009062000.tar.gz
> (71KB)
>
> It uses live_dir=LiveOS-x86_64 vs. live_dir=LiveOS-i686 to
> boot the image.
>
> The syslinux patch provides "default-{x86_64,i386}"
> keywords in isolinux.cfg.
>
> livecd-iso-to-disk is not patched/compatible with such
> image.
>
> livecd-creator should create such ISO on a single run, not
> by merging the
> output of two livecd-creator runs by a 3rd party app.
>
>
> Regards,
> Jan
>
> Reasons:
>
> * I still did not understand why I have to carry with me
> two media - both
>   x86_64 and i386 - when all the data perfectly fit on
> a single media.
>
> * Why I have to try to boot x86_64 first to find out if the
> specific machine
>   is x86_64?  Even common programmers do not know
> it, "Windows XP works here".
>
> * The OS must "just work", it must be fun and easy. 
> Requiring a special
>   technical decision before even starting the OS
> download is a showstopper.
>
> * Checked that a regular user will on http://fedoraproject.org/get-fedora
>   still download terrible performance degradation of
> 32-bit OS although her
>   hadware is in 70%-95%(?) of cases x86_64. 
> x86_64 is here for 6 years now.
>
>   * Arguing x86 may be faster than x86_64... I did not
> find any such case,
>     x86_64 is a more modern arch (more registers,
> PIC for free, better ABI).
>     We already hit the 2GB address space
> limitations.  x86_64 is the future.
>
> * All the friends of mine have 8Mbit+ ADSL and TB disks
> downloading many DVD
>   disks so some several more hundreds of MB are not
> something to notice.
>
> -----Inline Attachment Follows-----
>
> mkisofs -f -J -r -hide-rr-moved
> -hide-joliet-trans-tbl -V Fedora-11-x86bi-Live -o
> ../x86bilive.iso -b isolinux/isolinux.bin -c
> isolinux/boot.cat -no-emul-boot -boot-info-table
> -boot-load-size 4 .
>
> mount -r -o loop Fedora-11-x86_64-Live.iso x86_64/
> mount -r -o loop Fedora-11-i686-Live.iso i686/
>
> x86bilive:
> total 4
> lrwxrwxrwx 1 root root   13 2009-06-18 21:10
> GPL -> ../x86_64/GPL
> lrwxrwxrwx 1 root root   14 2009-06-18 21:11
> LiveOS-i686 -> ../i686/LiveOS/
> lrwxrwxrwx 1 root root   16 2009-06-18 21:10
> LiveOS-x86_64 -> ../x86_64/LiveOS/
> lrwxrwxrwx 1 root root   16 2009-06-18 21:10
> README -> ../x86_64/README
> drwxr-xr-x 2 root root 4096 2009-06-20 21:44 isolinux/
>
> x86bilive/isolinux:
> total 184
> lrwxrwxrwx 1 root root     30
> 2009-06-18 21:13 boot.cat ->
> ../../x86_64/isolinux/boot.cat
> lrwxrwxrwx 1 root root     31
> 2009-06-18 21:17 ii686 ->
> ../../i686/isolinux/initrd0.img
> -rw-r--r-- 1 root root  14336 2009-06-20 21:45
> isolinux.bin
> -r--r--r-- 1 root root   1411 2009-06-20
> 21:44 isolinux.cfg
> lrwxrwxrwx 1 root root     33
> 2009-06-18 21:13 ix8664 ->
> ../../x86_64/isolinux/initrd0.img
> lrwxrwxrwx 1 root root     28
> 2009-06-18 21:17 ki686 -> ../../i686/isolinux/vmlinuz0
> lrwxrwxrwx 1 root root     30
> 2009-06-18 21:13 kx8664 ->
> ../../x86_64/isolinux/vmlinuz0
> lrwxrwxrwx 1 root root     29
> 2009-06-18 21:13 memtest ->
> ../../x86_64/isolinux/memtest
> lrwxrwxrwx 1 root root     32
> 2009-06-18 21:13 splash.jpg ->
> ../../x86_64/isolinux/splash.jpg
> -r--r--r-- 1 root root 159888 2009-06-20 20:48
> vesamenu.c32
>
> isolinux.cfg:
>
> default vesamenu.c32
> timeout 100
>
> menu background splash.jpg
> menu title Welcome to Fedora-11-x86bi-Live!
> menu color border 0 #ffffffff #00000000
> menu color sel 7 #ffffffff #ff000000
> menu color title 0 #ffffffff #00000000
> menu color tabmsg 0 #ffffffff #00000000
> menu color unsel 0 #ffffffff #00000000
> menu color hotsel 0 #ff000000 #ffffffff
> menu color hotkey 7 #ffffffff #ff000000
> menu color timeout_msg 0 #ffffffff #00000000
> menu color timeout 0 #ffffffff #00000000
> menu color cmdline 0 #ffffffff #00000000
> menu hidden
> menu hiddenrow 5
> label linux0
>   menu label x86_64 Boot
>   kernel kx8664
>   append initrd=ix8664
> root=CDLABEL=Fedora-11-x86bi-Live rootfstype=auto
> live_dir=LiveOS-x86_64 ro liveimg quiet  rhgb
> menu default-x86_64
> label check0
>   menu label x86_64 Verify and Boot
>   kernel kx8664
>   append initrd=ix8664
> root=CDLABEL=Fedora-11-x86bi-Live rootfstype=auto
> live_dir=LiveOS-x86_64 ro liveimg quiet  rhgb check
> label linux1
>   menu label i686 Boot
>   kernel ki686
>   append initrd=ii686
> root=CDLABEL=Fedora-11-x86bi-Live rootfstype=auto
> live_dir=LiveOS-i686 ro liveimg quiet  rhgb
> menu default-i386
> label check1
>   menu label i686 Verify and Boot
>   kernel ki686
>   append initrd=ii686
> root=CDLABEL=Fedora-11-x86bi-Live rootfstype=auto
> live_dir=LiveOS-i686 ro liveimg quiet  rhgb check
> label memtest
>   menu label Memory Test
>   kernel memtest
> label local
>   menu label Boot from local drive
>   localboot 0xffff
>
> -----Inline Attachment Follows-----
>
> --- /dev/null    1
> Jan 1970 00:00:00 -0000
> +++ defaults.patch    20 Jun 2009 20:10:46
> -0000
> @@ -0,0 +1,175 @@
> +---
> syslinux-3.75-orig/com32/menu/Makefile   
> 2009-04-16 06:42:14.000000000 +0200
> ++++
> syslinux-3.75-defaults/com32/menu/Makefile   
> 2009-06-20 19:21:32.000000000 +0200
> +@@ -24,7 +24,7 @@ MODULES      =
> menu.c32 vesamenu.c32
> + TESTFILES =
> +
> + COMMONOBJS = menumain.o readconfig.o passwd.o drain.o
> printmsg.o colors.o \
> +-    background.o refstr.o execute.o
> ++    background.o refstr.o execute.o
> verify_cpu.o
> +
> + all: $(MODULES) $(TESTFILES)
> +
> +--- syslinux-3.75-orig/com32/menu/menu.h   
> 2009-04-16 06:42:14.000000000 +0200
> ++++
> syslinux-3.75-defaults/com32/menu/menu.h   
> 2009-06-20 19:21:32.000000000 +0200
> +@@ -224,4 +224,9 @@ void execute(const char *cmdline, enum
> k
> + /* drain.c */
> + void drain_keyboard(void);
> +
> ++/* verify_cpu.S */
> ++#if defined(__i386__) || defined(__x86_64__)
> ++int verify_cpu(void);
> ++#endif
> ++
> + #endif /* MENU_H */
> +---
> syslinux-3.75-orig/com32/menu/readconfig.c   
> 2009-04-16 06:42:14.000000000 +0200
> ++++
> syslinux-3.75-defaults/com32/menu/readconfig.c   
> 2009-06-20 20:23:24.000000000 +0200
> +@@ -656,11 +656,22 @@ static void parse_config_file(FILE
> *f)
> +        
> m->parent_entry->displayname =
> refstr_get(m->title);
> +       }
> +     }
> +-      } else if ( looking_at(p, "default")
> ) {
> +-    if (ld.label) {
> +-      ld.menudefault = 1;
> +-    } else if (m->parent_entry) {
> +-      m->parent->defentry =
> m->parent_entry->entry;
> ++      } else if ( looking_at(p,
> "default")
> ++#if defined(__i386__) || defined(__x86_64__)
> ++          ||
> looking_at(p, "default-i386")
> ++          ||
> looking_at(p, "default-x86_64")
> ++#endif
> ++          ) {
> ++#if defined(__i386__) || defined(__x86_64__)
> ++        if (! ( ( looking_at(p,
> "default-i386") && verify_cpu () == 0 ) ||
> ++            (
> looking_at(p, "default-x86_64") && verify_cpu () !=
> 0 ) ) )
> ++#endif
> ++    {
> ++      if (ld.label) {
> ++        ld.menudefault = 1;
> ++      } else if (m->parent_entry)
> {
> ++       
> m->parent->defentry = m->parent_entry->entry;
> ++      }
> +     }
> +       } else if ( looking_at(p,
> "hide") ) {
> +     ld.menuhide = 1;
> +---
> syslinux-3.75-orig/com32/menu/verify_cpu.S   
> 1970-01-01 01:00:00.000000000 +0100
> ++++
> syslinux-3.75-defaults/com32/menu/verify_cpu.S   
> 2009-06-20 20:30:27.000000000 +0200
> +@@ -0,0 +1,119 @@
> ++/* https://lists.linux-foundation.org/pipermail/fastboot/2006-November/011885.html
> */
> ++#if defined(__i386__) || defined(__x86_64__)
> ++    .globl    verify_cpu
> ++verify_cpu:
> ++    push    %ebx
> ++    push    %esi
> ++    push    %edi
> ++    push    %ebp
> ++    call    Xverify_cpu
> ++    pop    %ebp
> ++    pop    %edi
> ++    pop    %esi
> ++    pop    %ebx
> ++    ret
> ++
> ++/*
> ++ *
> ++ *    verify_cpu.S
> ++ *
> ++ *     14 Nov 2006  Vivek Goyal:
> Created the file
> ++ *
> ++ *    This is a common code for
> verification whether CPU supports
> ++ *     long mode and SSE or not. It is not
> called directly instead this
> ++ *    file is included at various places
> and compiled in that context.
> ++ *     Following are the current usage.
> ++ *
> ++ *     This file is included by both 16bit
> and 32bit code.
> ++ *
> ++ *    arch/x86_64/boot/setup.S : Boot cpu
> verification (16bit)
> ++ *    arch/x86_64/boot/compressed/head.S:
> Boot cpu verification (32bit)
> ++ *    arch/x86_64/kernel/trampoline.S:
> secondary processor verfication (16bit)
> ++ *   
> arch/x86_64/kernel/acpi/wakeup.S:Verfication at resume
> (16bit)
> ++ *
> ++ *    verify_cpu, returns the status of
> cpu check in register %eax.
> ++ *        0: Success 
>   1: Failure
> ++ *
> ++ *     The caller needs to check for the
> error code and take the action
> ++ *     appropriately. Either display a
> message or halt.
> ++ */
> ++
> ++Xverify_cpu:
> ++
> ++    pushfl   
>             #
> Save caller passed flags
> ++    pushl   
> $0            #
> Kill any dangerous flags
> ++    popfl
> ++
> ++    /* minimum CPUID flags for x86-64 */
> ++    /* see http://www.x86-64.org/lists/discuss/msg02971.html */
> ++#define SSE_MASK ((1<<25)|(1<<26))
> ++#define REQUIRED_MASK1
> ((1<<0)|(1<<3)|(1<<4)|(1<<5)|(1<<6)|(1<<8)|\
> ++           
>        
>    (1<<13)|(1<<15)|(1<<24))
> ++#define REQUIRED_MASK2 (1<<29)
> ++    pushfl   
>             #
> standard way to check for cpuid
> ++    popl    %eax
> ++    movl    %eax,%ebx
> ++    xorl    $0x200000,%eax
> ++    pushl    %eax
> ++    popfl
> ++    pushfl
> ++    popl    %eax
> ++    cmpl    %eax,%ebx
> ++    jz   
> verify_cpu_no_longmode    # cpu has no cpuid
> ++
> ++    movl   
> $0x0,%eax        # See if
> cpuid 1 is implemented
> ++    cpuid
> ++    cmpl    $0x1,%eax
> ++    jb   
> verify_cpu_no_longmode    # no cpuid 1
> ++
> ++    xor    %di,%di
> ++    cmpl   
> $0x68747541,%ebx    # AuthenticAMD
> ++    jnz   
> verify_cpu_noamd
> ++    cmpl   
> $0x69746e65,%edx
> ++    jnz   
> verify_cpu_noamd
> ++    cmpl   
> $0x444d4163,%ecx
> ++    jnz   
> verify_cpu_noamd
> ++    mov   
> $1,%di       
>     # cpu is from AMD
> ++
> ++verify_cpu_noamd:
> ++    movl   
> $0x1,%eax        # Does the
> cpu have what it takes
> ++    cpuid
> ++    andl   
> $REQUIRED_MASK1,%edx
> ++    xorl   
> $REQUIRED_MASK1,%edx
> ++    jnz   
> verify_cpu_no_longmode
> ++
> ++    movl   
> $0x80000000,%eax    # See if extended cpuid
> is implemented
> ++    cpuid
> ++    cmpl    $0x80000001,%eax
> ++    jb     
> verify_cpu_no_longmode    # no extended
> cpuid
> ++
> ++    movl   
> $0x80000001,%eax    # Does the cpu have what
> it takes
> ++    cpuid
> ++    andl   
> $REQUIRED_MASK2,%edx
> ++    xorl   
> $REQUIRED_MASK2,%edx
> ++    jnz 
>    verify_cpu_no_longmode
> ++
> ++verify_cpu_sse_test:
> ++    movl    $1,%eax
> ++    cpuid
> ++    andl    $SSE_MASK,%edx
> ++    cmpl    $SSE_MASK,%edx
> ++    je   
> verify_cpu_sse_ok
> ++    test    %di,%di
> ++    jz   
> verify_cpu_no_longmode    # only try to force
> SSE on AMD
> ++    movl   
> $0xc0010015,%ecx    # HWCR
> ++    rdmsr
> ++    btr   
> $15,%eax        # enable SSE
> ++    wrmsr
> ++    xor   
> %di,%di       
>     # don't loop
> ++    jmp   
> verify_cpu_sse_test    # try again
> ++
> ++verify_cpu_no_longmode:
> ++    popfl   
>             #
> Restore caller passed flags
> ++    movl $1,%eax
> ++    ret
> ++verify_cpu_sse_ok:
> ++    popfl   
>             #
> Restore caller passed flags
> ++    xorl %eax, %eax
> ++    ret
> ++#endif
> --- syslinux.spec    16 Apr 2009 18:11:30
> -0000    1.59
> +++ syslinux.spec    20 Jun 2009 20:10:46
> -0000
> @@ -7,6 +7,7 @@ License: GPLv2+
>  Group: Applications/System
>  URL: http://syslinux.zytor.com/
>  Source0: ftp://ftp.kernel.org/pub/linux/utils/boot/syslinux/%{name}-%{tarball_version}.tar.bz2
> +Patch9: defaults.patch
>  ExclusiveArch: %{ix86} x86_64
>  Buildroot:
> %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u}
> -n)
>  BuildRequires: nasm >= 0.98.38-1, perl, netpbm-progs
> @@ -33,12 +34,18 @@ MEMDISK, which loads legacy operating
> sy
>  
>  %prep
>  %setup -q -n syslinux-%{tarball_version}
> +%patch9 -p1
>  
>  %build
>  CFLAGS="-Werror -Wno-unused -finline-limit=2000"
>  export CFLAGS
>  # If you make clean here, we lose the provided
> syslinux.exe
>  #make clean
> +rm -f com32/menu/vesamenu.c32
> +make -C com32/lib libcom32.a
> +make -C com32/gpllib libcom32gpl.a
> +make -C com32/menu vesamenu.c32
> +test -f com32/menu/vesamenu.c32
>  make installer
>  make -C sample tidy
>  
>
> -----Inline Attachment Follows-----
>
> --
> Fedora-livecd-list mailing list
> [hidden email]
> https://www.redhat.com/mailman/listinfo/fedora-livecd-list
>


     

--
Fedora-livecd-list mailing list
[hidden email]
https://www.redhat.com/mailman/listinfo/fedora-livecd-list
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: auto-biarch (x86_64 + i686) LiveDVD patch + ISO

Jeroen van Meeuwen-2
In reply to this post by Jan Kratochvil-3
On 06/21/2009 08:35 PM, Jan Kratochvil wrote:

> On Sun, 21 Jun 2009 19:53:58 +0200, Jeroen van Meeuwen wrote:
>> On 06/21/2009 12:05 PM, Jan Kratochvil wrote:
>>> The syslinux patch provides "default-{x86_64,i386}" keywords in isolinux.cfg.
> ...
>> It does not make much sense to me, so maybe you can explain it:
>>
>> Isn't syslinux 3.72 or later itself capable of choosing one or the other
>> menu entry using ifcpu64.c32?
>>
>> Would that not be a better option?
>
> yes, definitely, my syslinux patch is useless.
>
> I did not expect such option exists when such ISO still has not been released
> while waiting for it the recent years.
>

So yeah, the problem we get with i386/x86_64 hybrids is more that we
would reduce the available size to either of the Live images to half a
CD or half a DVD. Some of our spins fit on half a DVD, but not half a
CD. If some spins have separate media for each arch, and others do not,
then that may work confusing.

That said though, I don't think we've had this kinda thing discussed or
decided upon... so it's a good point ;-)

-Jeroen

--
Fedora-livecd-list mailing list
[hidden email]
https://www.redhat.com/mailman/listinfo/fedora-livecd-list
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: auto-biarch (x86_64 + i686) LiveDVD patch + ISO

Bill Nottingham
Jeroen van Meeuwen ([hidden email]) said:
> So yeah, the problem we get with i386/x86_64 hybrids is more that we  
> would reduce the available size to either of the Live images to half a  
> CD or half a DVD. Some of our spins fit on half a DVD, but not half a  
> CD. If some spins have separate media for each arch, and others do not,  
> then that may work confusing.
>
> That said though, I don't think we've had this kinda thing discussed or  
> decided upon... so it's a good point ;-)

I think it's safe to assume that attempting to fit any 'real' biarch
spin on CD would be a futile exercise. DVD shouldn't be an issue for
the non-Games live spins yet, should it?

Bill


--
Fedora-livecd-list mailing list
[hidden email]
https://www.redhat.com/mailman/listinfo/fedora-livecd-list
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: auto-biarch (x86_64 + i686) LiveDVD patch + ISO

Jan Kratochvil-3
On Tue, 23 Jun 2009 16:22:07 +0200, Bill Nottingham wrote:
> DVD shouldn't be an issue for the non-Games live spins yet, should it?

* FireFox + OpenOffice.org are (IMO) the two most visible F/OSS applications.

* LiveCD is there (also / primarily?) to make a preview of what is F/OSS.

=> The major F/OSS application success is omitted because of ... why?

There ware recent discussions people no longer download CD media; but to say
the truth I do not find a clear consensus.
        BitTorrent downloaders of the split CD sets have been decreasing.
        F9: 6.32%. F10 4.58% F11 so far: 2.2%.
        +
        Do we need split media CDs for F12?
        https://www.redhat.com/archives/fedora-devel-list/2009-June/thread.html#00953
        +
        https://fedoraproject.org/wiki/F12_No_Split_CDs_Proposal


Regards,
Jan

--
Fedora-livecd-list mailing list
[hidden email]
https://www.redhat.com/mailman/listinfo/fedora-livecd-list
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: auto-biarch (x86_64 + i686) LiveDVD patch + ISO

Bruno Wolff III
In reply to this post by Bill Nottingham
On Tue, Jun 23, 2009 at 10:22:07 -0400,
  Bill Nottingham <[hidden email]> wrote:

> Jeroen van Meeuwen ([hidden email]) said:
> > So yeah, the problem we get with i386/x86_64 hybrids is more that we  
> > would reduce the available size to either of the Live images to half a  
> > CD or half a DVD. Some of our spins fit on half a DVD, but not half a  
> > CD. If some spins have separate media for each arch, and others do not,  
> > then that may work confusing.
> >
> > That said though, I don't think we've had this kinda thing discussed or  
> > decided upon... so it's a good point ;-)
>
> I think it's safe to assume that attempting to fit any 'real' biarch
> spin on CD would be a futile exercise. DVD shouldn't be an issue for
> the non-Games live spins yet, should it?

A biarch rescue image would be useful. For some kinds of recoveries you need
to use a rescue image matching the arch of the system you are trying to fix.
I got bit by this during the F11 devel cycle.

--
Fedora-livecd-list mailing list
[hidden email]
https://www.redhat.com/mailman/listinfo/fedora-livecd-list
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: auto-biarch (x86_64 + i686) LiveDVD patch + ISO

Jeroen van Meeuwen-2
On 06/23/2009 06:14 PM, Bruno Wolff III wrote:

> On Tue, Jun 23, 2009 at 10:22:07 -0400,
>    Bill Nottingham<[hidden email]>  wrote:
>> Jeroen van Meeuwen ([hidden email]) said:
>>> So yeah, the problem we get with i386/x86_64 hybrids is more that we
>>> would reduce the available size to either of the Live images to half a
>>> CD or half a DVD. Some of our spins fit on half a DVD, but not half a
>>> CD. If some spins have separate media for each arch, and others do not,
>>> then that may work confusing.
>>>
>>> That said though, I don't think we've had this kinda thing discussed or
>>> decided upon... so it's a good point ;-)
>> I think it's safe to assume that attempting to fit any 'real' biarch
>> spin on CD would be a futile exercise. DVD shouldn't be an issue for
>> the non-Games live spins yet, should it?
>
> A biarch rescue image would be useful. For some kinds of recoveries you need
> to use a rescue image matching the arch of the system you are trying to fix.
> I got bit by this during the F11 devel cycle.
>

This would actually fit on a CD, too. I'm interested in exploring this.

Would this most suitably fit within the Fedora Project as a spin, or
maybe something else (a Fedora 12 Feature??)?

-Jeroen

--
Fedora-livecd-list mailing list
[hidden email]
https://www.redhat.com/mailman/listinfo/fedora-livecd-list
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

auto-biarch (x86_64 + i686) LiveUSBFlash [Re: auto-biarch (x86_64 + i686) LiveDVD patch + ISO]

Jan Kratochvil-3
In reply to this post by Jeroen van Meeuwen-2
Hi,

followup on:
        https://www.redhat.com/archives/fedora-livecd-list/2009-June/msg00018.html

On Sun, 21 Jun 2009 19:53:58 +0200, Jeroen van Meeuwen wrote:
> Isn't syslinux 3.72 or later itself capable of choosing one or the
> other menu entry using ifcpu64.c32?

updated it to use ifcpu64.c32, thanks for the notice.

It is currently tested only with F-12 (updated) but it should work with any
release.  It can take Fedora-12-i686-Live.iso + Fedora-12-x86_64-Live.iso or
it can build two such from hypothetical custom Fedora-12-LiveCD.ks.

The previous version created biarch DVD.  But one could not easily convert it
to USBFlash as livecd-iso-to-disk expects a single directory on the CD/DVD.
As CD/DVD are IMO no longer useful as bootable media this script converts:

uni-arch x86_64 CD/DVD + uni-arch i686 CD/DVD -> bi-arch x86_64+i686 USBFlash

Created it now just for my personal needs; there is missing:
 * Some proper integration with livecd tools.  Either
   * livecd-creator should be able to create biarch CD/DVDs AND
     livecd-iso-to-disk should convert such biarch CD/DVDs into USBFlashes.  
   or
   * livecd-iso-to-disk should create biarch USBFlash from two uniarch CD/DVDs.
   or
   * livecd-iso-to-disk should be able to update uniarch USBFlash with second
     uniarch CD/DVD creating biarch USBFlash (=reimplementing this script).
* It does not have EFI.  Unaware how to test it and when it is needed for x86*.
* It is an ugly hack.

Some people may think Fedora should stop producing i686.
Unfortunately I still know about two boxes running 32bit only CPUs.
(Running i686 on x86_64 box has no technical benefits; besides some easier
compatibility with proprietary i686 binaries as I heard about.)


Regards,
Jan

--
livecd mailing list
[hidden email]
https://admin.fedoraproject.org/mailman/listinfo/livecd

Fedora-12-LiveCD.sh (4K) Download Attachment
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

mkbiarch state [auto-biarch (x86_64 + i686) LiveUSBFlash]

Jan Kratochvil-3
Hi,

I finally could check the output of mkbiarch, which I believed should be the
upstreamed variant of "auto-biarch" script posted by me:
        http://lists.fedoraproject.org/pipermail/livecd/2010-March/005755.html

But it does not serve for the primary purpose at all: Normal user just not
touching the boot on an x86_64 box will still get booted the crippled i686 OS.
I have checked It does not use ifcpu64.c32 at all so it cannot work.

It also does not provide the "Basic Video" / "Memory Test" etc. options.
It also does not provide an option for a fat filesystem on the flash media,
together with fitting/specifying media size for an available free space there.

It is neither on-par with the original media nor on-par with "auto-biarch".

Should I convert the "auto-biarch" script into Python or try to merge the
features into existing /usr/bin/mkbiarch to get it accepted?  This way I am
not sure if it still be in time for a meaningful official F15 bi-arch media.


Thanks,
Jan
--
livecd mailing list
[hidden email]
https://admin.fedoraproject.org/mailman/listinfo/livecd
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: auto-biarch update for F14

Jan Kratochvil-3
On Thu, 30 Dec 2010 09:02:48 +0100, Jan Kratochvil wrote:
> But it does not serve for the primary purpose at all: Normal user just not
> touching the boot on an x86_64 box will still get booted the crippled i686 OS.
> I have checked It does not use ifcpu64.c32 at all so it cannot work.
>
> It also does not provide the "Basic Video" / "Memory Test" etc. options.
> It also does not provide an option for a fat filesystem on the flash media,
> together with fitting/specifying media size for an available free space there.

Attaching an updated shell script with these features.  Tested with:
        livecd-tools-14.0-1.fc14.x86_64


> Should I convert the "auto-biarch" script into Python or try to merge the
> features into existing /usr/bin/mkbiarch to get it accepted?

BTW I would prefer Perl which is not available on some LiveCDs but it should
be always available on the build system.  I do not know if/why EFI support
would be needed for such boot-flash.  GPT should not be needed on boot-flash.


Thanks,
Jan

--
livecd mailing list
[hidden email]
https://admin.fedoraproject.org/mailman/listinfo/livecd

OOo-LiveCD.sh (3K) Download Attachment
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: auto-biarch update for F14 [fix]

Jan Kratochvil-3
[ Sorry, one fatality fix.  ]

#! /bin/bash
# $Id: OOo-LiveCD.sh,v 1.5 2010/12/30 23:34:08 jkratoch Exp $

set -ex
SIZE=2021654528
BASE=f14-live
BIN=$BASE.bin
ISO64=$BASE-x86_64.iso
ISO32=$BASE-i686.iso
ISO=$BASE.iso
KS=$BASE.ks
SELF=$BASE.sh
# $PWD: rpm: arguments to --root (-r) must begin with a /
MNT=$PWD/$BASE.mnt
LOOPDEV=

set -o pipefail
renice +19 -p $$
ionice -c3 -p $$
test "`uname -m`" = "x86_64"
test ! -e $BIN
test ! -e $ISO
test ! -e $MNT
test -e $SELF

if [ ! -e $ISO64 ];then
  test -e "$KS"
  livecd-creator --config=$KS --fslabel=$BASE --cache=/var/cache/live
  test -e $ISO
  mv -f $ISO $ISO64
fi
if [ ! -e $ISO32 ];then
  test -e "$KS"
  setarch i686 livecd-creator --config=$KS --fslabel=$BASE --cache=/var/cache/live
  test -e $ISO
  mv -f $ISO $ISO32
fi

trap 'set +e; rm -f $BIN; (losetup -d $LOOPDEV; umount $MNT/{c,b,a,}; rmdir $MNT/{c,b,a,}) 2>/dev/null' EXIT
dd if=/dev/zero of=$BIN bs=1 seek=$[SIZE-1] count=1
/sbin/parted --script $BIN mklabel msdos
dd bs=1 if=/usr/share/syslinux/mbr.bin of=$BIN conv=notrunc
# 17408=34*512
/sbin/parted --script $BIN unit b mkpart primary fat32 17408 $[$(find $BIN -printf %s)-17408] set 1 boot on
LOOPDEV=`losetup -o 17408 -v -f $BIN | sed 's/^Loop device is //'`
[ -n "$LOOPDEV" -a "${LOOPDEV#/dev/loop[0-9]}" != "$LOOPDEV" ]
/sbin/mkdosfs -n LIVE $LOOPDEV
UUID="$(dd skip=$[0x43] bs=1 count=4 if=$LOOPDEV|od -An -txI|tr a-z A-Z|sed 's/^ \(....\)\(....\)$/\1-\2/')"
# --overlay-size-mb 100 --home-size-mb 100
echo | livecd-iso-to-disk --unencrypted-home --livedir $BASE-i686 $ISO32 $LOOPDEV
mkdir $MNT
mount $LOOPDEV $MNT
CFG="`cat $MNT/syslinux/syslinux.cfg | sed 's/\( root=live:UUID=\)....-.... /\1'"$UUID /"`"
mv $MNT/syslinux/initrd0.img $MNT/syslinux/initrd1.img
mv $MNT/syslinux/vmlinuz0 $MNT/syslinux/vmlinuz1
umount $MNT
livecd-iso-to-disk --unencrypted-home --livedir $BASE-x86_64 $ISO64 $LOOPDEV
mount $LOOPDEV $MNT
cp -p /usr/share/syslinux/ifcpu64.c32 $MNT/syslinux/
(
  echo "$CFG" | sed -n '1,/^menu hiddenrow/p'
  cat <<EOH
label detect
  menu label Autoselect x86_64 / i686 Boot
  kernel ifcpu64.c32
  append linux0 -- linux1
  menu default
EOH
  echo "$CFG" | sed -n -e "s/$BASE-i686/$BASE-x86_64/g"                             -e 's/^  menu label .*$/& x86_64/' -e '/^label.*0$/,/^  append/p'
  echo "$CFG" | sed -n -e 's/^\(label.*\)0$/\11/' -e 's/\(vmlinuz\|initrd\)0/\11/g' -e 's/^  menu label .*$/& i686/'   -e '/^label.*1$/,/^  append/p'
  echo "$CFG" | sed -n '/^label mem/,$p'
) >$MNT/syslinux/syslinux.cfg
cp -p $SELF $MNT/
if [ -e "$KS" ];then
  cp -p $KS $MNT/
fi
umount $MNT
mkdir $MNT/{a,b,c}
mount $LOOPDEV $MNT/a
mount -r -o loop $MNT/a/$BASE-x86_64/squashfs.img $MNT/b
mount -r -o loop $MNT/b/LiveOS/ext3fs.img $MNT/c
rpm -r $MNT/c -qa|sort >$MNT/a/$BASE-x86_64/rpm-qa
umount $MNT/{c,b}
mount -r -o loop $MNT/a/$BASE-i686/squashfs.img $MNT/b
mount -r -o loop $MNT/b/LiveOS/ext3fs.img $MNT/c
rpm -r $MNT/c -qa|sort >$MNT/a/$BASE-i686/rpm-qa
diff -u <(sed 's/\.x86_64$//' <$MNT/a/$BASE-x86_64/rpm-qa) <(sed 's/\.i686$//' <$MNT/a/$BASE-i686/rpm-qa) || :
BIN=
echo OK

--
livecd mailing list
[hidden email]
https://admin.fedoraproject.org/mailman/listinfo/livecd
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: auto-biarch update for F14 [fixes#2]

Jan Kratochvil-3
[ Some minor fixes, no longer hacking it now so this one should be final.  ]

#! /bin/bash
# $Id: OOo-LiveCD.sh,v 1.6 2010/12/31 21:58:53 jkratoch Exp $

set -ex
SIZE=2021654528
BASE=f14-live
BIN=$BASE.bin
ISO64=$BASE-x86_64.iso
ISO32=$BASE-i686.iso
ISO=$BASE.iso
KS=$BASE.ks
SELF=$BASE.sh
# $PWD: rpm: arguments to --root (-r) must begin with a /
MNT=$PWD/$BASE.mnt
LOOPDEV=

set -o pipefail
renice +19 -p $$
ionice -c3 -p $$
test "`uname -m`" = "x86_64"
test ! -e $BIN
test ! -e $ISO
test ! -e $MNT
test -e $SELF

if [ ! -e $ISO64 ];then
  test -e "$KS"
  livecd-creator --config=$KS --fslabel=$BASE --cache=/var/cache/live
  test -e $ISO
  mv -f $ISO $ISO64
fi
if [ ! -e $ISO32 ];then
  test -e "$KS"
  setarch i686 livecd-creator --config=$KS --fslabel=$BASE --cache=/var/cache/live
  test -e $ISO
  mv -f $ISO $ISO32
fi

trap 'set +e; rm -f $BIN; (umount $MNT/{c,b,a,}; rmdir $MNT/{c,b,a,}; losetup -d $LOOPDEV) 2>/dev/null' EXIT
dd if=/dev/zero of=$BIN bs=1 seek=$[SIZE-1] count=1
/sbin/parted --script $BIN mklabel msdos
dd bs=1 if=/usr/share/syslinux/mbr.bin of=$BIN conv=notrunc
# 17408=34*512
/sbin/parted --script $BIN unit b mkpart primary fat32 17408 $[$(find $BIN -printf %s)-17408] set 1 boot on
LOOPDEV=`losetup -o 17408 -v -f $BIN | sed 's/^Loop device is //'`
[ -n "$LOOPDEV" -a "${LOOPDEV#/dev/loop[0-9]}" != "$LOOPDEV" ]
/sbin/mkdosfs -n LIVE $LOOPDEV
UUID="$(dd skip=$[0x43] bs=1 count=4 if=$LOOPDEV|od -An -txI|tr a-z A-Z|sed 's/^ \(....\)\(....\)$/\1-\2/')"
# --overlay-size-mb 100 --home-size-mb 100
echo | livecd-iso-to-disk --unencrypted-home --livedir $BASE-i686 $ISO32 $LOOPDEV
mkdir $MNT
mount $LOOPDEV $MNT
CFG="`cat $MNT/syslinux/syslinux.cfg | sed 's/\( root=live:UUID=\)....-.... /\1'"$UUID /"`"
mv $MNT/syslinux/initrd0.img $MNT/syslinux/initrd1.img
mv $MNT/syslinux/vmlinuz0 $MNT/syslinux/vmlinuz1
umount $MNT
livecd-iso-to-disk --unencrypted-home --livedir $BASE-x86_64 $ISO64 $LOOPDEV
mount $LOOPDEV $MNT
cp -p /usr/share/syslinux/ifcpu64.c32 $MNT/syslinux/
(
  echo "$CFG" | sed -n '1,/^menu hiddenrow/p'
  cat <<EOH
label detect
  menu label Autoselect x86_64 / i686 Boot
  kernel ifcpu64.c32
  append linux0 -- linux1
  menu default
EOH
  echo "$CFG" | sed -n -e "s/$BASE-i686/$BASE-x86_64/g"                             -e 's/^  menu label .*$/& x86_64/' -e '/^label.*0$/,/^  append/p'
  echo "$CFG" | sed -n -e 's/^\(label.*\)0$/\11/' -e 's/\(vmlinuz\|initrd\)0/\11/g' -e 's/^  menu label .*$/& i686/'   -e '/^label.*1$/,/^  append/p'
  echo "$CFG" | sed -n '/^label mem/,$p'
) >$MNT/syslinux/syslinux.cfg
cp -p $SELF $MNT/
if [ -e "$KS" ];then
  cp -p $KS $MNT/
fi
umount $MNT
mkdir $MNT/{a,b,c}
mount $LOOPDEV $MNT/a
mount -r -o loop $MNT/a/$BASE-x86_64/squashfs.img $MNT/b
mount -r -o loop $MNT/b/LiveOS/ext3fs.img $MNT/c
rpm -r $MNT/c -qa|sort >$MNT/a/$BASE-x86_64/rpm-qa
umount $MNT/{c,b}
mount -r -o loop $MNT/a/$BASE-i686/squashfs.img $MNT/b
mount -r -o loop $MNT/b/LiveOS/ext3fs.img $MNT/c
rpm -r $MNT/c -qa|sort >$MNT/a/$BASE-i686/rpm-qa
diff -u <(sed 's/\.x86_64$//' <$MNT/a/$BASE-x86_64/rpm-qa) <(sed 's/\.i.86$//' <$MNT/a/$BASE-i686/rpm-qa) || :
BIN=
echo OK

--
livecd mailing list
[hidden email]
https://admin.fedoraproject.org/mailman/listinfo/livecd
Loading...