GithubHelp home page GithubHelp logo

Comments (4)

luxas avatar luxas commented on June 12, 2024

Yeah, when you say it, that's how it is.
The script takes the input /dev/sda and appends 1 and 2 for the partitions.
Thanks for observing this.
Which way is best to do it? Ask the user and provide options PART1=p1 PART2=p2 sudo sdcard/... for automating the process. What do you think?

But, how couldn't write.sh be executable by default?
I have to investigate it.

from kubernetes-on-arm.

nsteinmetz avatar nsteinmetz commented on June 12, 2024

I was thinking about write.sh being able to manage something like:

In pseudo code:

if $1 starts with "/dev/sdX": then :
    part1= /dev/sdX1
    part2= /dev/sdX2
elif $1 starts with "/dev/mmcblkX"; then :
    part1= /dev/mmcblkXp1
    part2= /dev/mmcblkXp2
else:
    exit()

... do some stuff with part1 and part2.

I don't know if there could be something else than these 2 cases.

from kubernetes-on-arm.

luxas avatar luxas commented on June 12, 2024

It's fully possible.
One could set it like this to handle every case (I don't either know if there are more cases than this):

# Special case
if $1 starts with "/dev/mmcblkX"; then :
    part1= ${1}p1
    part2= ${1}p2
else:
    # General case, /dev/sda, (/dev/hda?)
    part1= ${1}1
    part2= ${1}2

# Question the user about continuing
if $continue is some of (n|N); then
   exit
else: 
   # do stuff

from kubernetes-on-arm.

luxas avatar luxas commented on June 12, 2024

Oh, I didn't know that commits could automatically close issues.
Feel free to comment more if it isn't working in future releases.

from kubernetes-on-arm.

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.