From c8c5a57489b0f1c36b81428fecf4ffaacc906014 Mon Sep 17 00:00:00 2001 From: Chris Gianelloni Date: Fri, 6 Jun 2008 04:04:00 +0000 Subject: [PATCH] Don't run the kernel copying code unless we're booting from CD. svn path=/trunk/; revision=534 --- releases/2008.0/ChangeLog | 3 +++ releases/2008.0/scripts/livecd.sh | 19 +++++++++++-------- 2 files changed, 14 insertions(+), 8 deletions(-) diff --git a/releases/2008.0/ChangeLog b/releases/2008.0/ChangeLog index 345a9030..1ef790c6 100644 --- a/releases/2008.0/ChangeLog +++ b/releases/2008.0/ChangeLog @@ -2,6 +2,9 @@ # Copyright 1999-2008 Gentoo Foundation; Distributed under the GPL v2 # $Header: $ + 06 Jun 2008; Chris Gianelloni scripts/livecd.sh: + Don't run the kernel copying code unless we're booting from CD. + 06 Jun 2008; Chris Gianelloni scripts/livecd.sh: Re-create /etc/fstab in the fsscript and add code to local.start to copy the kernel/initramfs from the CD's root and rename it to what was built by diff --git a/releases/2008.0/scripts/livecd.sh b/releases/2008.0/scripts/livecd.sh index 88e7399f..bedd10ee 100644 --- a/releases/2008.0/scripts/livecd.sh +++ b/releases/2008.0/scripts/livecd.sh @@ -46,13 +46,16 @@ echo "tmpfs /boot tmpfs defaults 0 0" >> /etc/fstab cd /boot && ls -1 | grep -v boot > /usr/livecd/bootfiles.txt mv -f System.map* /usr/livecd cat << EOF >> /etc/conf.d/local.start -INITR_TMP=`ls -1 /mnt/cdrom/*/*.gz | head -n 1` -INITRAMFS=`basename ${INITR_TMP}` -KERNEL=${INITRAMFS/.gz/} -initramfs=`grep initr /usr/livecd/bootfiles.txt | head -n 1` -kernel=`grep kernel /usr/livecd/bootfiles.txt | head -n 1` -cp -f /mnt/cdrom/*/${INITRAMFS} /boot/${initramfs} -cp -f /mnt/cdrom/*/${KERNEL} /boot/${kernel} -mv -f /usr/livecd/System.map* /boot +if [ -n "$(ls /mnt/cdrom)" ] +then + INITR_TMP=`ls -1 /mnt/cdrom/*/*.gz | head -n 1` + INITRAMFS=`basename ${INITR_TMP}` + KERNEL=${INITRAMFS/.gz/} + initramfs=`grep initr /usr/livecd/bootfiles.txt | head -n 1` + kernel=`grep kernel /usr/livecd/bootfiles.txt | head -n 1` + cp -f /mnt/cdrom/*/${INITRAMFS} /boot/${initramfs} + cp -f /mnt/cdrom/*/${KERNEL} /boot/${kernel} + mv -f /usr/livecd/System.map* /boot +fi EOF