Automatic root login on livecd
by msacks
Hello List,
I am creating a diagnostic livecd that will run a custom script as
soon as it boots.
I'd like to bypass the login screen altogether and automatically log
in as the root user.
I was considering creating a custom rpm with the following lines in
the following files like so:
/etc/gdm/custom.conf AutomaticLoginEnable=true
AutomaticLogin=root
and my /etc/pam.d/gdm
#auth required pam_succeed_if.so user != root quiet
Is there a better way to achieve this than customizing these config
files and over-writing them in an RPM?
Thanks in advance.
12 years, 11 months
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
Branch 'f13-branch' - 5 commits - imgcreate/yuminst.py Makefile tools/livecd-creator tools/livecd-iso-to-disk.sh
by Brian C. Lane
Makefile | 2 +-
imgcreate/yuminst.py | 4 ++++
tools/livecd-creator | 3 +++
tools/livecd-iso-to-disk.sh | 28 ++++++++++++++++++++--------
4 files changed, 28 insertions(+), 9 deletions(-)
New commits:
commit 22906d509ec12b7a66f52b5e1ececb4a0ac32043
Author: Brian C. Lane <bcl(a)redhat.com>
Date: Wed Dec 22 15:25:08 2010 -0800
Version 13.1
diff --git a/Makefile b/Makefile
index 935b025..d667622 100644
--- a/Makefile
+++ b/Makefile
@@ -1,5 +1,5 @@
-VERSION = 13.0
+VERSION = 13.1
INSTALL = /usr/bin/install -c
INSTALL_PROGRAM = ${INSTALL}
commit 7557c86f838264ec4cfc0105652825f91427e40d
Author: Frederick Grose <fgrose(a)localhost.localdomain>
Date: Wed Dec 22 13:59:06 2010 -0800
Trap copyFile errors (#663849)
'Set -o pipefail' is needed with the new starce-based copy function.
Also, keep || clauses inprocess, so that an exit command applies to
the main script and not just a subshell.
diff --git a/tools/livecd-iso-to-disk.sh b/tools/livecd-iso-to-disk.sh
index 23e2d4a..b730b52 100755
--- a/tools/livecd-iso-to-disk.sh
+++ b/tools/livecd-iso-to-disk.sh
@@ -664,13 +664,15 @@ fi
[ -n "$efi" -a ! -d $USBMNT/EFI/boot ] && mkdir -p $USBMNT/EFI/boot
# Live image copy
+set -o pipefail
if [ "$isotype" = "live" -a -z "$skipcopy" ]; then
echo "Copying live image to USB stick"
[ ! -d $USBMNT/$LIVEOS ] && mkdir $USBMNT/$LIVEOS
[ -n "$keephome" -a -f "$USBMNT/$HOMEFILE" ] && mv $USBMNT/$HOMEFILE $USBMNT/$LIVEOS/$HOMEFILE
if [ -n "$skipcompress" -a -f $CDMNT/LiveOS/squashfs.img ]; then
mount -o loop $CDMNT/LiveOS/squashfs.img $CDMNT || exitclean
- copyFile $CDMNT/LiveOS/ext3fs.img $USBMNT/$LIVEOS/ext3fs.img || (umount $CDMNT ; exitclean)
+ copyFile $CDMNT/LiveOS/ext3fs.img $USBMNT/$LIVEOS/ext3fs.img || {
+ umount $CDMNT ; exitclean ; }
umount $CDMNT
elif [ -f $CDMNT/LiveOS/squashfs.img ]; then
copyFile $CDMNT/LiveOS/squashfs.img $USBMNT/$LIVEOS/squashfs.img || exitclean
commit a3a300e4c832c4e5f584bf52d1a6e792797cd392
Author: Brian C. Lane <bcl(a)redhat.com>
Date: Tue Nov 30 15:14:53 2010 -0800
Create tmpdir if it doesn't exist (#658632)
If the directory passed to --tmpdir doesn't exist, create it and its
parent directories.
diff --git a/tools/livecd-creator b/tools/livecd-creator
index d352d74..64b645a 100755
--- a/tools/livecd-creator
+++ b/tools/livecd-creator
@@ -25,6 +25,7 @@ import optparse
import logging
import imgcreate
+from imgcreate.fs import makedirs
class Usage(Exception):
def __init__(self, msg = None, no_error = False):
@@ -116,6 +117,8 @@ def main():
creator = imgcreate.LiveImageCreator(ks, name, fs_label)
creator.tmpdir = os.path.abspath(options.tmpdir)
+ if not os.path.exists(creator.tmpdir):
+ makedirs(creator.tmpdir)
creator.compress_type = options.compress_type
creator.skip_compression = options.skip_compression
creator.skip_minimize = options.skip_minimize
commit 1a36e1603f5be37e9d506854decf6a5fabe86e72
Author: Frederick Grose <fgrose(a)gmail.com>
Date: Mon Nov 29 17:15:09 2010 -0800
Fix partition number selection for MMC bus devices (#587411)
Enable detection of partition number prefixes.
diff --git a/tools/livecd-iso-to-disk.sh b/tools/livecd-iso-to-disk.sh
index 4cfca27..23e2d4a 100755
--- a/tools/livecd-iso-to-disk.sh
+++ b/tools/livecd-iso-to-disk.sh
@@ -68,6 +68,13 @@ getdisk() {
partnum=${p##$device}
}
+getpartition() {
+ DEV=$1
+ pa=$( < /proc/partitions )
+ pa=${pa##*$DEV}
+ partnum=${pa%% *}
+}
+
resetMBR() {
if isdevloop "$DEV"; then
return
@@ -166,11 +173,12 @@ createGPTLayout() {
partinfo=$(LC_ALL=C /sbin/parted --script -m $device "unit b print" |grep ^$device:)
size=$(echo $partinfo |cut -d : -f 2 |sed -e 's/B$//')
/sbin/parted --script $device unit b mkpart '"EFI System Partition"' fat32 17408 $(($size - 17408)) set 1 boot on
- USBDEV=${device}1
# Sometimes automount can be _really_ annoying.
echo "Waiting for devices to settle..."
/sbin/udevadm settle
sleep 5
+ getpartition ${device#/dev/}
+ USBDEV=${device}${partnum}
umount $USBDEV &> /dev/null
/sbin/mkdosfs -n LIVE $USBDEV
USBLABEL="UUID=$(/sbin/blkid -s UUID -o value $USBDEV)"
@@ -188,15 +196,16 @@ createMSDOSLayout() {
partinfo=$(LC_ALL=C /sbin/parted --script -m $device "unit b print" |grep ^$device:)
size=$(echo $partinfo |cut -d : -f 2 |sed -e 's/B$//')
/sbin/parted --script $device unit b mkpart primary fat32 17408 $(($size - 17408)) set 1 boot on
- if ! isdevloop "$DEV"; then
- USBDEV=${device}1
- else
- USBDEV=${device}
- fi
# Sometimes automount can be _really_ annoying.
echo "Waiting for devices to settle..."
/sbin/udevadm settle
sleep 5
+ if ! isdevloop "$DEV"; then
+ getpartition ${device#/dev/}
+ USBDEV=${device}${partnum}
+ else
+ USBDEV=${device}
+ fi
umount $USBDEV &> /dev/null
/sbin/mkdosfs -n LIVE $USBDEV
USBLABEL="UUID=$(/sbin/blkid -s UUID -o value $USBDEV)"
@@ -214,11 +223,12 @@ createEXTFSLayout() {
partinfo=$(LC_ALL=C /sbin/parted --script -m $device "unit b print" |grep ^$device:)
size=$(echo $partinfo |cut -d : -f 2 |sed -e 's/B$//')
/sbin/parted --script $device unit b mkpart primary ext2 17408 $(($size - 17408)) set 1 boot on
- USBDEV=${device}1
# Sometimes automount can be _really_ annoying.
echo "Waiting for devices to settle..."
/sbin/udevadm settle
sleep 5
+ getpartition ${device#/dev/}
+ USBDEV=${device}${partnum}
umount $USBDEV &> /dev/null
/sbin/mkfs.ext4 -L LIVE $USBDEV
USBLABEL="UUID=$(/sbin/blkid -s UUID -o value $USBDEV)"
commit d33e398d6778f0260d256840d246a73810e6cfe4
Author: Lubomir Rintel <lkundrak(a)v3.sk>
Date: Sat Nov 20 13:01:24 2010 +0100
Tolerate empty transactions
It can be useful when rebuilding the image without adding or removing a
package.
diff --git a/imgcreate/yuminst.py b/imgcreate/yuminst.py
index 9e54982..5f3333b 100644
--- a/imgcreate/yuminst.py
+++ b/imgcreate/yuminst.py
@@ -171,6 +171,10 @@ class LiveCDYum(yum.YumBase):
(res, resmsg) = self.buildTransaction()
except yum.Errors.RepoError, e:
raise CreatorError("Unable to download from repo : %s" %(e,))
+ # Empty transactions are generally fine, we might be rebuilding an
+ # existing image with no packages added
+ if resmsg and resmsg[0].endswith(" - empty transaction"):
+ return res
if res != 2:
raise CreatorError("Failed to build transaction : %s" % str.join("\n", resmsg))
12 years, 11 months
Branch 'f14-branch' - 5 commits - imgcreate/yuminst.py Makefile tools/livecd-creator tools/livecd-iso-to-disk.sh
by Brian C. Lane
Makefile | 2 +-
imgcreate/yuminst.py | 4 ++++
tools/livecd-creator | 3 +++
tools/livecd-iso-to-disk.sh | 28 ++++++++++++++++++++--------
4 files changed, 28 insertions(+), 9 deletions(-)
New commits:
commit c41e07bf5960aded17d6db26a41737f755fbd0ca
Author: Brian C. Lane <bcl(a)redhat.com>
Date: Wed Dec 22 15:23:17 2010 -0800
Version 14.1
diff --git a/Makefile b/Makefile
index 917027f..87e8448 100644
--- a/Makefile
+++ b/Makefile
@@ -1,5 +1,5 @@
-VERSION = 14.0
+VERSION = 14.1
INSTALL = /usr/bin/install -c
INSTALL_PROGRAM = ${INSTALL}
commit 19d1af5da0cf38a4d2e942b6bd0ec611dca3040d
Author: Frederick Grose <fgrose(a)localhost.localdomain>
Date: Wed Dec 22 13:59:06 2010 -0800
Trap copyFile errors (#663849)
'Set -o pipefail' is needed with the new starce-based copy function.
Also, keep || clauses inprocess, so that an exit command applies to
the main script and not just a subshell.
diff --git a/tools/livecd-iso-to-disk.sh b/tools/livecd-iso-to-disk.sh
index 23e2d4a..b730b52 100755
--- a/tools/livecd-iso-to-disk.sh
+++ b/tools/livecd-iso-to-disk.sh
@@ -664,13 +664,15 @@ fi
[ -n "$efi" -a ! -d $USBMNT/EFI/boot ] && mkdir -p $USBMNT/EFI/boot
# Live image copy
+set -o pipefail
if [ "$isotype" = "live" -a -z "$skipcopy" ]; then
echo "Copying live image to USB stick"
[ ! -d $USBMNT/$LIVEOS ] && mkdir $USBMNT/$LIVEOS
[ -n "$keephome" -a -f "$USBMNT/$HOMEFILE" ] && mv $USBMNT/$HOMEFILE $USBMNT/$LIVEOS/$HOMEFILE
if [ -n "$skipcompress" -a -f $CDMNT/LiveOS/squashfs.img ]; then
mount -o loop $CDMNT/LiveOS/squashfs.img $CDMNT || exitclean
- copyFile $CDMNT/LiveOS/ext3fs.img $USBMNT/$LIVEOS/ext3fs.img || (umount $CDMNT ; exitclean)
+ copyFile $CDMNT/LiveOS/ext3fs.img $USBMNT/$LIVEOS/ext3fs.img || {
+ umount $CDMNT ; exitclean ; }
umount $CDMNT
elif [ -f $CDMNT/LiveOS/squashfs.img ]; then
copyFile $CDMNT/LiveOS/squashfs.img $USBMNT/$LIVEOS/squashfs.img || exitclean
commit 9a9cdc758163150b2afc6bb038e23e8fd6dba2e0
Author: Brian C. Lane <bcl(a)redhat.com>
Date: Tue Nov 30 15:14:53 2010 -0800
Create tmpdir if it doesn't exist (#658632)
If the directory passed to --tmpdir doesn't exist, create it and its
parent directories.
diff --git a/tools/livecd-creator b/tools/livecd-creator
index d352d74..64b645a 100755
--- a/tools/livecd-creator
+++ b/tools/livecd-creator
@@ -25,6 +25,7 @@ import optparse
import logging
import imgcreate
+from imgcreate.fs import makedirs
class Usage(Exception):
def __init__(self, msg = None, no_error = False):
@@ -116,6 +117,8 @@ def main():
creator = imgcreate.LiveImageCreator(ks, name, fs_label)
creator.tmpdir = os.path.abspath(options.tmpdir)
+ if not os.path.exists(creator.tmpdir):
+ makedirs(creator.tmpdir)
creator.compress_type = options.compress_type
creator.skip_compression = options.skip_compression
creator.skip_minimize = options.skip_minimize
commit 2cdb0e512959985a90e0c4acac58cb8ffcd4c4d8
Author: Frederick Grose <fgrose(a)gmail.com>
Date: Mon Nov 29 17:15:09 2010 -0800
Fix partition number selection for MMC bus devices (#587411)
Enable detection of partition number prefixes.
diff --git a/tools/livecd-iso-to-disk.sh b/tools/livecd-iso-to-disk.sh
index 4cfca27..23e2d4a 100755
--- a/tools/livecd-iso-to-disk.sh
+++ b/tools/livecd-iso-to-disk.sh
@@ -68,6 +68,13 @@ getdisk() {
partnum=${p##$device}
}
+getpartition() {
+ DEV=$1
+ pa=$( < /proc/partitions )
+ pa=${pa##*$DEV}
+ partnum=${pa%% *}
+}
+
resetMBR() {
if isdevloop "$DEV"; then
return
@@ -166,11 +173,12 @@ createGPTLayout() {
partinfo=$(LC_ALL=C /sbin/parted --script -m $device "unit b print" |grep ^$device:)
size=$(echo $partinfo |cut -d : -f 2 |sed -e 's/B$//')
/sbin/parted --script $device unit b mkpart '"EFI System Partition"' fat32 17408 $(($size - 17408)) set 1 boot on
- USBDEV=${device}1
# Sometimes automount can be _really_ annoying.
echo "Waiting for devices to settle..."
/sbin/udevadm settle
sleep 5
+ getpartition ${device#/dev/}
+ USBDEV=${device}${partnum}
umount $USBDEV &> /dev/null
/sbin/mkdosfs -n LIVE $USBDEV
USBLABEL="UUID=$(/sbin/blkid -s UUID -o value $USBDEV)"
@@ -188,15 +196,16 @@ createMSDOSLayout() {
partinfo=$(LC_ALL=C /sbin/parted --script -m $device "unit b print" |grep ^$device:)
size=$(echo $partinfo |cut -d : -f 2 |sed -e 's/B$//')
/sbin/parted --script $device unit b mkpart primary fat32 17408 $(($size - 17408)) set 1 boot on
- if ! isdevloop "$DEV"; then
- USBDEV=${device}1
- else
- USBDEV=${device}
- fi
# Sometimes automount can be _really_ annoying.
echo "Waiting for devices to settle..."
/sbin/udevadm settle
sleep 5
+ if ! isdevloop "$DEV"; then
+ getpartition ${device#/dev/}
+ USBDEV=${device}${partnum}
+ else
+ USBDEV=${device}
+ fi
umount $USBDEV &> /dev/null
/sbin/mkdosfs -n LIVE $USBDEV
USBLABEL="UUID=$(/sbin/blkid -s UUID -o value $USBDEV)"
@@ -214,11 +223,12 @@ createEXTFSLayout() {
partinfo=$(LC_ALL=C /sbin/parted --script -m $device "unit b print" |grep ^$device:)
size=$(echo $partinfo |cut -d : -f 2 |sed -e 's/B$//')
/sbin/parted --script $device unit b mkpart primary ext2 17408 $(($size - 17408)) set 1 boot on
- USBDEV=${device}1
# Sometimes automount can be _really_ annoying.
echo "Waiting for devices to settle..."
/sbin/udevadm settle
sleep 5
+ getpartition ${device#/dev/}
+ USBDEV=${device}${partnum}
umount $USBDEV &> /dev/null
/sbin/mkfs.ext4 -L LIVE $USBDEV
USBLABEL="UUID=$(/sbin/blkid -s UUID -o value $USBDEV)"
commit 8ee15a854952a7e15c8f7ebaeb3de44bcc5c072b
Author: Lubomir Rintel <lkundrak(a)v3.sk>
Date: Sat Nov 20 13:01:24 2010 +0100
Tolerate empty transactions
It can be useful when rebuilding the image without adding or removing a
package.
diff --git a/imgcreate/yuminst.py b/imgcreate/yuminst.py
index 9e54982..5f3333b 100644
--- a/imgcreate/yuminst.py
+++ b/imgcreate/yuminst.py
@@ -171,6 +171,10 @@ class LiveCDYum(yum.YumBase):
(res, resmsg) = self.buildTransaction()
except yum.Errors.RepoError, e:
raise CreatorError("Unable to download from repo : %s" %(e,))
+ # Empty transactions are generally fine, we might be rebuilding an
+ # existing image with no packages added
+ if resmsg and resmsg[0].endswith(" - empty transaction"):
+ return res
if res != 2:
raise CreatorError("Failed to build transaction : %s" % str.join("\n", resmsg))
12 years, 11 months
4 commits - HACKING imgcreate/fs.py Makefile tools/livecd-iso-to-disk.sh
by Brian C. Lane
HACKING | 4 ++--
Makefile | 2 +-
imgcreate/fs.py | 3 ++-
tools/livecd-iso-to-disk.sh | 4 +++-
4 files changed, 8 insertions(+), 5 deletions(-)
New commits:
commit 2d81ac6cdbe20e785f38a74e1f5991b2f4c0d063
Author: Brian C. Lane <bcl(a)redhat.com>
Date: Wed Dec 22 14:26:21 2010 -0800
Version 5.2
diff --git a/Makefile b/Makefile
index 2fd0549..5a8a9ea 100644
--- a/Makefile
+++ b/Makefile
@@ -1,5 +1,5 @@
-VERSION = 15.1
+VERSION = 15.2
INSTALL = /usr/bin/install -c
INSTALL_PROGRAM = ${INSTALL}
commit 817682c10ab42fcef0da96ebfce5b8a9bdba7eda
Author: David Lehman <dlehman(a)redhat.com>
Date: Fri Dec 17 10:21:02 2010 -0600
Assign a device-mapper UUID w/ subsystem prefix to the dm snapshot.
Creators of device-mapper maps/devices should set a device-mapper
UUID for their devices which include a prefix to identify the
subsystem responsible for the device. The format generally used is
$SUBSYSTEM-$MAPNAME, with subsystem being all caps.
diff --git a/imgcreate/fs.py b/imgcreate/fs.py
index f0e0885..a43c6e5 100644
--- a/imgcreate/fs.py
+++ b/imgcreate/fs.py
@@ -527,7 +527,8 @@ class DeviceMapperSnapshot(object):
self.imgloop.device,
self.cowloop.device)
- args = ["/sbin/dmsetup", "create", self.__name, "--table", table]
+ args = ["/sbin/dmsetup", "create", self.__name,
+ "--uuid", "LIVECD-%s" % self.__name, "--table", table]
if call(args) != 0:
self.cowloop.cleanup()
self.imgloop.cleanup()
commit 9342cc0249080ca19945cfd0f453ff7c9ead3d99
Author: David Lehman <dlehman(a)redhat.com>
Date: Fri Dec 17 10:21:01 2010 -0600
Fix git URLs to match reality.
diff --git a/HACKING b/HACKING
index 0e88c32..e912112 100644
--- a/HACKING
+++ b/HACKING
@@ -4,11 +4,11 @@ SOURCE CONTROL MANAGEMENT
This project is stored in git and can be checked out using
- git clone git://git.fedoraproject.org/git/hosted/livecd
+ git clone git://git.fedorahosted.org/git/livecd
or if you have write access you might want to use
- git clone ssh://git.fedoraproject.org/git/hosted/livecd
+ git clone ssh://git.fedorahosted.org/git/livecd
Change history etc. can be obtained from the web interface
commit 8049edc786a6ff347281ea9587c721bc2fb35e31
Author: Frederick Grose <fgrose(a)localhost.localdomain>
Date: Wed Dec 22 13:59:06 2010 -0800
Trap copyFile errors (#663849)
'Set -o pipefail' is needed with the new starce-based copy function.
Also, keep || clauses inprocess, so that an exit command applies to
the main script and not just a subshell.
diff --git a/tools/livecd-iso-to-disk.sh b/tools/livecd-iso-to-disk.sh
index 51abc0c..dfabed7 100755
--- a/tools/livecd-iso-to-disk.sh
+++ b/tools/livecd-iso-to-disk.sh
@@ -688,13 +688,15 @@ fi
[ -n "$efi" -a ! -d $USBMNT/EFI/boot ] && mkdir -p $USBMNT/EFI/boot
# Live image copy
+set -o pipefail
if [ "$isotype" = "live" -a -z "$skipcopy" ]; then
echo "Copying live image to USB stick"
[ ! -d $USBMNT/$LIVEOS ] && mkdir $USBMNT/$LIVEOS
[ -n "$keephome" -a -f "$USBMNT/$HOMEFILE" ] && mv $USBMNT/$HOMEFILE $USBMNT/$LIVEOS/$HOMEFILE
if [ -n "$skipcompress" -a -f $CDMNT/LiveOS/squashfs.img ]; then
mount -o loop $CDMNT/LiveOS/squashfs.img $CDMNT || exitclean
- copyFile $CDMNT/LiveOS/ext3fs.img $USBMNT/$LIVEOS/ext3fs.img || (umount $CDMNT ; exitclean)
+ copyFile $CDMNT/LiveOS/ext3fs.img $USBMNT/$LIVEOS/ext3fs.img || {
+ umount $CDMNT ; exitclean ; }
umount $CDMNT
elif [ -f $CDMNT/LiveOS/squashfs.img ]; then
copyFile $CDMNT/LiveOS/squashfs.img $USBMNT/$LIVEOS/squashfs.img || exitclean
12 years, 11 months
[Patch] Trap copyFile errors
by Frederick Grose
>From Bug 663849 <https://bugzilla.redhat.com/show_bug.cgi?id=663849> - copyFile
failures not trapped in livecd-iso-to-disk
Trap copyFile errors
Set -o pipefail is needed with the new strace-based copy function.
And keep || clauses inprocess, so that an exit command applies to the
main script and not just a subshell.
diff --git a/tools/livecd-iso-to-disk.sh b/tools/livecd-iso-to-disk.sh
index 51abc0c..464b5e4 100755
--- a/tools/livecd-iso-to-disk.sh
+++ b/tools/livecd-iso-to-disk.sh
@@ -21,6 +21,7 @@
export PATH=/sbin:/usr/sbin:$PATH
+set -o pipefail
usage() {
echo "$0 [--timeout <time>] [--totaltimeout <time>] [--format]
[--reset-mbr] [--noverify] [--overlay-size-mb <size>] [--home-size-mb
<size>] [--unencrypted-home] [--skipcopy] [--efi] <isopath> <usbstick
device>"
@@ -694,7 +695,8 @@ if [ "$isotype" = "live" -a -z "$skipcopy" ]; then
[ -n "$keephome" -a -f "$USBMNT/$HOMEFILE" ] && mv $USBMNT/$HOMEFILE
$USBMNT/$LIVEOS/$HOMEFILE
if [ -n "$skipcompress" -a -f $CDMNT/LiveOS/squashfs.img ]; then
mount -o loop $CDMNT/LiveOS/squashfs.img $CDMNT || exitclean
- copyFile $CDMNT/LiveOS/ext3fs.img $USBMNT/$LIVEOS/ext3fs.img ||
(umount $CDMNT ; exitclean)
+ copyFile $CDMNT/LiveOS/ext3fs.img $USBMNT/$LIVEOS/ext3fs.img || {
+ umount $CDMNT ; exitclean ; }
umount $CDMNT
elif [ -f $CDMNT/LiveOS/squashfs.img ]; then
copyFile $CDMNT/LiveOS/squashfs.img $USBMNT/$LIVEOS/squashfs.img ||
exitclean
12 years, 11 months
Two trivial patches
by David Lehman
HACKING | 4 ++--
imgcreate/fs.py | 3 ++-
2 files changed, 4 insertions(+), 3 deletions(-)
12 years, 11 months
Build Kernel with LZMA Support
by Muhammad Ammar
Hi,
I want to build a custom kernel with LZMA support. Is it possible now at
this stage. The kernel i want to rebuild is 2.6.35. If its possible what
steps should i follow?
Regards,
13 years
Virtual machine
by Lars Bjørndal
Hi
I have a Fedora 13 system running as a server. I need to run a virtual
machine on that server, with console access only for a special purpose.
What's the easiest way to create and run such a setup? And how can I
connect to it from the console? Is a livecd image suitable for this?
Regards,
Lars
13 years