편재성과 함께 early_command를 사용하는 방법

편재성과 함께 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 파일은 내 USB 스틱에 auto.seed 파일로 있습니다(정상적으로 로드됩니다). 하지만 내 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이 실행되기 전에 설치를 중지하면 일반적인 Live Desktop이 나타나고 콘솔을 열고 /root/test. 하지만 난 그렇지 않아요.

/var/log/syslog를 보고 있는데 부팅 매개변수를 볼 수 있지만 early_command에 대한 추가 로그 줄은 없습니다.

내 미리 설정 파일에는 다음과 같은 줄이 포함되어 있습니다.

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

이 상황을 어떻게 디버깅할 수 있나요? 계속해서 다시 시작하는 것은 짜증나는 일입니다.

답변1

나는 유비쿼터스에서는 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를 설정하고 재부팅하기 전에 설치에 대한 기타 수정 작업을 수행합니다.

관련 정보