Pantek Library
Hosting Provided By
CybrHost
High Speed Hosting

Re: [patch] New option LOGOPNG to replace the g-i logo

From: Petter Reinholdtsen <pere(at)hungry.com>
Date: Wed Jul 18 2007 - 16:12:42 EDT

[Petter Reinholdtsen]
> Hm, the testing I did has proven to be insufficient. This patch
> only work when executing as root. When running as a normal user,
> /dev/console and /dev/null is removed from the initrd. So it need
> more work.

And here is a patch that work even for non-root builds. IS this an OK approach? As you probably can tell from the code, I am not very skilled with cpio.

diff -ur debian-cd.unpatched/tools/boot/etch/boot-amd64 debian-cd/tools/boot/etch/boot-amd64

--- debian-cd.unpatched/tools/boot/etch/boot-amd64	2007-07-18 17:06:09.000000000 +0200
+++ debian-cd/tools/boot/etch/boot-amd64	2007-07-18 19:16:46.000000000 +0200
@@ -164,6 +164,26 @@
 		ppmtolss16 "#ffffff=7" "#000000=0" > boot$N/isolinux/splash.rle
 fi  
+if [ "$LOGOPNG" ] ; then
+	# Add custom logo to the initrd.gz file, replacing old image
+	GTKINITRD=$CDDIR/install.amd/gtk/initrd
+	GTKINITRDGZ=$GTKINITRD.gz
+	echo "info: Adding $LOGOPNG to $GTKINITRD"
+	INITRDDIR=$TDIR/initrd-$$
+	# Repack initrd with new image
+	mkdir -p $INITRDDIR
+	(
+	       cd $INITRDDIR
+	       gunzip $GTKINITRDGZ
+	       mkdir -p $INITRDDIR/usr/share/graphics
+	       cp $LOGOPNG $INITRDDIR/usr/share/graphics/logo_debian.png
+	       echo usr/share/graphics/logo_debian.png | \
+		   cpio -oA -H newc -F $GTKINITRD
+	       gzip -9 $GTKINITRD
+	)
+	rm -rf $INITRDDIR
+fi
+

 rm -rf cdrom
 sed -i "s|built on|built $BUILD_DATE; d-i|" boot$N/isolinux/f1.txt  

diff -ur debian-cd.unpatched/tools/boot/etch/boot-i386 debian-cd/tools/boot/etch/boot-i386

--- debian-cd.unpatched/tools/boot/etch/boot-i386	2007-07-18 17:06:09.000000000 +0200
+++ debian-cd/tools/boot/etch/boot-i386	2007-07-18 19:17:25.000000000 +0200
@@ -197,6 +203,25 @@
 		pngtopnm < $SPLASHPNG | ppmquant 16 | \
 			ppmtolss16 "#ffffff=7" "#000000=0" > boot$N/isolinux/splash.rle
 	fi
+	if [ "$LOGOPNG" ] ; then
+		# Add custom logo to the initrd.gz file, replacing old image
+		GTKINITRD=$CDDIR/install.386/gtk/initrd
+		GTKINITRDGZ=$GTKINITRD.gz
+		echo "info: Adding $LOGOPNG to $GTKINITRD"
+		INITRDDIR=$TDIR/initrd-$$
+		# Repack initrd with new image
+		mkdir -p $INITRDDIR
+		(
+			cd $INITRDDIR
+			gunzip $GTKINITRDGZ
+			mkdir -p $INITRDDIR/usr/share/graphics
+			cp $LOGOPNG $INITRDDIR/usr/share/graphics/logo_debian.png
+			echo usr/share/graphics/logo_debian.png | \
+			    cpio -oA -H newc -F $GTKINITRD
+			gzip -9 $GTKINITRD
+		)
+		rm -rf $INITRDDIR
+	fi
 
 	sed -i "s|/install/|/install.386/|" boot$N/isolinux/isolinux.cfg
Do you need help?X

Happy hacking,

-- 
Petter Reinholdtsen


-- 
To UNSUBSCRIBE, email to debian-cd-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Received on Wed Jul 18 16:17:14 2007

This archive was generated by hypermail 2.1.8 : Thu Aug 09 2007 - 19:05:56 EDT


Contact Us  Legal Notices  Order Services Online 
Pantek Home  Privacy Policy  IT news  Site Map  Pantek Library