Commit 8040cfa1 authored by Andrey Filippov's avatar Andrey Filippov

naming bug

parent d5901897
...@@ -285,7 +285,9 @@ class PC(): ...@@ -285,7 +285,9 @@ class PC():
bwrite = chunk_blocks - (blocks_skip % chunk_blocks) bwrite = chunk_blocks - (blocks_skip % chunk_blocks)
if (bwrite > blocks_load): if (bwrite > blocks_load):
bwrite = blocks_load bwrite = blocks_load
fname = dirname+"/"+"file_"+str(num_file)+".img" # fname = dirname+"/"+"file_"+str(num_file)+".img"
fname = "%s/file_%03d.img" %(dirname, num_file) #dirname+"/"+"file_"+str(num_file)+".img"
print("Aligning skip to chunks, downloading %d %d-byte blocks (skipping %d blocks) to %s"%(bwrite, block_size, blocks_skip, fname)) print("Aligning skip to chunks, downloading %d %d-byte blocks (skipping %d blocks) to %s"%(bwrite, block_size, blocks_skip, fname))
shout("sudo dd if="+part+" "+" of="+fname+" bs="+str(block_size)+" count="+str(bwrite)+" skip="+str(blocks_skip)) shout("sudo dd if="+part+" "+" of="+fname+" bs="+str(block_size)+" count="+str(bwrite)+" skip="+str(blocks_skip))
blocks_skip += bwrite blocks_skip += bwrite
...@@ -297,7 +299,8 @@ class PC(): ...@@ -297,7 +299,8 @@ class PC():
chunks_skip = blocks_skip // chunk_blocks # should be already multiple of chunks chunks_skip = blocks_skip // chunk_blocks # should be already multiple of chunks
if (chunks_write > file_chunks): if (chunks_write > file_chunks):
chunks_write = file_chunks chunks_write = file_chunks
fname = dirname+"/"+"file_"+str(num_file)+".img" # fname = dirname+"/"+"file_"+str(num_file)+".img"
fname = "%s/file_%03d.img" %(dirname, num_file) #dirname+"/"+"file_"+str(num_file)+".img"
print("Downloading %d %d-byte chunks, skipping %d chunks to %s"%(chunks_write, chunk_bytes, chunks_skip, fname)) print("Downloading %d %d-byte chunks, skipping %d chunks to %s"%(chunks_write, chunk_bytes, chunks_skip, fname))
shout("sudo dd if="+part+" "+" of="+fname+" bs="+str(chunk_bytes)+" count="+str(chunks_write)+" skip="+str(chunks_skip)) shout("sudo dd if="+part+" "+" of="+fname+" bs="+str(chunk_bytes)+" count="+str(chunks_write)+" skip="+str(chunks_skip))
bwrite = chunks_write * chunk_blocks bwrite = chunks_write * chunk_blocks
...@@ -306,7 +309,8 @@ class PC(): ...@@ -306,7 +309,8 @@ class PC():
num_file += 1 num_file += 1
# optionally write the remainder (< chunk), 1 block at a time # optionally write the remainder (< chunk), 1 block at a time
if (blocks_load > 0): if (blocks_load > 0):
fname = dirname+"/"+"file_"+str(num_file)+".img" # fname = dirname+"/"+"file_"+str(num_file)+".img"
fname = "%s/file_%03d.img" %(dirname, num_file) #dirname+"/"+"file_"+str(num_file)+".img"
print("Downloading last %d %d-byte blocks, skipping %d blocks to %s"%(blocks_load, block_size, blocks_skip, fname)) print("Downloading last %d %d-byte blocks, skipping %d blocks to %s"%(blocks_load, block_size, blocks_skip, fname))
shout("sudo dd if="+part+" "+" of="+fname+" bs="+str(block_size)+" count="+str(blocks_load)+" skip="+str(blocks_skip)) shout("sudo dd if="+part+" "+" of="+fname+" bs="+str(block_size)+" count="+str(blocks_load)+" skip="+str(blocks_skip))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment