Re: [patch] New option LOGOPNG to replace the g-i logo
[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
Happy hacking,
--
Petter Reinholdtsen
Reply to: