Browse Source

Use xz for image compression

Bob Mottram 9 years ago
parent
commit
fed3a049eb

+ 2
- 2
README.md View File

31
 
31
 
32
 Then install packages needed for building images:
32
 Then install packages needed for building images:
33
 
33
 
34
-    sudo apt-get -y install python-docutils mktorrent vmdebootstrap
34
+    sudo apt-get -y install python-docutils mktorrent vmdebootstrap xz-utils
35
     sudo apt-get -y install dosfstools btrfs-tools extlinux python-distro-info mbr
35
     sudo apt-get -y install dosfstools btrfs-tools extlinux python-distro-info mbr
36
     sudo apt-get -y install qemu-user-static binfmt-support u-boot-tools qemu
36
     sudo apt-get -y install qemu-user-static binfmt-support u-boot-tools qemu
37
 
37
 
99
 
99
 
100
 If the image is compressed then decompress it with:
100
 If the image is compressed then decompress it with:
101
 
101
 
102
-    tar -xjvf filename.tar.bz2
102
+    unxz filename.img.xz
103
 
103
 
104
 Then copy it to a microSD card. Depending on your system you may need an adaptor to be able to do that.
104
 Then copy it to a microSD card. Depending on your system you may need an adaptor to be able to do that.
105
 
105
 

+ 2
- 2
doc/EN/installation.org View File

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

BIN
man/freedombone-image.1.gz View File


BIN
man/freedombone.1.gz View File


+ 2
- 2
src/freedombone-image View File

231
     PASSWORD="$(openssl rand -base64 10 | cut -c1-8)"
231
     PASSWORD="$(openssl rand -base64 10 | cut -c1-8)"
232
 fi
232
 fi
233
 
233
 
234
-image_types=( bz2 img sig vdi qcow2 )
234
+image_types=( xz img sig vdi qcow2 )
235
 for im in "${image_types[@]}"
235
 for im in "${image_types[@]}"
236
 do
236
 do
237
     no_of_files=$(ls -afq ${CURR_DIR}/${PROJECT_NAME}*.${im} | wc -l)
237
     no_of_files=$(ls -afq ${CURR_DIR}/${PROJECT_NAME}*.${im} | wc -l)
348
 "
348
 "
349
     fi
349
     fi
350
 fi
350
 fi
351
-ls -lh ${PROJECT_NAME}*.img ${PROJECT_NAME}*.sig ${PROJECT_NAME}*.bz2 ${PROJECT_NAME}*.vdi ${PROJECT_NAME}*.qcow2
351
+ls -lh ${PROJECT_NAME}*.img ${PROJECT_NAME}*.sig ${PROJECT_NAME}*.xz ${PROJECT_NAME}*.vdi ${PROJECT_NAME}*.qcow2
352
 
352
 
353
 # Remove the mesh script after use
353
 # Remove the mesh script after use
354
 if [[ $VARIANT == "mesh"* ]]; then
354
 if [[ $VARIANT == "mesh"* ]]; then

+ 24
- 13
src/freedombone-image-makefile View File

40
 TODAY := $(shell date +%Y-%m-%d)
40
 TODAY := $(shell date +%Y-%m-%d)
41
 NAME = build/$(PROJECT_NAME)-$(IMAGE_NAME)-$(TODAY)_$(BUILD)
41
 NAME = build/$(PROJECT_NAME)-$(IMAGE_NAME)-$(TODAY)_$(BUILD)
42
 IMAGE = $(NAME).img
42
 IMAGE = $(NAME).img
43
-ARCHIVE = $(NAME).tar.bz2
43
+ARCHIVE = $(IMAGE).xz
44
 SIGNATURE = $(ARCHIVE).sig
44
 SIGNATURE = $(ARCHIVE).sig
45
 OWNER = 1000
45
 OWNER = 1000
46
-TAR = tar --checkpoint=1000 --checkpoint-action=dot -cjvf
46
+XZ = xz --no-warn --best --verbose
47
 SIGN = -gpg --output $(SIGNATURE) --detach-sig $(ARCHIVE)
47
 SIGN = -gpg --output $(SIGNATURE) --detach-sig $(ARCHIVE)
48
 
48
 
49
 # settings for `make test`
49
 # settings for `make test`
83
 	$(eval ARCHITECTURE = armhf)
83
 	$(eval ARCHITECTURE = armhf)
84
 	$(eval MACHINE = beaglebone)
84
 	$(eval MACHINE = beaglebone)
85
 	$(MAKE_IMAGE)
85
 	$(MAKE_IMAGE)
86
-	$(TAR) $(ARCHIVE) $(IMAGE)
86
+	@rm -f $(ARCHIVE)
87
+	$(XZ) $(IMAGE)
87
 	@echo ""
88
 	@echo ""
88
 	$(SIGN)
89
 	$(SIGN)
89
 	@echo "Build complete."
90
 	@echo "Build complete."
93
 	$(eval ARCHITECTURE = armhf)
94
 	$(eval ARCHITECTURE = armhf)
94
 	$(eval MACHINE = cubieboard2)
95
 	$(eval MACHINE = cubieboard2)
95
 	$(MAKE_IMAGE)
96
 	$(MAKE_IMAGE)
96
-	$(TAR) $(ARCHIVE) $(IMAGE)
97
+	@rm -f $(ARCHIVE)
98
+	$(XZ) $(IMAGE)
97
 	@echo ""
99
 	@echo ""
98
 	$(SIGN)
100
 	$(SIGN)
99
 	@echo "Build complete."
101
 	@echo "Build complete."
103
 	$(eval ARCHITECTURE = armhf)
105
 	$(eval ARCHITECTURE = armhf)
104
 	$(eval MACHINE = cubietruck)
106
 	$(eval MACHINE = cubietruck)
105
 	$(MAKE_IMAGE)
107
 	$(MAKE_IMAGE)
106
-	$(TAR) $(ARCHIVE) $(IMAGE)
108
+	@rm -f $(ARCHIVE)
109
+	$(XZ) $(IMAGE)
107
 	@echo ""
110
 	@echo ""
108
 	$(SIGN)
111
 	$(SIGN)
109
 	@echo "Build complete."
112
 	@echo "Build complete."
113
 	$(eval ARCHITECTURE = armhf)
116
 	$(eval ARCHITECTURE = armhf)
114
 	$(eval MACHINE = a20-olinuxino-lime2)
117
 	$(eval MACHINE = a20-olinuxino-lime2)
115
 	$(MAKE_IMAGE)
118
 	$(MAKE_IMAGE)
116
-	$(TAR) $(ARCHIVE) $(IMAGE)
119
+	@rm -f $(ARCHIVE)
120
+	$(XZ) $(IMAGE)
117
 	@echo ""
121
 	@echo ""
118
 	$(SIGN)
122
 	$(SIGN)
119
 	@echo "Build complete."
123
 	@echo "Build complete."
123
 	$(eval ARCHITECTURE = armhf)
127
 	$(eval ARCHITECTURE = armhf)
124
 	$(eval MACHINE = a20-olinuxino-micro)
128
 	$(eval MACHINE = a20-olinuxino-micro)
125
 	$(MAKE_IMAGE)
129
 	$(MAKE_IMAGE)
126
-	$(TAR) $(ARCHIVE) $(IMAGE)
130
+	@rm -f $(ARCHIVE)
131
+	$(XZ) $(IMAGE)
127
 	@echo ""
132
 	@echo ""
128
 	$(SIGN)
133
 	$(SIGN)
129
 	@echo "Build complete."
134
 	@echo "Build complete."
133
 	$(eval ARCHITECTURE = i386)
138
 	$(eval ARCHITECTURE = i386)
134
 	$(eval MACHINE = all)
139
 	$(eval MACHINE = all)
135
 	$(MAKE_IMAGE)
140
 	$(MAKE_IMAGE)
136
-	$(TAR) $(ARCHIVE) $(IMAGE)
141
+	@rm -f $(ARCHIVE)
142
+	$(XZ) $(IMAGE)
137
 	@echo ""
143
 	@echo ""
138
 	$(SIGN)
144
 	$(SIGN)
139
 	@echo "Build complete."
145
 	@echo "Build complete."
143
 	$(eval ARCHITECTURE = amd64)
149
 	$(eval ARCHITECTURE = amd64)
144
 	$(eval MACHINE = all)
150
 	$(eval MACHINE = all)
145
 	$(MAKE_IMAGE)
151
 	$(MAKE_IMAGE)
146
-	$(TAR) $(ARCHIVE) $(IMAGE)
152
+	@rm -f $(ARCHIVE)
153
+	$(XZ) $(IMAGE)
147
 	@echo ""
154
 	@echo ""
148
 	$(SIGN)
155
 	$(SIGN)
149
 	@echo "Build complete."
156
 	@echo "Build complete."
157
 	$(MAKE_IMAGE)
