• Installer with custom partitioner/filesystem package question

    From Aaron Goulding@21:1/5 to All on Mon Feb 5 23:00:02 2024
    Hey all!

    So I am attempting to build a custom Deb12 installer where the goal is to
    be able to do a zerotouch install to a system (currently using preseeding)
    and have it set up the partitioning for an encrypted root. Normally I'd
    just use preseeding entirely, but partman-auto-crypto doesn't allow for
    setting up encryption WITHOUT the use of LVM, which I'm not allowed to use
    in our environment.

    I had e-mailed several months ago to see about possibly updating partman-auto-crypto, but in the mean time I'm trying to get something
    working internally. I found https://github.com/thoto/partrep and used that
    as a basis for how to build a package that replaces partman, and wrote my
    own handling for getting things set up correctly in our environment.

    In running install tests with this, I can see it's successfully partitioned
    the root disk, set up LUKS based dm crypt on the root partition,
    formatted and mounted the partitions, wrote out /etc/fstab and
    /etc/crypttab, and queued the correct target packages. My package exits
    with 0 correctly.

    My problem comes when the next step of the installer runs, and the base-installer tries to run debootstrap. The install process freezes, then
    the base-installer package exits with a non-zero code. I can't seem to find
    any more info from it though. Interestingly, if I go into the menu and
    manually run base-installer again, the install completes successfully.

    I have gone through and extracted both the original Deb12 initrd.gz as well
    as my altered one and ran a diff on every file. Other than the additional
    files from my package, and the extra entries in /var/lib/dpkg/status for
    the new package and it's dependencies (bzpartrep, crypto-dm-modules, cryptsetup-udeb, di-utils-mapdevfs, disk-detect, dmidecode-udeb,
    dmsetup-udeb, dosfsutils-udeb, e2fsprogs-udeb, efi-modules,
    liibargon2-1-udeb, libcryptsetup12-udeb, libdevmapper1.02.1-udeb, libjson-c5-udeb, libparted2-udeb, libpopt0-udeb, md-modules, and
    parted-udeb)

    For reference, here is part of the debian/control file:
    Package: bzpartrep
    Package-Type: udeb
    Architecture: any
    Depends: ${shlibs:Depends}, ${misc:Depends}, e2fsprogs-udeb,
    dosfstools-udeb, efi-modules, archdetect, harddrive-detection, di-utils-mapdevfs, di-utils, cdebconf-udeb, cryptsetup-udeb,
    crypto-modules, crypto-dm-modules, parted-udeb
    Provides: partman-base, made-filesystems, mounted-partitions, partitioned-harddrives, created-fstab
    Installer-Menu-Item: 4199
    Description: Encrypted partition partman alternative

    Any suggestions, or things I'm missing?

    Thanks!
    -Aaron

    --
    This email, including its contents and any attachment(s), may contain confidential and/or proprietary information and is solely for the review
    and use of the intended recipient(s). If you have received this email in
    error, please notify the sender and permanently delete this email, its
    content, and any attachment(s). Any disclosure, copying, or taking of any action in reliance on an email received in error is strictly prohibited.

    <div dir="ltr">Hey all!<div><br></div><div>So I am attempting to build a custom Deb12 installer where the goal is to be able to do a zerotouch install to a system (currently using preseeding) and have it set up the partitioning for an encrypted root.
    Normally I&#39;d just use preseeding entirely, but partman-auto-crypto doesn&#39;t allow for setting up encryption WITHOUT the use of LVM, which I&#39;m not allowed to use in our environment.</div><div><br></div><div>I had e-mailed several months ago to
    see about possibly updating partman-auto-crypto, but in the mean time I&#39;m trying to get something working internally. I found <a href="https://github.com/thoto/partrep">https://github.com/thoto/partrep</a> and used that as a basis for how to build
    a package that replaces partman, and wrote my own handling for getting things set up correctly in our environment.</div><div><br></div><div>In running install tests with this, I can see it&#39;s successfully partitioned the root disk, set up LUKS based
    dm crypt on the root partition, formatted and mounted the partitions, wrote out /etc/fstab and /etc/crypttab, and queued the correct target packages. My package exits with 0 correctly.</div><div><br></div><div>My problem comes when the next step of the
    installer runs, and the base-installer tries to run debootstrap. The install process freezes, then the base-installer package exits with a non-zero code. I can&#39;t seem to find any more info from it though. Interestingly, if I go into the menu and
    manually run base-installer again, the install completes successfully. </div><div><br></div><div>I have gone through and extracted both the original Deb12 initrd.gz as well as my altered one and ran a diff on every file. Other than the additional files
    from my package, and the extra entries in /var/lib/dpkg/status for the new package and it&#39;s dependencies (bzpartrep, crypto-dm-modules, cryptsetup-udeb, di-utils-mapdevfs, disk-detect, dmidecode-udeb, dmsetup-udeb, dosfsutils-udeb, e2fsprogs-udeb,
    efi-modules, liibargon2-1-udeb, libcryptsetup12-udeb, libdevmapper1.02.1-udeb, libjson-c5-udeb, libparted2-udeb, libpopt0-udeb, md-modules, and parted-udeb)<br><br>For reference, here is part of the debian/control file:<br>Package: bzpartrep<br>Package-
    Type: udeb<br>Architecture: any<br>Depends: ${shlibs:Depends}, ${misc:Depends}, e2fsprogs-udeb, dosfstools-udeb, efi-modules, archdetect, harddrive-detection, di-utils-mapdevfs, di-utils, cdebconf-udeb, cryptsetup-udeb, crypto-modules, crypto-dm-modules,
    parted-udeb<br>Provides: partman-base, made-filesystems, mounted-partitions, partitioned-harddrives, created-fstab<br>Installer-Menu-Item: 4199<br>Description: Encrypted partition partman alternative<br></div><div><br></div><div>Any suggestions, or
    things I&#39;m missing?</div><div><br></div><div>Thanks!</div><div>-Aaron</div></div>


    <span style="white-space:pre-wrap"><font size="2" color="#808080">This email, including its contents and any attachment(s), may contain confidential and/or proprietary information and is solely for the review and use of the intended recipient(s). If you
    have received this email in error, please notify the sender and permanently delete this email, its content, and any attachment(s). Any disclosure, copying, or taking of any action in reliance on an email received in error is strictly prohibited.</font></
    span><br>

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Aaron Goulding@21:1/5 to All on Tue Feb 6 21:30:01 2024
    Update: So a suggestion for anyone who runs into anything similar, run your tests on another machine if possible. It turns out, my NVME was beginning
    to fail, and the install proceeds properly now.
    -Aaron

    On Mon, Feb 5, 2024 at 1:23 PM Aaron Goulding <agoulding@backblaze.com> wrote:

    Hey all!

    So I am attempting to build a custom Deb12 installer where the goal is to
    be able to do a zerotouch install to a system (currently using preseeding) and have it set up the partitioning for an encrypted root. Normally I'd
    just use preseeding entirely, but partman-auto-crypto doesn't allow for setting up encryption WITHOUT the use of LVM, which I'm not allowed to use
    in our environment.

    I had e-mailed several months ago to see about possibly updating partman-auto-crypto, but in the mean time I'm trying to get something
    working internally. I found https://github.com/thoto/partrep and used
    that as a basis for how to build a package that replaces partman, and wrote my own handling for getting things set up correctly in our environment.

    In running install tests with this, I can see it's successfully
    partitioned the root disk, set up LUKS based dm crypt on the root
    partition, formatted and mounted the partitions, wrote out /etc/fstab and /etc/crypttab, and queued the correct target packages. My package exits
    with 0 correctly.

    My problem comes when the next step of the installer runs, and the base-installer tries to run debootstrap. The install process freezes, then the base-installer package exits with a non-zero code. I can't seem to find any more info from it though. Interestingly, if I go into the menu and manually run base-installer again, the install completes successfully.

    I have gone through and extracted both the original Deb12 initrd.gz as
    well as my altered one and ran a diff on every file. Other than the additional files from my package, and the extra entries in /var/lib/dpkg/status for the new package and it's dependencies (bzpartrep, crypto-dm-modules, cryptsetup-udeb, di-utils-mapdevfs, disk-detect, dmidecode-udeb, dmsetup-udeb, dosfsutils-udeb, e2fsprogs-udeb, efi-modules, liibargon2-1-udeb, libcryptsetup12-udeb, libdevmapper1.02.1-udeb, libjson-c5-udeb, libparted2-udeb, libpopt0-udeb, md-modules, and
    parted-udeb)

    For reference, here is part of the debian/control file:
    Package: bzpartrep
    Package-Type: udeb
    Architecture: any
    Depends: ${shlibs:Depends}, ${misc:Depends}, e2fsprogs-udeb,
    dosfstools-udeb, efi-modules, archdetect, harddrive-detection, di-utils-mapdevfs, di-utils, cdebconf-udeb, cryptsetup-udeb,
    crypto-modules, crypto-dm-modules, parted-udeb
    Provides: partman-base, made-filesystems, mounted-partitions, partitioned-harddrives, created-fstab
    Installer-Menu-Item: 4199
    Description: Encrypted partition partman alternative

    Any suggestions, or things I'm missing?

    Thanks!
    -Aaron


    --
    This email, including its contents and any attachment(s), may contain confidential and/or proprietary information and is solely for the review
    and use of the intended recipient(s). If you have received this email in error, please notify the sender and permanently delete this email, its content, and any attachment(s). Any disclosure, copying, or taking of any action in reliance on an email received in error is strictly prohibited.

    <div dir="ltr">Update: So a suggestion for anyone who runs into anything similar, run your tests on another machine if possible. It turns out, my NVME was beginning to fail, and the install proceeds properly now.<div>-Aaron</div></div><br><div class="
    gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, Feb 5, 2024 at 1:23 PM Aaron Goulding &lt;<a href="mailto:agoulding@backblaze.com">agoulding@backblaze.com</a>&gt; wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;
    border-left:1px solid rgb(204,204,204);padding-left:1ex"><div di