Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
L
lipck
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
osak
lipck
Commits
b2474654
Commit
b2474654
authored
9 years ago
by
Christopher Spinrath
Browse files
Options
Downloads
Patches
Plain Diff
ensure partition _unmounted_ for all targets accessing the image file
parent
62517878
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
Makefile
+17
-7
17 additions, 7 deletions
Makefile
with
17 additions
and
7 deletions
Makefile
+
17
−
7
View file @
b2474654
...
...
@@ -79,6 +79,17 @@ $(strip $1): image_mount_if
)
$(
strip
$1
)
__ignore_mount
endef
#On the other hand, targets operating on the actual image file
#require that the partition is unmounted. So here we go with an
#"inverse" of ensure_mount:
define
ensure_unmount =
$(eval
.PHONY
:
$(strip $1) $(strip $1)__ignore_mount
$(strip $1)
:
image_umount_if
$(
MAKE
)
$(
strip
$1
)
__ignore_mount
)
$(
strip
$1
)
__ignore_mount
endef
RSYNC
=
rsync
-a
LZMA_FLAGS
=
-T
0
...
...
@@ -361,7 +372,7 @@ initrd_pack : $(ARCH_DIR)$(INITRD_TARGET)
$(call gentargets,$(INITRD_TARGET))
:
$(call archdir
,
%)$(STATE_DIR)/initrd_remastered
cd
"
$(
call archdir,
$*
)$(
INITRD
)
"
&&
find | cpio
-H
newc
-o
| lzma
$(
LZMA_FLAGS
)
-z
>
"
$(
call archdir,
$*
)$(
INITRD_TARGET
)
"
clean_really_all
:
iso_clean_both rootfs_clean_both rootfs_common_clean initrd_clean_both image_clean
$(call ensure_unmount,
clean_really_all
)
:
iso_clean_both rootfs_clean_both rootfs_common_clean initrd_clean_both image_clean
$(call ensure_mount,image_git) $(IMAGE_DIR)/.git
:
|$(WORKSPACE)
test
!
-e
"
$(
IMAGE_DIR
)
/.git"
...
...
@@ -416,7 +427,7 @@ $(call ensure_mount,image_content): image_git_pull $(IMAGE_DIR)/.remastered $(IM
@
echo
@
echo
"Image content is ready:
$(
IMAGE_DIR
)
"
image_skel_file
:
$(IMAGE_PART_FILE)
$(call ensure_unmount,
image_skel_file
)
:
$(IMAGE_PART_FILE)
$(IMAGE_PART_FILE)
:
truncate
-s
"
$(
IMAGE_PART_SIZE
)
"
"
$@
"
mkfs.vfat
-n
"
$(
IMAGE_PART_LABEL
)
"
"
$@
"
...
...
@@ -460,7 +471,7 @@ $(IMAGE_DIR)$(GRUB_INSTALL_DIR)/.lipgrub: $(GRUB_ASSEMBLE_DIR)/grub.x86_64-efi $
$(
RSYNC
)
--no-p
--no-g
--no-o
"
$(
GRUB_ASSEMBLE_DIR
)
/grub.i386-efi"
"
$(
IMAGE_DIR
)
/efi/boot/bootia32.efi"
touch
"
$(
IMAGE_DIR
)$(
GRUB_INSTALL_DIR
)
/.lipgrub"
image_assemble
:
$(IMAGE_FILE)
$(call ensure_unmount,
image_assemble
)
:
$(IMAGE_FILE)
$(IMAGE_FILE)
:
$(IMAGE_PART_FILE) $(GRUB_ASSEMBLE_DIR)/mbr.img
cp
"
$(
GRUB_ASSEMBLE_DIR
)
/mbr.img"
"
$@
"
ddrescue
--output-position
=
2048s
--sparse
"
$(
IMAGE_PART_FILE
)
"
"
$@
"
...
...
@@ -471,10 +482,10 @@ $(IMAGE_FILE): $(IMAGE_PART_FILE) $(GRUB_ASSEMBLE_DIR)/mbr.img
@echo
@echo "Image is ready
:
$@"
image_deploy
:
$(IMAGE_FILE) $(IMAGE_FILE).sha1sum
image_deploy_vmdk
:
$(IMAGE_FILE:.img=.vmdk) $(IMAGE_FILE:.img=.vmdk).sha1sum
$(call ensure_unmount,
image_deploy
)
:
$(IMAGE_FILE) $(IMAGE_FILE).sha1sum
$(call ensure_unmount,
image_deploy_vmdk
)
:
$(IMAGE_FILE:.img=.vmdk) $(IMAGE_FILE:.img=.vmdk).sha1sum
image_clean
:
$(call ensure_unmount,
image_clean
)
:
$(
RM
)
"
$(
IMAGE_PART_FILE
)
"
$(
RM
)
-r
"
$(
GRUB_ASSEMBLE_DIR
)
"
...
...
@@ -612,7 +623,6 @@ help:
@
echo
"
\$
$
make WORKSPACE=/media/drivewithspace config #configure lipck"
@
echo
"# make image #main remaster process (requires several cups of coffee)"
@
echo
"# make repo #build offline repo"
@
echo
"# make image_umount #umount the image partition"
@
echo
"
\$
$
#copy mbr+partition to final destination"
@
echo
"
\$
$
make IMAGE_FILE=/somewhere/myfinalimage.img image_deploy"
@
echo
"
\$
$
#(optionally) create a vmdk version. Note that IMAGE_FILE is still the raw .img file here!"
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment