【问题标题】:How to use autoyast to install an external package while installing Suse unattended?无人值守安装 Suse 时如何使用 autoyast 安装外部包?
【发布时间】:2022-01-20 10:14:10
【问题描述】:

最近我正在学习如何使用 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包,安装时没有发现错误消息。 我不知道我错在哪里。请纠正我。提前感谢您的帮助。

问候 艾森

【问题讨论】:

  • 经过 1 天的测试。我发现了一些新的东西——当我在这个新安装的虚拟机上运行“zypper install rlwrap”时。它报告 -- rlwrap-0.43-lp152.3.8.x86_64.rpm: Header V3 RSA/SHA256 Signature, key ID 3dbdc284: NOKEY V3 RSA/SHA256 Signature, key ID 3dbdc284: NOKEY rlwrap-0.43-lp152.3.8.x86_64 (http -192.168.95.77-897f574f):签名验证失败[4-签名公钥不可用]中止、重试、忽略? [a/r/i] (a): a 也许是 gpg 密钥错误 -- 任何人都知道如何在存储库源端设置 GPG?谢谢

标签: suse pxe


【解决方案1】:

找到解决方案——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>

那么第三方包就安装成功了。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2012-05-12
    • 1970-01-01
    • 2021-09-24
    • 1970-01-01
    • 2023-03-15
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多