[puredyne] bash again

classic Classic list List threaded Threaded
9 messages Options
enrike enrike
Reply | Threaded
Open this post in threaded view
|

[puredyne] bash again

hi

cat /usr/share/bouilloncube/sh/grub2/grub.cfg.in | sed -e
's/\${BLKID}/'${BLKID}'/g' >  ${DEVMOUNT}/boot/grub/grub.cfg

could anyone describe in pseudocode what is this doing? i think it is
concatenating the content of some files into grub.cfg but i am not clear
about the details

thanks

enrike

---
[hidden email]
http://identi.ca/group/puredyne
irc://irc.goto10.org/puredyne
DanS DanS
Reply | Threaded
Open this post in threaded view
|

Re: [puredyne] bash again

2010/6/4 enrike <[hidden email]>:
> hi
>
> cat /usr/share/bouilloncube/sh/grub2/grub.cfg.in

Output the contents of this file (a template for grub.cfg) to...

> |

...send its contents into...

> sed -e 's/\${BLKID}/'${BLKID}'/g'

...a command which replaces all occurrences of ${BLKID} with the
actual value of BLKID (which is determined further up the script)
and...

> >

...writes the resulting output to...

> ${DEVMOUNT}/boot/grub/grub.cfg

this file.

HTH
Dan

---
[hidden email]
http://identi.ca/group/puredyne
irc://irc.goto10.org/puredyne
enrike enrike
Reply | Threaded
Open this post in threaded view
|

Re: [puredyne] bash again

ok, thanks! now it is more clear. i am finding bash quite obscure
sometimes...

or., 2010.eko ekaren 04a 15:45(e)an, Dan S(e)k idatzi zuen:

> 2010/6/4 enrike<[hidden email]>:
>> hi
>>
>> cat /usr/share/bouilloncube/sh/grub2/grub.cfg.in
>
> Output the contents of this file (a template for grub.cfg) to...
>
>> |
>
> ...send its contents into...
>
>> sed -e 's/\${BLKID}/'${BLKID}'/g'
>
> ...a command which replaces all occurrences of ${BLKID} with the
> actual value of BLKID (which is determined further up the script)
> and...
>
>>>
>
> ...writes the resulting output to...
>
>> ${DEVMOUNT}/boot/grub/grub.cfg
>
> this file.
>
> HTH
> Dan
>
> ---
> [hidden email]
> http://identi.ca/group/puredyne
> irc://irc.goto10.org/puredyne
>


---
[hidden email]
http://identi.ca/group/puredyne
irc://irc.goto10.org/puredyne
enrike enrike
Reply | Threaded
Open this post in threaded view
|

Re: [puredyne] bash again

In reply to this post by DanS
what about this?

du -sb /live/image | cut -f1

I know it calculates the size of the first partition but i am not sure
how, the cut -f1 confuses me. I am not sure i can translate this line to
python. I am now running it with os.popen and returning the output of
the subprocess.

i am getting very close to have the python version ready, next step
would be to add a GTK GUI to control it.

thanks again...


or., 2010.eko ekaren 04a 15:45(e)an, Dan S(e)k idatzi zuen:

> 2010/6/4 enrike<[hidden email]>:
>> hi
>>
>> cat /usr/share/bouilloncube/sh/grub2/grub.cfg.in
>
> Output the contents of this file (a template for grub.cfg) to...
>
>> |
>
> ...send its contents into...
>
>> sed -e 's/\${BLKID}/'${BLKID}'/g'
>
> ...a command which replaces all occurrences of ${BLKID} with the
> actual value of BLKID (which is determined further up the script)
> and...
>
>>>
>
> ...writes the resulting output to...
>
>> ${DEVMOUNT}/boot/grub/grub.cfg
>
> this file.
>
> HTH
> Dan
>
> ---
> [hidden email]
> http://identi.ca/group/puredyne
> irc://irc.goto10.org/puredyne
>


---
[hidden email]
http://identi.ca/group/puredyne
irc://irc.goto10.org/puredyne
Aymeric Mansoux Aymeric Mansoux
Reply | Threaded
Open this post in threaded view
|

Re: [puredyne] bash again

enrike said :
> what about this?
>
> du -sb /live/image | cut -f1

This cut splits the output of the pipe, after the 1st element, it would be
roughly translated in Python as:

output.split()[0]

 
> I know it calculates the size of the first partition but i am not
> sure how, the cut -f1 confuses me. I am not sure i can translate
> this line to python. I am now running it with os.popen and returning
> the output of the subprocess.

BTW, os.popen is obsolete, check the subprocess module instead.
http://docs.python.org/library/subprocess.html

 
> i am getting very close to have the python version ready, next step
> would be to add a GTK GUI to control it.

woohoo :D

a.
--
http://su.kuri.mu


---
[hidden email]
http://identi.ca/group/puredyne
irc://irc.goto10.org/puredyne
alejoo alejoo
Reply | Threaded
Open this post in threaded view
|

Re: [puredyne] bash again

ei all, this is just a quick suggestion..
will it be possible enrike to add an option to create the partitions
in a way that the key could be also prepared for booting macs? that
will be a real kick to many.

saludos,
/a

On Sat, Jun 5, 2010 at 8:52 AM, Aymeric Mansoux <[hidden email]> wrote:

> enrike said :
>> what about this?
>>
>> du -sb /live/image | cut -f1
>
> This cut splits the output of the pipe, after the 1st element, it would be
> roughly translated in Python as:
>
> output.split()[0]
>
>
>> I know it calculates the size of the first partition but i am not
>> sure how, the cut -f1 confuses me. I am not sure i can translate
>> this line to python. I am now running it with os.popen and returning
>> the output of the subprocess.
>
> BTW, os.popen is obsolete, check the subprocess module instead.
> http://docs.python.org/library/subprocess.html
>
>
>> i am getting very close to have the python version ready, next step
>> would be to add a GTK GUI to control it.
>
> woohoo :D
>
> a.
> --
> http://su.kuri.mu
>
>
> ---
> [hidden email]
> http://identi.ca/group/puredyne
> irc://irc.goto10.org/puredyne
>

---
[hidden email]
http://identi.ca/group/puredyne
irc://irc.goto10.org/puredyne
Ricardo Gabriel Herdt Ricardo Gabriel Herdt
Reply | Threaded
Open this post in threaded view
|

Re: [puredyne] bash again

Don't think it's possible, since it's not pure:dyne's fault. AFAIK the
default mac boot manager doesn't allow you to boot from pen-drives.
The only solution is to install something like rEFIt or Grub. There
are some tutorials on the internet.

2010/6/5 alejo d <[hidden email]>:
> ei all, this is just a quick suggestion..
> will it be possible enrike to add an option to create the partitions
> in a way that the key could be also prepared for booting macs? that
> will be a real kick to many.
>

---
[hidden email]
http://identi.ca/group/puredyne
irc://irc.goto10.org/puredyne
enrike enrike
Reply | Threaded
Open this post in threaded view
|

Re: [puredyne] bash again

In reply to this post by Aymeric Mansoux
lr., 2010.eko ekaren 05a 08:52(e)an, Aymeric Mansoux(e)k idatzi zuen:
> enrike said :
>> what about this?
>>
>> du -sb /live/image | cut -f1
>
> This cut splits the output of the pipe, after the 1st element, it would be
> roughly translated in Python as:
>
> output.split()[0]

thanks. i will leave this for later as it is in the live part of the
ifs. i am focusing now on making live device from an .iso

>> I know it calculates the size of the first partition but i am not
>> sure how, the cut -f1 confuses me. I am not sure i can translate
>> this line to python. I am now running it with os.popen and returning
>> the output of the subprocess.
>
> BTW, os.popen is obsolete, check the subprocess module instead.
> http://docs.python.org/library/subprocess.html

yes i know but i find easier to work using os.popen and os.system. when
i have something running i will change them to subprocess.Popen

>> i am getting very close to have the python version ready, next step
>> would be to add a GTK GUI to control it.
>
> woohoo :D





---
[hidden email]
http://identi.ca/group/puredyne
irc://irc.goto10.org/puredyne
Aymeric Mansoux Aymeric Mansoux
Reply | Threaded
Open this post in threaded view
|

Re: [puredyne] bash again

In reply to this post by Ricardo Gabriel Herdt
Ricardo G. Herdt said :
> Don't think it's possible, since it's not pure:dyne's fault. AFAIK the
> default mac boot manager doesn't allow you to boot from pen-drives.
> The only solution is to install something like rEFIt or Grub. There
> are some tutorials on the internet.

It should be possible to have both according to this discussion:
https://bugs.launchpad.net/puredyne-live/+bug/508802

a.
--
http://su.kuri.mu


---
[hidden email]
http://identi.ca/group/puredyne
irc://irc.goto10.org/puredyne