キックスタートで暗号化されたパーティションにパッケージをインストールしますか?

キックスタートで暗号化されたパーティションにパッケージをインストールしますか?

私はフォローしましたこれブログ記事では、暗号化されたパーティションに適したkickstartからluks暗号化されたパーティションを作成する方法について詳しく説明しています。

暗号化するパーティションは、キックスタートセクションでインストールしたいくつかの/var/libパッケージと同じようにインストールする必要があります。%packages

%packages私が経験している問題は、そのセクションのパッケージがインストールされるまで暗号化されたパーティションがインストールされていないようです。これは/var/lib、暗号化されたパーティションではなくルートパーティションの下に作成(およびインストール)されたことを意味します。

/var/libキックスタートの一部としてパッケージをインストールする前に、暗号化されたパーティションがインストールされていることを確認する方法はありますか?どの部分でこれが起こるべきですか?

ベストアンサー1

ここでも同じ問題が発生します。私が見つけたものは次のとおりです。

ks.cfg 方法:

文書によると、これは正しいです(私が読んだ方法は...)。

part / --size=8000 --grow --fstype=ext4 --encrypted --passphrase=somepassword

最終結果:

/dev/vda6 on / type ext4 (rw,relatime,errors=remount-ro)

暗号化されていない素晴らしい作品で、誰でも無料で視聴できます! :)

解決策:

Ubuntu(DebianおよびRedhat Automation Technology)で実行するには、ks.cfgとプロビジョニングファイルを混在させる必要があります。 Canonicalがなぜこのアプローチを選んだのかは少し混乱していると言うべきです。しかし、私が見つけたほとんどのドキュメントでは、自動化されたUbuntuインストールでks.cfgとks.preseedファイルを使用することをお勧めします。 mini.iso(ネットワークインストール)を使用している場合は、ks.preseedのみを使用でき、Debianのドキュメントに正確に従うことができます(私はこれを広く行いました)。上記の問題を解決するには:ディスク構成のks.preseedファイルに次のものを追加する必要があります。

インストーラはファイルシステムをマウントし、オペレーティングシステムをインストールします。最後に、必要に応じて%packagesディレクティブを使用できるようです。ただし、さらに制御が必要な場合は、プロビジョニングファイルを再利用することを検討してください。

インストールされたシステムの修正:

d-i preseed/late_command string \
    # the root filesystem is in /target
    mkdir -p /target/opt/scripts; \ 
    # in-target executes everything as if you were in the new system.
    in-target chmod +x /opt/rtd/scripts/post-install.sh; \ 


ディスク構成:

# --------------------------------------------------- #
#   Disk layout   
# --------------------------------------------------- #
#
## Set option to encrypt the hard disk:
d-i partman-auto/method string crypto

# Option to temporarily set full disk encryption password to automate the install below. 
# If you prefer to be propmpted during the system installation process comment out the 
# two crypto/passphrase options below. The disk encryption password can be changed at 
# anytime once the system is installed using the following command: 
#
#       tool      :   command   : device and partition number
#               cryptsetup luksChangeKey /dev/sda4 
#
#
d-i partman-crypto/passphrase password plaintextpassword-or-encrypted
d-i partman-crypto/passphrase-again password plaintextpassword-or-encrypted

# When disk encryption is enabled, skip wiping the partitions beforehand since it takes too much time.
d-i partman-auto-crypto/erase_disks boolean false
# Delete anything on the first hard drive, then define the actual layout of the disk 
# using and encrypted LVM volume for security. 
d-i partman-lvm/device_remove_lvm boolean true
d-i partman-lvm/device_remove_lvm_span boolean true
d-i partman-auto/purge_lvm_from_device boolean true
d-i partman-lvm/confirm boolean true
d-i partman-lvm/confirm_nooverwrite boolean true
d-i partman-auto-lvm/guided_size string max
d-i partman-auto-lvm/new_vg_name string crypt
# Use generic instead of vda & sda to ensure recipie is applied even if this install is run in KVM, vmware, virtualbox IDE or SATA.
# d-i partman-auto/disk string /dev/sdb 
d-i partman-auto/choose_recipe select root-encrypted
d-i partman-auto/expert_recipe string                         \
      root-encrypted ::                                       \
                    538 538 1075 free                         \
                    $primary                                  \
                    $iflabel{ gpt }                           \
                    $reusemethod{ }                           \
                    method{ efi } format{ }                   \
              .                                               \
              500 500 500 ext3                                \
                      $primary{ } $bootable{ }                \
                      method{ format } format{ }              \
                      use_filesystem{ } filesystem{ ext4 }    \
                      mountpoint{ /boot }                     \
                                                              \
              .                                               \
              2000 2000 2000 linux-swap                       \
                      $lvmok{ } lv_name{ swap }               \
                      in_vg { crypt }                         \
                      $primary{ }                             \
                      method{ swap } format{ }                \
              .                                               \
              500 10000 1000000000 ext4                       \
                      $lvmok{ } lv_name{ root }               \
                      in_vg { crypt }                         \
                      $primary{ }                             \
                      method{ format } format{ }              \
                      use_filesystem{ } filesystem{ ext4 }    \
                      mountpoint{ / }                         \
              .                                               \
              2000 2000 2000 ext4                             \
                      $primary{ }                             \
                      method{ keep }                          \
                      use_filesystem{ } filesystem{ ext4 }    \
                      label{ rescuedisk }                     \
              .

d-i partman-md/device_remove_md boolean true
d-i partman-md/confirm boolean true
d-i partman-basicfilesystems/no_mount_point boolean false
d-i partman-partitioning/confirm_write_new_label boolean true
d-i partman/choose_partition select finish
d-i partman/confirm boolean true
d-i partman/confirm_nooverwrite boolean true
# --------------------------------------------------- #

おすすめ記事