auto-biarch (x86_64 + i686) LiveDVD patch + ISO
by Jan Kratochvil
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/01188... */
++#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_vers...
+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
12 years, 11 months
btrfs for Fedora 12 and 13 LiveCD/DVD ?
by Valent Turkovic
Hi,
how to make Fedora 12 and Fedora 13 LiveCD/DVD that is btrfs formated
and not ext4?
What options need to be enables in kicstart file so that
livecd-creator makes btrfs iso images?
I would like to also have compression enabled after btrfs image in
transfered to hard drive or SSD.
Has anybody tried this?
Thank you in advanced,
Valent.
--
pratite me na twitteru - www.twitter.com/valentt
blog: http://kernelreloaded.blog385.com
linux, anime, spirituality, windsurf, wireless, ronjenje, pametne kuće, zwave
registered as user #367004 with the Linux Counter, http://counter.li.org.
ICQ: 2125241, Skype: valent.turkovic, MSN: valent.turkovic(a)hotmail.com
13 years, 2 months
Re: [Fedora-livecd-list] [Fedora-spins] livecd-tools 032 coming
by Martin Dengler
On Mon, Jun 21, 2010 at 03:10:38PM -0400, Daniel J Walsh wrote:
> On 06/21/2010 02:57 PM, Martin Dengler wrote:
> >[Sorry to reply to GP - I'm not on spins@]
> >
> >>On Mon, Jun 21, 2010 at 14:06:18 -0400,
> >> Daniel J Walsh<dwalsh(a)redhat.com> wrote:
> >>>
> >>>One think I would like to talk about with livecd-creator would be a way
> >>>to setup the livecd to have uninterrupted boot.
> >>>
> >>>The question is, am I the only one who thinks this is interesting?
> >
> >IIUC, "uninterrupted" boot is quite useful for Sugar on a Stick[1], at
> >least on some architectures (XO-1, XO-1.5). If it wasn't present,
> >we'd have to hack it in[2]
> >
> >Martin
> >
> >1. http://spins.fedoraproject.org/soas/
> >2. http://cgit.sugarlabs.org/soas/mainline/tree/soas-liveuserscripts-elimina...
>
>
> My idea is for apps like cash registers/kiosk/demo booths. If I
> imbed a bootable OS and do not allow external USB/CD. Theoretically
> people who can touch the box, can not boot their own OS or break
> into the OS to turn off security features like SELinux/iptables etc.
That sounds like "uninterruptable" boot to me, to be pedantic. Seems
like plenty of overlap between what I was understanding as
"uninterrupted" -- no user input / confusing configuration required --
and what I imagine cash registers/kiosk/demo booths would require to
be "uniterruptable".
On that basis I'd say:
> >>>The question is, am I the only one who thinks this is
> >>>interesting?
No, it's plenty interesting. If it was unintentional that
livecd-tools provided something close to this, please don't take it
away. Further enhancing livecd-tools in such a way is very useful.
Thanks,
Martin
13 years, 5 months
Re: [Fedora-livecd-list] [Fedora-spins] livecd-tools 032 coming
by Bruno Wolff III
On Mon, Jun 21, 2010 at 15:10:38 -0400,
Daniel J Walsh <dwalsh(a)redhat.com> wrote:
> My idea is for apps like cash registers/kiosk/demo booths. If I imbed a
> bootable OS and do not allow external USB/CD. Theoretically people who
> can touch the box, can not boot their own OS or break into the OS to
> turn off security features like SELinux/iptables etc.
Usually what I do to discourage playing around is set a grub password,
set PROMPT=no in /etc/sysconfig/init and disable control alt delete,
set a bios admin password, disable booting from removable media (unless
a password is supplied).
I never took a look at syslinux or isolinux to see if they have commands to
escape them, but that wouldn't apply in my use cases.
13 years, 5 months
Re: [Fedora-livecd-list] [Fedora-spins] livecd-tools 032 coming
by Bruno Wolff III
On Mon, Jun 21, 2010 at 14:06:18 -0400,
Daniel J Walsh <dwalsh(a)redhat.com> wrote:
>
> One think I would like to talk about with livecd-creator would be a way
> to setup the livecd to have uninterrupted boot.
>
> The question is, am I the only one who thinks this is interesting?
It seems like most of the time if you can do stuff at the console you can
also mess with the media you are booting from. I don't see a lot of cases
where there is a security benefit.
Being able to reduce the wait time probably has more value in making it boot
faster. So I think having a way to do that would be useful.
13 years, 5 months
Re: [Fedora-livecd-list] [Fedora-spins] livecd-tools 032 coming
by Bruno Wolff III
On Mon, Jun 21, 2010 at 10:42:39 -0400,
Daniel J Walsh <dwalsh(a)redhat.com> wrote:
> On 06/21/2010 10:06 AM, Bruno Wolff III wrote:
> >On Mon, Jun 21, 2010 at 08:02:37 -0400,
> > Daniel J Walsh<dwalsh(a)redhat.com> wrote:
> >>Will this update include the patches I sent to allow spins to be
> >>generated without the liveuser?
> >
> >I don't remember seeing those. I thought most of your patches was for
> >the livebase.ks rather than livecd-creator. I also didn't remember seeing
> >anything in the commit log that looked like your patches.
> >
> >We are trying to get some more pending patches reviewed, and I think what
> >you are trying to do is in scope for that whether as part of livebase
> >or livecd-creator. I hadn't thought of that before you prompted me with
> >this message and had been thinking it was a separate issue (for spins instead
> >of livecd).
> Oops never mind. The patches are in spin-kickstarts. I will blame
> it on Monday.
Yeah, but we are trying to get some people together to review pending
livecd-creator patches, and I think some of them can probably help with
reviewing your stuff. On that low a level I think the livebase kickstart
and the livecd-creator tool are closely related.
13 years, 5 months
Re: [Fedora-livecd-list] [Fedora-spins] livecd-tools 032 coming
by Bruno Wolff III
On Mon, Jun 21, 2010 at 08:02:37 -0400,
Daniel J Walsh <dwalsh(a)redhat.com> wrote:
> Will this update include the patches I sent to allow spins to be
> generated without the liveuser?
I don't remember seeing those. I thought most of your patches was for
the livebase.ks rather than livecd-creator. I also didn't remember seeing
anything in the commit log that looked like your patches.
We are trying to get some more pending patches reviewed, and I think what
you are trying to do is in scope for that whether as part of livebase
or livecd-creator. I hadn't thought of that before you prompted me with
this message and had been thinking it was a separate issue (for spins instead
of livecd).
13 years, 5 months
032 building for rawhide
by Bruno Wolff III
I tagged 032 with what we currently have committed and built an update using
it for rawhide. It should show up tomorrow.
I don't think this should be the final version for rawhide, but I wanted
to start getting some more testing of the changes we have already committed.
Since the practice seems to be to just make tags and not branches for this
project, that's what I did.
It also seems that we don't publish tar balls for tags on Fedora Hosted.
Getting them is as easy as:
git archive master | bzip2 > ~/livecd-tools-032.tar.bz2
So that doesn't seem to be a big deal.
At some point we should decide what we are going to push back to F13.
I think a good choice since we seem to have limited people time is
to wait until we think we have the final version for the F14 release
and build that version for F13. In the meantime, people who really need
fixes now, should be able to grab the F14 version and use that.
13 years, 5 months