r1926 - in trunk: . etc packages/initramfs

alexander at linuxfromscratch.org alexander at linuxfromscratch.org
Sat Jun 23 22:25:17 PDT 2007


Author: alexander
Date: 2007-06-23 23:25:17 -0600 (Sat, 23 Jun 2007)
New Revision: 1926

Added:
   trunk/etc/issue.fullcd
   trunk/etc/issue.nosrc
   trunk/etc/issue.toram
Removed:
   trunk/etc/issue
Modified:
   trunk/Makefile
   trunk/packages/initramfs/init.in
Log:
Switch the greeting based on availability of LFS sources on the CD

Modified: trunk/Makefile
===================================================================
--- trunk/Makefile	2007-06-17 14:04:08 UTC (rev 1925)
+++ trunk/Makefile	2007-06-24 05:25:17 UTC (rev 1926)
@@ -114,7 +114,7 @@
 $(MKTREE): root.ext2
 	mkdir -p $(MP) $(MPBASE)$(SRC) $(MPBASE)$(WD)/bin $(MPBASE)/iso/boot
 	mount -o loop root.ext2 $(MP)
-	-rm -f $(MP)/boot $(MP)$(LFSSRC)
+	-rm -f $(MP)/boot
 	mkdir -p $(MKTREE) $(MP)$(SRC) $(MP)$(WD)
 	mkdir -p $(MP)/boot $(MP)$(LFSSRC) $(MPBASE)/iso$(LFSSRC)
 	mount --bind $(MPBASE)$(ROOT) $(MP)$(ROOT)
@@ -186,7 +186,7 @@
 	@cp $(ROOT)/scripts/unpack $(MP)/bin
 	@chroot "$(MP)" $(chenv-blfs) 'set +h && cd $(ROOT) && \
 	 make blfs $(chbash-post-bash)'
-	@install -m644 etc/issue $(MP)/etc/issue
+	@install -m644 etc/issue* $(MP)/etc
 
 lfsuser:
 	@-groupadd lfs
@@ -362,7 +362,7 @@
 	cd /usr/share/fonts ; mkfontscale ; mkfontdir ; fc-cache -f
 	mandb -c 2>/dev/null
 	echo 'dummy / ext2 defaults 0 0' >/etc/mtab
-	updatedb --prunepaths='/sources /tools /lfs-livecd /proc /sys /dev /tmp /var/tmp'
+	updatedb --prunepaths='/sources /tools /lfs-livecd /lfs-sources /proc /sys /dev /tmp /var/tmp'
 	echo >/etc/mtab
 
 chroot-gvim:
@@ -379,7 +379,7 @@
 	@>$(MP)/var/log/lastlog
 	@install -m644 isolinux/{isolinux.cfg,*.msg,splash.lss} $(MP)/boot/isolinux
 	@sed -i "s/Version:/Version: $(VERSION)/" $(MP)/boot/isolinux/boot.msg
-	@sed -i "s/Version:/Version: $(VERSION)/" $(MP)/etc/issue
+	@sed -i "s/Version:/Version: $(VERSION)/" $(MP)/etc/issue*
 	@install -m644 doc/README doc/lfscd-remastering-howto.txt $(MP)/root
 	@sed -i "s/\[version\]/$(VERSION)/" $(MP)/root/README
 	@install -m600 root/.bashrc $(MP)/root/.bashrc
@@ -441,7 +441,7 @@
 	-umount $(MP)$(ROOT)
 	-rmdir $(MP)$(SRC) $(MP)$(WD) $(MP)$(ROOT)
 	-rmdir $(MP)/boot $(MP)$(LFSSRC)
-	-ln -s /dev/shm/.cdrom/boot /dev/shm/.cdrom$(LFSSRC) $(MP)
+	-ln -s /dev/shm/.cdrom/boot $(MP)
 	-umount $(MP)
 
 zeroes: $(MKTREE)

Deleted: trunk/etc/issue
===================================================================
--- trunk/etc/issue	2007-06-17 14:04:08 UTC (rev 1925)
+++ trunk/etc/issue	2007-06-24 05:25:17 UTC (rev 1926)
@@ -1,19 +0,0 @@
-
-This is the Official Linux From Scratch LiveCD
-
-Created by: Jeremy Huntwork
-Maintained by: Alexander Patrakov
-
-Version:
-____________________________________________________________
-
-Please read the /root/README file before using this CD.
-
-All source packages needed to build an LFS system are located in /lfs-sources.
-You can find the LFS book in /usr/share/LFS-BOOK-SVN-HTML.
-
-Support questions concerning this CD should be directed to
-livecd at linuxfromscratch.org
-
-Type greeting at any time to view this message again.
-

