preseed/late_command is interpreted differently depending on how the file is passed to the installer

Bug #1318080 reported by Knut Auvor Grythe
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
preseed (Ubuntu)
New
Undecided
Unassigned

Bug Description

If I give the installer a preseed file using url=tftp://10.30.112.109/ubuntu/preseed.cfg on the kernel command line, the following late_command works fine:

d-i preseed/late_command string tftp -g -l /target/root/bootstrap.sh -r /ubuntu/bootstrap.sh 10.30.112.109 && mv /target/etc/rc.local /target/etc/rc.local.orig && printf '#! /bin/bash\nbash /root/bootstrap.sh 2>&1 | tee /root/bootstrap.log\n' > /target/etc/rc.local && chmod +x /target/etc/rc.local

However, if I rebuild the initrd and put the exact same file as /preseed.cfg in the file system, the command is cut off after the first occurrence of \n, so it tries to execute

  tftp -g -l /target/root/bootstrap.sh -r /ubuntu/bootstrap.sh 10.30.112.109 && mv /target/etc/rc.local /target/etc/rc.local.orig && printf '#! /bin/bash

I tried double-escaping the newlines as \\n, but this just appended a \ to the end of the command line.

I would expect the same preseed.cfg to be parsed the same way, regardless of method of delivery.

Revision history for this message
Knut Auvor Grythe (knut-5) wrote :

A workaround is to use \x0a instead of \n

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.