ubiquity で early_command を使用する方法

ubiquity で early_command を使用する方法

自動インストールを試みており、できるだけ早くいくつかのコマンドを実行する必要があります。そこで、USB インストール メディア (Ubuntu 16.04) を変更して、以下を追加しました。

menuentry "Install automatically" {
    set gfxpayload=keep
    linux   /casper/vmlinuz.efi file=/cdrom/auto.seed preseed/early_command=/cdrom/early.sh boot=casper auto=true automatic-ubiquity debug-ubiquity  quiet splash ---
    initrd  /casper/initrd.lz
}

これはここで説明されています: https://wiki.ubuntu.com/UbiquityAutomation そしてここhttps://wiki.ubuntu.com/DesktopCDOptions

early.sh ファイルは、auto.seed ファイルとして USB スティック上に存在します (問題なく読み込まれます)。しかし、私の early.sh スクリプトは実行されないようです。

ライブ システムにファイルをコピーしたいだけです:

#!/bin/bash
cp /cdrom/wlan /root/etc/NetworkManager/system-connections/wlan;
chmod 0600 /root/etc/NetworkManager/system-connections/wlan;

上記のリンクで説明されているように、/root をプレフィックスとして追加しました。さらに、次のことも試しました:

#!/bin/bash
touch /root/test

partman が実行される前にインストールを停止すると、通常のライブ デスクトップが表示され、コンソールを開いて が表示されることを期待します/root/test。しかし、そうはなりません。

/var/log/syslog を見ていたところ、ブートパラメータは確認できましたが、early_command に関するログ行はそれ以上ありませんでした。

私の preseed ファイルには次のような行が含まれています:

d-i preseed/early_command string in-target touch /root/test

この状況をどのようにデバッグすればよいでしょうか? 何度もやり直すのは面倒です。

答え1

ubiquityではearly_commandとlate_commandは単純に機能しないと思います。そのため、現在は次のようなものを使用しています。

ubiquity  ubiquity/success_command string \
  cp /cdrom/script /target/root/; \
  chmod 0700 /target/root/script; \
  in-target /root/script; \

これらのコマンドは正常に動作し、再起動する前に Wi-Fi を設定し、インストールのその他の修正を行います。

関連情報