Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
E
elphel-tools-update
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Elphel
elphel-tools-update
Commits
e930191b
Commit
e930191b
authored
Nov 25, 2016
by
Oleg Dzhimiev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
disabled ISO
parent
5d285fbd
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
9 deletions
+17
-9
create_img_iso.py
create_img_iso.py
+17
-9
No files found.
create_img_iso.py
View file @
e930191b
...
@@ -41,7 +41,7 @@ import time
...
@@ -41,7 +41,7 @@ import time
IMG_NAME
=
"sdimage.img"
IMG_NAME
=
"sdimage.img"
ISO_NAME
=
"sdimage.iso"
ISO_NAME
=
"sdimage.iso"
SDCARD_SIZE
=
4
000
SDCARD_SIZE
=
3
000
PT_TYPE
=
"msdos"
PT_TYPE
=
"msdos"
...
@@ -73,6 +73,9 @@ def create_empty_img(name,sizeM):
...
@@ -73,6 +73,9 @@ def create_empty_img(name,sizeM):
shout
(
"dd if=/dev/zero of="
+
name
+
" bs=1M count="
+
str
(
sizeM
))
shout
(
"dd if=/dev/zero of="
+
name
+
" bs=1M count="
+
str
(
sizeM
))
print
(
"== Create image file: "
+
IMG_NAME
)
print
(
"== Create image file: "
+
IMG_NAME
)
if
os
.
path
.
isfile
(
IMG_NAME
):
shout
(
"rm -rf "
+
IMG_NAME
)
create_empty_img
(
IMG_NAME
,
SDCARD_SIZE
)
create_empty_img
(
IMG_NAME
,
SDCARD_SIZE
)
shout
(
"parted "
+
IMG_NAME
+
" mktable "
+
PT_TYPE
)
shout
(
"parted "
+
IMG_NAME
+
" mktable "
+
PT_TYPE
)
...
@@ -103,8 +106,10 @@ while not devs_created:
...
@@ -103,8 +106,10 @@ while not devs_created:
shout
(
"mkfs.vfat /dev/mapper/loop0p1 -F 32 -n "
+
BOOT_LABEL
)
shout
(
"mkfs.vfat /dev/mapper/loop0p1 -F 32 -n "
+
BOOT_LABEL
)
shout
(
"mkfs.ext4 /dev/mapper/loop0p2 -L "
+
ROOT_LABEL
)
shout
(
"mkfs.ext4 /dev/mapper/loop0p2 -L "
+
ROOT_LABEL
)
if
not
os
.
path
.
isdir
(
"tmp"
):
shout
(
"mkdir tmp"
)
shout
(
"mkdir tmp"
)
else
:
shout
(
"umount tmp"
)
print
(
"== copy boot to /dev/mapper/loop0p1"
)
print
(
"== copy boot to /dev/mapper/loop0p1"
)
shout
(
"mount /dev/mapper/loop0p1 tmp"
)
shout
(
"mount /dev/mapper/loop0p1 tmp"
)
...
@@ -118,19 +123,22 @@ shout("mount /dev/mapper/loop0p2 tmp")
...
@@ -118,19 +123,22 @@ shout("mount /dev/mapper/loop0p2 tmp")
shout
(
"tar -C tmp/ -xzpf "
+
ROOT_ARCHIVE
)
shout
(
"tar -C tmp/ -xzpf "
+
ROOT_ARCHIVE
)
shout
(
"umount tmp"
)
shout
(
"umount tmp"
)
#sys.exit()
shout
(
"rm -rf tmp"
)
shout
(
"rm -rf tmp"
)
#print("== convert img to iso")
#http://www.linuxquestions.org/questions/linux-software-2/how-to-convert-img-to-iso-files-325650/
#shout("mkisofs -f -r -udf -o "+ISO_NAME+" "+IMG_NAME)
#shout("dd if=/dev/loop0 of="+ISO_NAME)
print
(
"== kpartx removes devices"
)
print
(
"== kpartx removes devices"
)
shout
(
"kpartx -dv "
+
IMG_NAME
)
shout
(
"kpartx -dv "
+
IMG_NAME
)
print
(
"== convert img to iso"
)
#http://www.linuxquestions.org/questions/linux-software-2/how-to-convert-img-to-iso-files-325650/
shout
(
"mkisofs -f -r -udf -o "
+
ISO_NAME
+
" "
+
IMG_NAME
)
print
(
"== compress img"
)
print
(
"== compress img"
)
shout
(
"tar -czvf "
+
IMG_NAME
+
".tar.gz "
+
IMG_NAME
)
shout
(
"tar -czvf "
+
IMG_NAME
+
".tar.gz "
+
IMG_NAME
)
print
(
"== compress iso"
)
#
print("== compress iso")
shout
(
"tar -czvf "
+
ISO_NAME
+
".tar.gz "
+
ISO_NAME
)
#
shout("tar -czvf "+ISO_NAME+".tar.gz "+ISO_NAME)
print
(
"Done"
)
print
(
"Done"
)
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment