Author: alexander
Date: 2005-11-02 09:11:09 -0700 (Wed, 02 Nov 2005)
New Revision: 1024

Modified:
   branches/dm/Makefile
   branches/dm/etc/fstab
   branches/dm/initramfs/init.c
   branches/dm/packages/lfs-bootscripts/udev
   branches/dm/packages/udev/Makefile
   branches/dm/scripts/shutdown-helper
Log:
Shutdown helper and udev adapted to device mapper
Typos in initramfs fixed



Modified: branches/dm/Makefile
===================================================================
--- branches/dm/Makefile        2005-11-01 15:04:20 UTC (rev 1023)
+++ branches/dm/Makefile        2005-11-02 16:11:09 UTC (rev 1024)
@@ -126,6 +126,7 @@
 $(MP)$(ROOT): root.ext2
        mkdir -p $(MP) $(MPBASE)$(SRC) $(MPBASE)$(WD)/bin $(MPBASE)/iso/boot
        mount -o loop root.ext2 $(MP)
+       -rm $(MP)/boot
        mkdir -p $(MP)$(ROOT) $(MP)$(SRC) $(MP)$(WD) $(MP)/boot
        mount --bind $(MPBASE)$(ROOT) $(MP)$(ROOT)
        mount --bind $(MPBASE)$(WD) $(MP)$(WD)
@@ -316,10 +317,10 @@
 minimal-blfs: ch-openssl ch-wget ch-reiserfsprogs ch-xfsprogs \
        ch-lynx ch-libxml2 ch-expat ch-subversion ch-lfs-bootscripts \
        ch-curl ch-zip ch-unzip ch-docbook-xml ch-libxslt ch-docbook-xsl \
-       ch-html_tidy ch-LFS-BOOK \
+       ch-html_tidy ch-LFS-BOOK ch-openssh \
        ch-dhcpcd ch-cpio ch-eject ch-nALFS ch-dialog ch-device-mapper \
        ch-linux ch-cdrtools ch-zisofs-tools ch-initramfs \
-       ch-syslinux ch-nALFS-profile
+       ch-syslinux ch-nALFS-profile ch-blfs-bootscripts
 
 blfs: ch-openssl ch-wget ch-reiserfsprogs ch-xfsprogs ch-nano ch-joe \
        ch-screen ch-curl ch-zip ch-unzip ch-lynx ch-libxml2 ch-expat \
@@ -517,11 +518,10 @@
        @-mv $(MP)/bin/uname.real $(MP)/bin/uname
 endif
 
-$(MPBASE)/iso/root.ext2: root.ext2
+iso: prepiso
        @make unmount
+       @sync
        @$(WD)/bin/mkzftree -F root.ext2 $(MPBASE)/iso/root.ext2
-
-iso: prepiso $(MPBASE)/iso/root.ext2
 ifeq ($(LFS-ARCH),x86)
        @cd $(MPBASE)/iso ; $(WD)/bin/mkisofs -z -R -l --allow-leading-dots -D 
-o \
        $(MPBASE)$(ROOT)/lfslivecd-$(VERSION).iso -b boot/isolinux/isolinux.bin 
\
@@ -600,8 +600,11 @@
        @-umount $(MP)$(WD)
        @-umount $(MP)$(ROOT)
        @-rmdir $(MP)$(SRC) $(MP)$(WD) $(MP)$(ROOT)
+       @-rmdir $(MP)/boot
+       @-ln -s /dev/shm/.cdrom/boot $(MP)
        @-umount $(MP)
-       @touch root.ext2
+       @-touch root.ext2
+       @-rm ../iso/root.ext2
 
 
 .PHONY: unmount clean_sources scrub clean iso chroot-gvim update-fontsdir \

Modified: branches/dm/etc/fstab
===================================================================
--- branches/dm/etc/fstab       2005-11-01 15:04:20 UTC (rev 1023)
+++ branches/dm/etc/fstab       2005-11-02 16:11:09 UTC (rev 1024)
@@ -1,7 +1,7 @@
 # Begin /etc/fstab
 
 # filesystem   mount-point     fs-type         options         dump    
fsck-order
-unionfs                /               unionfs         defaults        0       0
+devmapper      /               ext2            defaults        0       0
 proc           /proc           proc            defaults        0       0
 sysfs          /sys            sysfs           defaults        0       0
 devpts         /dev/pts        devpts          gid=4,mode=620  0       0

Modified: branches/dm/initramfs/init.c
===================================================================
--- branches/dm/initramfs/init.c        2005-11-01 15:04:20 UTC (rev 1023)
+++ branches/dm/initramfs/init.c        2005-11-02 16:11:09 UTC (rev 1024)
@@ -148,7 +148,7 @@
 
        /* Create a symlink for the CD drive to /dev/lfs-cd */
 
-       symlink(lfscd, "/.union/dev/lfs-cd");
+       symlink(lfscd, ROOT "/dev/lfs-cd");
 
 
        /* Remove the "/init" binary to free some RAM */

Modified: branches/dm/packages/lfs-bootscripts/udev
===================================================================
--- branches/dm/packages/lfs-bootscripts/udev   2005-11-01 15:04:20 UTC (rev 
1023)
+++ branches/dm/packages/lfs-bootscripts/udev   2005-11-02 16:11:09 UTC (rev 
1024)
@@ -15,17 +15,6 @@
 . /etc/sysconfig/rc
 . ${rc_functions}
 
