[Bug 1318080] [NEW] preseed/late_command is interpreted differently depending on how the file is passed to the installer
Knut Auvor Grythe
knut at auvor.no
Fri May 9 21:57:55 UTC 2014
Public bug reported:
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.
** Affects: preseed (Ubuntu)
Importance: Undecided
Status: New
--
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to preseed in Ubuntu.
https://bugs.launchpad.net/bugs/1318080
Title:
preseed/late_command is interpreted differently depending on how the
file is passed to the installer
Status in “preseed” package in Ubuntu:
New
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.
To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/preseed/+bug/1318080/+subscriptions
More information about the foundations-bugs
mailing list