Re: Bug#512740: Sparc disk labels broken on LDOM and Parallel installs

2010-03-08 Thread Colin Watson
Source: parted
Source-Version: 2.2-1

(Note that this is still in NEW, and is currently targeted at
experimental but we plan to move it to unstable soon; I'm
version-closing it while I remember.)

On Tue, Feb 09, 2010 at 06:54:39PM +0100, Frans Pop wrote:
> I've read through the patch, but must admit I don't understand it. What 
> seems to be missing is *how* exactly it fixes the problem.
> 
> And somehow I doubt this patch stands on its own. I would think that it is 
> a requirement for patches in other packages (such as partman). If that is 
> true, then testing the patch in isolation is not much use (as applying it 
> on its own would not fix the reported issue anyway).
> 
> Also, I question the definition of (unused?) tags for usr, var, home etc. 
> What's the purpose of that? How's that supposed to be used? Does it mean 
> you're not allowed to put e.g. /srv on a separate partition as there's no 
> tag for it?

In all honesty, the only reason I hadn't dropped this patch from Ubuntu
long ago was that I felt I'd have had to sit there and try to understand
it otherwise.  It definitely modified far more than it needed to in
order to get the job done, and as far as I know the original authors
never sent it upstream.

I'm not aware of any partman changes that were associated with this
change in Ubuntu.

Anyway, the patch non-trivially failed to apply on top of parted 2.2-1,
which forced the issue a bit, so I went and looked at it in more detail
than I had done previously, starting by stripping out non-essential
parts of the patch (renamed structures, added #defines, etc.).  It
turned out that there was nothing left!  The actual important part of
this change was applied upstream in 2.2, with this NEWS entry:

  sun: the version, sanity and nparts VTOC fields were ignored by libparted.
  Those fields are properly initialized now. The nparts (number of partitions)
  field is initialized to 8 (max. number of sun partitions) rather that to a
  real number of partitions. This solution is compatible with Linux kernel
  and Linux fdisk.

Thus I've dropped this patch from Ubuntu, with some relief, and we can
consider it fixed in Debian once parted 2.2-1 lands.

Cheers,

-- 
Colin Watson   [cjwat...@debian.org]


-- 
To UNSUBSCRIBE, email to debian-sparc-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org
Archive: http://lists.debian.org/20100308165847.ga2...@riva.ucam.org



Re: Bug#512740: Sparc disk labels broken on LDOM and Parallel installs

2010-02-14 Thread Frans Pop
On Sunday 14 February 2010, Jurij Smakov wrote:
> 1. dh-di needed for build of partman-base is not pulled in as a
> result of 'apt-get build-dep debian-installer', probably should be?

No: base-installer is a separate source package and thus has its own build 
deps. I just forgot to include a step to install those (but luckily DDs 
are smart enough to figure such minor omissions out by themselves ;-)

> 2. Firmware loading is broken in the mini iso image, error is
> 'mountmedia not found'.

Added now for future builds. Please 'svn up'.

> 3. The installation is still affected by the kernel issue where it
> misreports the architecture and SILO installs the incorrect
> second-stage bootloader as a result.

Correct. The installer still uses 2.6.30 and the bug is related to the 
kernel version that's running when silo is installed. It'll get solved 
when we switch to 2.6.32, which should happen soon after the (delayed) D-I 
alpha1 release gets out.


-- 
To UNSUBSCRIBE, email to debian-sparc-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org
Archive: http://lists.debian.org/201002141742.20722.elen...@planet.nl



Re: Bug#512740: Sparc disk labels broken on LDOM and Parallel installs

2010-02-14 Thread Jurij Smakov
On Tue, Feb 09, 2010 at 06:54:39PM +0100, Frans Pop wrote:
> Below are instructions for building a custom D-I image that includes a 
> patched libparted and partman. It's not that hard.

I've built a mini iso image according to these instructions. It is 
available from http://www.wooyd.org/debian/512740, along with 
intermediate packages. Minor issues with the build and the resulting 
image:

1. dh-di needed for build of partman-base is not pulled in as a 
result of 'apt-get build-dep debian-installer', probably should be?
2. Firmware loading is broken in the mini iso image, error is 
'mountmedia not found'.
3. The installation is still affected by the kernel issue where it 
misreports the architecture and SILO installs the incorrect 
second-stage bootloader as a result.

I've ran a couple of installs with this image, zero-filling beginning 
of the disk with zeros during one of them, and did not see any 
regressions.

Mike, can you try downloading the mini.iso and testing that it fixes 
the issue for you? If your machine needs firmware loaded for the disks 
to be detected, you'll need to do it manually. Also, you will need to 
drop into installer shell at the end of the installation, chroot into 
/target, mount /proc and run 'silo -u -f' to unbreak the booloader. 
Let me know if you would like more specific instructions.

Thanks.
-- 
Jurij Smakov   ju...@wooyd.org
Key: http://www.wooyd.org/pgpkey/  KeyID: C99E03CC


-- 
To UNSUBSCRIBE, email to debian-sparc-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org
Archive: http://lists.debian.org/20100214155149.ga5...@droopy.oc.cox.net



Re: Bug#512740: Sparc disk labels broken on LDOM and Parallel installs

2010-02-09 Thread Frans Pop
On Tuesday 09 February 2010, Stefano Zacchiroli wrote:
> On Mon, Feb 08, 2010 at 10:04:05PM +, Jurij Smakov wrote:
> > My main concern is whether it affects installer in any adverse way, so
> > if you could arrange for an installer image to be built with the
> > modified parted, we could do some testing. I don't have access to a
> > machine which supports LDOMs, but I could at least confirm that it
> > does not introduce any regressions.
>
> Personally, I'm not very proficient in d-i (read: not at all), so I'm
> getting -boot into the loop forwarding your request, for help. Bottom
> line for d-i, to test the patch proposed to fix #512740, we need a d-i
> sparc image to check for regression on sparc. The patch is attached for
> your convenience, see bug log for full context.

I've read through the patch, but must admit I don't understand it. What 
seems to be missing is *how* exactly it fixes the problem.

And somehow I doubt this patch stands on its own. I would think that it is 
a requirement for patches in other packages (such as partman). If that is 
true, then testing the patch in isolation is not much use (as applying it 
on its own would not fix the reported issue anyway).

Also, I question the definition of (unused?) tags for usr, var, home etc. 
What's the purpose of that? How's that supposed to be used? Does it mean 
you're not allowed to put e.g. /srv on a separate partition as there's no 
tag for it?

More porter input is definitely needed here.

Below are instructions for building a custom D-I image that includes a 
patched libparted and partman. It's not that hard.

Cheers,
FJP

0) preparation
- check out D-I SVN
- install build deps for debian-installer

1) build patched parted
- build parted with the patch (preferably with increased package version)
- install the lib and -dev packages
- suggestion: install 'parted' and test that before continuing

2) build partman against the patched libparted
- cd to packages/partman/partman-base
- increase package version ('dch')
- debuild

3) build a D-I image
- cd to installer/build
- cp ../../partman/*.udeb ./localudebs
- cp all (lib)parted udebs (from the first step) to ./localudebs
- echo "partman-base" >./pkg-lists/local
  # This will include the custom udebs in the D-I initrd and thus ensure
  # they'll be used instead of the versions in the archive.
- make reallyclean; make build_netboot
  # Instead of build_netboot you can also use build_miniiso.

4) test
- boot the installer from the image you'll find under ./dest


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



Re: Bug#512740: Sparc disk labels broken on LDOM and Parallel installs

2010-02-09 Thread Otavio Salvador
Hello,

On Tue, Feb 9, 2010 at 5:52 AM, Stefano Zacchiroli  wrote:
> On Mon, Feb 08, 2010 at 10:04:05PM +, Jurij Smakov wrote:
>> My main concern is whether it affects installer in any adverse way, so
>> if you could arrange for an installer image to be built with the
>> modified parted, we could do some testing. I don't have access to a
>> machine which supports LDOMs, but I could at least confirm that it
>> does not introduce any regressions.
>
> Personally, I'm not very proficient in d-i (read: not at all), so I'm
> getting -boot into the loop forwarding your request, for help. Bottom
> line for d-i, to test the patch proposed to fix #512740, we need a d-i
> sparc image to check for regression on sparc. The patch is attached for
> your convenience, see bug log for full context.

We need this patch against GNU Parted 2.1 (that can be found in
experimental) since this is the current codebase. Besides, it would be
good if we push it upstream, we can work on that after this has been
ported to 2.1 version.

Can someone from Sparc take a look and port it?

-- 
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-sparc-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org



Re: Bug#512740: Sparc disk labels broken on LDOM and Parallel installs

2010-02-08 Thread Stefano Zacchiroli
On Mon, Feb 08, 2010 at 10:04:05PM +, Jurij Smakov wrote:
> My main concern is whether it affects installer in any adverse way, so 
> if you could arrange for an installer image to be built with the 
> modified parted, we could do some testing. I don't have access to a 
> machine which supports LDOMs, but I could at least confirm that it 
> does not introduce any regressions.

Personally, I'm not very proficient in d-i (read: not at all), so I'm
getting -boot into the loop forwarding your request, for help. Bottom
line for d-i, to test the patch proposed to fix #512740, we need a d-i
sparc image to check for regression on sparc. The patch is attached for
your convenience, see bug log for full context.

Thanks for your feedback!
Cheers.

-- 
Stefano Zacchiroli -o- PhD in Computer Science \ PostDoc @ Univ. Paris 7
z...@{upsilon.cc,pps.jussieu.fr,debian.org} -<>- http://upsilon.cc/zack/
Dietro un grande uomo c'è ..|  .  |. Et ne m'en veux pas si je te tutoie
sempre uno zaino ...| ..: | Je dis tu à tous ceux que j'aime
#! /bin/sh /usr/share/dpatch/dpatch-run
## sparc-new-label.dpatch by David S. Miller and
## Fabio M. Di Nitto 
##
## All lines beginning with `## DP:' are a description of the patch.
## DP: Fix sparc disk label generation. This is required for LDOM and
## DP: parallel installations with Solaris 10.

@DPATCH@
diff -urNad parted-1.8.8.git.2008.03.24~/libparted/labels/sun.c 
parted-1.8.8.git.2008.03.24/libparted/labels/sun.c
--- parted-1.8.8.git.2008.03.24~/libparted/labels/sun.c 2008-06-24 
12:52:11.0 +0100
+++ parted-1.8.8.git.2008.03.24/libparted/labels/sun.c  2008-06-24 
12:56:06.0 +0100
@@ -38,12 +38,30 @@
 #define SUN_DISK_MAGIC 0xDABE  /* Disk magic number */
 #define SUN_DISK_MAXPARTITIONS 8
 