-# Create some things that sysfs does not, and should not export for us.  Feel
-# free to add devices to this list.
-make_extra_nodes() {
-       ln -s /proc/self/fd /dev/fd
-       ln -s /proc/self/fd/0 /dev/stdin
-       ln -s /proc/self/fd/1 /dev/stdout
-       ln -s /proc/self/fd/2 /dev/stderr
-       ln -s /proc/kcore /dev/core
-       mkdir /dev/pts
-}
-
 case "${1}" in
        start)
                boot_mesg "Populating /dev with device nodes..."
@@ -35,16 +24,8 @@
                echo /sbin/udevsend > /proc/sys/kernel/hotplug
 
                # Populate /dev with all the devices that are already available,
-               # and save it's status so we can report failures.
-               udevstart || failed=1
+               UDEV_RUN=0 udevstart
 
-               # Now, create some required files/directories/devices that sysfs
-               # doesn't export for us.
-               make_extra_nodes
-
-               # When reporting the status, base it on the success or failure
-               # of the `udevstart' command, since that's the most important.
-               (exit ${failed})
                evaluate_retval
                ;;
 

Modified: branches/dm/packages/udev/Makefile
===================================================================
--- branches/dm/packages/udev/Makefile  2005-11-01 15:04:20 UTC (rev 1023)
+++ branches/dm/packages/udev/Makefile  2005-11-02 16:11:09 UTC (rev 1024)
@@ -35,7 +35,9 @@
        make EXTRAS=extras/run_directory/ DESTDIR=/ install
        # Udev-070 Makefile has a bug here
        install -m755 extras/run_directory/udev_run_hotplugd /sbin
-       cp $(SRC)/$(CONFIG1) /etc/udev/rules.d/25-lfs.rules
+       sed '/KERNEL==.dm-/d' $(SRC)/$(CONFIG1) >/etc/udev/rules.d/25-lfs.rules
+       echo 'KERNEL=="device-mapper", NAME="mapper/control"' 
>>/etc/udev/rules.d/25-lfs.rules
+       echo 'KERNEL=="dm-*", NAME=""' >>/etc/udev/rules.d/25-lfs.rules
        echo 'RUN+="/sbin/udev_run_hotplugd"' >>/etc/udev/rules.d/25-lfs.rules
        install -m644 -D docs/writing_udev_rules/index.html \
         /usr/share/doc/$(DIR)/index.html

Modified: branches/dm/scripts/shutdown-helper
===================================================================
--- branches/dm/scripts/shutdown-helper 2005-11-01 15:04:20 UTC (rev 1023)
+++ branches/dm/scripts/shutdown-helper 2005-11-02 16:11:09 UTC (rev 1024)
@@ -14,6 +14,8 @@
 /sbin/halt
 /sbin/reboot
 /usr/sbin/chroot
+/usr/sbin/dmsetup
+/usr/lib/libdevmapper.so.1.01
 /usr/bin/eject
 /bin/sleep
 /lib/libm.so.6
@@ -22,7 +24,8 @@
 /dev/console
 /dev/null
 /dev/lfs-cd
-/dev/loop0"
+/dev/loop0
+/dev/mapper/control"
 
 case "$RUNLEVEL" in
        0)
@@ -38,34 +41,37 @@
 cat >/dev/shm/sbin/init <<EOF
 #!/bin/sh
 
+halt() {
+       $HALT
+       while true ; do sleep 1 ; done
+}
+
 fail() {
        echo "Could not unmount the CD, sorry. Please report this as a bug."
        sleep 5
-       $HALT
-       while true ; do sleep 1 ; done
+       halt
 }
 
 exec </dev/console >/dev/console 2>/dev/console
 TIMEOUT=
-while ! umount -n /old 2>/dev/null && [ "$TIMEOUT" != "....." ] ; do
+while ! umount -n /old 2>/dev/null && [ "\$TIMEOUT" != "....." ] ; do
         sleep 1
-       TIMEOUT=".$TIMEOUT"
+       TIMEOUT=".\$TIMEOUT"
 done
-[ "$TIMEOUT" = "....." ] && fail
-umount -n /.sqfs || fail
+[ "\$TIMEOUT" = "....." ] && fail
+dmsetup remove_all || fail
 losetup -d /dev/loop0 || fail
 umount -n /.cdrom || fail
-( sleep 30 ; $HALT ) &
 eject -r /dev/lfs-cd
 echo -n "Take the CD, close the CD-ROM tray and press Enter..."
+( sleep 30 ; halt ) &
 read ENTER
-$HALT
-while true ; do sleep 1 ; done
+halt
 EOF
 chmod 755 /dev/shm/sbin/init
 ln -nsf /old/dev/initctl /dev/shm/dev/initctl
-umount /tmp
-umount -a -t nounionfs
+# "-t no" because otherwise /dev/pts isn't unmounted.
+umount -na -t no
 cd /dev/shm
 mount -n -t proc proc /dev/shm/proc
 pivot_root . old

-- 
http://linuxfromscratch.org/mailman/listinfo/livecd
FAQ: http://www.linuxfromscratch.org/faq/
Unsubscribe: See the above information page

Reply via email to