[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#405572: PowerPC, prep flavor: missing root= boot option after install



tags 405572 + patch
thanks

On Saturday 06 January 2007 12:32, Ulrich Teichert wrote:
> > Can you test if creating a file /etc/initramfs-tools/conf.d/prep-root
> > with such a line works too? If it does, then that is much to be
> > preferred.
>
> I just checked out the d-i trunk, I'll see what I can do.

You don't really need to build a new package for this. You can also just
create the file manually from a shell after the base system installation
is done.


I think the attached patch will do the job as the final solution. It is a
bit heavier than strictly needed because of some backwards compatibility
support (that needs to be cleaned up after Etch).

If you'd like to quickly test the principle after using the installer,
try manually adding (using nano) the following (simplified) code in:
/var/lib/dpkg/info/base-installer.postinst
It should be added just after the resume partition is configured.

@@ -767,6 +767,14 @@
                                echo "RESUME=$resume" >> $resumeconf
                        fi
                fi
+
+               # Set PReP boot partition
+               if [ "$SUBARCH" = prep ] && [ "$rd_generator" = initramfs-tools ]; then
+                       prepconf=/target/etc/initramfs-tools/conf.d/prep-boot
+                       rootpart_devfs=$(mount | grep "on /target " | cut -d' ' -f1)
+                       rootpart=$(mapdevfs $rootpart_devfs)
+                       echo "ROOT=$rootpart" >> $prepconf
+               fi
        else
                info "Not installing $package."
        fi

Index: debian/postinst
===================================================================
--- debian/postinst	(revision 43901)
+++ debian/postinst	(working copy)
@@ -767,6 +767,28 @@
 				echo "RESUME=$resume" >> $resumeconf
 			fi
 		fi
+
+		# Set PReP boot partition
+		if [ "$ARCH" = powerpc] && [ "$SUBARCH" = prep ] && \
+		   [ "$rd_generator" = initramfs-tools ]; then
+			if [ -d /target/etc/initramfs-tools/conf.d ]; then
+				prepconf=/target/etc/initramfs-tools/conf.d/prep-boot
+			elif [ -d /target/etc/mkinitramfs/conf.d ]; then
+				prepconf=/target/etc/mkinitramfs/conf.d/prep-boot
+			else
+				# old location
+				prepconf=/target/etc/mkinitramfs/initramfs.conf
+			fi
+
+			rootpart_devfs=$(mount | grep "on /target " | cut -d' ' -f1)
+			rootpart=$(mapdevfs $rootpart_devfs)
+			if [ -f $prepconf ] && grep -q "^#* *ROOT=" $prepconf; then
+				sed -e "s@^#* *ROOT=.*@ROOT=$rootpart@" < $prepconf > $prepconf.new &&
+					mv $prepconf.new $prepconf
+			else
+				echo "ROOT=$rootpart" >> $prepconf
+			fi
+		fi
 	else
 		info "Not installing $package."
 	fi

Attachment: pgpMDT_GuumuV.pgp
Description: PGP signature


Reply to: