[ag-automation] [PATCH]master_script_bugfix.diff

Luotao Fu l.fu at pengutronix.de
Fri Sep 15 12:22:42 CEST 2006


Hi,
I have reviewed, as required, the script for remastering knoppix to 
OSADL Demo CD, done some fixes fo several minor bugs and made some 
improvements. Along with this mail I attached the patch with the fixes.

Following Changes will be made:
 create_livecd.sh |   31 +++++++++++++++----------------
 1 file changed, 15 insertions(+), 16 deletions(-)

fixed wrong directory name of kernel-config

removed several unused Variables

added copy_done flag

signed-off-by: Luotao Fu (lfu AT pengutronix.de)

The 2.6.17 Kernel seems to have a minor bug which prevents compilition
with the default config file. I made an unofficial patch for the problem, 
which is also attached to this mail. This one is still a hotfix and yet 
not tested with other configs. Thus it's still not submited to the
trivial patches of the mainline. Futher I attached my list I made during 
the review, which explains some changes and contains some more
recommendations. 

Regards
Luotao Fu

-- 
     Dipl.-Ing. Luotao Fu | http://www.pengutronix.de
  Pengutronix - Linux Solutions for Science and Industry
    Handelsregister: Amtsgericht Hildesheim, HRA 2686
      Hannoversche Str. 2, 31134 Hildesheim, Germany
    Phone: +49-5121-206917-0 |  Fax: +49-5121-206917-9

-------------- next part --------------
--- osadl-knoppix/create_livecd.sh.orig	2006-09-15 11:19:22.000000000 +0200
+++ osadl-knoppix/create_livecd.sh	2006-09-15 11:19:14.000000000 +0200
@@ -21,7 +21,6 @@ umount_all ()
 umount_and_rm ()
 {
 	umount_all
-	rm -rf $TEMP_DIR
 }
 
 exit_failed ()
@@ -193,7 +192,7 @@ then
 		exit_failed
 	fi
 
-	if [ ! -f kernel_configs/config-knoppix ]
+	if [ ! -f kernel-configs/config-knoppix ]
 	then
 		echo "No kernel config found"
 		echo "Please create ./kernel_configs/config-knoppix"
@@ -217,14 +216,15 @@ fi
 
 if [ -d $TARGET_DIR ]
 then
-	chroot $TARGET_DIR/source/KNOPPIX ls
-	if [ $? -eq 0 ]
-	then
-		DONT_COPY=1
-	else
-		echo "$TARGET_DIR is NOT empty and doesn't contain a remastering environment"
-		exit 1
-	fi
+#	chroot $TARGET_DIR/source/KNOPPIX ls
+#	if [ $? -eq 0 ]
+#	then
+#		DONT_COPY=1
+#	else
+#		echo "$TARGET_DIR is NOT empty and doesn't contain a remastering environment"
+#		exit 1
+#	fi
+	[ ! -e $TARGET_DIR/source/KNOPPIX/copy_done ] && DONT_COPY=0 || DONT_COPY=1
 else
 	DONT_COPY=0
 	if [ -z "$KNOPPIX_CDROM" ]
@@ -258,8 +258,6 @@ then
 fi
 
 # Stupid write permission check ;-)
-TEMP_DIR=$TARGET_DIR/temp
-mkdir -p $TEMP_DIR
 
 touch $TARGET_DIR/gubbl_$$
 handle_return_value "No write access to target directory"
@@ -284,7 +282,7 @@ then
 		false
 		handle_return_value "No cloop device found"
 	fi
-	mount $CLOOP $TARGET_DIR/temp
+	mount -o ro $CLOOP $TARGET_DIR/temp	
 	handle_return_value
 	
 	mkdir -p $KNOPPIX_SOURCE
@@ -304,6 +302,7 @@ then
 		rsync -a --exclude "$KNOPPIX_CDROM/KNOPPIX/KNOPPIX" $KNOPPIX_CDROM/ $MASTER_DIR/
 		handle_return_value
 	fi
+	touch $KNOPPIX_SOURCE/copy_done
 fi
 
 # Remove the OpenOffice package to save space
@@ -337,7 +336,7 @@ then
 	# Patch some startup files
 	# 1) /etc/X11/Xsession.d/45xsession
 	TMPFILE=$TARGET_DIR/tmpfile
-	TARGETFILE=$TARGET_DIR/source/KNOPPIX/etc/X11/Xsession.d/45xsession
+	TARGETFILE=$KNOPPIX_SOURCE/etc/X11/Xsession.d/45xsession
 	LINENUMBER=`grep -n 'ln \$HOME/Desktop/KNOPPIX.desktop \$HOME/.kde/Autostart/showindex.desktop' $TARGETFILE | cut -d: -f1`
 
 	if [ -z "`grep latency-demo $TARGETFILE`" ]
@@ -377,7 +376,7 @@ STOP
 	fi
 
 	# 2) /etc/skel/.kde/share/config/kickerrc
-	TARGETFILE=$TARGET_DIR/source/KNOPPIX/etc/skel/.kde/share/config/kickerrc
+	TARGETFILE=$KNOPPIX_SOURCE/etc/skel/.kde/share/config/kickerrc
 	if grep -q openoffice $TARGETFILE
 	then
 		# First figure out the largest applet number
@@ -417,7 +416,7 @@ then
 	make distclean
 	make-kpkg clean
 	# Copy the config file to the kernel source directory
-	cp $COMEFROM/kernel_configs/config-knoppix $KERNEL_SOURCE/.config
+	cp $COMEFROM/kernel-configs/config-knoppix $KERNEL_SOURCE/.config
 
 	KERNELVERSION=`make kernelversion`
 	make-kpkg kernel-image kernel-headers
-------------- next part --------------
1. kernel-configs given in tar-ball, however the script checks keren_config. 
  bug or feature(R) ?

2. if targetdir is given, script tries to chroot to it subdir source/knoppix.
  Suppose the user might have created an empty dir to hold the image before 
  running the script, in this case the script will quit 'cause the chroot will
  not success. Thus the check here is somehow not quite reasonable, one should 
  check the content of the target dir to decide if one want to copy.

3. After failed run, i.E. running script not as root. script will left created
  target dir undeleted, makes rerunning impossible.(see point 2)

4. -o ro parameter shall also be added to mount command while mounting cloop
  device to avoid waring

5. "Debian way" compiling kernel cause unneccessary dialogs and warnings, 
  makes autobuilding difficult 

6. Requirement unclear: 
	* one needs root privileg
	* one needs patched kernelsource
	* one needs cloop 
	* should make clear that cloop needs file= parameter in case loading
	manually

7. cloop cause oops with 2.6.17+gcc4.1, pci_hotplug does not compile with 
  2.6.17-rt8 (gcc3.4.6 and gcc4.0)
-------------- next part --------------
--- linux-2.6.17-rt/include/linux/pci-acpi.h.orig	2006-09-15 12:07:50.000000000 +0200
+++ linux-2.6.17-rt/include/linux/pci-acpi.h	2006-09-14 17:34:07.000000000 +0200
@@ -51,7 +51,7 @@ extern acpi_status pci_osc_control_set(a
 extern acpi_status pci_osc_support_set(u32 flags);
 #else
 #if !defined(acpi_status)
-typedef u32 		acpi_status;
+//typedef u32 		acpi_status;
 #define AE_ERROR      	(acpi_status) (0x0001)
 #endif    
 static inline acpi_status pci_osc_control_set(acpi_handle handle, u32 flags)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
Url : https://lists.osadl.org/pipermail/ag-automation/attachments/20060915/3e8071a6/attachment.pgp 


More information about the ag-automation mailing list