Browse Source

catch up with upstream, only hold our two relevant changes

master
Alf Gaida 4 years ago
parent
commit
89cba7eb58
8 changed files with 428 additions and 160 deletions
  1. 225
    40
      debian/changelog
  2. 7
    5
      debian/control
  3. 21
    9
      debian/copyright
  4. 1
    1
      debian/install
  5. 2
    2
      debian/postinst
  6. 1
    1
      debian/rules
  7. 2
    1
      hooks/fll
  8. 169
    101
      scripts/fll

+ 225
- 40
debian/changelog View File

@@ -1,77 +1,262 @@
fll-live-initramfs (2014.10.06) unstable; urgency=medium
fll-live-initramfs (2.9.14) unstable; urgency=medium

* remove the thin-pool hook, add the module dm-thin-...
[ Stefan Lippers-Hollmann ]
* NOT RELEASED YET

[ Alf Gaida ]
* release it, only two siduction changes, ehci and thin-prov

-- Alf Gaida <agaida@siduction.org> Sat, 25 Jun 2016 13:38:20 +0200

fll-live-initramfs (2.9.13) unstable; urgency=medium

* fix lintian warning:
command-with-path-in-maintainer-script postinst: /usr/sbin/update-initramfs
rely on $(which update-initramfs) instead.

-- Stefan Lippers-Hollmann <s.l-h@gmx.de> Sat, 12 Mar 2016 02:46:10 +0100

fll-live-initramfs (2.9.12) unstable; urgency=medium

* fix F.U.L.L.S.T.O.R.Y. homepage URL.

-- Stefan Lippers-Hollmann <s.l-h@gmx.de> Sat, 12 Mar 2016 02:43:23 +0100

fll-live-initramfs (2.9.11) unstable; urgency=medium

* remove the udevadm trigger+settle dance again for testing, this should be
fixed in udev 221.

-- Stefan Lippers-Hollmann <s.l-h@gmx.de> Sat, 04 Jul 2015 23:15:40 +0200

fll-live-initramfs (2.9.10) unstable; urgency=medium

* for now run udevadm trigger+settle in scripts/fll (for single-core
systems).

-- Niall Walsh <niallwalsh@celtux.org> Fri, 19 Jun 2015 04:54:59 +0100

fll-live-initramfs (2.9.9) unstable; urgency=medium

* revert running scripts/init-top/udev for testing, udev seems to be fixed.

-- Stefan Lippers-Hollmann <s.l-h@gmx.de> Fri, 19 Jun 2015 00:34:12 +0200

fll-live-initramfs (2.9.8) unstable; urgency=medium

* run scripts/init-top/udev (again) from scripts/fll as it appears to
be running too early.

-- Niall Walsh <niallwalsh@celtux.org> Tue, 09 Jun 2015 20:19:10 +0100

fll-live-initramfs (2.9.7) unstable; urgency=medium

* drop versioned dependency on initramfs-tools, it's provided by all
relevant Debian releases.

-- Stefan Lippers-Hollmann <s.l-h@gmx.de> Sun, 04 Jan 2015 01:34:26 +0100

fll-live-initramfs (2.9.6) unstable; urgency=medium

* bump standards version to 3.9.6, no changes necessary.
* convert to machine readable copyright.

-- Stefan Lippers-Hollmann <s.l-h@gmx.de> Sat, 03 Jan 2015 19:56:56 +0100

fll-live-initramfs (2.9.5) unstable; urgency=medium

* get rid of the extraneous -v for awk left behind in the last change.

-- Niall Walsh <niallwalsh@celtux.org> Sun, 21 Dec 2014 23:43:19 +0000

fll-live-initramfs (2.9.4) unstable; urgency=medium

* fix toram typo and tweak figures to be more caustiously realistic.

-- Niall Walsh <niallwalsh@celtux.org> Sun, 21 Dec 2014 22:49:40 +0000

fll-live-initramfs (2.9.3) unstable; urgency=medium

* fix broken awk in detection of toram size and count both squashfs sizes.

-- Niall Walsh <niallwalsh@celtux.org> Sun, 21 Dec 2014 14:34:34 +0000

fll-live-initramfs (2.9.2) unstable; urgency=medium

* fixup md5sum for fromhd squashfs partition case.

-- Niall Walsh <niallwalsh@celtux.org> Mon, 08 Dec 2014 19:49:01 +0000

fll-live-initramfs (2.9.1) unstable; urgency=medium

* mount up secondary squashfs and fixup toram.

-- Alf Gaida <agaida@siduction.org> Sun, 05 Oct 2014 22:56:55 +0200
-- Niall Walsh <niallwalsh@celtux.org> Mon, 08 Dec 2014 02:05:44 +0000

fll-live-initramfs (2014.10.05) unstable; urgency=medium
fll-live-initramfs (2.9.0) unstable; urgency=medium

* make all hooks executable
* s/overlayfs/overlay/.

-- Alf Gaida <agaida@siduction.org> Sun, 05 Oct 2014 19:12:12 +0200
-- Stefan Lippers-Hollmann <s.l-h@gmx.de> Sat, 22 Nov 2014 18:32:03 +0100

fll-live-initramfs (2014.09.27) unstable; urgency=medium
fll-live-initramfs (2.8.3) unstable; urgency=medium

* install all hooks
* fix fix logic error when detecting the unioning method once more.

-- Alf Gaida <agaida@siduction.org> Sat, 27 Sep 2014 23:49:34 +0200
-- Stefan Lippers-Hollmann <s.l-h@gmx.de> Tue, 28 Oct 2014 13:29:25 +0100

fll-live-initramfs (2014.09.07) unstable; urgency=medium
fll-live-initramfs (2.8.2) unstable; urgency=medium

* merging upstream
* fix logic error when detecting the unioning method.

-- Alf Gaida <agaida@siduction.org> Sun, 07 Sep 2014 00:57:41 +0200
-- Stefan Lippers-Hollmann <s.l-h@gmx.de> Tue, 28 Oct 2014 13:10:58 +0100

fll-live-initramfs (2013.11.27) unstable; urgency=low
fll-live-initramfs (2.8.1) unstable; urgency=medium

* transfer to unstable, no further changes
* detect the available FLL_UNION_MODULE automatically.

-- Alf Gaida <agaida@siduction.org> Thu, 28 Nov 2013 21:56:57 +0100
-- Stefan Lippers-Hollmann <s.l-h@gmx.de> Tue, 28 Oct 2014 06:10:30 +0100

fll-live-initramfs (2013.10.09) next; urgency=low
fll-live-initramfs (2.8.0) unstable; urgency=medium

* sync with fullstory
* new numbering
* new copyright format
* (re-)indent code and add overlayfs cheatcode.
* drop dmsetup code.
* drop unionfs code.

-- Alf Gaida <agaida@siduction.org> Wed, 09 Oct 2013 21:25:12 +0200
-- Stefan Lippers-Hollmann <s.l-h@gmx.de> Tue, 28 Oct 2014 02:49:26 +0100

fll-live-initramfs (2.6.9) unstable; urgency=low
fll-live-initramfs (2.7.19) unstable; urgency=medium

* revert changes in debian/postinst
* add ehci-pci module to hook functions
* fixup toram fssize and handling of mount juggling.

-- siduction builders <packaging@siduction.org> Thu, 28 Feb 2013 07:29:56 +0100
-- Niall Walsh <niallwalsh@celtux.org> Mon, 27 Oct 2014 22:58:07 +0000

fll-live-initramfs (2.6.8.1) unstable; urgency=low
fll-live-initramfs (2.7.18) unstable; urgency=medium

* add ehci-pci to modules to build in initramfs
* add overlayfs support.

-- Torsten Wohlfarth <towo@siduction.org> Wed, 27 Feb 2013 21:00:41 +0100
-- Niall Walsh <niallwalsh@celtux.org> Sun, 26 Oct 2014 23:05:17 +0000

fll-live-initramfs (2.6.8) unstable; urgency=low
fll-live-initramfs (2.7.17) unstable; urgency=medium

* fixed another typo in debian/postinst
* allow squashfs under gpt partlabel matching uuid as discovered device.

-- Niall Walsh <niallwalsh@celtux.org> Wed, 22 Oct 2014 14:19:42 +0100

fll-live-initramfs (2.7.16) unstable; urgency=medium

* drop support for classic persistence.
* add udev override handling and setting the hostname into the initramfs
hook.

-- Stefan Lippers-Hollmann <s.l-h@gmx.de> Sat, 30 Aug 2014 23:04:26 +0200

fll-live-initramfs (2.7.15) unstable; urgency=medium

* drop special handling for /etc/machine-id, it's now handled via pyfll
itself.

-- Stefan Lippers-Hollmann <s.l-h@gmx.de> Sun, 22 Jun 2014 23:08:49 +0200

fll-live-initramfs (2.7.14) unstable; urgency=medium

* debian/control: switch Vcs tags to github.

-- Stefan Lippers-Hollmann <s.l-h@gmx.de> Sun, 13 Apr 2014 22:18:59 +0200

fll-live-initramfs (2.7.13) unstable; urgency=low

* generate a unique machine id for systemd.
* bump standards version to 3.9.5, no changes necessary.

-- Stefan Lippers-Hollmann <s.l-h@gmx.de> Sun, 02 Mar 2014 18:00:10 +0100

fll-live-initramfs (2.7.12) unstable; urgency=low

* selinuxfs is now mounted at /sys/fs/selinux/, don't create /selinux/
anymore.

-- Stefan Lippers-Hollmann <s.l-h@gmx.de> Tue, 07 May 2013 18:26:53 +0200

fll-live-initramfs (2.7.11) unstable; urgency=low

* update FSF postal address to be URLs.
* bump standards version to 3.9.4, no changes necessary.

-- Stefan Lippers-Hollmann <s.l-h@gmx.de> Sat, 12 Jan 2013 02:34:06 +0100

fll-live-initramfs (2.7.10) unstable; urgency=low

* drop versioned dependency on busybox.

-- Stefan Lippers-Hollmann <s.l-h@gmx.de> Mon, 06 Aug 2012 00:25:46 +0200

fll-live-initramfs (2.7.9) unstable; urgency=low

* busybox 1:1.20.0-5 fixes the previous problems (#679377) with awk and PATH
unset, bump dependency accordingly and revert the no longer required
workaround.
* don't complain if /tmp/ already exists.
* rework coding style (whitespace/ comment cleanup).

-- Stefan Lippers-Hollmann <s.l-h@gmx.de> Sun, 08 Jul 2012 16:25:45 +0200

fll-live-initramfs (2.7.8) unstable; urgency=low

* work around #679377 by prepending busybox to all awk instances, thanks to
Michael Tokarev <mjt@tls.msk.ru>.

-- Stefan Lippers-Hollmann <s.l-h@gmx.de> Fri, 06 Jul 2012 04:02:44 +0200

fll-live-initramfs (2.7.7) unstable; urgency=low

* move --noclear hacking into the builder.

-- Stefan Lippers-Hollmann <s.l-h@gmx.de> Fri, 15 Jun 2012 00:31:28 +0200

fll-live-initramfs (2.7.6) unstable; urgency=low

* default to --no-clear for the live-system, this is reverted for the
installed system by fll-installer.
* avoid multiple --no-clear lines on persistent live systems.

-- Stefan Lippers-Hollmann <s.l-h@gmx.de> Tue, 05 Jun 2012 23:20:41 +0200

fll-live-initramfs (2.7.5) unstable; urgency=low

* Clear FLL_PERSIST_BLOCKMNT when persisting to a file (i.e. on fat)
* FLL_COWDIR is /fll/persist when persisting to a file
* Change test for persist to just use FLL_PERSIST (now _BLOCKMNT is cleared)

-- Niall Walsh <niallwalsh@users.berlios.de> Mon, 26 Mar 2012 15:57:48 +0100

fll-live-initramfs (2.7.4) unstable; urgency=low

[ Niall Walsh ]
* make serial work on runlevels 4,5 so you can "debug" X a bit
* use FLL_PERSIST_BLOCKMNT in aufs/unionfs setup

[ Stefan Lippers-Hollmann ]
* use safer variable checking.
* add live-only option to not clear ttys (cheatcode "getty=noclear").

-- Torsten Wohlfarth <towo@siduction.org> Wed, 27 Feb 2013 20:09:29 +0100
-- Stefan Lippers-Hollmann <s.l-h@gmx.de> Sun, 25 Mar 2012 22:20:45 +0200

fll-live-initramfs (2.6.7) unstable; urgency=low
fll-live-initramfs (2.7.3) unstable; urgency=low

* fixed the typo in debian/postinst
* Add console=ttyS (serial) support

-- Torsten Wohlfarth <towo@siduction.org> Wed, 27 Feb 2013 19:15:13 +0100
-- Niall Walsh <niallwalsh@users.berlios.de> Sun, 25 Mar 2012 17:55:28 +0100

fll-live-initramfs (2.6.6) unstable; urgency=low
fll-live-initramfs (2.7.2) unstable; urgency=low

* added a fix for not working usb-boot
* Mount union on / instead of FLL_BLOCKMNT

-- Torsten Wohlfarth <towo@siduction.org> Wed, 27 Feb 2013 18:53:23 +0100
-- Niall Walsh <niallwalsh@users.berlios.de> Sun, 25 Mar 2012 17:26:02 +0100

fll-live-initramfs (2.6.5) unstable; urgency=low
fll-live-initramfs (2.7.1) unstable; urgency=low

* source override added to prevent lintian complaining aubout
XSBC_original-Maintainer
* fixes #642
* bump standards version to 3.9.3, no changes necessary.

-- Stefan Lippers-Hollmann <s.l-h@gmx.de> Thu, 23 Feb 2012 16:19:22 +0100


+ 7
- 5
debian/control View File

@@ -1,18 +1,20 @@
Source: fll-live-initramfs
Maintainer: Stefan Lippers-Hollmann <s.l-h@gmx.de>
Uploaders: Niall Walsh <niallwalsh@celtux.org>,
Alf Gaida <agaida@siduction.org>
Section: misc
Priority: extra
Maintainer: Alf Gaida <agaida@siduction.org>
Build-Depends: debhelper (>= 9)
Standards-Version: 3.9.5
Vcs-git: git://github.com/fullstory/fll-live-initramfs.git
Build-Depends: debhelper (>= 9.20120115)
Standards-Version: 3.9.8
Vcs-Browser: https://github.com/fullstory/fll-live-initramfs
Vcs-Git: git://github.com/fullstory/fll-live-initramfs.git

Package: fll-live-initramfs
Architecture: all
Depends: ${misc:Depends},
busybox,
distro-defaults,
initramfs-tools (>= 0.40)
initramfs-tools
Suggests: lvm2,
nbd-client
Description: fll live media initramfs glue

+ 21
- 9
debian/copyright View File

@@ -1,19 +1,31 @@
Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
Upstream-Name: fll-live-initramfs
Source: <http://developer.berlios.de/projects/fullstory/fll-live-initramfs>
Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
Upstream-Name: fll-live-initramfs
Upstream-Contact: Stefan Lippers-Hollmann <s.l-h@gmx.de>
Source: git://github.com/fullstory/fll-live-initramfs.git

Files: *
Copyright: 2007-2010 Kel Modderman <kel@otaku42.de>
2007-2014 Stefan Lippers-Hollmann <s.l-h@gmx.de>
2007-2012 Niall Walsh <niallwalsh@users.berlios.de>
2003 Klaus Knopper <knoppix@knopper.net>
2003-2006 Joerg Schirottke <master@kanotix.com>
Copyright: 2007-2010, Kel Modderman <kel@otaku42.de>
2007-2015, Stefan Lippers-Hollmann <s.l-h@gmx.de>
2007-2014, Niall Walsh <niallwalsh@users.berlios.de>
License: GPL-2.0
Comment:
Some parts of initramfs scripts are derived from the KNOPPIX/KANOTIX linuxrc
contained in live-initrd-sidux.
Copyright: Klaus Knopper <knoppix@knopper.net>
2003-2006, Joerg Schirottke <master@kanotix.com>
2006, Stefan Lippers-Hollmann <s.l-h@gmx.de>
License: GPL-2.0
.
Some code and ideas taken from the debian-live and ubuntu project; casper.
Copyright: 2006, Marco Amadori <marco.amadori@gmail.com>
2005-2006, Canonical Ltd. <http://www.canonical.com/>
License: GPL-2.0
ftp://ftp.debian.org/debian/pool/main/c/casper/

License: GPL-2.0
This package is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License.
the Free Software Foundation; version 2 of the License.
.
This package is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of

+ 1
- 1
debian/install View File

@@ -1,2 +1,2 @@
hooks/* usr/share/initramfs-tools/hooks
hooks/fll usr/share/initramfs-tools/hooks
scripts/fll usr/share/initramfs-tools/scripts

+ 2
- 2
debian/postinst View File

@@ -3,8 +3,8 @@
set -e

update_initramfs() {
if [ -x /usr/sbin/update-initramfs ] && \
[ -e /etc/initramfs-tools/initramfs.conf ]; then
if [ -x "$(which update-initramfs)" ] && \
[ -e "/etc/initramfs-tools/initramfs.conf" ]; then
update-initramfs -u
fi
}

+ 1
- 1
debian/rules View File

@@ -5,4 +5,4 @@

override_dh_fixperms:
dh_fixperms
chmod 0755 debian/fll-live-initramfs/usr/share/initramfs-tools/*/*
chmod 0755 debian/fll-live-initramfs/usr/share/initramfs-tools/*/fll

+ 2
- 1
hooks/fll View File

@@ -8,7 +8,7 @@
# License: GPLv2
#
# F.U.L.L.S.T.O.R.Y Project Homepage:
# http://developer.berlios.de/projects/fullstory
# https://github.com/fullstory
###############################################################################

# initramfs-tools prerequisite handling
@@ -40,6 +40,7 @@ manual_add_modules ehci-pci
# filesystem unioning modules
manual_add_modules unionfs
manual_add_modules aufs
manual_add_modules overlay

# squashfs and loop
manual_add_modules squashfs

+ 169
- 101
scripts/fll View File

@@ -5,11 +5,11 @@
#
# Copyright: © 2007-2010 Kel Modderman <kel@otaku42.de>
# © 2006-2014 Stefan Lippers-Hollmann <s.l-h@gmx.de>
# © 2007-2012 Niall Walsh <niallwalsh@users.berlios.de>
# © 2007-2014 Niall Walsh <niallwalsh@celtux.org>
# License: GPLv2
#
# F.U.L.L.S.T.O.R.Y Project Homepage:
# http://developer.berlios.de/projects/fullstory
# https://github.com/fullstory
#
# This script snippet needs to get executed under busybox sh, due to
# using awk; klibc sh doesn't provide an awk implementation
@@ -114,6 +114,26 @@ fll_finger_fstype()
return 1
}

###############################################################################
# identify label of block device, fallback to gpt partlabel
###############################################################################
fll_finger_label()
{
LABEL="$(/sbin/blkid -s LABEL -o value ${1})"

if [ -n "${LABEL}" ] ; then
export LABEL
return 0
fi
LABEL="$(/sbin/blkid -s PARTLABEL -o value ${1})"
if [ -n "${LABEL}" ] ; then
export LABEL
return 0
fi
unset LABEL
return 1
}

###############################################################################
# modprobe loop and wait for device node creation
###############################################################################
@@ -504,11 +524,6 @@ mountroot()
toram)
FLL_TORAM="yes"
;;
unionfs|aufs)
# set FLL_UNION_MODULE in default/distro if needed
# current default is dmsetup
FLL_UNION_MODULE="${opt}"
;;
console=ttyS*,*)
# parse out port and speed
FLL_SERIAL="${opt#console=}"
@@ -608,7 +623,7 @@ mountroot()
# loop is broken
# FLL_MEDIA_FOUND - set only when we have the live media compressed
# filesystem located and mounted
unset FLL_BLOCKMNT FLL_DOUMOUNT FLL_DOMOVEMOUNT FLL_MEDIA_FOUND
unset FLL_BLOCKMNT FLL_PROBE FLL_DOUMOUNT FLL_DOMOVEMOUNT FLL_MEDIA_FOUND FLL_2FS

#
# determine filesystem type of block device
@@ -620,19 +635,28 @@ mountroot()
fi
printf "[ ${dev#/dev/} ] "

# we have determined FSTYPE of the device, set FLL_BLOCKMNT
# we have determined FSTYPE of the wrapper device, set FLL_BLOCKMNT
FLL_BLOCKMNT="/fll/${dev##*/}"
FLL_PROBE="${FLL_BLOCKMNT}/${FLL_IMAGE_LOCATION}"
if [ "${FSTYPE}" = "squashfs" ]; then
fll_finger_label "${dev}" >/dev/null 2>&1
if [ "${LABEL}" = "${FLL_UUID}.${FLL_IMAGE_LOCATION#*\.}" ]; then
FLL_BLOCKMNT="${FLL_MOUNTPOINT}"
FLL_PROBE="${dev}"
elif [ "${LABEL}" = "${FLL_UUID}.2" ]; then
FLL_2FS="${dev}"
fi
fi
mkdir -p "${FLL_BLOCKMNT}"

# mount block device on FLL_BLOCKMNT for probe
if fll_mount "${FSTYPE}" "${dev}" "${FLL_BLOCKMNT}" ro; then
# add current FLL_BLOCKMNT to FLL_DOMOVEMOUNT stack
FLL_DOMOVEMOUNT="${FLL_BLOCKMNT} ${FLL_DOMOVEMOUNT}"

#
# probe for iso image
# probe for iso image unless already have media
#
if [ "${FLL_FROMISO}" = "yes" ]; then
if [ ! -e "${FLL_PROBE}" ] && [ "${FLL_FROMISO}" = "yes" ]; then
if [ -f "${FLL_BLOCKMNT}/${FLL_MEDIA_NAME#/}" ]; then
# located iso, update dev description
FLL_MEDIA_FOUND="${dev}"
@@ -657,6 +681,8 @@ mountroot()
# update FLL_BLOCKMNT, FLL_DOMOVEMOUNT stack
FLL_BLOCKMNT="/fll/fromiso"
FLL_DOMOVEMOUNT="${FLL_BLOCKMNT} ${FLL_DOMOVEMOUNT}"
# update FLL_PROBE as FLL_BLOCKMNT changed
FLL_PROBE="${FLL_BLOCKMNT}/${FLL_IMAGE_LOCATION}"
else
fll_umount ${FLL_DOUMOUNT}
panic "Failed to mount ${FSTYPE} filesystem from iso image"
@@ -668,11 +694,10 @@ mountroot()
printf "\n"
fi
fi

#
# probe for compressed filesystem
#
if [ -f "${FLL_BLOCKMNT}/${FLL_IMAGE_LOCATION}" ]; then
if [ -e "${FLL_PROBE}" ] ; then
# found FLL compressed filesystem
# set/update FLL_MEDIA_FOUND variable (possibly already set via fromiso)
if [ -z "${FLL_MEDIA_FOUND}" ]; then
@@ -685,20 +710,32 @@ mountroot()

# md5sum check
if [ "${FLL_MD5SUM_CHECK}" = "yes" ]; then
MAINFS="${FSTYPE}"
if [ -b "${FLL_PROBE}" ]; then
umount "${FLL_BLOCKMNT}"
if fll_finger_fstype "${FLL_PROBE%%[1234567890]*}" >dev/null 2>&1; then
fll_mount "${FSTYPE}" "${FLL_PROBE%%[1234567890]*}" "${FLL_BLOCKMNT}" ro
FSTYPE="${MAINFS}"
MAINFS=""
fi
fi
printf "Performing md5sum integrity check of live media...\n\n"

if fll_md5sum_check ${FLL_BLOCKMNT}; then
printf "All md5sums verified successfully.\n\n"
else
fll_umount ${FLL_DOUMOUNT}
panic "Failed md5sum check!"
fi
if [ -z "${MAINFS}" ]; then
umount "${FLL_BLOCKMNT}"
fll_mount "${FSTYPE}" "${FLL_PROBE}" "${FLL_BLOCKMNT}" ro
fi
fi

#
# prepare live filesystem
#
if fll_finger_fstype "${FLL_BLOCKMNT}/${FLL_IMAGE_LOCATION}" >/dev/null 2>&1; then
if fll_finger_fstype "${FLL_PROBE}" >/dev/null 2>&1; then
printf "Detected live ${FSTYPE} "
if [ "${FLL_FROMISO}" = "yes" ]; then
printf "filesystem on ${FLL_MEDIA_NAME}\n"
@@ -706,18 +743,47 @@ mountroot()
printf "filesystem on ${FLL_MEDIA_FOUND}\n"
fi

# find secondary squashfs if we didn't pick it up already
if [ -z "${FLL_2FS}" ]; then
if [ -f "${FLL_PROBE}" ]; then
FLL_2FS="${FLL_PROBE%.*}.2"
else
MAINFS="${FSTYPE}"
printf "Checking ${FLL_PROBE%%[1234567890]*}* for 2nd squashfs..."
for testfs in ${FLL_PROBE%%[1234567890]*}*; do
if fll_finger_fstype "${testfs}" >/dev/null 2>&1; then
if [ "${FSTYPE}" = "squashfs" ]; then
fll_finger_label "${testfs}" >/dev/null 2>&1
if [ "${LABEL}" = "${FLL_UUID}.2" ]; then
FLL_2FS="${testfs}"
printf "found on ${testfs}"
continue
fi
fi
fi
done
FSTYPE="${MAINFS}"
if [ -z "${FLL_2FS}" ]; then
printf "none present"
fi
printf "\n"
fi
fi

# copy to tmpfs
if [ "${FLL_TORAM}" = "yes" ]; then
# required tmpfs size: compressed filesystem size + 10% buffer
eval $(fll_meminfo)

# ls -l returns units in Bytes, divide by (1024*1024) to convert to MB
FLL_TORAM_FSSIZE=$(ls -l "${FLL_BLOCKMNT}/${FLL_IMAGE_LOCATION}" | \
awk '{ printf("%d\n", int($5 * 1.1 / 1048576)) }')
if [ -f "${FLL_PROBE}" ]; then
FLL_TORAM_FSSIZE=$(du -m "${FLL_PROBE}" "${FLL_2FS}" | awk -v c=0 '{c+=$1}END{print int(c * 1.1) }')
else
FLL_TORAM_FSSIZE=$(df -m "${FLL_PROBE}" | awk '/^\//{print int($2 * 1.2) }')
fi

# memory required to operate normally after iso has consumed memory
# at least 32M is required
FLL_TORAM_MEMREQ=$(( ${FLL_TORAM_FSSIZE} + 32 ))
# at least 256M is required for sanity
FLL_TORAM_MEMREQ=$(( ${FLL_TORAM_FSSIZE} + 256 ))

# do we have enough free memory for toram?
if [ "${MEMFREE}" -gt "${FLL_TORAM_MEMREQ}" ]; then
@@ -728,10 +794,35 @@ mountroot()

# copy compressed filesystem to tmpfs
printf "Copying live filesystem from ${dev#/dev/} to ram...\n"
if fll_copy_with_perc "${FLL_BLOCKMNT}/${FLL_IMAGE_LOCATION}" "/fll/toram/${FLL_IMAGE_DIR}"; then
# add old mount point to umount stack, update FLL_BLOCKMNT
FLL_DOUMOUNT="${FLL_BLOCKMNT} ${FLL_DOUMOUNT}"
if [ -f "${FLL_PROBE}" ]; then
toramcmd="fll_copy_with_perc ${FLL_PROBE} /fll/toram/${FLL_IMAGE_DIR}"
else
toramcmd="cp ${FLL_PROBE} /fll/toram/${FLL_IMAGE_LOCATION}"
printf "... copy about to start without progress, please wait.\n"
fi
if $toramcmd; then
toramcmd=""
if [ -f "${FLL_2FS}" ]; then
printf "Copying 2nd filesystem from ${FLL_2FS} to ram..."
fll_copy_with_perc "${FLL_2FS}" "/fll/toram/${FLL_IMAGE_DIR}/"
printf "done\n"
FLL_2FS="/fll/toram/${FLL_IMAGE_DIR}/${FLL_IMAGE_FILE%.*}.2"
elif [ -n "${FLL_2FS}" ]; then
printf "Copying 2nd filesystem from ${FLL_2FS} to ram..."
cp "${FLL_2FS}" "/fll/toram/${FLL_IMAGE_DIR}/${FLL_IMAGE_FILE%.*}.2"
printf "done\n"
FLL_2FS="/fll/toram/${FLL_IMAGE_DIR}/${FLL_IMAGE_FILE%.*}.2"
fi
if [ "${FLL_BLOCKMNT}" = "${FLL_MOUNTPOINT}" ]; then
# umount the direct squashfs partition
fll_umount "${FLL_BLOCKMNT}"
else
# add old mount point to umount stack
FLL_DOUMOUNT="${FLL_BLOCKMNT} ${FLL_DOUMOUNT}"
fi
# update FLL_BLOCKMNT
FLL_BLOCKMNT="/fll/toram"
FLL_PROBE="${FLL_BLOCKMNT}/${FLL_IMAGE_LOCATION}"
FLL_DOMOVEMOUNT="${FLL_BLOCKMNT} ${FLL_DOMOVEMOUNT}"
else
if [ "${FLL_FROMISO}" = "yes" ]; then
@@ -757,23 +848,15 @@ mountroot()
fi

# mount compressed filesystem, source directory: FLL_BLOCKMNT
mkdir -p "${FLL_MOUNTPOINT}"
if [ -n "${FLL_UNION_MODULE}" ] && [ "${FLL_UNION_MODULE}" != "dmsetup" ] && fll_mount "${FSTYPE}" "${FLL_BLOCKMNT}/${FLL_IMAGE_LOCATION}" "${FLL_MOUNTPOINT}"; then
printf "Mounted ${FSTYPE} filesystem on ${FLL_MOUNTPOINT}\n\n"
FLL_DOMOVEMOUNT="${FLL_MOUNTPOINT} ${FLL_DOMOVEMOUNT}"
elif [ -z "${FLL_UNION_MODULE}" ] || [ "${FLL_UNION_MODULE}" = "dmsetup" ]; then
mkdir -p "${FLL_MOUNTPOINT}.mnt"

if fll_mount "${FSTYPE}" "${FLL_BLOCKMNT}/${FLL_IMAGE_LOCATION}" "${FLL_MOUNTPOINT}.mnt" ; then
printf "Mounted ${FSTYPE} filesystem on ${FLL_MOUNTPOINT}.mnt\n\n"
FLL_DOMOVEMOUNT="${FLL_MOUNTPOINT}.mnt ${FLL_DOMOVEMOUNT}"
if [ ! -d "${FLL_MOUNTPOINT}" ]; then
mkdir -p "${FLL_MOUNTPOINT}"
if fll_mount "${FSTYPE}" "${FLL_PROBE}" "${FLL_MOUNTPOINT}"; then
printf "Mounted ${FSTYPE} filesystem on ${FLL_MOUNTPOINT}\n\n"
FLL_DOMOVEMOUNT="${FLL_MOUNTPOINT} ${FLL_DOMOVEMOUNT}"
else
fll_umount ${FLL_DOUMOUNT}
panic "Failed to mount ${FSTYPE} filesystem"
fi
else
fll_umount ${FLL_DOUMOUNT}
panic "Failed to mount ${FSTYPE} filesystem"
fi
else
fll_umount ${FLL_DOUMOUNT}
@@ -785,7 +868,6 @@ mountroot()
fi
fi
fi

# umount mount points in FLL_DOUMOUNT stack
fll_umount ${FLL_DOUMOUNT}

@@ -812,79 +894,65 @@ mountroot()
# debug checkpoint
maybe_break fll-postmount

# mount secondary squashfs if we have one
if [ -n "${FLL_2FS}" ]; then
mkdir "${FLL_MOUNTPOINT}.2"
FLL_DOMOVEMOUNT="${FLL_MOUNTPOINT}.2 ${FLL_DOMOVEMOUNT}"
fll_mount squashfs "${FLL_2FS}" "${FLL_MOUNTPOINT}.2" ro
#mount -t squashfs "${FLL_2FS}" "${FLL_MOUNTPOINT}.2"
fi


#
# prepare COW union filesystem
#
FLL_SNAP_DEV="/dev/mapper/${FLL_DISTRO_NAME}-snapshot"

if [ -z "${FLL_UNION_MODULE}" ] || [ "${FLL_UNION_MODULE}" = "dmsetup" ]; then
# use losetup and dmsetup to create root snapshot
if ! [ -b ${FLL_SNAP_DEV} ]; then
# TODO size
mkdir -p /run/fll
dd if=/dev/zero of=/run/fll/snapshot bs=1M count=1 seek=511 2>/dev/null
FLL_SNAP_DEV=$(losetup -f)
losetup ${FLL_SNAP_DEV} /run/fll/snapshot
fi

FLL_ROOT_SIZE=$(ls -l "${FLL_MOUNTPOINT}.mnt/${FLL_IMAGE_FILE}" | awk '{print $5}')
FLL_ROOT_DMSIZE=$((${FLL_ROOT_SIZE}/512))
FLL_IMAGE_DEV=$(losetup -f)

losetup ${FLL_IMAGE_DEV} "${FLL_MOUNTPOINT}.mnt/${FLL_IMAGE_FILE}"

