Merge lp:~rsalveti/ubuntu/maverick/jasper-initramfs/fix-629269 into lp:ubuntu/maverick/jasper-initramfs

Proposed by Ricardo Salveti
Status: Needs review
Proposed branch: lp:~rsalveti/ubuntu/maverick/jasper-initramfs/fix-629269
Merge into: lp:ubuntu/maverick/jasper-initramfs
Diff against target: 570 lines (+507/-0) (has conflicts)
11 files modified
debian/changelog (+150/-0)
debian/compat (+1/-0)
debian/control (+22/-0)
debian/copyright (+24/-0)
debian/jasper.install (+2/-0)
debian/jasper.triggers (+1/-0)
debian/rules (+3/-0)
debian/source/format (+1/-0)
hooks/jasper (+30/-0)
scripts/local-bottom/jasper_setup (+127/-0)
scripts/local-premount/jasper_growroot (+146/-0)
Conflict adding file debian.  Moved existing file to debian.moved.
Conflict adding file hooks.  Moved existing file to hooks.moved.
Conflict adding file scripts.  Moved existing file to scripts.moved.
To merge this branch: bzr merge lp:~rsalveti/ubuntu/maverick/jasper-initramfs/fix-629269
Reviewer Review Type Date Requested Status
Oliver Grawert Pending
Review via email: mp+34514@code.launchpad.net

Description of the change

Changing boot args to use 1gb for Panda ES2.

Aug 26 14:52:16 <rsalveti> robclark: what are the boot args you're using for es2?
Aug 26 14:52:28 <rsalveti> I interested at the mem argument
Aug 26 14:52:50 <rsalveti> do we need to let any free chunk available?
Aug 26 15:20:48 <robclark> rsalveti: root=/dev/mmcblk0p2 rootwait rw mem=460M@0x80000000 mem=512M@0xA0000000 console=ttyO2,115200n8 vram=8M omapfb.vram=0:8M
Aug 26 15:21:58 <rsalveti> robclark: hm, ok, and who uses the other free megabytes between 460 and 512?
Aug 26 15:22:28 <robclark> rsalveti: for ducati
Aug 26 15:22:58 <robclark> if you aren't using the hw accelerated video codecs, then you don't need it
Aug 26 15:23:45 <rsalveti> robclark: hm, ok, makes sense
Aug 26 15:23:46 <robclark> (and some point, in the next release or two, they will start dynamically allocating the memory for coprocessors.. but not sure when that will be exactly)
Aug 26 15:23:47 <rsalveti> thanks :-)

To post a comment you must log in.

Unmerged revisions

70. By Ricardo Salveti

releasing version 0.16

69. By Ricardo Salveti

Add correct mem argument for Panda ES2 (for 1gb) (LP: #629269)

68. By Oliver Grawert

releasing version 0.15

67. By Oliver Grawert

add a hack to work around bug 625108 during maverick beta until the kernel is fixed

66. By Oliver Grawert

releasing version 0.14

65. By Oliver Grawert

jasper_growroot: do not exit if fsck exits with 1 (i.e. if last mount time doesnt match RTC)

64. By Oliver Grawert

releasing version 0.13

63. By Oliver Grawert

update changelog

62. By Oliver Grawert

jasper_setup: switch / mount to noatime

61. By Oliver Grawert

jasper_growroot: small fixes, jasper_setup: disable swap file creation (temporary), add sysctl.d file to switch kernel to less disk writes, default to noop elevator on kernel cmdline, add more output (temporary)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== added directory 'debian'
2=== renamed directory 'debian' => 'debian.moved'
3=== added file 'debian/changelog'
4--- debian/changelog 1970-01-01 00:00:00 +0000
5+++ debian/changelog 2010-09-03 06:14:40 +0000
6@@ -0,0 +1,150 @@
7+jasper-initramfs (0.16) maverick; urgency=low
8+
9+ * Add correct mem argument for Panda ES2 (for 1gb) (LP: #629269)
10+
11+ -- Ricardo Salveti de Araujo <ricardo.salveti@canonical.com> Fri, 03 Sep 2010 02:40:40 -0300
12+
13+jasper-initramfs (0.15) maverick; urgency=low
14+
15+ * add a hack to work around bug 625108 during maverick beta until the kernel
16+ is fixed
17+
18+ -- Oliver Grawert <ogra@ubuntu.com> Fri, 27 Aug 2010 12:50:06 +0200
19+
20+jasper-initramfs (0.14) maverick; urgency=low
21+
22+ * do not exit before resizing even if e2fsck found wrong last mount time etc.
23+
24+ -- Oliver Grawert <ogra@ubuntu.com> Thu, 26 Aug 2010 13:54:17 +0200
25+
26+jasper-initramfs (0.13) maverick; urgency=low
27+
28+ * jasper_growroot:
29+ - strip parentheses from resize2fs output
30+ - add proper percentage output for each single pass instead of plain dots so
31+ the user gets more details about the resize progress.
32+ - change info string and bind time to SD size (10min per 4G)
33+ * depend on bc for percentage calculation
34+ * copy bc in the jasper hook
35+ * jasper_setup:
36+ - run gdm-set-default-session chrooted
37+ - add /etc/sysctl.d/30-jasper-root-on-sd.conf file with options to reduce
38+ disk access.
39+ - temporary disable swapfile creation.
40+ - default to noop elevator on cmdline for a test
41+ - add more debug output (temporary)
42+ - mount / with noatime
43+ * reboot if the filesystem was resized
44+
45+ -- Oliver Grawert <ogra@ubuntu.com> Sun, 18 Jul 2010 09:02:16 +0200
46+
47+jasper-initramfs (0.12) maverick; urgency=low
48+
49+ * default to une-efl session if it is installed in the root filesystem
50+ * add progress reporting to resize2fs output
51+
52+ -- Oliver Grawert <ogra@ubuntu.com> Wed, 14 Jul 2010 14:01:07 +0200
53+
54+jasper-initramfs (0.11) maverick; urgency=low
55+
56+ * jasper_setup: create /root/boot/boot.script to make user editing of
57+ cmdline options easier, users only need to edit this file and run
58+ flash-kernel on the installed system now.
59+ * change upstream branch to lp:jasper-initramfs to match the new project
60+ name
61+
62+ -- Oliver Grawert <ogra@ubuntu.com> Fri, 09 Jul 2010 13:57:37 +0200
63+
64+jasper-initramfs (0.10) maverick; urgency=low
65+
66+ [ Oliver Grawert ]
67+ * jasper_setup:
68+ - fix whitespace
69+ - add proper logging and better logfile handling
70+ - fix typo in flash-kernel.conf creation
71+ - add quiet and splash to default cmdline
72+ - set board specific cmdline options in boot.scr for panda and beagleboard
73+
74+ [ Alexander Sack ]
75+ * jasper_setup: improve match for proc line from /etc/fstab
76+
77+ -- Oliver Grawert <ogra@ubuntu.com> Tue, 06 Jul 2010 13:56:43 +0200
78+
79+jasper-initramfs (0.9) maverick; urgency=low
80+
81+ [ Alexander Sack ]
82+ * jasper_setup: allow rootfs to live on any device; don't assume its on mmc device
83+ if root= kernel command line already has a UUID= id there
84+
85+ [ Oliver Grawert ]
86+ * jasper_setup: add swap file creation if not existing in fstab yet with a
87+ default value of 256M
88+
89+ -- Oliver Grawert <ogra@ubuntu.com> Thu, 01 Jul 2010 23:28:15 +0200
90+
91+jasper-initramfs (0.7) maverick; urgency=low
92+
93+ * jasper_growroot: dont call sync with full path in write_vfat, that makes
94+ the script choke
95+
96+ -- Oliver Grawert <ogra@ubuntu.com> Wed, 30 Jun 2010 20:27:28 +0200
97+
98+jasper-initramfs (0.6) maverick; urgency=low
99+
100+ * jasper_setup:
101+ - adjust variable handling
102+ - create new boot.scr with root=UUID=... entry
103+ - copy log to /var/log
104+ - write flash-kernel.conf
105+ * jasper_growroot:
106+ - add detection of rootdevice from cmdline
107+ - use DOS compatibility in sfdisk call to make sure vfat stays bootable
108+ - give a more precise time to the user in the script output
109+ - add caching and re-formatting of the vfat partition with the new
110+ CHS geometry of the SD card so we can be sure we are still able to boot
111+ * debian/control: drop dep on mtools, add dep on uboot-mkimage
112+
113+ -- Oliver Grawert <ogra@ubuntu.com> Tue, 22 Jun 2010 17:39:18 +0200
114+
115+jasper-initramfs (0.5) maverick; urgency=low
116+
117+ * jasper_setup: fix fstab creation
118+ * jasper_growroot:
119+ - add e2fsck call (LP: #594756)
120+ - use fdisk to get the blocksize of first partition
121+ - move removal of fake mtab file to end of the script
122+ - rework logging to /dev/.initramfs/jasper.log
123+ - rework partitioning code
124+ - fix SIZE detection
125+
126+ -- Oliver Grawert <ogra@ubuntu.com> Fri, 18 Jun 2010 15:59:38 +0200
127+
128+jasper-initramfs (0.4) maverick; urgency=low
129+
130+ * make the package arch: all ... no need to build it separately
131+ * be more agressive with the trigger
132+ * move debian/install and debian/triggers to package specific namespace
133+
134+ -- Oliver Grawert <ogra@ubuntu.com> Sun, 13 Jun 2010 17:11:12 +0200
135+
136+jasper-initramfs (0.3) maverick; urgency=low
137+
138+ * add update-initramfs trigger to make sure the scripts end up where they
139+ beling
140+
141+ -- Oliver Grawert <ogra@ubuntu.com> Sun, 13 Jun 2010 16:09:11 +0200
142+
143+jasper-initramfs (0.2) maverick; urgency=low
144+
145+ * jasper_growroot: use fake mtab in initramfs to please resize2fs, drop
146+ fsck, we need to do that at image build time, change UUID generation code.
147+ * jasper_setup: use ext3 filesystem in fstab, remount /root rw for write
148+ operations
149+
150+ -- Oliver Grawert <ogra@ubuntu.com> Thu, 10 Jun 2010 07:28:25 +0200
151+
152+jasper-initramfs (0.1) maverick; urgency=low
153+
154+ * Initial release.
155+
156+ -- Oliver Grawert <ogra@ubuntu.com> Fri, 04 Jun 2010 18:29:17 +0200
157
158=== added file 'debian/compat'
159--- debian/compat 1970-01-01 00:00:00 +0000
160+++ debian/compat 2010-09-03 06:14:40 +0000
161@@ -0,0 +1,1 @@
162+7
163
164=== added file 'debian/control'
165--- debian/control 1970-01-01 00:00:00 +0000
166+++ debian/control 2010-09-03 06:14:40 +0000
167@@ -0,0 +1,22 @@
168+Source: jasper-initramfs
169+Section: misc
170+Priority: optional
171+Maintainer: Oliver Grawert <ogra@ubuntu.com>
172+Build-Depends: debhelper (>= 7.0.50~)
173+Standards-Version: 3.8.4
174+Vcs-Bzr: lp:jasper-initramfs
175+
176+Package: jasper
177+Architecture: all
178+Section: misc
179+Priority: extra
180+Depends: ${shlibs:Depends}, ${misc:Depends}, initramfs-tools, busybox-initramfs, util-linux (>= 2.17.2-0), uuid-runtime, e2fsprogs (>= 1.41.11-1), coreutils (>= 7.4-2), oem-config, dosfstools, uboot-mkimage, bc
181+Description: Configure a preinstalled ext2/3 system image
182+ Jasper is a tool to configure preinstalled ext2/3 images that were
183+ created using the ubuntu infrastructure from the initramfs.
184+ Such as armel omap3/4 images in Ubuntu 10.10 and beyond.
185+ .
186+ It grows the system partition of a preinstalled ext2/3 image to the
187+ full size of the SD card, configures fstab, loopback networking, adds
188+ the UUID to the kernel cmdline and properly sets up flash-kernel for
189+ the kernel package post installation scripts.
190
191=== added file 'debian/copyright'
192--- debian/copyright 1970-01-01 00:00:00 +0000
193+++ debian/copyright 2010-09-03 06:14:40 +0000
194@@ -0,0 +1,24 @@
195+Author: Oliver Grawert <ogra@canonical.com>
196+
197+Copyright:
198+
199+License (everything else):
200+
201+ Copyright (C) 2010 Canonical Ltd. <http://www.canonical.com/>
202+
203+ This program is free software; you can redistribute it and/or modify
204+ it under the terms of the GNU General Public License as published by
205+ the Free Software Foundation; either version 2 of the License, or
206+ (at your option) any later version.
207+
208+ This program is distributed in the hope that it will be useful,
209+ but WITHOUT ANY WARRANTY; without even the implied warranty of
210+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
211+ GNU General Public License for more details.
212+
213+ You should have received a copy of the GNU General Public License
214+ along with this program; if not, write to the Free Software
215+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
216+
217+On Debian and Ubuntu systems, the complete text of the GNU General Public License
218+can be found in /usr/share/common-licenses/GPL file.
219
220=== added file 'debian/jasper.install'
221--- debian/jasper.install 1970-01-01 00:00:00 +0000
222+++ debian/jasper.install 2010-09-03 06:14:40 +0000
223@@ -0,0 +1,2 @@
224+scripts usr/share/initramfs-tools/
225+hooks usr/share/initramfs-tools/
226
227=== added file 'debian/jasper.triggers'
228--- debian/jasper.triggers 1970-01-01 00:00:00 +0000
229+++ debian/jasper.triggers 2010-09-03 06:14:40 +0000
230@@ -0,0 +1,1 @@
231+activate update-initramfs
232
233=== added file 'debian/rules'
234--- debian/rules 1970-01-01 00:00:00 +0000
235+++ debian/rules 2010-09-03 06:14:40 +0000
236@@ -0,0 +1,3 @@
237+#! /usr/bin/make -f
238+%:
239+ dh $@
240
241=== added directory 'debian/source'
242=== added file 'debian/source/format'
243--- debian/source/format 1970-01-01 00:00:00 +0000
244+++ debian/source/format 2010-09-03 06:14:40 +0000
245@@ -0,0 +1,1 @@
246+3.0 (native)
247
248=== added directory 'hooks'
249=== renamed directory 'hooks' => 'hooks.moved'
250=== added file 'hooks/jasper'
251--- hooks/jasper 1970-01-01 00:00:00 +0000
252+++ hooks/jasper 2010-09-03 06:14:40 +0000
253@@ -0,0 +1,30 @@
254+#!/bin/sh -e
255+# initramfs hook for jasper
256+
257+PREREQ=""
258+
259+# Output pre-requisites
260+prereqs()
261+{
262+ echo "$PREREQ"
263+}
264+
265+case "$1" in
266+ prereqs)
267+ prereqs
268+ exit 0
269+ ;;
270+esac
271+
272+. /usr/share/initramfs-tools/hook-functions
273+
274+copy_exec /sbin/resize2fs /sbin
275+copy_exec /sbin/e2fsck /sbin
276+copy_exec /sbin/tune2fs /sbin
277+copy_exec /sbin/sfdisk /sbin
278+copy_exec /sbin/fdisk /sbin
279+copy_exec /usr/bin/uuidgen /bin
280+copy_exec /bin/sync /bin
281+copy_exec /sbin/mkdosfs /sbin
282+copy_exec /sbin/mkswap /sbin
283+copy_exec /usr/bin/bc /bin
284
285=== added directory 'scripts'
286=== renamed directory 'scripts' => 'scripts.moved'
287=== added directory 'scripts/local-bottom'
288=== added file 'scripts/local-bottom/jasper_setup'
289--- scripts/local-bottom/jasper_setup 1970-01-01 00:00:00 +0000
290+++ scripts/local-bottom/jasper_setup 2010-09-03 06:14:40 +0000
291@@ -0,0 +1,127 @@
292+#!/bin/sh -e
293+
294+PREREQ=""
295+
296+# Output pre-requisites
297+prereqs()
298+{
299+ echo "$PREREQ"
300+}
301+
302+case "$1" in
303+ prereqs)
304+ prereqs
305+ exit 0
306+ ;;
307+esac
308+
309+LOGFILE=/dev/.initramfs/jasper.log
310+# If we are already confiugured we dont want to run again
311+[ -e /root/etc/flash-kernel.conf ] && exit 0
312+
313+machine=$(grep "^Hardware" /proc/cpuinfo | sed 's/Hardware\s*:\s*//')
314+
315+if echo "$root" | grep -q '^UUID='; then
316+ VOLID=$root
317+else
318+ VOLID=$(blkid |grep mmcblk0p2|awk '{print $2}'|tr -d [\"])
319+fi
320+
321+UBOOT_PART="/dev/mmcblk0p1"
322+TMPDIR="/dev/.initramfs/jasper-tmp"
323+BOOT_SCRIPT="/boot/boot.script"
324+
325+# make sure FS is writable
326+mount -o remount,rw /root
327+
328+# create fstab in /root, we only support ext3 partitions atm
329+echo "setting up fstab"
330+if ! cat /root/etc/fstab | grep -v '^#' | awk '{print $3}' | grep -q ^proc; then
331+ echo "proc /proc proc defaults 0 0" >>/root/etc/fstab
332+fi
333+if ! grep -q ${VOLID} /root/etc/fstab; then
334+ echo "${VOLID} / ext3 defaults,noatime,errors=remount-ro 0 1" >>/root/etc/fstab
335+fi
336+#echo "setting up swap"
337+#if ! grep -q swap /root/etc/fstab; then
338+# dd if=/dev/zero of=${DIR}/root/SWAP.swap bs=512 count=0 seek=1048576 >>$LOGFILE 2>&1
339+# mkswap /root/SWAP.swap >>$LOGFILE 2>&1
340+# echo "/SWAP.swap none swap sw 0 0" >>/root/etc/fstab
341+#fi
342+
343+echo "setting up loopback networking"
344+# create loopback networking device in /root
345+echo "auto lo" >/root/etc/network/interfaces
346+echo "iface lo inet loopback" >>/root/etc/network/interfaces
347+
348+# hack to prevent bug #625108 in maverick beta until the kernel is fixed
349+echo "auto usb0" >>/root/etc/network/interfaces
350+echo "iface usb0 inet dhcp" >>/root/etc/network/interfaces
351+
352+echo "enabling oem-config"
353+# switch oem-config on
354+mkdir -p /root/var/lib/oem-config
355+touch /root/var/lib/oem-config/run
356+
357+echo "writing flash-kernel.conf"
358+# create flash-kernel setup
359+echo "UBOOT_PART=${UBOOT_PART}" >/root/etc/flash-kernel.conf
360+echo "ROOT=${VOLID}" >>/root/etc/flash-kernel.conf
361+
362+# TODO get EDID data and pick reasonable resolution for cmdline
363+
364+# create new boot.scr file with root=${VOLID}
365+case "$machine" in
366+ "OMAP3 Beagle Board")
367+ BOARD_OPTS="elevator=noop vram=12M omapfb.mode=dvi:1280x720MR-16@60"
368+ ;;
369+ "OMAP4430 Panda Board")
370+ BOARD_OPTS="elevator=noop vram=32M mem=460M@0x80000000 mem=512M@0xA0000000"
371+ ;;
372+esac
373+
374+echo "creating boot.script"
375+cat >"/root${BOOT_SCRIPT}" <<EOF
376+ fatload mmc 0:1 0x80000000 uImage
377+ fatload mmc 0:1 0x81600000 uInitrd
378+ setenv bootargs quiet splash ro ${BOARD_OPTS} root=${VOLID} fixrtc
379+ bootm 0x80000000 0x81600000
380+EOF
381+mkdir -p ${TMPDIR}
382+mount ${UBOOT_PART} ${TMPDIR}
383+/root/usr/bin/mkimage -A arm -T script -C none -n "Ubuntu boot script" -d /root${BOOT_SCRIPT} ${TMPDIR}/boot.scr >>$LOGFILE 2>&1
384+umount ${TMPDIR}
385+rm -rf ${TMPDIR}
386+
387+echo "adding SD card optimizations"
388+cat >"/root/etc/sysctl.d/30-jasper-root-on-sd.conf" <<EOF
389+# The values below try to reduce disk writes, they were put in place
390+# by the jasper-initramfs package during first boot of this computer.
391+# If you encounter problems due to the settings please file a bug
392+# against the jasper-initramfs ubuntu package.
393+vm.swappiness = 0
394+vm.vfs_cache_pressure=50
395+vm.dirty_background_ratio = 20
396+vm.dirty_expire_centisecs = 0
397+vm.dirty_ratio = 80
398+vm.dirty_writeback_centisecs = 6000
399+EOF
400+
401+echo "setting default session"
402+# default to 2D une session if it is installed
403+if [ -e /root/usr/share/xsessions/une-efl.desktop ] && [ -e /root/usr/lib/gdm/gdm-set-default-session ];then
404+ chroot /root /usr/lib/gdm/gdm-set-default-session une-efl >>$LOGFILE 2>&1 || true
405+fi
406+
407+# move jasper.log to root filesystem
408+mv $LOGFILE /root/var/log/
409+
410+# remount readonly
411+mount -o remount,ro /root
412+
413+echo "reboot check"
414+if [ -e /dev/.initramfs/jasper-reboot ];then
415+ echo "Rebooting into configuration session ..."
416+ sleep 1
417+ reboot
418+fi
419
420=== added directory 'scripts/local-premount'
421=== added file 'scripts/local-premount/jasper_growroot'
422--- scripts/local-premount/jasper_growroot 1970-01-01 00:00:00 +0000
423+++ scripts/local-premount/jasper_growroot 2010-09-03 06:14:40 +0000
424@@ -0,0 +1,146 @@
425+#!/bin/sh -e
426+
427+PREREQ=""
428+
429+# Output pre-requisites
430+prereqs()
431+{
432+ echo "$PREREQ"
433+}
434+
435+case "$1" in
436+ prereqs)
437+ prereqs
438+ exit 0
439+ ;;
440+esac
441+
442+DISK=mmcblk0
443+SEP="p"
444+
445+LOG=/dev/.initramfs/jasper.log
446+CACHE=/dev/.initramfs/jasper-vfat
447+
448+touch ${LOG}
449+mkdir -p ${CACHE}
450+
451+BOOTPATH=""
452+PARTITION=""
453+
454+# we only handle mmc and sdX disk types atm if a UUID is already set we dont want
455+# to do any action since we assume the system was configured before
456+[ -z "`grep root=UUID /proc/cmdline`" ] || exit 0
457+for arg in $(cat /proc/cmdline)
458+do
459+ case $arg in
460+ root=*)
461+ BOOTPATH=${arg#root=}
462+ PARTITION=${BOOTPATH#/dev/}
463+ case $PARTITION in
464+ mmcblk*)
465+ DISK=$(echo ${PARTITION}|sed -e 's/p[0-9]*$//')
466+ ;;
467+ sd*)
468+ DISK=$(echo ${PARTITION}|sed -e 's/[0-9]*$//')
469+ SEP=""
470+ ;;
471+ *)
472+ echo "E: Jasper error, can not hanlde this disk type"
473+ exit 1
474+ ;;
475+ esac
476+ ;;
477+ esac
478+done
479+
480+# We save the vfat contents because we adjust the CHS gemoetry to match the SD card,
481+# MLO/u-boot wont work without re-formatting the vfat with the new values
482+cache_vfat()
483+{
484+ mount -t tmpfs -o mode=0755 none ${CACHE}
485+ mkdir -p /mnt
486+ mount -t vfat /dev/${DISK}${SEP}1 /mnt
487+ cp -a /mnt/* ${CACHE}/
488+ umount /dev/${DISK}${SEP}1
489+}
490+
491+# Format the new vfat and write the cached content back in the right order
492+write_vfat()
493+{
494+ # TODO: find a better LABEL and add it to list of hidden partitions in udisk
495+ /sbin/mkdosfs -n "SERVICEV001" -F 32 /dev/${DISK}${SEP}1
496+ mount /dev/${DISK}${SEP}1 /mnt
497+ for file in MLO boot.scr u-boot.bin uImage uInitrd; do
498+ cp ${CACHE}/$file /mnt/${file}
499+ sync
500+ done
501+ umount ${CACHE}
502+ umount /mnt
503+}
504+
505+# The actual resizing function
506+resize_partitions()
507+{
508+ # Get size in blocks of first partition and cylinder count
509+ SIZE_P1=`LANG=C /sbin/fdisk -l /dev/${DISK} | grep ${DISK}${SEP}1 | awk '{print $4}'`
510+ DISKSIZE=`LANG=C /sbin/fdisk -l /dev/${DISK} | grep Disk | awk '{print $5}' | tr -d '\n'`
511+ CYLS=$(($DISKSIZE/255/63/512))
512+ sync
513+ # Enlarge the OS partition to fill the rest of the disk, we need to maintain
514+ # the new CHS geometry for the bootloader
515+ /sbin/sfdisk -H 255 -S 63 -C ${CYLS} --no-reread -D -q /dev/${DISK} <<EOF >>${LOG} 2>&1
516+,$SIZE_P1,c,*
517+,,,-
518+EOF
519+}
520+
521+# Most functions below want an mtab file to check if the disk is mounted
522+ln -s /proc/mounts /etc/mtab >>${LOG} 2>&1
523+
524+echo "Caching vfat content in ${CACHE} ..." >>${LOG}
525+cache_vfat >>${LOG} 2>&1
526+
527+echo "Resizing root partition ..." >>${LOG}
528+resize_partitions
529+
530+echo "Re-writing vfat partition ..." >>${LOG}
531+write_vfat >>${LOG} 2>&1
532+
533+# Give some info to the user TODO: create plymouth output
534+echo "Resizing root filesystem. Please wait, this will take about ten minutes per 4G ..."
535+echo "Resizing root filesystem ..." >>${LOG}
536+# little workaround for wrong clocks
537+mount /dev/${DISK}${SEP}2 /root
538+umount /root
539+
540+printf "Checking filesystem before resizing..."
541+/sbin/e2fsck -fy /dev/${DISK}${SEP}2 >>${LOG} 2>&1 || true
542+echo " Done."
543+pass=1
544+iter=0
545+LANG=C /sbin/resize2fs -p /dev/${DISK}${SEP}2 2>&1 | while read -n 1 input; do
546+ char=$(echo $input|sed 's/[)(]//')
547+ if [ "${char}" = "X" ];then
548+ if [ "${iter}" = "100.0" ];then
549+ iter=0
550+ pass=$(($pass+1))
551+ echo >>${LOG}
552+ fi
553+ iter=$(echo $iter+2.5|bc)
554+ printf "\rResizing, pass: %i [%3.0f/100]" $pass $iter
555+ fi
556+ if [ -z "${char}" ]; then
557+ echo -n " " >>${LOG}
558+ else
559+ echo -n "${char}" >>${LOG}
560+ fi
561+done
562+echo >>${LOG}
563+echo
564+echo 1>/dev/.initramfs/jasper-reboot
565+
566+# Set a new UUID to make sure we're unique in the world
567+/sbin/tune2fs -U $(uuidgen) /dev/${DISK}${SEP}2 >>${LOG} 2>&1
568+
569+rm /etc/mtab
570+rm -rf ${CACHE}

Subscribers

People subscribed via source and target branches

to all changes: