run: created hybrid MBR for image/disk

Issue #2778
This commit is contained in:
Alexander Boettcher 2018-05-15 14:35:04 +02:00 committed by Christian Helmuth
parent 0efa67893e
commit b1389416d2

View File

@ -15,6 +15,7 @@ proc image_disk_size { } { return [get_cmd_arg --image-disk-size 0] }
# #
proc run_image { {unused ""} } { proc run_image { {unused ""} } {
requires_installation_of gdisk
requires_installation_of parted requires_installation_of parted
requires_installation_of e2cp requires_installation_of e2cp
@ -74,6 +75,10 @@ proc run_image { {unused ""} } {
# create partition table entry pointing to the content # create partition table entry pointing to the content
catch { exec parted -a none [run_dir].img -- mkpart Fix GENODE* ext2 [expr $first_sector]s ${last_sector}s } catch { exec parted -a none [run_dir].img -- mkpart Fix GENODE* ext2 [expr $first_sector]s ${last_sector}s }
# create hybrid MBR
exec echo -e "r\no\nh\n1\nn\n\ny\nn\no\nw\ny\n" | gdisk [run_dir].img
set size_image [expr [regsub {\s.*} [exec du -sk [run_dir].img] {}]] set size_image [expr [regsub {\s.*} [exec du -sk [run_dir].img] {}]]
puts "Created image file [run_dir].img (${size_image}kiB)" puts "Created image file [run_dir].img (${size_image}kiB)"
} }