Code Monkey home page Code Monkey logo

Comments (3)

deitch avatar deitch commented on August 24, 2024

We have a bunch of code in snapd / Ubuntu Core around creating partitions / structures that now via the ubuntu-image rewrite uses this library

Great!

It would be great both for creating images for consumption on physical media that has 4K physical sector size / block size and for our own VM based testing to be able to create disk images via some option that use 4K as the sector size instead of the default 512 that is currently hard-coded here in diskfs.go

Right. If it is an actual block device, it reads it from the block device here; if not, it just assumes 512 bytes here

It sounds reasonable to be able to override it.

Maybe a new function CreateWithSectorSize or some additional Format flag in Create()?

I think an additional flag is better than a proliferation of functions. We easily could have more parameters in the future, which can make it unwieldy. Granted, this is just a stylistic preference, but I am allowed to prefer. :-)

I have used variadic parameters in the past to keep things from growing too much or changing a signature, but that seems overkill here. Let's just add a parameter. On the other hand, that does break the existing API, which semver would indicate should cut a new release. I have no great desire to cut 2.0.0 just for this.

Eh, let's go for the parameter and not worry too much about semver's strict rules here.

Care to open a PR for it?

from go-diskfs.

anonymouse64 avatar anonymouse64 commented on August 24, 2024

Hi, I will try to take a stab at it next week, but if I don't get around to it, please by all means someone else can take over working on this issue.

from go-diskfs.

anonymouse64 avatar anonymouse64 commented on August 24, 2024

Thanks @sil2100 for working on this!

from go-diskfs.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.