Copied: trunk/etc/issue.fullcd (from rev 1922, trunk/etc/issue)
===================================================================
--- trunk/etc/issue.fullcd	                        (rev 0)
+++ trunk/etc/issue.fullcd	2007-06-24 05:25:17 UTC (rev 1926)
@@ -0,0 +1,19 @@
+
+This is the Official Linux From Scratch LiveCD
+
+Created by: Jeremy Huntwork
+Maintained by: Alexander Patrakov
+
+Version:
+____________________________________________________________
+
+Please read the /root/README file before using this CD.
+
+All source packages needed to build an LFS system are located in /lfs-sources.
+You can find the LFS book in /usr/share/LFS-BOOK-SVN-HTML.
+
+Support questions concerning this CD should be directed to
+livecd at linuxfromscratch.org
+
+Type greeting at any time to view this message again.
+

Added: trunk/etc/issue.nosrc
===================================================================
--- trunk/etc/issue.nosrc	                        (rev 0)
+++ trunk/etc/issue.nosrc	2007-06-24 05:25:17 UTC (rev 1926)
@@ -0,0 +1,19 @@
+
+This is the Official Linux From Scratch LiveCD
+
+Created by: Jeremy Huntwork
+Maintained by: Alexander Patrakov
+
+Version:
+____________________________________________________________
+
+Please read the /root/README file before using this CD.
+
+This CD does not include LFS sources.
+You can find the LFS book in /usr/share/LFS-BOOK-SVN-HTML.
+
+Support questions concerning this CD should be directed to
+livecd at linuxfromscratch.org
+
+Type greeting at any time to view this message again.
+

Added: trunk/etc/issue.toram
===================================================================
--- trunk/etc/issue.toram	                        (rev 0)
+++ trunk/etc/issue.toram	2007-06-24 05:25:17 UTC (rev 1926)
@@ -0,0 +1,22 @@
+
+This is the Official Linux From Scratch LiveCD
+
+Created by: Jeremy Huntwork
+Maintained by: Alexander Patrakov
+
+Version:
+____________________________________________________________
+
+Please read the /root/README file before using this CD.
+
+All source packages needed to build an LFS system are located on the CD,
+but were not loaded into RAM. After mounting the CD, you can find them in
+the lfs-sources subdirectory of the mount point.
+
+You can find the LFS book in /usr/share/LFS-BOOK-SVN-HTML.
+
+Support questions concerning this CD should be directed to
+livecd at linuxfromscratch.org
+
+Type greeting at any time to view this message again.
+

Modified: trunk/packages/initramfs/init.in
===================================================================
--- trunk/packages/initramfs/init.in	2007-06-17 14:04:08 UTC (rev 1925)
+++ trunk/packages/initramfs/init.in	2007-06-24 05:25:17 UTC (rev 1926)
@@ -14,6 +14,7 @@
 resume=
 all_generic_ide=0
 toram=0
+cdtype=
 
 find_cd() {
 	for SYS in /sys/block/hd* /sys/block/sr* ; do
@@ -41,6 +42,7 @@
 }
 
 copy_cd_to_ram() {
+	echo "Copying LFS LiveCD to RAM. This will take several minutes..."
 	mount -n -t iso9660 -o ro,norock /dev/lfs-cd /.tmpfs/.cdrom
 	cat /fakecd.iso.head >/.tmpfs/.fakecd.iso
 	dd if=/.tmpfs/.cdrom/root.ext2 bs=2048 conv=sync >>/.tmpfs/.fakecd.iso
@@ -80,6 +82,21 @@
 	ln -sf /dev/loop2 /dev/lfs-cd
 }
 
+detect_cd_type() {
+	mount -n -t iso9660 -o ro /dev/lfs-cd /.tmpfs/.cdrom
+	if [ -d /.tmpfs/.cdrom/lfs-sources ] ; then
+		if [ "$toram" = 1 ] ; then
+			cdtype=toram
+		else
+			cdtype=fullcd
+		fi
+	else
+		cdtype=nosrc
+	fi
+	umount -n /.tmpfs/.cdrom
+}
+
+
 do_mount_cd() {
 	i=1
 	while [ ! -L /dev/lfs-cd ] ; do
@@ -119,6 +136,7 @@
 	mkdir /.tmpfs
 	mount -n -t tmpfs -o size=90% tmpfs /.tmpfs
 	mkdir /.tmpfs/.cdrom
+	detect_cd_type
 	if [ "$toram" = 1 ] ; then copy_cd_to_ram ; fi
 	mount -n -t iso9660 -o ro /dev/lfs-cd /.tmpfs/.cdrom
 	/sbin/losetup /dev/loop0 /.tmpfs/.cdrom/root.ext2
@@ -132,6 +150,10 @@
 	mount -n --move /.tmpfs /.root/dev/shm
 	if [ "$toram" != 1 ] ; then cp -a /dev/lfs-cd /.root/dev/lfs-cd ; fi
 	cat /etc/modprobe.conf >>/.root/etc/modprobe.conf
+	ln -sf issue.$cdtype /.root/etc/issue
+	if [ "$cdtype" = "fullcd" ] ; then
+		ln -sf /dev/shm/.cdrom/lfs-sources /.root/lfs-sources
+	fi
 }
 
 do_mount_root() {




More information about the livecd mailing list