Bug#586221: flash-kernel-installer/uboot-installer patch

2010-08-31 Thread Martin Michlmayr
* Thibaut Girka t...@sitedethib.com [2010-08-15 17:30]:
 Here is a patch to do that (works only for the GTA02 for now).

 - I don't think the partman check should be part of flash-kernel.  It
   should be put somewhere in partman.  Best to ask the partman people.

 - The templates will need to be reviewed.  Best to ping Christian
   Perrier.

 - modify_uboot_env() is way too GTA02-specific.  All the device-specific
   assumptions (e.g. bootcmd) should be moved elsewhere.

I don't have time to do an in-depth review right since as I'm about to
go on holidays.  But this isn't squeeze material anyway.
-- 
Martin Michlmayr
http://www.cyrius.com/



-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org



Bug#586221: flash-kernel-installer/uboot-installer patch

2010-08-26 Thread Otavio Salvador
Hello Martin,

On Sun, Aug 15, 2010 at 12:30 PM, Thibaut Girka t...@sitedethib.com wrote:
 Here is a patch to do that (works only for the GTA02 for now).

Can you take a look on this?

-- 
Otavio Salvador                  O.S. Systems
E-mail: ota...@ossystems.com.br  http://www.ossystems.com.br
Mobile: +55 53 9981-7854         http://projetos.ossystems.com.br



--
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org



Bug#586221: flash-kernel-installer/uboot-installer patch

2010-08-15 Thread Thibaut Girka
Here is a patch to do that (works only for the GTA02 for now).
From 10351531703fd014d460f67aa331873060cc062f Mon Sep 17 00:00:00 2001
From: Thibaut Girka t...@sitedethib.com
Date: Sun, 15 Aug 2010 13:38:33 +0200
Subject: [PATCH 3/9] flash-kernel-installer: add uboot-installer

---
 packages/flash-kernel/check.d/_numbers |1 +
 packages/flash-kernel/check.d/ext2_boot|   64 +
 packages/flash-kernel/debian/control   |2 +-
 .../debian/flash-kernel-installer.di-numbers   |1 +
 .../debian/flash-kernel-installer.install  |1 +
 .../debian/flash-kernel-installer.postinst |1 +
 .../debian/flash-kernel-installer.templates|   71 ++
 packages/flash-kernel/debian/rules |2 +-
 packages/flash-kernel/uboot-installer  |  146 
 9 files changed, 287 insertions(+), 2 deletions(-)
 create mode 100644 packages/flash-kernel/check.d/_numbers
 create mode 100755 packages/flash-kernel/check.d/ext2_boot
 create mode 100644 packages/flash-kernel/debian/flash-kernel-installer.di-numbers
 create mode 100644 packages/flash-kernel/debian/flash-kernel-installer.install
 create mode 100644 packages/flash-kernel/uboot-installer

diff --git a/packages/flash-kernel/check.d/_numbers b/packages/flash-kernel/check.d/_numbers
new file mode 100644
index 000..18d7600
--- /dev/null
+++ b/packages/flash-kernel/check.d/_numbers
@@ -0,0 +1 @@
+05 ext2_boot
diff --git a/packages/flash-kernel/check.d/ext2_boot b/packages/flash-kernel/check.d/ext2_boot
new file mode 100755
index 000..7109543
--- /dev/null
+++ b/packages/flash-kernel/check.d/ext2_boot
@@ -0,0 +1,64 @@
+#!/bin/sh
+# Check that the boot partition is of type ext2, and that it is marked as
+# bootable. Used for Openmoko FreeRunner (GTA02).
+
+machine=$(sed '/^Hardware/ {s/^Hardware\s*:\s*//;p}' /proc/cpuinfo)
+case $machine in
+	GTA02)
+	;;
+	*)
+		exit 0
+	;;
+esac
+
+. /lib/partman/lib/base.sh
+
+for dev in $DEVICES/*; do
+	[ -d $dev ] || continue
+	cd $dev
+	open_dialog PARTITIONS
+	while { read_line num id size type fs path name; [ $id ]; }; do
+		[ $fs != free ] || continue
+		[ -f $id/method ] || continue
+		[ -f $id/acting_filesystem ] || continue
+		[ -f $id/mountpoint ] || continue
+		mountpoint=$(cat $id/mountpoint)
+		filesystem=$(cat $id/acting_filesystem)
+		if [ $mountpoint = / ]; then
+			root_fs=$filesystem
+			root_type=$type
+			root_path=$path
+			if [ -f $id/bootable ]; then
+root_bootable=yes
+			fi
+		elif [ $mountpoint = /boot ]; then
+			boot_fs=$filesystem
+			boot_type=$type
+			boot_path=$path
+			if [ -f $id/bootable ]; then
+boot_bootable=yes
+			fi
+		fi
+	done
+	close_dialog
+done
+
+# If no separate boot partition exists root acts as boot
+if [ -z $boot_path ]; then
+	boot_fs=$root_fs
+	boot_type=$root_type
+	boot_path=$root_path
+	boot_bootable=$root_bootable
+fi
+
+# We require an ext2 filesystem to boot
+if [ $boot_fs != ext2 ]; then
+	db_set flash-kernel-installer/uboot/boot_not_ext2 true
+	db_input critical flash-kernel-installer/uboot/boot_not_ext2 || true
+	db_go || true
+	db_get flash-kernel-installer/uboot/boot_not_ext2
+	if [ $RET = true ]; then
+		exit 1
+	fi
+fi
+
diff --git a/packages/flash-kernel/debian/control b/packages/flash-kernel/debian/control
index ce959a2..7d1fc1a 100644
--- a/packages/flash-kernel/debian/control
+++ b/packages/flash-kernel/debian/control
@@ -3,7 +3,7 @@ Section: utils
 Priority: optional
 Maintainer: Debian Install System Team debian-b...@lists.debian.org
 Uploaders: Martin Michlmayr t...@cyrius.com, Wouter Verhelst wou...@debian.org
-Build-Depends: debhelper (= 7.3.10)
+Build-Depends: debhelper (= 7.3.10), dh-di
 Standards-Version: 3.7.2
 Vcs-Svn: svn://svn.debian.org/d-i/trunk/packages/flash-kernel
 
diff --git a/packages/flash-kernel/debian/flash-kernel-installer.di-numbers b/packages/flash-kernel/debian/flash-kernel-installer.di-numbers
new file mode 100644
index 000..0110b8d
--- /dev/null
+++ b/packages/flash-kernel/debian/flash-kernel-installer.di-numbers
@@ -0,0 +1 @@
+check.d lib/partman
diff --git a/packages/flash-kernel/debian/flash-kernel-installer.install b/packages/flash-kernel/debian/flash-kernel-installer.install
new file mode 100644
index 000..cd38ae6
--- /dev/null
+++ b/packages/flash-kernel/debian/flash-kernel-installer.install
@@ -0,0 +1 @@
+uboot-installer usr/share/flash-kernel-installer
diff --git a/packages/flash-kernel/debian/flash-kernel-installer.postinst b/packages/flash-kernel/debian/flash-kernel-installer.postinst
index 22bc6d1..164e464 100755
--- a/packages/flash-kernel/debian/flash-kernel-installer.postinst
+++ b/packages/flash-kernel/debian/flash-kernel-installer.postinst
@@ -5,6 +5,7 @@
 set -e
 
 . /usr/share/debconf/confmodule
+. /usr/share/flash-kernel-installer/uboot-installer
 
 log() {
 	logger -t flash-kernel-installer $@
diff --git a/packages/flash-kernel/debian/flash-kernel-installer.templates