~postmarketos/pmbootstrap-devel

This thread contains a patchset. You're looking at the original emails, but you may wish to use the patch review UI. Review patch
3 2

[PATCH pmbootstrap v2] install: initial implementation of flat btrfs layout

Details
Message ID
<170436606365.31622.8646592258649313487-0@git.sr.ht>
DKIM signature
missing
Download raw message
Patch: +25 -2
From: Jacob Ludvigsen <jacob.ludvigsen@protonmail.com>

---
Noticed I had used a noreply email address. Revised to use an actual
email address people can reach me with.

 pmb/install/_install.py | 20 ++++++++++++++++++--
 pmb/install/format.py   |  7 +++++++
 2 files changed, 25 insertions(+), 2 deletions(-)

diff --git a/pmb/install/_install.py b/pmb/install/_install.py
index 1adfe789..35020375 100644
--- a/pmb/install/_install.py
+++ b/pmb/install/_install.py
@@ -152,8 +152,12 @@ def create_home_from_skel(args):
    Create /home/{user} from /etc/skel
    """
    rootfs = args.work + "/chroot_native/mnt/install"
    if args.filesystem == "btrfs":
        pmb.helpers.run.root(args,
        ["btrfs", "subvol", "create", rootfs + "/home"])
    else:
        pmb.helpers.run.root(args, ["mkdir", rootfs + "/home"])
    homedir = rootfs + "/home/" + args.user
    pmb.helpers.run.root(args, ["mkdir", rootfs + "/home"])
    if os.path.exists(f"{rootfs}/etc/skel"):
        pmb.helpers.run.root(args, ["cp", "-a", f"{rootfs}/etc/skel", homedir])
    else:
@@ -757,7 +761,19 @@ def create_fstab(args, layout, suffix):
    boot_filesystem = args.deviceinfo["boot_filesystem"] or "ext2"
    root_filesystem = pmb.install.get_root_filesystem(args)

    fstab = f"""
    if root_filesystem == "btrfs":
        # btrfs gets separate subvolumes for root, var and home
        fstab = f"""
# <file system> <mount point> <type> <options> <dump> <pass>
{root_mount_point} / {root_filesystem} subvol=root,compress=zstd:2,ssd 0 0
{root_mount_point} /home {root_filesystem} subvol=home,compress=zstd:2,ssd 0 0
{root_mount_point} /var {root_filesystem} subvol=var,compress=zstd:2,ssd 0 0

{boot_mount_point} /boot {boot_filesystem} defaults 0 0
""".lstrip()

    else:
        fstab = f"""
# <file system> <mount point> <type> <options> <dump> <pass>
{root_mount_point} / {root_filesystem} defaults 0 0
{boot_mount_point} /boot {boot_filesystem} defaults 0 0
diff --git a/pmb/install/format.py b/pmb/install/format.py
index 6eebd1c6..21cf0579 100644
--- a/pmb/install/format.py
+++ b/pmb/install/format.py
@@ -124,6 +124,13 @@ def format_and_mount_root(args, device, root_label, disk):
    pmb.chroot.root(args, ["mkdir", "-p", mountpoint])
    pmb.chroot.root(args, ["mount", device, mountpoint])

    # Create separate subvolumes if root filesystem is btrfs
    if filesystem == "btrfs":
        pmb.chroot.root(args,
            ["btrfs", "subvol", "create", mountpoint + "/root"])
        pmb.chroot.root(args,
            ["btrfs", "subvol", "create", mountpoint + "/var"])


def format(args, layout, boot_label, root_label, disk):
    """
-- 
2.38.5

[pmbootstrap/patches/.build.yml] build failed

builds.sr.ht <builds@sr.ht>
Details
Message ID
<CY5VCS6G8WN6.E2YONRBUKXQ5@cirno2>
In-Reply-To
<170436606365.31622.8646592258649313487-0@git.sr.ht> (view parent)
DKIM signature
missing
Download raw message
pmbootstrap/patches/.build.yml: FAILED in 24s

[install: initial implementation of flat btrfs layout][0] v2 from [~papiris][1]

[0]: https://lists.sr.ht/~postmarketos/pmbootstrap-devel/patches/48288
[1]: jacob.ludvigsen@protonmail.com

✗ #1126887 FAILED pmbootstrap/patches/.build.yml https://builds.sr.ht/~postmarketos/job/1126887

Re: [PATCH pmbootstrap v2] install: initial implementation of flat btrfs layout

Details
Message ID
<CYA9IWNTIPDC.2KRV3BRNE09G2@pm-mail-aerc>
In-Reply-To
<170436606365.31622.8646592258649313487-0@git.sr.ht> (view parent)
DKIM signature
missing
Download raw message
On Sat Dec 23, 2023 at 1:57 AM CET, ~papiris wrote:
> From: Jacob Ludvigsen <jacob.ludvigsen@protonmail.com>

This is very nice, thank you!
I've tested it with qemu.

Reviewed-by: Oliver Smith <ollieparanoid@postmarketos.org>
Tested-by: Oliver Smith <ollieparanoid@postmarketos.org>
>
> ---
> Noticed I had used a noreply email address. Revised to use an actual
> email address people can reach me with.
>
>  pmb/install/_install.py | 20 ++++++++++++++++++--
>  pmb/install/format.py   |  7 +++++++
>  2 files changed, 25 insertions(+), 2 deletions(-)
>
> diff --git a/pmb/install/_install.py b/pmb/install/_install.py
> index 1adfe789..35020375 100644
> --- a/pmb/install/_install.py
> +++ b/pmb/install/_install.py
> @@ -152,8 +152,12 @@ def create_home_from_skel(args):
>      Create /home/{user} from /etc/skel
>      """
>      rootfs = args.work + "/chroot_native/mnt/install"
> +    if args.filesystem == "btrfs":
> +        pmb.helpers.run.root(args,
> +        ["btrfs", "subvol", "create", rootfs + "/home"])
> +    else:
> +        pmb.helpers.run.root(args, ["mkdir", rootfs + "/home"])
>      homedir = rootfs + "/home/" + args.user
> -    pmb.helpers.run.root(args, ["mkdir", rootfs + "/home"])
>      if os.path.exists(f"{rootfs}/etc/skel"):
>          pmb.helpers.run.root(args, ["cp", "-a", f"{rootfs}/etc/skel", homedir])
>      else:
> @@ -757,7 +761,19 @@ def create_fstab(args, layout, suffix):
>      boot_filesystem = args.deviceinfo["boot_filesystem"] or "ext2"
>      root_filesystem = pmb.install.get_root_filesystem(args)
>  
> -    fstab = f"""
> +    if root_filesystem == "btrfs":
> +        # btrfs gets separate subvolumes for root, var and home
> +        fstab = f"""
> +# <file system> <mount point> <type> <options> <dump> <pass>
> +{root_mount_point} / {root_filesystem} subvol=root,compress=zstd:2,ssd 0 0
> +{root_mount_point} /home {root_filesystem} subvol=home,compress=zstd:2,ssd 0 0
> +{root_mount_point} /var {root_filesystem} subvol=var,compress=zstd:2,ssd 0 0
> +
> +{boot_mount_point} /boot {boot_filesystem} defaults 0 0
> +""".lstrip()
> +
> +    else:
> +        fstab = f"""
>  # <file system> <mount point> <type> <options> <dump> <pass>
>  {root_mount_point} / {root_filesystem} defaults 0 0
>  {boot_mount_point} /boot {boot_filesystem} defaults 0 0
> diff --git a/pmb/install/format.py b/pmb/install/format.py
> index 6eebd1c6..21cf0579 100644
> --- a/pmb/install/format.py
> +++ b/pmb/install/format.py
> @@ -124,6 +124,13 @@ def format_and_mount_root(args, device, root_label, disk):
>      pmb.chroot.root(args, ["mkdir", "-p", mountpoint])
>      pmb.chroot.root(args, ["mount", device, mountpoint])
>  
> +    # Create separate subvolumes if root filesystem is btrfs
> +    if filesystem == "btrfs":
> +        pmb.chroot.root(args,
> +            ["btrfs", "subvol", "create", mountpoint + "/root"])
> +        pmb.chroot.root(args,
> +            ["btrfs", "subvol", "create", mountpoint + "/var"])
> +
>  
>  def format(args, layout, boot_label, root_label, disk):
>      """
> -- 
> 2.38.5

Re: [PATCH pmbootstrap v2] install: initial implementation of flat btrfs layout

Details
Message ID
<170481592331.2313.316207703846564471.b4-ty@postmarketos.org>
In-Reply-To
<170436606365.31622.8646592258649313487-0@git.sr.ht> (view parent)
DKIM signature
missing
Download raw message
On Sat, 23 Dec 2023 01:57:07 +0100, ~papiris wrote:
> 


Applied, thanks!

[1/1] install: initial implementation of flat btrfs layout
      commit: 392e82db07aecdbe69e8f1a5cfefe7e7db9293cb

Best regards,
-- 
Oliver Smith <ollieparanoid@postmarketos.org>
Reply to thread Export thread (mbox)