summaryrefslogtreecommitdiff
blob: e4bd2fc232aa60a245865e941eca3d6c130f23d3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
--- /livecd/livecd-ng	2003-06-05 10:16:47.000000000 -0500
+++ livecd-ng	2003-10-18 13:49:09.000000000 -0500
@@ -1,5 +1,5 @@
 #!/bin/bash  
-# Daniel Robbins, 28 Sep 2002 <drobbins@gentoo.org>
+# Daniel Robbins, 28 Sep 2002 <drobbins@gentoo.org> , Bob Johnson <livewire@gentoo.org>
 # Copyright 2002 Gentoo Technologies, Inc; http://www.gentoo.org
 # Released under the GNU General Public License version 2
 
@@ -16,7 +16,6 @@
  build		Build a bootable LiveCD tree (requires 'fetch')
  delete		Remove chroot directory (to allow 'build' to work)
  kernbuild	Perform only the kernel building steps (requires 'build')
- initrd		Generate the bootable LiveCD initrd (requires 'kernbuild')
  clean		Prepare chroot for CD by removing extraneous data
  cloop		Create compressed loopback filesystem
  isogen		Generate the final bootable LiveCD ISO image (requires 'prep')
@@ -74,9 +73,9 @@
 	exit 1
 fi
 
-if [ ! -e "${LIVECD_ROOT}/profiles/${1}/settings" ] || [ ! -e "${HOME}/.livecd-ng" ] 
+if [ ! -e "${LIVECD_ROOT}/profiles/${1}/settings" ]  
 then
-	echo "$0: Cannot find global or ~/.livecd-ng settings."
+	echo "$0: Cannot find global settings"
 	exit 1
 fi
 
@@ -133,8 +132,6 @@
 
 ## GRABBING PROFILE SETTINGS
 #####################################
-
-source ~/.livecd-ng || die "Couldn't find local settings in ~/.livecd-ng." 
 source ${LIVECD_ROOT}/profiles/${CD_PROFILE}/settings
 if [ "$KERNCONFIG" = "" ]
 then
@@ -149,11 +146,6 @@
 CD_STAGEFILE="${CD_STAGELOC}/${CD_STAGETARBALL##*/}"
 LOOP_ROOT=${CD_BUILDROOT}/looproot
 ISO_ROOT=${CD_BUILDROOT}/isoroot
-CLOOP_TARBALL=cloop_0.68-2.tar.gz
-#CLOOP_TARBALL=gcloop-0.66.3.tar.bz2
-CLOOP_DIR=cloop-0.68
-BUSYBOX_TARBALL=busybox-0.60.5.tar.bz2
-BUSYBOX_DIR=busybox-0.60.5
 LOOP_FILE=${CD_BUILDROOT}/livecd.loop
 CLOOP_FILE=${CD_BUILDROOT}/livecd.cloop
 
@@ -207,14 +199,11 @@
 #env-update is important for gcc-3.2.1-r6 and higher.
 env-update
 source /etc/profile
-#OWOWOWOWO!!
-#export CCACHE_DISABLE=true
 export DISTDIR=/home/distfiles
 export CONFIG_PROTECT='-*'
 #lilo appears to need to write to /etc do do awking
 export FEATURES="-sandbox ccache distcc"
 export PATH="/usr/bin/ccache:/usr/lib/distcc/bin:\${PATH}"
-#lilo will try to mount /boot if it's in /etc/fstab, so let's move it out of the way...
 export CFLAGS="$CD_CFLAGS"
 export CXXFLAGS="$CD_CFLAGS"
 export USE="$CD_USE"
@@ -259,14 +248,14 @@
 EOF
 	}
 
-stage1_build() {
+base_build() {
 	cp "${LIVECD_ROOT}/profiles/${CD_PROFILE}/aux-files/freeramdisk.c" $CD_BUILDTEMP || chroot_die
-	cp ${LIVECD_ROOT}/profiles/${CD_PROFILE}/stage1-* $CD_BUILDTEMP || chroot_die
+	cp ${LIVECD_ROOT}/profiles/${CD_PROFILE}/base-packages $CD_BUILDTEMP || chroot_die
 	if [ -d ${LIVECD_ROOT}/profiles/${CD_PROFILE}/launcher ]
 	then
 		cp -a ${LIVECD_ROOT}/profiles/${CD_PROFILE}/launcher $CD_BUILDTEMP || chroot_die
 	fi
-	cat > $CD_BUILDTEMP/stage1-build << EOF
+	cat > $CD_BUILDTEMP/base-build << EOF
 cd /tmp/livecd
 source /tmp/livecd/build-setup || exit 1
 mv /etc/fstab /etc/fstab.bak
@@ -277,30 +266,19 @@
 emerge --noreplace distcc
 distcc-config --set-hosts "${DISTCC_HOSTS}"
 distccd &
-echo 'MAKEOPTS="-j6"' >>/etc/make.conf
+echo 'MAKEOPTS="${MAKEOPTS}"' >>/etc/make.conf
 #build our packages...
-for x in \`cat /tmp/livecd/stage1-packages | grep -v ^#\`
-do
-	emerge --buildpkg --usepkg --noreplace --pretend \$x
-	#ewrapper --buildpkg --usepkg --noreplace \$x || exit 1 
-	emerge --buildpkg --usepkg --noreplace \$x || exit 1
-
-done
-if [ -e /tmp/livecd/stage1-experimental ]
-then
-	export ACCEPT_KEYWORDS="~${ARCH}"
-	for x in \`cat /tmp/livecd/stage1-experimental | grep -v ^#\`
-	do
-		emerge --buildpkg --usepkg --noreplace --pretend \$x
-		emerge --buildpkg --usepkg --noreplace \$x || exit 1
-
-	done
-fi
-#Handle 2.5 kernels....
-#if [ -e /usr/src/linux-beta ]
-#then
-#	ln -s linux-beta /usr/src/linux
-#fi
+for x in \`cat /tmp/livecd/base-packages | grep -v ^#\`
+ do
+                        if [ "\${x:0:1}" = "^" ]
+                        then
+                                ACCEPT_KEYWORDS="~${MAINARCH}" emerge -pv --noreplace --buildpkg --usepkg \${x:1} || exit 1
+                                ACCEPT_KEYWORDS="~${MAINARCH}" emerge --noreplace --buildpkg --usepkg \${x:1} || exit 1
+                        else
+                                emerge -pv --noreplace --buildpkg --usepkg \$x || exit 1
+                                emerge --noreplace --buildpkg --usepkg \$x || exit 1
+                        fi
+                done
 gcc ${CFLAGS} freeramdisk.c -o /sbin/freeramdisk || exit 1
 strip /sbin/freeramdisk
 if [ -d /tmp/livecd/launcher ]
@@ -314,54 +292,48 @@
 	cp gamelaunch /usr/sbin/ || exit 1
 fi
 EOF
-	chmod +x $CD_BUILDTEMP/stage1-build
-	chroot $CD_BUILDCHROOT /tmp/livecd/stage1-build
-	[ $? -ne 0 ] && chroot_die "stage 1 build failure"
+	chmod +x $CD_BUILDTEMP/base-build
+	chroot $CD_BUILDCHROOT /tmp/livecd/base-build
+	[ $? -ne 0 ] && chroot_die "base build failure"
 }
 
-stage2_build() {
-	cp ${LIVECD_ROOT}/profiles/${CD_PROFILE}/stage2-* $CD_BUILDTEMP || chroot_die
-	cat > $CD_BUILDTEMP/stage2-build << EOF
+kern_build() {
+	cp ${LIVECD_ROOT}/profiles/${CD_PROFILE}/kern-packages $CD_BUILDTEMP || chroot_die
+	cat > $CD_BUILDTEMP/kern-build << EOF
 cd /tmp/livecd
 source /tmp/livecd/build-setup || exit 1
 #build our packages...
-for x in \`cat /tmp/livecd/stage2-packages | grep -v ^#\`
-do
-	#don't build or use packages, since these guys are kernel-dependent and we want them to sync with the current
-	#kernel compile.
-	emerge --noreplace --pretend \$x
-	emerge --noreplace \$x || exit 1 
-done
-cd /usr/src/linux
-for x in \`cat /tmp/livecd/stage2-experimental | grep -v ^#\`
+for x in \`cat /tmp/livecd/kern-packages | grep -v ^#\`
 do
-       export ACCEPT_KEYWORDS="~${ARCH}"
-       emerge --noreplace --pretend \$x
-       emerge --noreplace \$x || exit 1
-done
+                        if [ "\${x:0:1}" = "^" ]
+                        then
+                                ACCEPT_KEYWORDS="~${MAINARCH}" emerge -pv --noreplace --buildpkg --usepkg \${x:1} || exit 1
+                                ACCEPT_KEYWORDS="~${MAINARCH}" emerge --noreplace --buildpkg --usepkg \${x:1} || exit 1
+                        else
+                                emerge -pv --noreplace --buildpkg --usepkg \$x || exit 1
+                                emerge --noreplace --buildpkg --usepkg \$x || exit 1
+                        fi
+                done
 
 EOF
-	chmod +x $CD_BUILDTEMP/stage2-build
-	chroot $CD_BUILDCHROOT /tmp/livecd/stage2-build
-	[ $? -ne 0 ] && chroot_die "stage 2 build failure"
+	chmod +x $CD_BUILDTEMP/kern-build
+	chroot $CD_BUILDCHROOT /tmp/livecd/kern-build
+	[ $? -ne 0 ] && chroot_die "kernel packages build failure"
 }
 
 kernel_build() {
-	cp "${LIVECD_ROOT}/profiles/${CD_PROFILE}/${KERNCONFIG}" "${CD_BUILDCHROOT}/usr/src/linux/.config" || chroot_die
+	cp "${LIVECD_ROOT}/profiles/${CD_PROFILE}/${KERNCONFIG}" "${CD_BUILDCHROOT}/etc/kernels/myconfig" || chroot_die
+	cp "${LIVECD_ROOT}/profiles/${CD_PROFILE}/settings" "${CD_BUILDCHROOT}/etc/kernels/settings" || chroot_die
+	cp -f /usr/sbin/genkernel "${CD_BUILDCHROOT}/usr/sbin" || chroot_die
 	cat > $CD_BUILDTEMP/kernel-build << EOF
-source /tmp/livecd/build-setup
-cd /usr/src/linux
-if [ ! -d /tmp/livecd/kernel/.complete ]
-then
+	source /tmp/livecd/build-setup
+	cd /usr/src/linux
+	if [ ! -d /tmp/livecd/kernel/.complete ]
+	then
 	install -d /tmp/livecd/kernel
-	make oldconfig || exit 1
-	make dep || exit 1
-	export PATH=/usr/lib/ccache/bin/:\${PATH}
-#	make menuconfig
-	make -j4 bzImage || exit 1
-	make -j4 modules || exit 1
-	make modules_install || true
-	cp arch/i386/boot/bzImage /tmp/livecd/kernel/
+	genkernel --livecd --myconfig || chroot_die
+	mv -f /kernel* /tmp/livecd/kernel/bzImage || chroot_die
+	mv -f /initrd* ${CD_BUILDROOT}/initrd.gz || chroot_die
 	touch /tmp/livecd/kernel/.complete
 fi
 EOF
@@ -370,161 +342,6 @@
 	[ $? -ne 0 ] && chroot_die "Chroot kernel/2nd package build failure"
 }
 
-initrd_build() {
-cp ${LIVECD_ROOT}/archives/${CLOOP_TARBALL} ${LIVECD_ROOT}/archives/${BUSYBOX_TARBALL} $CD_BUILDTEMP || chroot_die
-cat > $CD_BUILDTEMP/initrd-build << EOF
-source /tmp/livecd/build-setup
-cd /tmp/livecd
-rm -rf ${CLOOP_DIR}
-cwrapper tar xzf ${CLOOP_TARBALL}
-cd ${CLOOP_DIR}
-make KERNEL_DIR=/usr/src/linux
-cd ..
-rm -rf ${BUSYBOX_DIR}
-cwrapper tar xjf ${BUSYBOX_TARBALL}
-cd ${BUSYBOX_DIR}
-cp Config.h Config.h.orig
-sed -e "s://#define BB_INSMOD:#define BB_INSMOD:" \
--e "s://#define BB_EXPR:#define BB_EXPR:" \
--e "s://#define BB_PIVOT_ROOT:#define BB_PIVOT_ROOT:" \
--e "s://#define BB_LOADKMAP:#define BB_LOADKMAP:" \
--e "s://#define BB_LOSETUP:#define BB_LOSETUP:" \
--e "s://#define BB_RMMOD:#define BB_RMMOD:" Config.h.orig > Config.h
-cwrapper make clean
-cwrapper make DOSTATIC=true
-EOF
-	chmod +x $CD_BUILDTEMP/initrd-build
-	chroot $CD_BUILDCHROOT /tmp/livecd/initrd-build
-	[ $? -ne 0 ] && chroot_die "Chroot kernel/2nd package build failure"
-}
-
-initrd_create() {
-	install -d ${CD_BUILDCHROOT}-initrd
-	rm -f ${CD_BUILDROOT}/initrd*
-	dd if=/dev/zero of=${CD_BUILDROOT}/initrd bs=1k count=5000
-	mke2fs -F -q -N5000 ${CD_BUILDROOT}/initrd
-	mount -t ext2 -o loop ${CD_BUILDROOT}/initrd ${CD_BUILDCHROOT}-initrd
-	#makeinitrd
-	if [ ! -e ${CD_BUILDCHROOT}-initrd/bin ]
-	then
-		install -d ${CD_BUILDCHROOT}-initrd/{bin,etc,usr,proc,tmp}	
-		ln -s bin ${CD_BUILDCHROOT}-initrd/sbin
-		ln -s ../bin ${CD_BUILDCHROOT}-initrd/usr/bin
-		ln -s ../bin ${CD_BUILDCHROOT}-initrd/usr/sbin
-		install -d ${CD_BUILDCHROOT}-initrd/keymaps
-		#keymap stuff is from the excellent tomsrtbt boot disk.
-		cp ${LIVECD_ROOT}/profiles/${CD_PROFILE}/keymaps/key.lst ${CD_BUILDCHROOT}-initrd/keymaps
-		tar xzf ${LIVECD_ROOT}/profiles/${CD_PROFILE}/keymaps/bin-keymaps.tar.gz -C ${CD_BUILDCHROOT}-initrd/keymaps
-		(mkdir ${CD_BUILDCHROOT}-initrd/dev;cd ${CD_BUILDCHROOT}-initrd/dev;MAKEDEV generic-i386;MAKEDEV scd)
-		cat >${CD_BUILDCHROOT}-initrd/etc/fstab <<EOF
-/dev/ram0       /             cramfs defaults
-proc            /proc         proc   defaults  0 0
-EOF
-	fi
-	install -m755 ${LIVECD_ROOT}/profiles/${CD_PROFILE}/linuxrc ${CD_BUILDCHROOT}-initrd
-	cp ${CD_BUILDTEMP}/${BUSYBOX_DIR}/busybox ${CD_BUILDCHROOT}-initrd/bin || chroot_die
-
-	# Generate busybox links. We really do not need all of them but its good to
-	# have a fall back in case we need them someday.
-	for i in '[' awk ash basename cat chroot clear cp dirname echo env false find \
-	grep gunzip gzip insmod ln ls loadkmap losetup lsmod mkdir mknod modprobe more mount mv \
-	pivot_root ps pwd rm rmdir rmmod sh sleep tar test touch true umount uname \
-	xargs yes zcat chmod chown expr; do 
-		rm -f ${CD_BUILDCHROOT}-initrd/bin/$i
-		ln ${CD_BUILDCHROOT}-initrd/bin/busybox ${CD_BUILDCHROOT}-initrd/bin/$i || chroot_die 
-	done 
-	install -d ${CD_BUILDCHROOT}-initrd/modules/storage
-	install -d ${CD_BUILDCHROOT}-initrd/modules/firewire
-	install -d ${CD_BUILDCHROOT}-initrd/modules/ataraid
-	install -d ${CD_BUILDCHROOT}-initrd/modules/pcmcia
-	install -d ${CD_BUILDCHROOT}-initrd/modules/usb
-	
-	  cp ${CD_BUILDTEMP}/${CLOOP_DIR}/cloop.o ${CD_BUILDCHROOT}-initrd/modules/cloop.o ||chroot_die "can't find cloop module"
-	local mymod
-	for i in $STORAGE_MODULES
-	do
-		mymod=`find ${CD_BUILDCHROOT}/lib/modules -name "${i}.o"`
-		if [ -z "${mymod}" ]
-		then
-			echo "Error: ${i}.o not found; skipping..."
-			continue
-		fi
-		cp $mymod ${CD_BUILDCHROOT}-initrd/modules/storage
-	done
-	local mymod1
-	for i in $FIREWIRE_MODULES
-        do
-                mymod1=`find ${CD_BUILDCHROOT}/lib/modules -name "${i}.o"`
-                if [ -z "${mymod}" ]
-                then
-                        echo "Error: ${i}.o not found; skipping..."
-                        continue
-                fi
-                cp $mymod1 ${CD_BUILDCHROOT}-initrd/modules/firewire
-        done
-	local mymod2
-	for i in $ATARAID_MODULES
-        do
-                mymod2=`find ${CD_BUILDCHROOT}/lib/modules -name "${i}.o"`
-                if [ -z "${mymod}" ]
-                then
-                        echo "Error: ${i}.o not found; skipping..."
-                        continue
-                fi
-                cp $mymod2 ${CD_BUILDCHROOT}-initrd/modules/ataraid
-        done
-	local mymod3
-	for i in $PCMCIA_MODULES
-        do
-                mymod3=`find ${CD_BUILDCHROOT}/lib/modules -name "${i}.o"`
-                if [ -z "${mymod}" ]
-                then
-                        echo "Error: ${i}.o not found; skipping..."
-                        continue
-                fi
-                cp $mymod3 ${CD_BUILDCHROOT}-initrd/modules/pcmcia
-        done
-
-	local mymod4
-        for i in $USB_MODULES
-        do
-                mymod4=`find ${CD_BUILDCHROOT}/lib/modules -name "${i}.o"`
-                if [ -z "${mymod}" ]
-                then
-                        echo "Error: ${i}.o not found; skipping..."
-                        continue
-                fi
-                cp $mymod4 ${CD_BUILDCHROOT}-initrd/modules/usb
-        done
-
-	#tweak our storage module settings based on our initrd
-	cat ${LIVECD_ROOT}/profiles/${CD_PROFILE}/linuxrc | sed "s/##STORAGE_MODULES##/${STORAGE_MODULES}/" >${CD_BUILDCHROOT}-initrd/linuxrc || chroot_die
-	cat ${CD_BUILDCHROOT}-initrd/linuxrc | sed "s/##FIREWIRE_MODULES##/${FIREWIRE_MODULES}/" >${CD_BUILDCHROOT}-initrd/linuxrc || chroot_die
-	cat ${CD_BUILDCHROOT}-initrd/linuxrc | sed "s/##ATARAID_MODULES##/${ATARAID_MODULES}/" >${CD_BUILDCHROOT}-initrd/linuxrc || chroot_die
-	cat ${CD_BUILDCHROOT}-initrd/linuxrc | sed "s/##PCMCIA_MODULES##/${PCMCIA_MODULES}/" >${CD_BUILDCHROOT}-initrd/linuxrc || chroot_die
-	cat ${CD_BUILDCHROOT}-initrd/linuxrc | sed "s/##USB_MODULES##/${USB_MODULES}/" >${CD_BUILDCHROOT}-initrd/linuxrc || chroot_die
-
-	chmod +x ${CD_BUILDCHROOT}-initrd/linuxrc
-	umount ${CD_BUILDCHROOT}-initrd
-	if [ -f ${LIVECD_ROOT}/profiles/${CD_PROFILE}/aux-files/1280.initrd ]
-	then
-       	cp ${CD_BUILDROOT}/initrd ${CD_BUILDROOT}/initrd.1280
-	cat ${LIVECD_ROOT}/profiles/${CD_PROFILE}/aux-files/1280.initrd >> ${CD_BUILDROOT}/initrd.1280
-	fi
-	if [ -f ${LIVECD_ROOT}/profiles/${CD_PROFILE}/aux-files/1024.initrd ]
-	then
-	cp ${CD_BUILDROOT}/initrd ${CD_BUILDROOT}/initrd.1024
-	cat ${LIVECD_ROOT}/profiles/${CD_PROFILE}/aux-files/1024.initrd >> ${CD_BUILDROOT}/initrd.1024
-	fi
-	if [ -f ${LIVECD_ROOT}/profiles/${CD_PROFILE}/aux-files/800.initrd ]
-	then
-	cp ${CD_BUILDROOT}/initrd ${CD_BUILDROOT}/initrd.800
-	cat ${LIVECD_ROOT}/profiles/${CD_PROFILE}/aux-files/800.initrd >> ${CD_BUILDROOT}/initrd.800
-	fi
-	gzip -f -9 ${CD_BUILDROOT}/initrd
-}
-
-
 cloop_create() {
 	umount_all
 	rm -f ${CD_BUILDROOT}/livecd.*
@@ -536,9 +353,8 @@
 	umount ${LOOP_ROOT} || chroot_die
 	if [ "$LOOP_MODE" = "cloop" ]
 	then
-#	${CD_BUILDTEMP}/${CLOOP_DIR}/compress_loop_ucl -b 131072 -vv ${LOOP_FILE} ${CLOOP_FILE}|| chroot_die
- cat ${LOOP_FILE} | ${CD_BUILDTEMP}/${CLOOP_DIR}/create_compressed_fs - 65536 > ${CLOOP_FILE} || chroot_die
-
+ 	cat ${LOOP_FILE} | /tmp/create_compressed_fs - 65536 > ${CLOOP_FILE} || chroot_die
+ 	rm -f /tmp/create_compressed_fs || chroot_die
 	fi
 }
 
@@ -549,23 +365,18 @@
 	cp ${LIVECD_ROOT}/profiles/${CD_PROFILE}/isolinux.cfg ${ISO_ROOT}/isolinux || die
 	cp ${LIVECD_ROOT}/profiles/${CD_PROFILE}/{*.lss,*.msg} ${ISO_ROOT}/isolinux || die
 	cp ${CD_BUILDROOT}/initrd.gz ${ISO_ROOT}/isolinux/initrd || die
-	if [ -f "${CD_BUILDROOT}/initrd.1280" ]
-	then
-	cp ${CD_BUILDROOT}/initrd.1280 ${ISO_ROOT}/isolinux || die
-	fi
-	if [ -f "${CD_BUILDROOT}/initrd.1024" ]
+	if [ "${BOOTSPLASH}" = "yes" ]
 	then
-	cp ${CD_BUILDROOT}/initrd.1024 ${ISO_ROOT}/isolinux || die
-	fi
-	if [ -f "${CD_BUILDROOT}/initrd.800" ]
-	then
-	cp ${CD_BUILDROOT}/initrd.800 ${ISO_ROOT}/isolinux || die
+	cat ${LIVECD_ROOT}/profiles/${CD_PROFILE}/1024.initrd >> ${ISO_ROOT}/isolinux/initrd || die
 	fi
 	cp ${LIVECD_ROOT}/profiles/${CD_PROFILE}/{*.lss,*.msg} ${ISO_ROOT}/isolinux || die
         cp ${CD_BUILDROOT}/initrd.gz ${ISO_ROOT}/isolinux/initrd || die 
 	cp ${CD_BUILDTEMP}/kernel/bzImage ${ISO_ROOT}/isolinux/gentoo || die
 	#Can't get isolinux to boot memtest, whether memtest.bin or the kernel image version
+	if [ -f ${LIVECD_ROOT}/profiles/${CD_PROFILE}/aux-files/memtest ]
+	then
 	cp ${LIVECD_ROOT}/profiles/${CD_PROFILE}/aux-files/memtest ${ISO_ROOT}/isolinux || die
+	fi
 	#First, clean up any old loops so we don't get extras on the Cd
         rm -f ${ISO_ROOT}/${CLOOP_FILE} ${ISO_ROOT}/${LOOP_FILE}
 
@@ -577,7 +388,7 @@
 	else
 		cp ${LOOP_FILE} ${ISO_ROOT} || die
 	fi
-	mkisofs -J -R -l -o ${CD_BUILDROOT}/livecd.iso -b isolinux/isolinux.bin -c isolinux/boot.cat \
+	mkisofs -J -R -l -o ${CD_BUILDROOT}/${CD_ISONAME} -b isolinux/isolinux.bin -c isolinux/boot.cat \
 	-no-emul-boot -boot-load-size 4 -boot-info-table ${ISO_ROOT}
 }
 
@@ -609,9 +420,9 @@
 	#let's do this....
 	mount_all
 	build_setup
-	stage1_build
+	base_build
 	kernel_build
-	stage2_build
+	kern_build
 	umount_all
 }
 
@@ -624,12 +435,12 @@
 
 chroot_clean() {
 umount_all
-        #first do local pre-clean script
-        if [ -e "${LIVECD_ROOT}/profiles/${CD_PROFILE}/pre-clean" ]
+        #first do local modifications script
+        if [ -e "${LIVECD_ROOT}/profiles/${CD_PROFILE}/mods" ]
         then
-                source ${LIVECD_ROOT}/profiles/${CD_PROFILE}/pre-clean
+                source ${LIVECD_ROOT}/profiles/${CD_PROFILE}/mods
         else
-                echo "No ${CD_PROFILE} pre-clean script found; skipping."
+                echo "No ${CD_PROFILE} mods script found; skipping."
         fi
         #next do global clean script
         if [ -e "${LIVECD_ROOT}/profiles/${CD_PROFILE}/clean" ]
@@ -656,25 +467,6 @@
     	chroot_generate;;
 	cloop)
 		cloop_create;;
-    initrd) 
-		mount_all 
-		initrd_build 
-		umount_all 
-		initrd_create 
-
-		;;
-    initrd-delete)
-    	umount_all
-		rm -rf ${CD_BUILDTEMP}/${CLOOP_DIR} || die
-		rm -rf ${CD_BUILDTEMP}/${BUSYBOX_DIR} || die
-		rm -rf ${CD_BUILDCHROOT}-initrd 
-		rm -rf ${CD_BUILDTEMP}/kernel
-		rm -rf ${CD_BUILDROOT}/isoroot
-		;;
-    shebang)
-		initrd_generate
-		mount_all
-		;;
     prep)   
     	chroot_prep
 		;;
@@ -704,6 +496,14 @@
 		usage 
 		exit 1
 		;;
+    all)
+	delete
+	build
+	clean
+	cloop
+	isogen
+	;;	
+	
 esac
 exit 0