r590 - x86/trunk/initramfs

jhuntwork at linuxfromscratch.org jhuntwork at linuxfromscratch.org
Thu Aug 25 13:47:17 PDT 2005


Author: jhuntwork
Date: 2005-08-25 14:47:16 -0600 (Thu, 25 Aug 2005)
New Revision: 590

Added:
   x86/trunk/initramfs/init.orig
Removed:
   x86/trunk/initramfs/init
Modified:
   x86/trunk/initramfs/Makefile
Log:
Adjusted use of sed on the init file in order to preserve permissions

Modified: x86/trunk/initramfs/Makefile
===================================================================
--- x86/trunk/initramfs/Makefile	2005-08-25 20:24:57 UTC (rev 589)
+++ x86/trunk/initramfs/Makefile	2005-08-25 20:47:16 UTC (rev 590)
@@ -30,8 +30,9 @@
 	@$(CP) $(KLIBC)/bin/{insmod,isoinfo,ln,losetup,mkdir,mount,run-init,sh,sleep} $(WDIR)/bin
 	@$(CP) $(KLIBC)/lib/klibc-*.so $(WDIR)/lib
 	@$(CP) /lib/modules/$(KVERS)/kernel/fs/unionfs.ko $(WDIR)/lib
-	@sed 's/-VERSION/-$(VERSION)/' init > init.new
-	@$(CP) init.new $(WDIR)/init
+	@$(CP) init.orig init
+	@sed -i 's/-VERSION/-$(VERSION)/'
+	@$(CP) init $(WDIR)/
 	@$(MK) -m 640 $(WDIR)/dev/console c 5 1
 	@$(MK) -m 660 $(WDIR)/dev/hda b 3 0
 	@$(MK) -m 660 $(WDIR)/dev/hdb b 3 64

Deleted: x86/trunk/initramfs/init
===================================================================
--- x86/trunk/initramfs/init	2005-08-25 20:24:57 UTC (rev 589)
+++ x86/trunk/initramfs/init	2005-08-25 20:47:16 UTC (rev 590)
@@ -1,64 +0,0 @@
-#!/bin/sh
-
-# The LABEL value below must match the label given when creating the iso.
-# This is done automatically in the make scripts using a simple sed.
-# See the packages/initramfs/Makefile for the actual command.
-LABEL="lfslivecd-VERSION"
-DEVS=`echo /dev/hd* /dev/sr*`
-
-while [ -z "$CDROM" ] && [ "$TIMEOUT" != "..............." ] ; do
-	for DEV in $DEVS ; do
-		if [ "`isoinfo -V $DEV 2>/dev/null`" = "$LABEL" ] ; then
-			CDROM=$DEV
-		fi
-	done
-	if [ -z "$CDROM" ] ; then
-		echo -n "."
-		TIMEOUT=".$TIMEOUT"
-		sleep 1
-	fi
-done
-
-if [ -z "$CDROM" ] ; then
-	echo "Cannot find LFS Live CD."
-	echo "This probably means that your IDE or SCSI controller is not supported."
-	exit 1
-else
-	echo "LFS Live CD is $CDROM"
-fi
-
-mount -w -t tmpfs -o size=90% tmpfs /.tmpfs
-mkdir /.tmpfs/.overlay
-
-# Probably redundant, but might be useful in the future for ejecting the CD
-mkdir -p /.tmpfs/.overlay/dev/shm /.tmpfs/.overlay/proc
-mkdir -m1777 /.tmpfs/.overlay/tmp
-
-mkdir /.tmpfs/.cdrom
-mkdir /.tmpfs/.sqfs
-
-# Work around unionfs bug that causes tst-cancel16 glibc test to fail in Ch5
-mkdir -m1777 /.tmpfs/.tmp
-
-mount -r -t iso9660 $CDROM /.tmpfs/.cdrom
-losetup /dev/loop0 /.tmpfs/.cdrom/.root.sqfs
-mount -r -t squashfs /dev/loop0 /.tmpfs/.sqfs
-
-# File locking and mmap don't work well on unionfs 1.0.11, this breaks
-# module-init-tools.
-# Fixed in unionfs 1.0.12a, but that version is oopsy when overwriting files.
-MODDIR=`echo /.tmpfs/.sqfs/lib/modules/*`
-MODDIR=${MODDIR#/.tmpfs/.sqfs/}
-mkdir -p /.tmpfs/.overlay/$MODDIR
-ln -s /dev/shm/.sqfs/$MODDIR/kernel /.tmpfs/.overlay/$MODDIR
-
-insmod /lib/unionfs.ko
-mount -w -t unionfs -o dirs=/.tmpfs/.overlay=rw:/.tmpfs/.cdrom=ro:/.tmpfs/.sqfs=ro unionfs /.union
-mount -o move /.tmpfs /.union/dev/shm
-
-ln -s $CDROM /.union/dev/lfs-cd
-
-# Work around unionfs bug that causes tst-cancel16 glibc test to fail in Ch5
-mount -o bind /.union/dev/shm/.tmp /.union/tmp
-
-exec run-init /.union /sbin/init

Copied: x86/trunk/initramfs/init.orig (from rev 589, x86/trunk/initramfs/init)




More information about the livecd mailing list