[patch] New option LOGOPNG to replace the g-i logo
Here is a patch to add a new option LOGOPNG, to replace the g-i logo.
When set, it will repack the initrd to replace the original image.
I tried to just append to initrd.gz, but that did not work, so I ended
up repacking it instead. The patch only work for amd64 and i386 so
far.
I suspect it should be moved to another script when implementing it
for all archs, to avoid too much code duplication.
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 17:09:12.000000000 +0200
@@ -164,6 +164,23 @@
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.gz
+ echo "info: Adding $LOGOPNG to $GTKINITRD"
+ INITRDDIR=$TDIR/initrd-$$
+ # Repack initrd with new image
+ mkdir -p $INITRDDIR
+ (
+ cd $INITRDDIR
+ gunzip < $GTKINITRD | cpio -i
+ mkdir -p $INITRDDIR/usr/share/graphics
+ cp $LOGOPNG $INITRDDIR/usr/share/graphics/logo_debian.png
+ find | cpio -o | 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 17:08:07.000000000 +0200
@@ -197,6 +203,22 @@
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.gz
+ echo "info: Adding $LOGOPNG to $GTKINITRD"
+ INITRDDIR=$TDIR/initrd-$$
+ # Repack initrd with new image
+ mkdir -p $INITRDDIR
+ (
+ cd $INITRDDIR
+ gunzip < $GTKINITRD | cpio -i
+ mkdir -p $INITRDDIR/usr/share/graphics
+ cp $LOGOPNG $INITRDDIR/usr/share/graphics/logo_debian.png
+ find | cpio -o | gzip -9 > $GTKINITRD
+ )
+ rm -rf $INITRDDIR
+ fi
sed -i "s|/install/|/install.386/|" boot$N/isolinux/isolinux.cfg
Reply to: