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
Help with a problem I am seeing when trying to build a liveCD for FC13
by Jim Galarowicz
Hi,
I've been building a FC13 liveCD to showcase our OpenSpeedShop
performance tool.
The process was working well and I was creating liveCDs that I could
boot and exercise our tool. Then, I'm not sure what happened, as now I
see this when trying to build the liveCD:
Installing: libICE ################### [ 69/1129]
Installing: info ################### [ 70/1129]
sh: uname: command not found
Installing: popt ################### [ 71/1129]
Installing: chkconfig ################### [ 72/1129]
Installing: libcom_err ################### [ 73/1129]
Installing: readline ################### [ 74/1129]
sh: uname: command not found
Installing: sqlite ################### [ 75/1129]
and
Installing: libdwarf ################### [ 239/1129]
sh: uname: command not found
/home/jeg/OpenSpeedShop/liveOSS/INSTALL/rpm-tmp.kepEKp: line 6: chmod:
command not found
/home/jeg/OpenSpeedShop/liveOSS/INSTALL/rpm-tmp.kepEKp: line 7: chmod:
command not found
/home/jeg/OpenSpeedShop/liveOSS/INSTALL/rpm-tmp.kepEKp: line 8: chmod:
command not found
/home/jeg/OpenSpeedShop/liveOSS/INSTALL/rpm-tmp.kepEKp: line 9: chmod:
command not found
/home/jeg/OpenSpeedShop/liveOSS/INSTALL/rpm-tmp.kepEKp: line 10: chmod:
command not found
warning: %post(libdwarf-20091230-1.i686) scriptlet failed, exit status 127
Installing: libtevent ################### [ 240/1129]
and
Installing: coreutils-libs ################### [ 355/1129]
sh: uname: command not found
Installing: coreutils ################### [ 356/1129]
error: error creating temporary file
/home/jeg/OpenSpeedShop/liveOSS/INSTALL/localhost.localdomain/rpm-tmp.EGAzFe:
No such file or directory
error: Couldn't create temporary file for
%post(coreutils-8.4-6.fc13.i686): No such file or directory
Installing: pam ################### [ 357/1129]
error: error creating temporary file
/home/jeg/OpenSpeedShop/liveOSS/INSTALL/localhost.localdomain/rpm-tmp.nqKSh7:
No such file or directory
error: Couldn't create temporary file for %post(pam-1.1.1-4.fc13.i686):
No such file or directory
Has anyone encountered this? It seems that the install_root isn't
getting the coreutils installed correctly or at all? I don't know if
something was killed in the middle of building and I'm stuck in some
intermediate setup state? I reinstalled the livecd-tools to see if
that would help, but it didn't.
Any help would be greatly appreciated.
Thanks,
Jim G.
THE DETAILS:
Steps I take to prepare the liveCD rpms:
//****************************************************************************//
// Getting
Started //
// Preparing The Base System
Environment //
//****************************************************************************//
1. Install Needed Development Packages
Note: Try to start with a base Fedora Core installation that includes
most development packages.
yum -y install libtool-ltdl-devel livecd-tools createrepo
2. Prepare The Local yum Repository
mkdir -p /var/www/html/yum/{base,updates}
cp /media/Fedora\ 13\ i386\
DVD/repodata/fce31f091be8211a394d8942fcf4f6cbeffa3d40d87b61af55a97b1a88b46987-Fedora-13-comps.xml
/var/www/html/yum/base/.
cp /media/Fedora\ 13\ i386\ DVD/Packages/*.rpm /var/www/html/yum/base/.
I had to copy these RPMs into /var/www/html/yum/base in order to create
the live os for OpenSpeedShop
cp /home/jeg/Downloads/anaconda-13.42-1.fc13.i686.rpm
/var/www/html/yum/base/.
cp /home/jeg/Downloads/binutils-2.20.51.0.2-20.fc13.i686.rpm
/var/www/html/yum/base/.
cp /home/jeg/Downloads/binutils-devel-2.20.51.0.2-20.fc13.i686.rpm
/var/www/html/yum/base/.
cp /home/jeg/Downloads/binutils-static-2.20.51.0.2-20.fc13.i686.rpm
/var/www/html/yum/base/.
cp /home/jeg/Downloads/blas-3.2.1-4.fc13.i686.rpm /var/www/html/yum/base/.
cp /home/jeg/Downloads/makebootfat-1.4-9.fc12.i686.rpm
/var/www/html/yum/base/.
cp /home/jeg/Downloads/isomd5sum-1.0.5-3.fc12.i686.rpm
/var/www/html/yum/base/.
cp /home/jeg/Downloads/pykickstart-1.69-1.fc13.noarch.rpm
/var/www/html/yum/base/.
cp /home/jeg/Downloads/python-cryptsetup-0.0.10-2.fc13.i686.rpm
/var/www/html/yum/base/.
cp /home/jeg/Downloads/pyparted-3.3-1.fc13.i686.rpm /var/www/html/yum/base/.
cp /home/jeg/Downloads/python-pyblock-0.47-1.fc13.i686.rpm
/var/www/html/yum/base/.
cp /home/jeg/Downloads/python-nss-0.8-1.fc12.i686.rpm
/var/www/html/yum/base/.
cp /home/jeg/Downloads/scim-chewing-0.3.3-2.fc12.i686.rpm
/var/www/html/yum/base/.
cp /home/jeg/Downloads/scim-pinyin-0.5.91-27.fc12.i686.rpm
/var/www/html/yum/base/.
cp /home/jeg/Downloads/squashfs-tools-4.0-4.fc13.i686.rpm
/var/www/html/yum/base/.
cp /home/jeg/Downloads/syslinux-3.84-1.fc13.i686.rpm
/var/www/html/yum/base/.
cp
/home/jeg/Downloads/tigervnc-server-1.0.90-0.8.20100219svn3993.fc13.i686.rpm
/var/www/html/yum/base/.
cp /home/jeg/Downloads/tigervnc-1.0.0-1.fc12.i686.rpm
/var/www/html/yum/base/.
cp /home/jeg/Downloads/perl-5.10.0-82.fc12.i686.rpm /var/www/html/yum/base/.
cp /home/jeg/Downloads/perl-Crypt-PasswdMD5-1.3-5.fc12.noarch.rpm
/var/www/html/yum/base/.
cp /home/jeg/Downloads/lapack-3.2.1-4.fc13.i686.rpm /var/www/html/yum/base/.
cp /home/jeg/Downloads/xorg-x11-fonts-misc-7.2-9.fc12.noarch.rpm
/var/www/html/yum/base/.
3. Build Open MPI using provided spec file.
Copy created RPM to /var/www/html/yum/base/
4) Build toyprograms, webtutorials, and optionally the openmpi package using
the setup_and_build_rpms.sh script
Copy created RPMs to /var/www/html/yum/base/
5. Build OpenSpeedShop prerequisite packages.
Copy created RPMs to /var/www/html/yum/base/
6. Build OpenSpeedShop
Copy created RPM to /var/www/html/yum/base/
7. Create Local yum Repository
createrepo -dg
/var/www/html/yum/base/fce31f091be8211a394d8942fcf4f6cbeffa3d40d87b61af55a97b1a88b46987-Fedora-13-comps.xml
/var/www/html/yum/base/
-----------------------------------------------------------------------------------------------------------
then use buildlivecd.sh, the build script I run after the steps above:
-----------------------------------------------------------------------------------------------------------
#!/bin/sh
livecd_label=OpenSpeedShop-Live
livecd_kickstart_file=livecd-fedora-13-openss.ks
#You must run livecd-creator as root...
if [ `whoami` != "root" ]; then
echo "remember: you must be root to run livecd-creator..."
fi
su -c "livecd-creator --config=$livecd_kickstart_file \
--fslabel=$livecd_label" root
-----------------------------------------------------------------------------------------------------------
cat livecd-fedora-13-base-openss.ks
-----------------------------------------------------------------------------------------------------------
# fedora-live-base.ks
#
# Defines the basics for all kickstarts in the fedora-live branch
# Does not include package selection (other then mandatory)
# Does not include localization packages or configuration
#
# Does includes "default" language configuration (kickstarts including
# this template can override these settings)
lang en_US.UTF-8
keyboard us
timezone US/Eastern
auth --useshadow --enablemd5
selinux --disabled
firewall --enabled --service=mdns
xconfig --startxonboot
part / --size 3072 --fstype ext4
services --enabled=NetworkManager --disabled=network,sshd
repo --name=a-base --baseurl=file:///var/www/html/yum/base
%packages
@base-x
@base
@core
@fonts
@input-methods
# Exclude ibus-pinyin-open-phrase as it's large and somewhat optional
-ibus-pinyin-open-phrase
@admin-tools
@dial-up
@hardware-support
@printing
# Explicitly specified here:
# <notting> walters: because otherwise dependency loops cause yum issues.
kernel
# The point of a live image is to install
anaconda
isomd5sum
#Fix for SELINUX Disabled
/usr/sbin/lokkit
%end
%post
# FIXME: it'd be better to get this installed from a package
cat > /etc/rc.d/init.d/livesys << EOF
#!/bin/bash
#
# live: Init script for live image
#
# chkconfig: 345 00 99
# description: Init script for live image.
. /etc/init.d/functions
if ! strstr "\`cat /proc/cmdline\`" liveimg || [ "\$1" != "start" ]; then
exit 0
fi
if [ -e /.liveimg-configured ] ; then
configdone=1
fi
exists() {
which \$1 >/dev/null 2>&1 || return
\$*
}
touch /.liveimg-configured
# mount live image
if [ -b \`readlink -f /dev/live\` ]; then
mkdir -p /mnt/live
mount -o ro /dev/live /mnt/live 2>/dev/null || mount /dev/live /mnt/live
fi
livedir="LiveOS"
for arg in \`cat /proc/cmdline\` ; do
if [ "\${arg##live_dir=}" != "\${arg}" ]; then
livedir=\${arg##live_dir=}
return
fi
done
# enable swaps unless requested otherwise
swaps=\`blkid -t TYPE=swap -o device\`
if ! strstr "\`cat /proc/cmdline\`" noswap && [ -n "\$swaps" ] ; then
for s in \$swaps ; do
action "Enabling swap partition \$s" swapon \$s
done
fi
if ! strstr "\`cat /proc/cmdline\`" noswap && [ -f
/mnt/live/\${livedir}/swap.img ] ; then
action "Enabling swap file" swapon /mnt/live/\${livedir}/swap.img
fi
mountPersistentHome() {
# support label/uuid
if [ "\${homedev##LABEL=}" != "\${homedev}" -o "\${homedev##UUID=}"
!= "\${homedev}" ]; then
homedev=\`/sbin/blkid -o device -t "\$homedev"\`
fi
# if we're given a file rather than a blockdev, loopback it
if [ "\${homedev##mtd}" != "\${homedev}" ]; then
# mtd devs don't have a block device but get magic-mounted with -t
jffs2
mountopts="-t jffs2"
elif [ ! -b "\$homedev" ]; then
loopdev=\`losetup -f\`
if [ "\${homedev##/mnt/live}" != "\${homedev}" ]; then
action "Remounting live store r/w" mount -o remount,rw /mnt/live
fi
losetup \$loopdev \$homedev
homedev=\$loopdev
fi
# if it's encrypted, we need to unlock it
if [ "\$(/sbin/blkid -s TYPE -o value \$homedev 2>/dev/null)" =
"crypto_LUKS" ]; then
echo
echo "Setting up encrypted /home device"
plymouth ask-for-password --command="cryptsetup luksOpen \$homedev
EncHome"
homedev=/dev/mapper/EncHome
fi
# and finally do the mount
mount \$mountopts \$homedev /home
# if we have /home under what's passed for persistent home, then
# we should make that the real /home. useful for mtd device on olpc
if [ -d /home/home ]; then mount --bind /home/home /home ; fi
[ -x /sbin/restorecon ] && /sbin/restorecon /home
if [ -d /home/liveuser ]; then USERADDARGS="-M" ; fi
}
findPersistentHome() {
for arg in \`cat /proc/cmdline\` ; do
if [ "\${arg##persistenthome=}" != "\${arg}" ]; then
homedev=\${arg##persistenthome=}
return
fi
done
}
if strstr "\`cat /proc/cmdline\`" persistenthome= ; then
findPersistentHome
elif [ -e /mnt/live/\${livedir}/home.img ]; then
homedev=/mnt/live/\${livedir}/home.img
fi
# if we have a persistent /home, then we want to go ahead and mount it
if ! strstr "\`cat /proc/cmdline\`" nopersistenthome && [ -n "\$homedev"
] ; then
action "Mounting persistent /home" mountPersistentHome
fi
# make it so that we don't do writing to the overlay for things which
# are just tmpdirs/caches
mount -t tmpfs -o mode=0755 varcacheyum /var/cache/yum
mount -t tmpfs tmp /tmp
mount -t tmpfs vartmp /var/tmp
[ -x /sbin/restorecon ] && /sbin/restorecon /var/cache/yum /tmp /var/tmp
>/dev/null 2>&1
if [ -n "\$configdone" ]; then
exit 0
fi
# add openssuser user with no passwd
useradd -c "OpenSpeedShop Live User" openssuser
passwd -d openssuser > /dev/null
# turn off firstboot for livecd boots
chkconfig --level 345 firstboot off 2>/dev/null
# don't start yum-updatesd for livecd boots
chkconfig --level 345 yum-updatesd off 2>/dev/null
# turn off mdmonitor by default
chkconfig --level 345 mdmonitor off 2>/dev/null
# turn off setroubleshoot on the live image to preserve resources
chkconfig --level 345 setroubleshoot off 2>/dev/null
# don't do packagekit checking by default
gconftool-2 --direct
--config-source=xml:readwrite:/etc/gconf/gconf.xml.defaults -s -t string
/apps/gnome-packagekit/update-icon/frequency_get_updates never >/dev/null
gconftool-2 --direct
--config-source=xml:readwrite:/etc/gconf/gconf.xml.defaults -s -t string
/apps/gnome-packagekit/update-icon/frequency_get_upgrades never >/dev/null
gconftool-2 --direct
--config-source=xml:readwrite:/etc/gconf/gconf.xml.defaults -s -t string
/apps/gnome-packagekit/update-icon/frequency_refresh_cache never >/dev/null
gconftool-2 --direct
--config-source=xml:readwrite:/etc/gconf/gconf.xml.defaults -s -t bool
/apps/gnome-packagekit/update-icon/notify_available false >/dev/null
gconftool-2 --direct
--config-source=xml:readwrite:/etc/gconf/gconf.xml.defaults -s -t bool
/apps/gnome-packagekit/update-icon/notify_distro_upgrades false >/dev/null
gconftool-2 --direct
--config-source=xml:readwrite:/etc/gconf/gconf.xml.defaults -s -t bool
/apps/gnome-packagekit/enable_check_firmware false >/dev/null
gconftool-2 --direct
--config-source=xml:readwrite:/etc/gconf/gconf.xml.defaults -s -t bool
/apps/gnome-packagekit/enable_check_hardware false >/dev/null
gconftool-2 --direct
--config-source=xml:readwrite:/etc/gconf/gconf.xml.defaults -s -t bool
/apps/gnome-packagekit/enable_codec_helper false >/dev/null
gconftool-2 --direct
--config-source=xml:readwrite:/etc/gconf/gconf.xml.defaults -s -t bool
/apps/gnome-packagekit/enable_font_helper false >/dev/null
gconftool-2 --direct
--config-source=xml:readwrite:/etc/gconf/gconf.xml.defaults -s -t bool
/apps/gnome-packagekit/enable_mime_type_helper false >/dev/null
# don't start cron/at as they tend to spawn things which are
# disk intensive that are painful on a live image
chkconfig --level 345 crond off 2>/dev/null
chkconfig --level 345 atd off 2>/dev/null
chkconfig --level 345 anacron off 2>/dev/null
chkconfig --level 345 readahead_early off 2>/dev/null
chkconfig --level 345 readahead_later off 2>/dev/null
# Stopgap fix for RH #217966; should be fixed in HAL instead
touch /media/.hal-mtab
# workaround clock syncing on shutdown that we don't want (#297421)
sed -i -e 's/hwclock/no-such-hwclock/g' /etc/rc.d/init.d/halt
# and hack so that we eject the cd on shutdown if we're using a CD...
if strstr "\`cat /proc/cmdline\`" CDLABEL= ; then
cat >> /sbin/halt.local << FOE
#!/bin/bash
# XXX: This often gets stuck during shutdown because /etc/init.d/halt
# (or something else still running) wants to read files from the block\
# device that was ejected. Disable for now. Bug #531924
# we want to eject the cd on halt, but let's also try to avoid
# io errors due to not being able to get files...
#cat /sbin/halt > /dev/null
#cat /sbin/reboot > /dev/null
#/usr/sbin/eject -p -m \$(readlink -f /dev/live) >/dev/null 2>&1
#echo "Please remove the CD from your drive and press Enter to finish
restarting"
#read -t 30 < /dev/console
FOE
chmod +x /sbin/halt.local
fi
EOF
# bah, hal starts way too late
cat > /etc/rc.d/init.d/livesys-late << EOF
#!/bin/bash
#
# live: Late init script for live image
#
# chkconfig: 345 99 01
# description: Late init script for live image.
. /etc/init.d/functions
if ! strstr "\`cat /proc/cmdline\`" liveimg || [ "\$1" != "start" ] || [
-e /.liveimg-late-configured ] ; then
exit 0
fi
exists() {
which \$1 >/dev/null 2>&1 || return
\$*
}
touch /.liveimg-late-configured
# read some variables out of /proc/cmdline
for o in \`cat /proc/cmdline\` ; do
case \$o in
ks=*)
ks="--kickstart=\${o#ks=}"
;;
xdriver=*)
xdriver="--set-driver=\${o#xdriver=}"
;;
esac
done
# this is a bad hack to work around #460581 for the geode
# purely to help move testing along for now
if [ \`grep -c Geode /proc/cpuinfo\` -ne 0 ]; then
cat > /etc/X11/xorg.conf <<FOE
Section "ServerLayout"
Identifier "Default Layout"
Screen 0 "Screen0" 0 0
InputDevice "Keyboard0" "CoreKeyboard"
EndSection
Section "InputDevice"
# keyboard added by rhpxl
Identifier "Keyboard0"
Driver "kbd"
Option "XkbModel" "pc105"
Option "XkbLayout" "us"
EndSection
Section "Monitor"
Identifier "Monitor0"
HorizSync 30-67
VertRefresh 48-52
DisplaySize 152 114
Mode "1200x900"
DotClock 57.275
HTimings 1200 1208 1216 1240
VTimings 900 905 908 912
Flags "-HSync" "-VSync"
EndMode
EndSection
Section "Device"
Identifier "Videocard0"
Driver "amd"
VendorName "Advanced Micro Devices, Inc."
BoardName "AMD Geode GX/LX"
Option "AccelMethod" "EXA"
Option "NoCompression" "true"
Option "MigrationHeuristic" "greedy"
Option "PanelGeometry" "1200x900"
EndSection
Section "Screen"
Identifier "Screen0"
Device "Videocard0"
Monitor "Monitor0"
DefaultDepth 16
SubSection "Display"
Depth 16
Modes "1200x900"
EndSubSection
EndSection
FOE
fi
# if liveinst or textinst is given, start anaconda
if strstr "\`cat /proc/cmdline\`" liveinst ; then
plymouth --quit
/usr/sbin/liveinst \$ks
fi
if strstr "\`cat /proc/cmdline\`" textinst ; then
plymouth --quit
/usr/sbin/liveinst --text \$ks
fi
# configure X, allowing user to override xdriver
if [ -n "\$xdriver" ]; then
exists system-config-display --noui --reconfig --set-depth=24 \$xdriver
fi
EOF
chmod 755 /etc/rc.d/init.d/livesys
/sbin/restorecon /etc/rc.d/init.d/livesys
/sbin/chkconfig --add livesys
chmod 755 /etc/rc.d/init.d/livesys-late
/sbin/restorecon /etc/rc.d/init.d/livesys-late
/sbin/chkconfig --add livesys-late
# work around for poor key import UI in PackageKit
rm -f /var/lib/rpm/__db*
rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-fedora
echo "Packages within this LiveCD"
rpm -qa
# go ahead and pre-make the man -k cache (#455968)
/usr/sbin/makewhatis -w
# save a little bit of space at least...
rm -f /boot/initramfs*
# make sure there aren't core files lying around
rm -f /core*
# convince readahead not to collect
rm -f /.readahead_collect
touch /var/lib/readahead/early.sorted
%end
%post --nochroot
cp $INSTALL_ROOT/usr/share/doc/*-release-*/GPL $LIVE_ROOT/GPL
cp
$INSTALL_ROOT/usr/share/doc/HTML/readme-live-image/en_US/readme-live-image-en_US.txt
$LIVE_ROOT/README
# only works on x86, x86_64
if [ "$(uname -i)" = "i386" -o "$(uname -i)" = "x86_64" ]; then
if [ ! -d $LIVE_ROOT/LiveOS ]; then mkdir -p $LIVE_ROOT/LiveOS ; fi
cp /usr/bin/livecd-iso-to-disk $LIVE_ROOT/LiveOS
fi
# copy some test applications for OpenSpeedShop
# make sure these apps exist on your host machine...and were compiled in
# in the same location. This makes source mapping easier for OpenSpeedShop.
%end
-----------------------------------------------------------------------------------------------------------
livecd-fedora-13-openss.ks
-----------------------------------------------------------------------------------------------------------
%include livecd-fedora-13-base-openss.ks
%packages
@graphical-internet
@gnome-desktop
NetworkManager-vpnc
NetworkManager-openvpn
# OpenSpeedShop-specific
openmpi
libdwarf
libunwind
sqlite
papi
libmonitor
dyninst
mrnet
openspeedshop
toyprograms
webtutorial
# dictionaries are big
-aspell-*
-man-pages-*
-scim-tables-*
-wqy-bitmap-fonts
-dejavu-fonts-experimental
-dejavu-fonts
# more fun with space saving
-scim-lang-chinese
scim-chewing
scim-pinyin
# save some space
-gnome-user-docs
-gimp-help
-evolution-help
-autofs
-nss_db
-vino
#-evolution TODO: need to mod the gnome panel...
-ekiga
-pidgin
-transmission
-tomboy
%end
%post
cat >> /etc/rc.d/init.d/fedora-live << EOF
# disable screensaver locking
gconftool-2 --direct
--config-source=xml:readwrite:/etc/gconf/gconf.xml.defaults -s -t bool
/apps/gnome-screensaver/lock_enabled false >/dev/null
# set up timed auto-login for after 1 second
sed -i -e
's/\[daemon\]/[daemon]\nTimedLoginEnable=true\nTimedLogin=openssuser\nTimedLoginDelay=1/'
/etc/gdm/custom.conf
if [ -e /usr/share/icons/hicolor/96x96/apps/fedora-logo-icon.png ] ; then
cp /usr/share/icons/hicolor/96x96/apps/fedora-logo-icon.png
/home/openssuser/.face
chown openssuser:openssuser /home/fedora/.face
# TODO: would be nice to get e-d-s to pick this one up too... but how?
fi
# add some OpenSpeedShop bashrc goodies...
echo "cat << EOF" > /root/.bashrc.oss
echo "------------------------------" >> /root/.bashrc.oss
echo "Welcome to Open|SpeedShop Live" >> /root/.bashrc.oss
echo "------------------------------" >> /root/.bashrc.oss
echo " " >> /root/.bashrc.oss
echo "To run a sequential experiment:" >> /root/.bashrc.oss
echo " >> cd sequential/smg2000/test" >> /root/.bashrc.oss
echo " >> osspcsamp \"smg2000 -n 50 50 50\" " >> /root/.bashrc.oss
echo " >> openss -f smg2000-pcsamp.openss &" >> /root/.bashrc.oss
echo " " >> /root/.bashrc.oss
echo "To run an MPI experiment:" >> /root/.bashrc.oss
echo " >> cd mpi/smg2000/test" >> /root/.bashrc.oss
echo " >> osspcsamp \"mpirun -np 2 smg2000 -n 50 50 50\" " >>
/root/.bashrc.oss
echo " >> openss -f smg2000-pcsamp.openss &" >> /root/.bashrc.oss
echo " " >> /root/.bashrc.oss
echo "For more information, please see the included HTML documentation."
>> /root/.bashrc.oss
echo "EOF" >> /root/.bashrc.oss
echo "if \[ -f /etc/bashrc \]; then" >> /root/.bashrc.oss
echo " . /etc/bashrc" >> /root/.bashrc.oss
echo "fi" >> /root/.bashrc.oss
echo "export QTDIR=/usr/lib/qt-3.3" >> /root/.bashrc.oss
echo "export OPENSS_PREFIX=/opt/OSS" >> /root/.bashrc.oss
echo "export OPENSS_PLUGIN_PATH=\\\$OPENSS_PREFIX/lib/openspeedshop" >>
/root/.bashrc.oss
echo "export OPENSS_INSTRUMENTOR=mrnet" >> /root/.bashrc.oss
echo "export OPENSS_MRNET_TOPOLOGY_FILE=/home/openssuser/.openss.top" >>
/root/.bashrc.oss
echo "export OPENSS_RAWDATA_DIR=/tmp" >> /root/.bashrc.oss
echo "export OPENSS_MPI_OPENMPI=/opt/openmpi" >> /root/.bashrc.oss
echo "export
DYNINSTAPI_RT_LIB=\\\$OPENSS_PREFIX/lib/libdyninstAPI_RT.so.1" >>
/root/.bashrc.oss
echo "export PATH=\\\$OPENSS_PREFIX/bin:/opt/openmpi/bin:\\\$PATH" >>
/root/.bashrc.oss
echo "export
LD_LIBRARY_PATH=\\\$OPENSS_PREFIX/lib:/opt/openmpi/lib:\\\$LD_LIBRARY_PATH"
>> /root/.bashrc.oss
echo "export XPLAT_RSHCOMMAND=ssh" >> /root/.bashrc.oss
echo "export XPLAT_RSH=ssh" >> /root/.bashrc.oss
echo "export MRNET_RSH=ssh" >> /root/.bashrc.oss
chmod 644 /root/.bashrc.oss
cp /root/.bashrc.oss /home/openssuser/.bashrc
chown openssuser:openssuser /home/openssuser/.bashrc
rm -f /root/.bashrc.oss
# add a MRNet topology file
echo "localhost.localdomain:0 => localhost.localdomain:1 ;" >
/root/.openss.top
cp /root/.openss.top /home/openssuser/
chown openssuser:openssuser /home/openssuser/.openss.top
rm -f /root/.openss.top
# start some apps...
echo "[Default]" > /root/.session-manual
echo "num_clients=2" >> /root/.session-manual
echo "0,RestartClientHint=3" >> /root/.session-manual
echo "0,Priority=50" >> /root/.session-manual
echo "0,RestartCommand=firefox /opt/doc/index.html" >> /root/.session-manual
echo "1,Program=firefox /opt/doc/index.html" >> /root/.session-manual
echo "1,RestartClientHint=3" >> /root/.session-manual
echo "1,Priority=50" >> /root/.session-manual
echo "1,RestartCommand=gnome-terminal" >> /root/.session-manual
echo "1,Program=gnome-terminal" >> /root/.session-manual
cp /root/.session-manual /home/openssuser/.gnome2/session-manual
chown openssuser:openssuser /home/openssuser/.gnome2/session-manual
rm -f /root/.session-manual
# setup preferences file for new user
mkdir /home/openssuser/.qt
echo "[ManageProcessesPanel]" > /root/.openspeedshoprc
echo "updateDisplayLineEdit=15" >> /root/.openspeedshoprc
echo "updateOnCheckBox=true" >> /root/.openspeedshoprc
echo "" >> /root/.openspeedshoprc
echo "[Source Panel]" >> /root/.openspeedshoprc
echo
"leftSideLineEdit0=/home/jeg/OpenSpeedShop/liveOSS/toyprograms-0.0.1" >>
/root/.openspeedshoprc
echo "leftSideLineEdit1=" >> /root/.openspeedshoprc
echo "leftSideLineEdit2=" >> /root/.openspeedshoprc
echo "leftSideLineEdit3=" >> /root/.openspeedshoprc
echo "leftSideLineEdit4=" >> /root/.openspeedshoprc
echo "leftSideLineEdit5=" >> /root/.openspeedshoprc
echo "leftSideLineEdit6=" >> /root/.openspeedshoprc
echo "leftSideLineEdit7=" >> /root/.openspeedshoprc
echo "leftSideLineEdit8=" >> /root/.openspeedshoprc
echo "leftSideLineEdit9=" >> /root/.openspeedshoprc
echo "rightSideLineEdit0=/home/openssuser" >> /root/.openspeedshoprc
echo "rightSideLineEdit1=" >> /root/.openspeedshoprc
echo "rightSideLineEdit2=" >> /root/.openspeedshoprc
echo "rightSideLineEdit3=" >> /root/.openspeedshoprc
echo "rightSideLineEdit4=" >> /root/.openspeedshoprc
echo "rightSideLineEdit5=" >> /root/.openspeedshoprc
echo "rightSideLineEdit6=" >> /root/.openspeedshoprc
echo "rightSideLineEdit7=" >> /root/.openspeedshoprc
echo "rightSideLineEdit8=" >> /root/.openspeedshoprc
echo "rightSideLineEdit9=" >> /root/.openspeedshoprc
echo "showLineNumbersCheckBox=true" >> /root/.openspeedshoprc
echo "showStatisticsCheckBox=false" >> /root/.openspeedshoprc
echo "" >> /root/.openspeedshoprc
echo "[Stats Panel]" >> /root/.openspeedshoprc
echo "advancedToolbarCheckBox=false" >> /root/.openspeedshoprc
echo "chartTypeComboBox=2" >> /root/.openspeedshoprc
echo "focusSourcePanelCheckBox=false" >> /root/.openspeedshoprc
echo "levelsToOpenLineEdit=-1" >> /root/.openspeedshoprc
echo "showMetadataCheckBox=true" >> /root/.openspeedshoprc
echo "showSkylineCheckBox=false" >> /root/.openspeedshoprc
echo "showSkylineLineEdit=25" >> /root/.openspeedshoprc
echo "showTextByLocationCheckBox=false" >> /root/.openspeedshoprc
echo "showTextByPercentCheckBox=true" >> /root/.openspeedshoprc
echo "showTextByValueCheckBox=false" >> /root/.openspeedshoprc
echo "showTextInChartCheckBox=true" >> /root/.openspeedshoprc
echo "showToolbarCheckBox=true" >> /root/.openspeedshoprc
echo "showTopNChartLineEdit=5" >> /root/.openspeedshoprc
echo "showTopNLineEdit=100" >> /root/.openspeedshoprc
echo "sortDecendingCheckBox=true" >> /root/.openspeedshoprc
echo "" >> /root/.openspeedshoprc
echo "[general]" >> /root/.openspeedshoprc
echo "allowPythonCommands=true" >> /root/.openspeedshoprc
echo "askAboutChangingArgs=true" >> /root/.openspeedshoprc
echo "askAboutSavingTheDatabase=true" >> /root/.openspeedshoprc
echo "globalFontFamily=Bitstream Charter" >> /root/.openspeedshoprc
echo "globalFontItalic=false" >> /root/.openspeedshoprc
echo "globalFontPointSize=10" >> /root/.openspeedshoprc
echo "globalFontWeight=75" >> /root/.openspeedshoprc
echo "globalRemoteShell=/usr/bin/rsh" >> /root/.openspeedshoprc
echo "helpLevelDefault=2" >> /root/.openspeedshoprc
echo "historyDefault=24" >> /root/.openspeedshoprc
echo "historyLimit=100" >> /root/.openspeedshoprc
echo "instrumentorIsOffline=true" >> /root/.openspeedshoprc
echo "lessRestrictiveComparisons=true" >> /root/.openspeedshoprc
echo "maxAsyncCommands=20" >> /root/.openspeedshoprc
echo "onRerunSaveCopyOfExperimentDatabase=true" >> /root/.openspeedshoprc
echo "saveExperimentDatabase=true" >> /root/.openspeedshoprc
echo "showGraphics=false" >> /root/.openspeedshoprc
echo "showSplashScreen=true" >> /root/.openspeedshoprc
echo "viewFieldSize=20" >> /root/.openspeedshoprc
echo "viewFullPath=false" >> /root/.openspeedshoprc
echo "viewMangledName=false" >> /root/.openspeedshoprc
echo "viewPrecision=6" >> /root/.openspeedshoprc
mkdir /root/.qt
chmod 644 /root/.openspeedshoprc
cp /root/.openspeedshoprc /root/.qt/openspeedshoprc
cp -r /root/.qt /home/openssuser/.
chown openssuser:openssuser -R /home/openssuser/.qt
rm /root/.openspeedshoprc
echo "localhost.localdomain ssh-rsa
AAAAB3NzaC1yc2EAAAABIwAAAQEApWX5IL5f9c0tmBbmuj3/+Wx/2s8Nv0eo04gom+46DWNL9OQqiLtzHbqzn6M9WA0500kUsS5ZYxPXAcAo6LtWBpJ8eqVIbgYbwVRf5K2Iprm1irK6gYzBh8+iTPdqyLj4bjVzecxuNDNyD0YJTwB+q84J/linTHKmqdPC4Pzl+bTa+Je9oan9uORe1k5BKKkm8sem6/V39EwlRePiJMuVtZPCwBtLspMgCA+9R2KuvyisnS5vDjwnwcZQaHzCTsi57isk/P//4x1RWX+6KEngjjpp5igjnN1DBaabfIhLTc09z9tDVPcBir7mg0fJ09kckA4BExip1fzVLqmM1NoPgw=="
> /root/.known_hosts
mkdir /root/.ssh
chmod 644 /root/.known_hosts
cp /root/.known_hosts /root/.ssh/known_hosts
cp -r /root/.ssh /home/openssuser/.
chown openssuser:openssuser -R /home/openssuser/.ssh
rm /root/.known_hosts
#move apps to /home/openssuser
#mkdir -p /home/openssuser/{mpi,openmp,sequential}
mkdir -p /home/openssuser/{mpi,sequential}
mv /opt/tempapps/mpi/smg2000 /home/openssuser/mpi/.
mv /opt/tempapps/mpi/nbody /home/openssuser/mpi/.
mv /opt/tempapps/sequential/smg2000 /home/openssuser/sequential/.
#mv /opt/tempapps/openmp/smg2000 /home/openssuser/openmp/
mv /opt/tempapps/sequential/forever /home/openssuser/sequential/.
mv /opt/tempapps/sequential/threads /home/openssuser/sequential/.
mv /opt/tempapps/sequential/mutatee /home/openssuser/sequential/.
mv /opt/tempapps/sequential/matmul /home/openssuser/sequential/.
chown openssuser:openssuser -R /home/openssuser/mpi
chown openssuser:openssuser -R /home/openssuser/sequential
rm -rf /opt/tempapps
rm -rf /tmp/*
EOF
%end
13 years, 1 month
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
[PATCH] Fixed buggy [[ "$DEV" =~ "/dev/loop*" ]] tests with new isdevloop() function
by Marc Herbert
This was accidentally working in old bash versions, not anymore in
Fedora 13's bash 4.1.7. Now using proper prefix matching instead of
the previous regex matching disguised as pattern matching.
---
tools/livecd-iso-to-disk.sh | 13 +++++++++----
1 files changed, 9 insertions(+), 4 deletions(-)
diff --git a/tools/livecd-iso-to-disk.sh b/tools/livecd-iso-to-disk.sh
index f4d0855..846fa73 100755
--- a/tools/livecd-iso-to-disk.sh
+++ b/tools/livecd-iso-to-disk.sh
@@ -39,10 +39,15 @@ exitclean() {
exit 1
}
+isdevloop()
+{
+ [ x"${1#/dev/loop}" != x"$1" ]
+}
+
getdisk() {
DEV=$1
- if [[ "$DEV" =~ "/dev/loop*" ]]; then
+ if isdevloop "$DEV"; then
device="$DEV"
return
fi
@@ -65,7 +70,7 @@ getdisk() {
}
resetMBR() {
- if [[ "$DEV" =~ "/dev/loop*" ]]; then
+ if isdevloop "$DEV"; then
return
fi
getdisk $1
@@ -94,7 +99,7 @@ resetMBR() {
}
checkMBR() {
- if [[ "$DEV" =~ "/dev/loop*" ]]; then
+ if isdevloop "$DEV"; then
return 0
fi
getdisk $1
@@ -124,7 +129,7 @@ checkPartActive() {
if [ "$dev" = "$device" ]; then
return
fi
- if [[ "$dev" =~ "/dev/loop*" ]]; then
+ if isdevloop "$dev"; then
return
fi
--
1.7.2
13 years, 2 months
mkbackup.py - Development of script to make LiveCD/DVD images from the running system
by Jasper Hartline
Here is what I have done so far on mkbackup.py
For anyone interested in knowing how this will be done..
I think I will use dump and restore to produce the Live images for now
which will be limited to Ext2/3/4
but I am glad to hear suggestions about supporting other filesystems
and or how to use any other tools.s
This should be interesting to see how it works as a backup media.
Being Live-runnable and installable later with much much easy using Anaconda.
The file is available at this URL and one attached. The on online will
be updated periodically.
Then I'll attach it to the mailing list here periodically too.
http://autopsy.liveprojects.info/scripts/mkbackup.py
13 years, 2 months
Development of biarch live CD script.
by Richard Shaw
On Fri, Aug 20, 2010 at 6:05 AM, Jasper Hartline
<jasper.hartline(a)gmail.com> wrote:
> On Thu, Aug 19, 2010 at 11:15 PM, Jasper Hartline
> <jasper.hartline(a)gmail.com> wrote:
>> On Thu, Aug 19, 2010 at 3:20 PM, Jasper Hartline
>
>> I'll keep workking with this and update you with the latest, as soon
>> as I get more done.
>>
>
> Well. I have failed to decrypt the FileSystem class for pyparted.
> It seems you create a format object
> and then pass that to Partition, like this.. below
> however, upon looking at the loop device and using hexdump, and dumpe2fs
> and trying to mount it, etc. It seems it is corrupt or is not a valid
> filesystem.
>
> So I'm not sure what is going on.
> Also, to get the size we can just use size divided by 512.
> That gives us the maximum number of sectors minus 1 for the MBR.
>
> #!/usr/bin/python
>
> import os
> import sys
> import parted
>
>
> size = os.stat("/tmp/file").st_size
> sectors = size / 512 - 1
>
> device = parted.Device(path="/dev/loop0")
> disk = parted.freshDisk(device, 'msdos')
>
> start = 2
> end = sectors
>
> new_geom = parted.Geometry(device=device,
> start=start,
> end=end)
>
> format = parted.FileSystem(type="ext2", geometry=new_geom).create()
>
> partition = parted.Partition(disk=disk,
> fs=format,
> type=82,
> geometry=new_geom)
>
>
> constraint = parted.Constraint(exactGeom=new_geom)
>
>
>
>
> disk.addPartition(partition=partition,
> constraint=constraint)
>
>
> disk.commit()
>
> So here attached is what I have so far, it is what I would like to
> continue to work on and
> fox the format routing when we figure out how to use pyparted properly.
>
> So far I have it setting up correctly and the master boot record is proper.
> /dev/loop0 on /tmp/tmprjsmh3 type ext3 (rw)
> /dev/loop1 on /tmp/tmpKTCs75 type iso9660 (rw)
> /dev/loop2 on /tmp/tmpLi76ER type iso9660 (rw)
> [root@localhost tmp]# ls -l /tmp/tmprjsmh3
> total 28
> drwx------ 2 root root 16384 Aug 20 03:54 lost+found
> drwxr-xr-x 2 root root 4096 Aug 20 03:54 syslinux
> drwxr-xr-x 2 root root 4096 Aug 20 03:54 x64
> drwxr-xr-x 2 root root 4096 Aug 20 03:54 x86
> [root@localhost tmp]#
I'll keep banging away at it. I'm digging through the pyparted source.
Richard
13 years, 2 months
List of previous issues with livecd-tools which should be addressed
by Jasper Hartline
In response to Jan Kratochvil's shell script I have attached a python
script which replicates
what she does in the bash shell script.
There is also a patch, which fixes up some regex/match in livecd-iso-to-disk
and another section which assumes our loop devices have extra numbered
partitions.
If you guys want to help beat mkbiarch.py Python script into shape maybe
we gan get it into the tools for livecd-tools.
The way you use it, is:
mkbiarch.py <x86 ISO image> <x64 ISO image> <Target Multi Arch Image name>
13 years, 3 months
SD/MMC partition support was: Development of biarch live CD script.
by Frederick Grose
On Sun, Aug 29, 2010 at 4:12 AM, Jasper Hartline
<jasper.hartline(a)gmail.com>wrote:
>
> {...}
>
About patches, do you have any in particular you're looking at?
> Most of any of them that were not submitted by Frederick Grose were
> updated by myself, to apply against git, but it is up to your
> discretion if you want to apply
> and test any of them. The only two I wish we could really apply soon
> soon, like when you do it
> is these two:
>
> 1)
> https://bugzilla.redhat.com/attachment.cgi?id=436736&action=diff&context=...
> 2) https://bugzilla.redhat.com/attachment.cgi?id=424664
>
> 1) Fix bug with vfat only disks, including adding support for Ext4
>
Comment added to https://bugzilla.redhat.com/show_bug.cgi?id=603277.
See https://bugzilla.redhat.com/show_bug.cgi?id=587411 livecd-iso-to-disk
--format fails with SD/MMC partitions.
The umount ${device}? will fail with an SD/MMC partition that uses a
device-partition# separator, such as the 'p' in /dev/mmcblk0p1
umount ${device}* would work, but would also unmount all partitions.
Having the partition number 1 hardcoded as USBDEV=${device}1 could also fail
with some SD/MMC drivers.
Attachment, https://bugzilla.redhat.com/attachment.cgi?id=413572&action=edit
, has
some replacement code:
- USBDEV=${device}1
+ partition=$( awk '$4 ~ /'${device#/dev/}'.*[0-9]$/ {print $4}'
/proc/partitions )
+ partnum=${partition##${device#/dev/}}
+ USBDEV=${device}${partnum}
--Fred
13 years, 3 months