imgutils: make do_graft work for files too
This is needed to make --icon work in mkefiboot
This commit is contained in:
parent
3ec9a12bf6
commit
9699e25045
@ -22,6 +22,7 @@ logger = logging.getLogger("pylorax.imgutils")
|
|||||||
|
|
||||||
import os, tempfile
|
import os, tempfile
|
||||||
from os.path import join, dirname
|
from os.path import join, dirname
|
||||||
|
from pylorax.sysutils import cpfile
|
||||||
from subprocess import *
|
from subprocess import *
|
||||||
|
|
||||||
######## Functions for making container images (cpio, squashfs) ##########
|
######## Functions for making container images (cpio, squashfs) ##########
|
||||||
@ -127,7 +128,10 @@ def do_grafts(grafts, dest, preserve=True):
|
|||||||
targetdir = join(dest, dirname(imgpath))
|
targetdir = join(dest, dirname(imgpath))
|
||||||
if not os.path.isdir(targetdir):
|
if not os.path.isdir(targetdir):
|
||||||
os.makedirs(targetdir)
|
os.makedirs(targetdir)
|
||||||
copytree(filename, join(dest, imgpath), preserve)
|
if os.path.isdir(filename):
|
||||||
|
copytree(filename, join(dest, imgpath), preserve)
|
||||||
|
else:
|
||||||
|
cpfile(filename, join(dest, imgpath))
|
||||||
|
|
||||||
def round_to_blocks(size, blocksize):
|
def round_to_blocks(size, blocksize):
|
||||||
'''If size isn't a multiple of blocksize, round up to the next multiple'''
|
'''If size isn't a multiple of blocksize, round up to the next multiple'''
|
||||||
|
Loading…
Reference in New Issue
Block a user