164
 	$(MAKE_IMAGE)
158
 	# Convert image to vdi hard drive
165
 	# Convert image to vdi hard drive
159
 	VBoxManage convertdd $(NAME).img $(NAME).vdi
166
 	VBoxManage convertdd $(NAME).img $(NAME).vdi
160
-	$(TAR) $(ARCHIVE) $(NAME).vdi
167
+	@rm -f $(ARCHIVE)
168
+	$(XZ) $(IMAGE)
161
 	@echo ""
169
 	@echo ""
162
 	$(SIGN)
170
 	$(SIGN)
163
 	@echo "Build complete."
171
 	@echo "Build complete."
168
 	$(MAKE_IMAGE)
176
 	$(MAKE_IMAGE)
169
 	# Convert image to vdi hard drive
177
 	# Convert image to vdi hard drive
170
 	VBoxManage convertdd $(NAME).img $(NAME).vdi
178
 	VBoxManage convertdd $(NAME).img $(NAME).vdi
171
-	$(TAR) $(ARCHIVE) $(NAME).vdi
179
+	@rm -f $(ARCHIVE)
180
+	$(XZ) $(IMAGE)
172
 	@echo ""
181
 	@echo ""
173
 	$(SIGN)
182
 	$(SIGN)
174
 	@echo "Build complete."
183
 	@echo "Build complete."
204
 	$(MAKE_IMAGE)
213
 	$(MAKE_IMAGE)
205
 	# Convert image to qemu format
214
 	# Convert image to qemu format
206
 	qemu-img convert -O qcow2 $(NAME).img $(NAME).qcow2
215
 	qemu-img convert -O qcow2 $(NAME).img $(NAME).qcow2
207
-	$(TAR) $(ARCHIVE) $(NAME).qcow2
216
+	@rm -f $(ARCHIVE)
217
+	$(XZ) $(IMAGE)
208
 	@echo ""
218
 	@echo ""
209
 	$(SIGN)
219
 	$(SIGN)
210
 	@echo "Build complete."
220
 	@echo "Build complete."
215
 	$(MAKE_IMAGE)
225
 	$(MAKE_IMAGE)
216
 	# Convert image to qemu format
226
 	# Convert image to qemu format
217
 	qemu-img convert -O qcow2 $(NAME).img $(NAME).qcow2
227
 	qemu-img convert -O qcow2 $(NAME).img $(NAME).qcow2
218
-	$(TAR) $(ARCHIVE) $(NAME).qcow2
228
+	@rm -f $(ARCHIVE)
229
+	$(XZ) $(IMAGE)
219
 	@echo ""
230
 	@echo ""
220
 	$(SIGN)
231
 	$(SIGN)
221
 	@echo "Build complete."
232
 	@echo "Build complete."

+ 3
- 3
website/EN/installation.html View File

3
 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
3
 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
4
 <html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
4
 <html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
5
 <head>
5
 <head>
6
-<!-- 2016-01-08 Fri 14:41 -->
6
+<!-- 2016-01-14 Thu 11:07 -->
7
 <meta  http-equiv="Content-Type" content="text/html;charset=utf-8" />
7
 <meta  http-equiv="Content-Type" content="text/html;charset=utf-8" />
8
 <meta  name="viewport" content="width=device-width, initial-scale=1" />
8
 <meta  name="viewport" content="width=device-width, initial-scale=1" />
9
 <title></title>
9
 <title></title>
234
 
234
 
235
 <div class="org-src-container">
235
 <div class="org-src-container">
236
 
236
 
237
-<pre class="src src-bash">sudo apt-get -y install python-docutils mktorrent vmdebootstrap
237
+<pre class="src src-bash">sudo apt-get -y install python-docutils mktorrent vmdebootstrap xz-utils
238
 sudo apt-get -y install dosfstools btrfs-tools extlinux python-distro-info mbr
238
 sudo apt-get -y install dosfstools btrfs-tools extlinux python-distro-info mbr
239
 sudo apt-get -y install qemu-user-static binfmt-support u-boot-tools qemu
239
 sudo apt-get -y install qemu-user-static binfmt-support u-boot-tools qemu
240
 </pre>
240
 </pre>
372
 
372
 
373
 <div class="org-src-container">
373
 <div class="org-src-container">
374
 
374
 
375
-<pre class="src src-bash">tar -xjvf filename.tar.bz2
375
+<pre class="src src-bash">unxz filename.img.xz
376
 </pre>
376
 </pre>
377
 </div>
377
 </div>
378
 
378