0

最近我正在学习如何使用 autoyast 通过网络和 pxe 无人值守地安装 SUSE。我的目标是——

  1. 使用 pxe 无人值守安装 Suse12.4 - 我已经使用 autoyast.xml 和 pxe 成功安装
  2. 安装不仅只安装 Suse,还需要安装一些外部包——例如。rlwrap 和 puppet 客户端...按照第 4.9.2 节中的https://documentation.suse.com/sles/12-SP4/html/SLES-all/configuration.html#CreateProfile-Software中的步骤进行操作所以我做了仅使用 rlwrap 包进行测试,这是我的步骤-
  3. 由于我的存储库是http://192.168.95.77/12.4,所以我将 rlwrap-0.43-lp152.3.8.x86_64.rpm 复制到http://192.168.95.77/12.4/suse/x86_64并确保它可以从 http 获得。
  4. 然后我修改了我的 autoyast.xml 在文件末尾添加了这个——

**

<add-on>
  <add_on_products config:type="list">
    <listentry>
      <media_url>http://192.168.95.77/12.4/suse/x86_64/rlwrap-0.43-lp152.3.8.x86_64.rpm</media_url>
      <product>rlwrap</product>
      <alias>rlwrap</alias>
      <product_dir></product_dir>
      <priority config:type="integer">99</priority>
      <ask_on_error config:type="boolean">false</ask_on_error>
      <confirm_license config:type="boolean">false</confirm_license>
      <name>eisen-repo-12.4</name>
    </listentry>
  </add_on_products>
</add-on>

**

然后我用一个新的VM测试,--然后我发现这个VM再次成功安装了Suse12.4,但是没有安装那个rlwrap包并且安装时没有发现错误消息。我不知道我错在哪里。请纠正我。提前感谢您的帮助。

问候艾森

4

1 回答 1

0

找到解决方案——autoyast.xml 中的 init.sh 部分可以做到。我是这样写的——

  <scripts>
    <init-scripts config:type="list">
      <script>
        <debug config:type="boolean">true</debug>
        <feedback config:type="boolean">false</feedback>
        <filename>init.sh</filename>
        <interpreter>shell</interpreter>
        <location><![CDATA[]]></location>
        <notification>customer initialization</notification>
        <source><![CDATA[
#!/bin/bash
touch /tmp/flag
rpm --import http://192.168.95.77/puppet7/repodata/repomd.xml.key 2>&1 >> /tmp/flag
zypper addrepo -f http://192.168.95.77/puppet7 eisen-repo-puppet7 2>&1 >> /tmp/flag
zypper install -y rlwrap 2>&1 >> /tmp/flag
zypper install -y puppet-agent 2>&1 >> /tmp/flag
        ]]></source>
      </script>
    </init-scripts>
  </scripts>

然后成功安装了 3rd 方包。

于 2021-12-20T07:58:09.630 回答