Use xz for image compression

This commit is contained in:
Bob Mottram 2016-01-14 11:07:40 +00:00
parent f7e8d478b7
commit fed3a049eb
7 changed files with 33 additions and 22 deletions

View File

@ -31,7 +31,7 @@ Install the freedombone commands onto your laptop/desktop:
Then install packages needed for building images: Then install packages needed for building images:
sudo apt-get -y install python-docutils mktorrent vmdebootstrap sudo apt-get -y install python-docutils mktorrent vmdebootstrap xz-utils
sudo apt-get -y install dosfstools btrfs-tools extlinux python-distro-info mbr sudo apt-get -y install dosfstools btrfs-tools extlinux python-distro-info mbr
sudo apt-get -y install qemu-user-static binfmt-support u-boot-tools qemu sudo apt-get -y install qemu-user-static binfmt-support u-boot-tools qemu
@ -99,7 +99,7 @@ And the hash with:
If the image is compressed then decompress it with: If the image is compressed then decompress it with:
tar -xjvf filename.tar.bz2 unxz filename.img.xz
Then copy it to a microSD card. Depending on your system you may need an adaptor to be able to do that. Then copy it to a microSD card. Depending on your system you may need an adaptor to be able to do that.

View File

@ -41,7 +41,7 @@ sudo make install
Then install packages needed for building images: Then install packages needed for building images:
#+BEGIN_SRC bash #+BEGIN_SRC bash
sudo apt-get -y install python-docutils mktorrent vmdebootstrap sudo apt-get -y install python-docutils mktorrent vmdebootstrap xz-utils
sudo apt-get -y install dosfstools btrfs-tools extlinux python-distro-info mbr sudo apt-get -y install dosfstools btrfs-tools extlinux python-distro-info mbr
sudo apt-get -y install qemu-user-static binfmt-support u-boot-tools qemu sudo apt-get -y install qemu-user-static binfmt-support u-boot-tools qemu
#+END_SRC #+END_SRC
@ -120,7 +120,7 @@ sha256sum filename.img
If the image is compressed then decompress it with: If the image is compressed then decompress it with:
#+BEGIN_SRC bash #+BEGIN_SRC bash
tar -xjvf filename.tar.bz2 unxz filename.img.xz
#+END_SRC #+END_SRC
Then copy it to a microSD card. Depending on your system you may need an adaptor to be able to do that. Then copy it to a microSD card. Depending on your system you may need an adaptor to be able to do that.

Binary file not shown.

Binary file not shown.

View File

@ -231,7 +231,7 @@ if [ ! $PASSWORD ]; then
PASSWORD="$(openssl rand -base64 10 | cut -c1-8)" PASSWORD="$(openssl rand -base64 10 | cut -c1-8)"
fi fi
image_types=( bz2 img sig vdi qcow2 ) image_types=( xz img sig vdi qcow2 )
for im in "${image_types[@]}" for im in "${image_types[@]}"
do do
no_of_files=$(ls -afq ${CURR_DIR}/${PROJECT_NAME}*.${im} | wc -l) no_of_files=$(ls -afq ${CURR_DIR}/${PROJECT_NAME}*.${im} | wc -l)
@ -348,7 +348,7 @@ else
" "
fi fi
fi fi
ls -lh ${PROJECT_NAME}*.img ${PROJECT_NAME}*.sig ${PROJECT_NAME}*.bz2 ${PROJECT_NAME}*.vdi ${PROJECT_NAME}*.qcow2 ls -lh ${PROJECT_NAME}*.img ${PROJECT_NAME}*.sig ${PROJECT_NAME}*.xz ${PROJECT_NAME}*.vdi ${PROJECT_NAME}*.qcow2
# Remove the mesh script after use # Remove the mesh script after use
if [[ $VARIANT == "mesh"* ]]; then if [[ $VARIANT == "mesh"* ]]; then

View File

@ -40,10 +40,10 @@ BUILD = $(MACHINE)-$(ARCHITECTURE)
TODAY := $(shell date +%Y-%m-%d) TODAY := $(shell date +%Y-%m-%d)
NAME = build/$(PROJECT_NAME)-$(IMAGE_NAME)-$(TODAY)_$(BUILD) NAME = build/$(PROJECT_NAME)-$(IMAGE_NAME)-$(TODAY)_$(BUILD)
IMAGE = $(NAME).img IMAGE = $(NAME).img
ARCHIVE = $(NAME).tar.bz2 ARCHIVE = $(IMAGE).xz
SIGNATURE = $(ARCHIVE).sig SIGNATURE = $(ARCHIVE).sig
OWNER = 1000 OWNER = 1000
TAR = tar --checkpoint=1000 --checkpoint-action=dot -cjvf XZ = xz --no-warn --best --verbose
SIGN = -gpg --output $(SIGNATURE) --detach-sig $(ARCHIVE) SIGN = -gpg --output $(SIGNATURE) --detach-sig $(ARCHIVE)
# settings for `make test` # settings for `make test`
@ -83,7 +83,8 @@ beaglebone: prep
$(eval ARCHITECTURE = armhf) $(eval ARCHITECTURE = armhf)
$(eval MACHINE = beaglebone) $(eval MACHINE = beaglebone)
$(MAKE_IMAGE) $(MAKE_IMAGE)
$(TAR) $(ARCHIVE) $(IMAGE) @rm -f $(ARCHIVE)
$(XZ) $(IMAGE)
@echo "" @echo ""
$(SIGN) $(SIGN)
@echo "Build complete." @echo "Build complete."
@ -93,7 +94,8 @@ cubieboard2: prep
$(eval ARCHITECTURE = armhf) $(eval ARCHITECTURE = armhf)
$(eval MACHINE = cubieboard2) $(eval MACHINE = cubieboard2)
$(MAKE_IMAGE) $(MAKE_IMAGE)
$(TAR) $(ARCHIVE) $(IMAGE) @rm -f $(ARCHIVE)
$(XZ) $(IMAGE)
@echo "" @echo ""
$(SIGN) $(SIGN)
@echo "Build complete." @echo "Build complete."
@ -103,7 +105,8 @@ cubietruck: prep
$(eval ARCHITECTURE = armhf) $(eval ARCHITECTURE = armhf)
$(eval MACHINE = cubietruck) $(eval MACHINE = cubietruck)
$(MAKE_IMAGE) $(MAKE_IMAGE)
$(TAR) $(ARCHIVE) $(IMAGE) @rm -f $(ARCHIVE)
$(XZ) $(IMAGE)
@echo "" @echo ""
$(SIGN) $(SIGN)
@echo "Build complete." @echo "Build complete."
@ -113,7 +116,8 @@ a20-olinuxino-lime2: prep
$(eval ARCHITECTURE = armhf) $(eval ARCHITECTURE = armhf)
$(eval MACHINE = a20-olinuxino-lime2) $(eval MACHINE = a20-olinuxino-lime2)
$(MAKE_IMAGE) $(MAKE_IMAGE)
$(TAR) $(ARCHIVE) $(IMAGE) @rm -f $(ARCHIVE)
$(XZ) $(IMAGE)
@echo "" @echo ""
$(SIGN) $(SIGN)
@echo "Build complete." @echo "Build complete."
@ -123,7 +127,8 @@ a20-olinuxino-micro: prep
$(eval ARCHITECTURE = armhf) $(eval ARCHITECTURE = armhf)
$(eval MACHINE = a20-olinuxino-micro) $(eval MACHINE = a20-olinuxino-micro)
$(MAKE_IMAGE) $(MAKE_IMAGE)
$(TAR) $(ARCHIVE) $(IMAGE) @rm -f $(ARCHIVE)
$(XZ) $(IMAGE)
@echo "" @echo ""
$(SIGN) $(SIGN)
@echo "Build complete." @echo "Build complete."
@ -133,7 +138,8 @@ i386: prep
$(eval ARCHITECTURE = i386) $(eval ARCHITECTURE = i386)
$(eval MACHINE = all) $(eval MACHINE = all)
$(MAKE_IMAGE) $(MAKE_IMAGE)
$(TAR) $(ARCHIVE) $(IMAGE) @rm -f $(ARCHIVE)
$(XZ) $(IMAGE)
@echo "" @echo ""
$(SIGN) $(SIGN)
@echo "Build complete." @echo "Build complete."
@ -143,7 +149,8 @@ amd64: prep
$(eval ARCHITECTURE = amd64) $(eval ARCHITECTURE = amd64)
$(eval MACHINE = all) $(eval MACHINE = all)
$(MAKE_IMAGE) $(MAKE_IMAGE)
$(TAR) $(ARCHIVE) $(IMAGE) @rm -f $(ARCHIVE)
$(XZ) $(IMAGE)
@echo "" @echo ""
$(SIGN) $(SIGN)
@echo "Build complete." @echo "Build complete."
@ -157,7 +164,8 @@ virtualbox-i386: prep
$(MAKE_IMAGE) $(MAKE_IMAGE)
# Convert image to vdi hard drive # Convert image to vdi hard drive
VBoxManage convertdd $(NAME).img $(NAME).vdi VBoxManage convertdd $(NAME).img $(NAME).vdi
$(TAR) $(ARCHIVE) $(NAME).vdi @rm -f $(ARCHIVE)
$(XZ) $(IMAGE)
@echo "" @echo ""
$(SIGN) $(SIGN)
@echo "Build complete." @echo "Build complete."
@ -168,7 +176,8 @@ virtualbox-amd64: prep
$(MAKE_IMAGE) $(MAKE_IMAGE)
# Convert image to vdi hard drive # Convert image to vdi hard drive
VBoxManage convertdd $(NAME).img $(NAME).vdi VBoxManage convertdd $(NAME).img $(NAME).vdi
$(TAR) $(ARCHIVE) $(NAME).vdi @rm -f $(ARCHIVE)
$(XZ) $(IMAGE)
@echo "" @echo ""
$(SIGN) $(SIGN)
@echo "Build complete." @echo "Build complete."
@ -204,7 +213,8 @@ qemu-i386: prep
$(MAKE_IMAGE) $(MAKE_IMAGE)
# Convert image to qemu format # Convert image to qemu format
qemu-img convert -O qcow2 $(NAME).img $(NAME).qcow2 qemu-img convert -O qcow2 $(NAME).img $(NAME).qcow2
$(TAR) $(ARCHIVE) $(NAME).qcow2 @rm -f $(ARCHIVE)
$(XZ) $(IMAGE)
@echo "" @echo ""
$(SIGN) $(SIGN)
@echo "Build complete." @echo "Build complete."
@ -215,7 +225,8 @@ qemu-x86_64: prep
$(MAKE_IMAGE) $(MAKE_IMAGE)
# Convert image to qemu format # Convert image to qemu format
qemu-img convert -O qcow2 $(NAME).img $(NAME).qcow2 qemu-img convert -O qcow2 $(NAME).img $(NAME).qcow2
$(TAR) $(ARCHIVE) $(NAME).qcow2 @rm -f $(ARCHIVE)
$(XZ) $(IMAGE)
@echo "" @echo ""
$(SIGN) $(SIGN)
@echo "Build complete." @echo "Build complete."

View File

@ -3,7 +3,7 @@
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en"> <html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head> <head>
<!-- 2016-01-08 Fri 14:41 --> <!-- 2016-01-14 Thu 11:07 -->
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" /> <meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" /> <meta name="viewport" content="width=device-width, initial-scale=1" />
<title></title> <title></title>
@ -234,7 +234,7 @@ Then install packages needed for building images:
<div class="org-src-container"> <div class="org-src-container">
<pre class="src src-bash">sudo apt-get -y install python-docutils mktorrent vmdebootstrap <pre class="src src-bash">sudo apt-get -y install python-docutils mktorrent vmdebootstrap xz-utils
sudo apt-get -y install dosfstools btrfs-tools extlinux python-distro-info mbr sudo apt-get -y install dosfstools btrfs-tools extlinux python-distro-info mbr
sudo apt-get -y install qemu-user-static binfmt-support u-boot-tools qemu sudo apt-get -y install qemu-user-static binfmt-support u-boot-tools qemu
</pre> </pre>
@ -372,7 +372,7 @@ If the image is compressed then decompress it with:
<div class="org-src-container"> <div class="org-src-container">
<pre class="src src-bash">tar -xjvf filename.tar.bz2 <pre class="src src-bash">unxz filename.img.xz
</pre> </pre>
</div> </div>