debian インストーラが initrd.gz の preseed.cfg を指すようにするにはどうすればよいですか?

debian インストーラが initrd.gz の preseed.cfg を指すようにするにはどうすればよいですか?

まず、投稿が長すぎて申し訳ありません。

さて、私はDebianのインストールをプロビジョニングするためにDebianのウェブサイトのガイドに従い、それを書いて、彼らが説明するように追加しましたpreseed.cfginitrd.gz

私が従う指示

ISOをプリセットするスクリプトです。

#!/bin/bash 

COMMON_PATH=$HOME/test
ISO_NAME=debian11-net
RAW_DEBIAN_ISO=$COMMON_PATH/$ISO_NAME.iso
WORKDIR=$COMMON_PATH/DEBIAN_ISO_WORKDIR
PRESEED_FILE=$COMMON_PATH/preseed.cfg
PRESEED_ISO=$COMMON_PATH/$ISO_NAME-preseeded.iso

function preseed(){
  ##### Scrub workdir
  sudo rm -rf $WORKDIR/*

  #### Mount image
  mkdir -p $WORKDIR/loopdir
  sudo mount -o loop $RAW_DEBIAN_ISO $WORKDIR/loopdir/

  #### Copy extracted/mounted image
  mkdir -p $WORKDIR/isodir
  cp -rT $WORKDIR/loopdir $WORKDIR/isodir

  # delete the temp loop dir
  sudo umount $WORKDIR/loopdir
  sudo rm -rf $WORKDIR/loopdir/

  #### unzip initrd
  sudo chmod +w -R $WORKDIR/isodir/install.amd/
  gunzip $WORKDIR/isodir/install.amd/initrd.gz

  #### add preseed file to initrd
  echo $PRESEED_FILE | cpio -H newc -o -A -F $WORKDIR/isodir/install.amd/initrd

  #### zip back initrd
  gzip $WORKDIR/isodir/install.amd/initrd
  sudo chmod -w -R $WORKDIR/isodir/install.amd/

  #### Fix md5sum
  cd $WORKDIR/isodir 
  sudo chmod +w md5sum.txt
  find -follow -type f ! -name md5sum.txt -print0 | xargs -0 md5sum > md5sum.txt
  sudo chmod -w md5sum.txt
  cd ..

  ##### Create ISO
  sudo chmod +w $WORKDIR/isodir/isolinux/isolinux.bin
  genisoimage -r -J -b isolinux/isolinux.bin -c isolinux/boot.cat \
            -no-emul-boot -boot-load-size 4 -boot-info-table \
            -o $PRESEED_ISO $WORKDIR/isodir/
  sudo chmod -w $WORKDIR/isodir/isolinux/isolinux.bin

  # commented out for checking the output image files
  # sudo rm -rf $WORKDIR/isodir/

}
preseed;

exit 0

実際のプロビジョニングファイルです。

#_preseed_V1

### Localization
d-i debian-installer/locale string en_US
### Keyboard selection.
d-i keyboard-configuration/xkb-keymap select us
### Network configuration
d-i netcfg/choose_interface select auto
d-i netcfg/get_hostname string someHostName
d-i netcfg/get_domain string someDomainname
d-i netcfg/wireless_wep string
### Mirror settings
d-i mirror/country string manual
d-i mirror/http/hostname string http.es.debian.org
d-i mirror/http/directory string /debian
d-i mirror/http/proxy string
# Suite to install.
d-i mirror/suite string testing
### Account setup
d-i passwd/root-password-crypted password $2b$10$/YuZPntPhCZfjEi3LNWXZer3W1HYiy25rgtoBged4nf026RNXfGzC
d-i passwd/user-fullname string firstName lastName
d-i passwd/username string myUsername
d-i passwd/user-password-crypted password $2b$10$/ly237ccHCsTATdtVGpP3eRs65Oe7BWdi58G1z.jfEoFw0./TfH1m
d-i passwd/user-default-groups string sudo audio video plugdev netdev
### Clock and time zone setup
d-i clock-setup/utc boolean true
d-i time/zone string America/New_York
d-i clock-setup/ntp boolean true
### Partitioning
# choosing the smallest partition first
d-i partman/early_command \
  string PRIMARYDISK=/dev/$(lsblk -o name sort \
  size --include 8 \
  | head -n 1) \
  debconf-set partman-auto/disk "$PRIMARYDISK";

d-i partman-auto/method string regular
d-i partman-auto/expert_recipe string        \
    boot-root ::                             \
        30000 30000 30000 ext4               \
        \$primary{ } \$bootable{ }           \
        method{ format } format{ }           \
        use_filesystem{ } filesystem{ ext4 } \
        mountpoint{ / } .                    \
                                             \
        219000 220000 220000 ext4            \
        method{ format } format{ }           \
        use_filesystem{ } filesystem{ ext4 } \
        mountpoint{ /home } .                

### Apt setup
d-i apt-setup/cdrom/set-first boolean false
d-i apt-setup/non-free boolean true
d-i apt-setup/contrib boolean true
### Package selection
tasksel tasksel/first multiselect standard
d-i pkgsel/include string build-essential
popularity-contest popularity-contest/participate boolean true
### Boot loader installation
d-i grub-installer/only_debian boolean true
d-i grub-installer/with_other_os boolean false
### Finishing up the installation
d-i finish-install/reboot_in_progress note

私が何が起こるのを期待しているのか

プリセットが利用可能である必要があります。持ち運べるどのコンピュータでも ISO を使用すると、何もクリックせずに Debian インストーラがpreseed.cfg自動的にオペレーティングシステムの読み込みと設定を開始します。

initrdメソッドが利用可能であることを読みました。

実際に何が起こったのか

プロビジョニングファイルがないかのようにインストールが続行され、一般インストールメニューを使用するように求められます。一般的な手動インストールプロセス。

私が試したこと

デバッグ方法:auto installation"initrdがまだ圧縮されているようで、リンクできません。"オプションを選択しました。

インストールメニューの削除を提案する別の記事を見つけました。試してみましたが、別のメニューバージョンに戻るようです。

graphical installクリックすると、自動的にプリセットを検索するように指示するなど、特定のサブメニューを変更する方法があるという他の記事は覚えていません。

また、仮想マシンにこのタスクを自動的に実行させることができることも読んでいます。

しかし、それは私が本当に欲しいものではありません。

ベストアンサー1

おすすめ記事