LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   need help with script syntax,etc (https://www.linuxquestions.org/questions/linux-general-1/need-help-with-script-syntax-etc-831360/)

linus72 09-10-2010 07:19 AM

need help with script syntax,etc
 
so I'm trying to make a live usb persistence wizard for Debian/Ubuntu
from SalixOS' source usbpersistencewizard

so, the ubuntu one works great
however the debian procedure for making a live-rw file is different than ubuntu's casper-rw file

casper-rw command
Code:

  SIZE=$1
FREE=$('df' -k .|tail -n1|awk '{print $4}')
AFTER=$(( $FREE - 1024 * $SIZE ))
if [ $AFTER -gt 0 ]; then
  dd if=/dev/zero of=casper-rw bs=1M count=$SIZE
  mkfs.ext3 -F casper-rw

live-rw command

Code:

SIZE=$1
FREE=$('df' -k .|tail -n1|awk '{print $4}')
AFTER=$(( $FREE - 1024 * $SIZE ))
if [ $AFTER -gt 0 ]; then
  dd if=/dev/null of=live-rw bs=$SIZE seek=1
  mkfs.ext2 -F live-rw

so, bs=$SIZE does not work because the command needs a M or G for MB or GB after it,etc
bs=1024M would create a 1gb live-rw file,etc

how do I add the M or G parameter to $SIZE?
thx

druuna 09-10-2010 07:25 AM

Hi

bs=${SIZE}M or bs=${SIZE}G

Hope this helps.

linus72 09-10-2010 07:48 AM

your sub-genius baby
thanks alot Druuna!

a little background; I'm adding this persistence wizard to my nFluxOS debian/ubuntu builds
as

a) debian doesn't have a gui way to create one

b) with ubuntu you must use usb-creator to make a casper-rw using gui

c) the persistence wizard also works off livecd too whereas ubuntu/debian doesn't have gui way to save stuff on livecd session

druuna 09-10-2010 07:53 AM

Hi,

You're welcome :)


All times are GMT -5. The time now is 06:15 PM.