Comment 4 for bug 195608

Revision history for this message
Christopher Townsend (townsend) wrote :

I have a use case in which I'm trying to use a fully automated install using oem-config. I've taken Colin's branch and applied it to the latest version of partman-auto in Precise and built a test version of Ubiquity and have included it in a build.

The disk-recipe is written such that /home should be it's own partition. The intention is that if the partition does not exist, then a new one should be created. If the partition already exists, then it should be kept and left untouched.

However, using the diff from Colin's branch, I have run into a few issues and shortcomings.

1. When installing, Ubiquity would spin at the point that it starts to partition disks. After much investigation, I found this is due to error at this line in the diff:
    partno="$(echo "$*" | sed '\''s/.*\$partno{ \([0-9][0-9]*\) }.*/\1/'\'')"

I ended up addressing this by changing it to:
    partno="$(echo "$*" | sed 's/.*\$partno{ \([0-9][0-9]*\) }.*/\1/')"

I'm not sure if this really correct, but it seems to have fixed that problem.

2. The next issue I ran into is if I set the $partno{ x } directive and the partition does not exist, it goes into an infinite loop. I found the following code block to be the culprit:
     if [ -z "$partid" ]; then
        logger -t partman-auto \
        "Partition number $partno in recipe not found; creating new partition instead"
        continue
     fi

I then fixed this loop by changing this block to this:
     if [ -z "$partid" ]; then
        logger -t partman-auto \
        "Partition number $partno in recipe not found; creating new partition instead"
        scheme="$scheme_rest"
        continue
     fi

3. With the last change in place, the next issue I ran into is that if the partition does not exist, then a new one will not be created.

4. Lastly, If I leave the $partno directive out and let partman-auto create the partition and then add the $partno directive back in when the partition exists, then the partition will be preserved, but it is not added to /etc/fstab and so the partition is not automatically mounted and used by the install and the running system.