【问题标题】:"preseed/late_command" does not work in Ubuntu 14.04“preseed/late_command”在 Ubuntu 14.04 中不起作用
【发布时间】:2018-06-13 10:09:00
【问题描述】:

我正在使用 preseed 设置 Ubuntu 14.04 的自动安装。我使用虚拟机(virtualBox machine)对此进行了测试。一切都安装得很好,没有任何问题,但我不太清楚如何在 preseed 文件末尾使用 late_command。

我第一次想做的是运行 start.sh 脚本。

我尝试了几次:

代码如下:

d-i preseed/late_command string cp /cdrom/start.sh /target/home/user; in-target chmod 700 /home/user/start.sh; /home/user/start.sh

还有:

d-i preseed/late_command string chroot /target; cp -f /cdrom/start.sh /home/user; chmod 700 /home/user/start.sh;

第三次尝试:

 d-i preseed/late_command string cp -f /cdrom/start.sh /home/user; in-target chmod +x /home/user/start.sh; in-target sh start.sh

脚本 start.sh 定义一个命令:

#! /bin/sh 
echo "bonjour" > /home/user/bonjour_file

我也试过在新机器上安装后创建一个文件:

d-i preseed/late_command string in-target touch /etc/postinst_user.done

preseed preseed/late_command string in-target touch /etc/postinst_user.done

但它只是在安装的最后挂起。安装正常,但脚本根本没有运行,文件“postinst_user.done”没有创建。

新安装的文件系统是否挂载在/target下?安装中此时的环境是什么样的。这样做的正确方法是什么?

提前谢谢你,

【问题讨论】:

    标签: automation debian ubuntu-14.04


    【解决方案1】:

    几天前我遇到了同样的问题,所以我想我会与您分享解决方案。在预置 Ubuntu 安装时,

    d-i preseed/late_command string yourcommand
    

    命令不起作用。相反,您必须使用

    ubiquity ubiquity/success_command string yourcommand
    

    希望对你有帮助

    一月

    【讨论】:

    • 您使用的是哪个 Ubuntu 版本? 18.04.5 还是 20.04?
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2015-07-01
    • 2015-11-10
    • 2017-02-19
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多