FLL_DM_MAP="0 ${FLL_ROOT_DMSIZE} snapshot ${FLL_IMAGE_DEV} ${FLL_SNAP_DEV} P 8"
# aufs || overlay
if [ ! -d /sys/module/overlay ] && [ ! -d /sys/module/aufs ]; then
modprobe "${MODPROBE_OPTIONS}" overlay >/dev/null 2>&1 || \
modprobe "${MODPROBE_OPTIONS}" aufs >/dev/null 2>&1
fi

dmsetup create ${FLL_DISTRO_NAME}-live --table "${FLL_DM_MAP}"
if [ -d /sys/module/overlay ]; then
FLL_UNION_MODULE="overlay"
elif [ -d /sys/module/aufs ]; then
FLL_UNION_MODULE="aufs"
fi

# TODO FS ??? DONE
if fll_finger_fstype /dev/mapper/${FLL_DISTRO_NAME}-live >/dev/null 2>&1 ; then
if ! mount -t ${FSTYPE} /dev/mapper/${FLL_DISTRO_NAME}-live ${rootmnt} ; then
panic "Failed to mount live filesystem"
fi
else
panic "Failed to recognise type of live filesystem"
fi
# unioned filesystem mount points
FLL_UNION_COWDIR="/fll/cow"

mkdir -p "${rootmnt}/${FLL_MOUNTPOINT}"
# prepare COW union filesystem
mkdir -p "${FLL_UNION_COWDIR}"
#
# mount a tmpfs over FLL_UNION_COWDIR, reserving 10% system memory
# Note: $rootmnt must be mounted with a fs != rootfs prior to run-init
#
printf "Mounting virtual memory tmpfs filesystem on ${FLL_UNION_COWDIR}..."
if mount -n -t tmpfs -o size=90%,mode=755 tmpfs "${FLL_UNION_COWDIR}"; then
printf "\n"
else
#aufs || unionfs
modprobe "${MODPROBE_OPTIONS}" "${FLL_UNION_MODULE}" >/dev/null 2>&1

# unioned filesystem mount points
FLL_UNION_COWDIR="/fll/cow"

# prepare COW union filesystem
mkdir -p "${FLL_UNION_COWDIR}"
#
# mount a tmpfs over FLL_UNION_COWDIR, reserving 10% system memory
# Note: $rootmnt must be mounted with a fs != rootfs prior to run-init
#
printf "Mounting virtual memory tmpfs filesystem on ${FLL_UNION_COWDIR}..."
if mount -n -t tmpfs -o size=90%,mode=755 tmpfs "${FLL_UNION_COWDIR}"; then
printf "\n"
else
panic "Failed to mount tmpfs over ${rootmnt}"
fi
FLL_DOMOVEMOUNT="${FLL_DOMOVEMOUNT} ${FLL_UNION_COWDIR}"
panic "Failed to mount tmpfs over ${rootmnt}"
fi
FLL_DOMOVEMOUNT="${FLL_DOMOVEMOUNT} ${FLL_UNION_COWDIR}"

# union module specific options
case "${FLL_UNION_MODULE}" in
aufs)
FLL_UNION_OPTIONS="br:${FLL_UNION_COWDIR}:${FLL_MOUNTPOINT}"
;;
unionfs)
FLL_UNION_OPTIONS="dirs=${FLL_UNION_COWDIR}=rw:${FLL_MOUNTPOINT}=ro"
;;
esac
# union module specific options
case "${FLL_UNION_MODULE}" in
aufs)
FLL_UNION_OPTIONS="br:${FLL_UNION_COWDIR}:${FLL_MOUNTPOINT}"
;;
overlay)
FLL_UNION_OPTIONS="lowerdir=${FLL_MOUNTPOINT},upperdir=${FLL_UNION_COWDIR}/upper,workdir=${FLL_UNION_COWDIR}/work"
mkdir ${FLL_UNION_COWDIR}/upper ${FLL_UNION_COWDIR}/work
;;
esac

# mount the union COW filesystem
printf "Mounting ${FLL_UNION_MODULE} union filesystem..."
if mount -t "${FLL_UNION_MODULE}" -o "${FLL_UNION_OPTIONS}" "${FLL_UNION_MODULE}" "${rootmnt}"; then
printf "\n"
else
panic "Failed to prepare ${FLL_UNION_MODULE} union filesystem"
fi
# mount the union COW filesystem
printf "Mounting ${FLL_UNION_MODULE} union filesystem..."
if mount -t "${FLL_UNION_MODULE}" -o "${FLL_UNION_OPTIONS}" "${FLL_UNION_MODULE}" "${rootmnt}"; then
printf "\n"
else
panic "Failed to prepare ${FLL_UNION_MODULE} union filesystem"
fi

# move all mounts in FLL_DOMOVEMOUNT stack to $rootmnt

Loading…
Cancel
Save