Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to create root partition with squashfs type in debos #428

Open
venkata-pyla opened this issue Aug 10, 2023 · 2 comments
Open

How to create root partition with squashfs type in debos #428

venkata-pyla opened this issue Aug 10, 2023 · 2 comments

Comments

@venkata-pyla
Copy link
Contributor

Hi,

The curent image-paratition action creates the partitions using parted utility and it doesn't create squashfs type, so is there any way we can create the squashfs rootfs inside debos ?

@obbardc
Copy link
Member

obbardc commented Aug 10, 2023

What's your goal ?

perhaps the best thing to do could be to wrap this in a run action, e.g.:

- action: run
  description: Make a squashfs from the rootfs
  command: mksquashfs $ROOTDIR $ARTIFACTDIR/image.squashfs

@venkata-pyla
Copy link
Contributor Author

I want to add the squashfs image to my root partition defined in image-partition

Below is my scenario, we were trying to create image which will have multiple partitions and in that ROOTFS should be squashfs ,

 - action: image-partition
    description: "Creating RW partitions"
    imagename: "test.img"
    imagesize: 2GiB
    partitions:
      - name: EFI
        fs: fat32
        start: 1MiB
        end: 128MiB
        flags: [ boot, esp ]
      - name: ROOTFS
        fs: ext4
        start: 128MiB
        end: 1024MiB
      - name: HOME
        fs: ext4
        start: 1024MiB
        end: 1536MiB
      - name: VAR
        fs: ext4
        start: 1536MiB
        end: 2048MiB
    mountpoints:
      - mountpoint: /
        partition: ROOTFS
        options: [ rw, relatime, errors=remount-ro ]
      - mountpoint: /boot/efi
        partition: EFI
        buildtime: true
      - mountpoint: /home
        partition: HOME
        buildtime: true
      - mountpoint: /var
        partition: VAR
        buildtime: true

  - action: run
    description: "Create squashfs image."
    chroot: false
    command: mksquashfs $ROOTDIR $ARTIFACTDIR/squashfs.img

  - action: run
    description: "Post this any actions on ROOTFS are discarded in the final image."
    chroot: false
    command: true

  - action: run
    description: "Copy squashfs image to root partition in postporcess"
    postprocess: true
    command: dd if=$ARTIFACTDIR/squashfs.img of=$ARTIFACTDIR/test.img bs=1M seek=128 count=$(stat -c %s $ARTIFACTDIR/squashfs.img) conv=notrunc

With the above approach it requires informing developers not to add any actions for updating the rootfs, in another approach creating squashfs in postprocess which needs extraction of image then create squahsfs image and dd squashfs image to final image.

I am checking if there is any simpler way to do this or implement in debos as a separate action or update image-partition action to support this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants