Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
mkimage-profiles
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
1
Issues
1
List
Board
Labels
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Ximper Linux
mkimage-profiles
Commits
d4cbbcba
Commit
d4cbbcba
authored
Jul 09, 2019
by
Gleb Fotengauer-Malinovskiy
Committed by
Michael Shigorin
Aug 19, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
tar2fs: Add support of ppc64le vm images
parent
15845d51
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
35 additions
and
2 deletions
+35
-2
tar2fs
bin/tar2fs
+35
-2
No files found.
bin/tar2fs
View file @
d4cbbcba
...
...
@@ -24,6 +24,7 @@ MB=1048576 # a parted's "megabyte" in bytes is *broken*
SIZE_FACTOR
=
2
# multiply the sizes found by this value
BOOT_SIZE_FACTOR
=
2
# multiply /boot size by this value additionally
BOOTLOADERPARTSIZEM
=
0
# PReP partition size (ppc*)
CUR_BOUNDARY
=
0
# align first partition at 1MB for performance (+1)
...
...
@@ -41,6 +42,13 @@ e2k)
BOOTPART
=
"1"
ROOTPART
=
"2"
;;
ppc
*
)
BOOTFSTYPE
=
"ext4"
BLOCKDEV
=
"/dev/sda"
BOOTLOADERPART
=
"1"
BOOTLOADERPARTSIZEM
=
"8"
ROOTPART
=
"2"
;;
*
)
ROOTPART
=
"1"
BLOCKDEV
=
"/dev/sda"
...
...
@@ -149,12 +157,24 @@ trap exit_handler EXIT ERR
# prepare disk image and a filesystem inside it
rm
-f
--
"
$IMG
"
OFFSET
=
"
$((
$CUR_BOUNDARY
+
$BOOTSIZEM
+
$ROOTSIZEM
-
1
))
"
OFFSET
=
"
$((
$CUR_BOUNDARY
+
$BOOTLOADERPARTSIZEM
+
$BOOTSIZEM
+
$ROOTSIZEM
-
1
))
"
dd
if
=
/dev/zero
of
=
"
$IMG
"
conv
=
notrunc
bs
=
$MB
count
=
1
seek
=
"
$OFFSET
"
losetup
"
$LOOPDEV
"
"
$IMG
"
parting mklabel msdos
if
[
-n
"
$BOOTLOADERPART
"
]
&&
[
-n
"
$BOOTLOADERPARTSIZEM
"
]
;
then
case
"
$ARCH
"
in
ppc
*
)
parting mkpart primary ext2 2048s
${
BOOTLOADERPARTSIZEM
}
M
CUR_BOUNDARY
=
"
$((
$CUR_BOUNDARY
+
$BOOTLOADERPARTSIZEM
))
"
parting
set
1 prep on
parting
set
1 boot on
;;
esac
fi
if
[
-n
"
$BOOTPART
"
]
;
then
BOOTDEV
=
"
$BLOCKDEV$BOOTPART
"
mkpart
"
$BOOTSIZEM
"
...
...
@@ -173,6 +193,10 @@ if [ -n "$BOOTPART" ]; then
mkfs.
"
$BOOTFSTYPE
"
"
$LOOPBOOT
"
fi
if
[
-n
"
$BOOTLOADERPART
"
]
&&
[
-n
"
$BOOTLOADERPARTSIZEM
"
]
;
then
LOOPBOOTLOADER
=
"/dev/mapper/
$(
basename
"
$LOOPDEV
"
)
p
$BOOTLOADERPART
"
fi
ROOTUUID
=
"
$(
blkid
-s
UUID
-o
value
-c
/dev/null
"
$LOOPROOT
"
)
"
if
[
-n
"
$ROOTUUID
"
]
;
then
ROOTDEV
=
"UUID=
$ROOTUUID
"
...
...
@@ -299,7 +323,16 @@ grub-efi)
;;
grub
)
chroot
"
$ROOTFS
"
grub-mkconfig
-o
/boot/grub/grub.cfg
chroot
"
$ROOTFS
"
grub-install
--target
=
i386-pc
"
$LOOPDEV
"
case
"
$ARCH
"
in
*
86
*
)
chroot
"
$ROOTFS
"
grub-install
--target
=
i386-pc
"
$LOOPDEV
"
;;
ppc
*
)
[
-z
"
$LOOPBOOTLOADER
"
]
||
chroot
"
$ROOTFS
"
grub-install
--target
=
powerpc-ieee1275
\
--no-nvram
"
$LOOPBOOTLOADER
"
;;
esac
;;
esac
...
...
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