-#define WHOLE_DISK_ID  0x05
+#define SUN_TAG_UNASSIGNED 0x00/* Unassigned partition */
+#define SUN_TAG_BOOT   0x01/* Boot partition   */
+#define SUN_TAG_ROOT   0x02/* Root filesystem  */
+#define SUN_TAG_SWAP   0x03/* Swap partition   */
+#define SUN_TAG_USR0x04/* /usr filesystem  */
+#define SUN_TAG_BACKUP 0x05/* Full-disk slice  */
+#define SUN_TAG_STAND  0x06/* Stand partition  */
+#define SUN_TAG_VAR0x07/* /var filesystem  */
+#define SUN_TAG_HOME   0x08/* /home filesystem */
+#define SUN_TAG_ALTSCTR0x09/* Alt sector partition */
+#define SUN_TAG_CACHE  0x0a/* Cachefs partition*/
+#define SUN_TAG_RESERVED   0x0b/* SMI reserved data*/
+#define SUN_TAG_LINUX_SWAP 0x82/* Linux SWAP   */
+#define SUN_TAG_LINUX_NATIVE   0x83/* Linux filesystem */
+#define SUN_TAG_LINUX_LVM  0x8e/* Linux LVM*/
+#define SUN_TAG_LINUX_RAID 0xfd/* LInux RAID   */
+
+#define SUN_FLAG_UNMNT 0x01/* Unmountable partition*/
+#define SUN_FLAG_RONLY 0x10/* Read only*/
+
 #define WHOLE_DISK_PART2   /* as in 0, 1, 2 (3rd 
partition) */
-#define LINUX_SWAP_ID  0x82
 
 typedef struct _SunRawPartition SunRawPartition;
-typedef struct _SunPartitionInfoSunPartitionInfo;
+typedef struct _SunPartInfo SunPartInfo;
 typedef struct _SunRawLabel SunRawLabel;
 typedef struct _SunPartitionDataSunPartitionData;
 typedef struct _SunDiskData SunDiskData;
@@ -53,18 +71,31 @@
u_int32_t   num_sectors;/* ...and it's length */
 };
 
-struct __attribute__ ((packed)) _SunPartitionInfo {
-   u_int8_tspare1;
-   u_int8_tid; /* Partition type */
-   u_int8_tspare2;
-   u_int8_tflags;  /* Partition flags */
+struct __attribute__ ((packed)) _SunPartInfo {
+   u_int16_t   tag;/* Tagged type */
+   u_int16_t   flags;  /* Partition flags */
 };
 
+#define SUN_LABEL_ID_SIZE  128
+#define SUN_VOLUME_ID_SIZE 8
+
+#define SUN_LABEL_VERSION  0x0001
+#define SUN_LABEL_SANE 0x600ddeee
+
 struct __attribute__ ((packed)) _SunRawLabel {
-   charinfo[128];  /* Informative text string */
-   u_int8_tspare0[14];
-   SunPartitionInfo infos[SUN_DISK_MAXPARTITIONS];
-   u_int8_tspare1[246];/* Boot information etc. */
+   charlabel_id[SUN_LABEL_ID_SIZE];/* Informative text 
string */
+   u_int32_t   version;
+   charvolume_id[SUN_VOLUME_ID_SIZE];
+   u_int16_t   num_part;
+   SunPartInfo infos[SUN_DISK_MAXPARTITIONS];
+   u_int16_t   pad1;
+   u_int32_t   bootinfo[3];
+   u_int32_t   sanity;
+   u_int32_t   resv[10];
+   u_int32_t   part_timestamps[SUN_DISK_MAXPARTITIONS];
+   u_int32_t   write_reinstruct;
+   u_int32_t   read_reinstruct;
+   u_int8_tpad2[148];

Re: Bug#512740: Sparc disk labels broken on LDOM and Parallel installs

2010-02-08 Thread Jurij Smakov
On Mon, Feb 08, 2010 at 04:27:14PM +0100, Stefano Zacchiroli wrote:
> On Sat, Oct 03, 2009 at 11:53:32AM +0200, Luk Claes wrote:
> > What's the status of this bug, can the patch be applied to fix it?
> 
> Ditto, and getting debian-sparc in the loop.
> 
> Executive summary for the sparc porters, there's a patch to fix disk
> label b0rkage on sparc with parted. The patch has been applied in Ubuntu
> for a while now.
> 
> Given that the parted maintainers are unresponsive on this, can please
> the porters comment on the patch?
 
My main concern is whether it affects installer in any adverse way, so 
if you could arrange for an installer image to be built with the 
modified parted, we could do some testing. I don't have access to a 
machine which supports LDOMs, but I could at least confirm that it 
does not introduce any regressions.

Best regards,
-- 
Jurij Smakov   ju...@wooyd.org
Key: http://www.wooyd.org/pgpkey/  KeyID: C99E03CC


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



Re: Bug#512740: Sparc disk labels broken on LDOM and Parallel installs

2010-02-08 Thread Stefano Zacchiroli
On Sat, Oct 03, 2009 at 11:53:32AM +0200, Luk Claes wrote:
> What's the status of this bug, can the patch be applied to fix it?

Ditto, and getting debian-sparc in the loop.

Executive summary for the sparc porters, there's a patch to fix disk
label b0rkage on sparc with parted. The patch has been applied in Ubuntu
for a while now.

Given that the parted maintainers are unresponsive on this, can please
the porters comment on the patch?

Many thanks in advance,
Cheers.

-- 
Stefano Zacchiroli -o- PhD in Computer Science \ PostDoc @ Univ. Paris 7
z...@{upsilon.cc,pps.jussieu.fr,debian.org} -<>- http://upsilon.cc/zack/
Dietro un grande uomo c'è ..|  .  |. Et ne m'en veux pas si je te tutoie
sempre uno zaino ...| ..: | Je dis tu à tous ceux que j'aime


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