r1882 - trunk/packages/initramfs

alexander at linuxfromscratch.org alexander at linuxfromscratch.org
Tue May 8 06:26:58 PDT 2007


Author: alexander
Date: 2007-05-08 07:26:58 -0600 (Tue, 08 May 2007)
New Revision: 1882

Modified:
   trunk/packages/initramfs/Makefile
   trunk/packages/initramfs/init.in
Log:
Added support for "resume=/dev/disk/by-label/swap" on the kernel command line


Modified: trunk/packages/initramfs/Makefile
===================================================================
--- trunk/packages/initramfs/Makefile	2007-05-08 13:25:34 UTC (rev 1881)
+++ trunk/packages/initramfs/Makefile	2007-05-08 13:26:58 UTC (rev 1882)
@@ -1,6 +1,6 @@
 # Makefile for initramfs included on the LFS livecd
 
-NM= initramfs-new
+NM= initramfs
 VRS= 1
 
 WDIR= temp
@@ -21,20 +21,24 @@
 compile-stage2:
 	mkdir -p $(WDIR)/{bin,dev,etc/udev/rules.d,lib,sbin,sys,proc}
 	cp /etc/udev/udev.conf $(WDIR)/etc/udev/udev.conf
-	cp /etc/udev/rules.d/{05-*,26-*,60-*} $(WDIR)/etc/udev/rules.d
+	cp /etc/udev/rules.d/{05-*,2*,60-*} $(WDIR)/etc/udev/rules.d
+	sed -i 's/, *GROUP="[^"]*"//' $(WDIR)/etc/udev/rules.d/*
 	sed s/@VERSION@/$(VERSION)/ init.in >$(WDIR)/init
 	chmod 755 $(WDIR)/init
 	mknod -m 640 $(WDIR)/dev/console c 5 1
 	mknod -m 664 $(WDIR)/dev/null c 1 3
-	cp /bin/{sh,dd,cat,cp,mkdir,mount,umount,sleep,ln,rm,uname} $(WDIR)/bin
+	cp /bin/{sh,dd,cat,cp,mkdir,mount,umount,sed,sleep,ln,rm,uname} $(WDIR)/bin
 	cp /lib/{libblkid.so.1,libc.so.6,libdl.so.2,ld-linux.so.2} $(WDIR)/lib
 	cp /lib/{libncursesw.so.5,libreadline.so.5,libhistory.so.5} $(WDIR)/lib
 	cp /lib/{libpthread.so.0,librt.so.1,libuuid.so.1} $(WDIR)/lib
+	cp /lib/{libvolume_id.so.0,libsysfs.so.2} $(WDIR)/lib
 	cp /usr/lib/libdevmapper.so.1.02 $(WDIR)/lib
 	cp -a /lib/udev $(WDIR)/lib
 	cp /sbin/{losetup,blockdev,udevd,udevtrigger,udevsettle,modprobe} $(WDIR)/sbin
+	cp /sbin/pcmcia-{check-broken-cis,socket-startup} $(WDIR)/sbin
+	cp /usr/bin/stat $(WDIR)/bin
 	cp /usr/sbin/dmsetup $(WDIR)/sbin
-	find /lib/modules/*/kernel/drivers/{ata,base,block,cdrom,ide,message,scsi,usb/{core,host,storage}} \
+	find /lib/modules/*/kernel/drivers/{ata,base,block,cdrom,ide,message,scsi,pcmcia,usb/{core,host,storage}} \
 	    /lib/modules/*/kernel/fs/{mbcache.ko,ext2,ext3,ext4,reiserfs,xfs,fat,vfat,ntfs,isofs,udf,nls} \
 	    /lib/modules/*/kernel/lib -type f | cpio --make-directories -p $(WDIR)
 	for a in /lib/modules/* ; do ver=$${a##*/} ; depmod -b $(WDIR) $$ver ; done

Modified: trunk/packages/initramfs/init.in
===================================================================
--- trunk/packages/initramfs/init.in	2007-05-08 13:25:34 UTC (rev 1881)
+++ trunk/packages/initramfs/init.in	2007-05-08 13:26:58 UTC (rev 1882)
@@ -7,6 +7,7 @@
 
 init=/sbin/init
 root=
+rootdelay=
 rootfstype=ext3,ext2,auto
 ro="ro"
 noresume=0
@@ -29,13 +30,10 @@
 		echo "$resume" >/sys/power/resume
 		;;
 	/dev/*)
-		dev=${resume#/dev/}
-		if [ -f /sys/block/${dev%?}/${dev}/dev ] ; then
-			cat /sys/block/${dev%?}/${dev}/dev >/sys/power/resume
-		elif [ -f /sys/block/${dev}/dev ] ; then
-			cat /sys/block/${dev}/dev >/sys/power/resume
+		if [ -b ${resume} ] ; then
+			eval echo $( stat -L -c '$(( 0x%t )):$(( 0x%T ))' ${resume} ) >/sys/power/resume
 		else
-			echo "Cannot resume from unknown device $dev"
+			echo "Cannot resume from device $resume, which doesn't exist"
 		fi
 		;;
 	esac
@@ -122,6 +120,9 @@
 	root=*)
 		root=${param#root=}
 		;;
+	rootdelay=*)
+		rootdelay=${param#rootdelay=}
+		;;
 	rootfstype=*)
 		rootfstype=${param#rootfstype=}
 		;;




More information about the livecd mailing list