summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
...
* Revert "mount_root: code failed in failsafe"John Crispin2016-05-151-5/+3
| | | | This reverts commit 09f8e0097fe1370700658542e7bda831c31de4bf.
* Revert "fstools: support for ext4fs overlay"John Crispin2016-05-117-214/+1
| | | | | | | | This reverts commit bf4f08af9b8fe991216023a906182744eb1e4645. this patch was breaking devices that have a normal ext4 rootfs Signed-off-by: John Crispin <john@phrozen.org>
* mount_root: code failed in failsafeJohn Crispin2016-05-101-3/+5
| | | | | | | | the code checks if we are in PREINIT before mounting root. change this to check if root is actually mounted. this is a regression caused by ssh login during failsafe. Signed-off-by: John Crispin <john@phrozen.org>
* snapshot: md5sum return codes are not properly handledJohn Crispin2016-04-271-2/+2
| | | | Signed-off-by: John Crispin <john@phrozen.org>
* block: add remount paramterJohn Crispin2016-04-271-0/+8
| | | | Signed-off-by: John Crispin <john@phrozen.org>
* fstools: support for ext4fs overlayRam Chandra Jangir2016-04-227-1/+214
| | | | | | | | | This change will enables eMMC (ext4 fs) boot support, when we try to boot from eMMC card then it will read partition names from /sys/block/mmcblkX/mmcblkXY/uevent file and will mount the rootfs_data partition as ext4fs overlay. Signed-off-by: Ram Chandra Jangir <rjangi@codeaurora.org>
* block: respect mount flags for /overlayJo-Philipp Wich2016-04-251-1/+2
| | | | | | | | Instead of hardcoding no-flags in the mount syscall, use the user configured values, this is useful when mounting external overlays with "sync" or "ro" flags. Signed-off-by: Jo-Philipp Wich <jo@mein.io>
* fstools: check existing filesystem state before writing the new oneFelix Fietkau2016-01-101-0/+3
| | | | Signed-off-by: Felix Fietkau <nbd@openwrt.org>
* fstools: allow to stack another overlay on top of existing oneRoman Yeryomin2015-12-201-0/+2
| | | | | | | | `mount_root ram' will pivot existing root to ram even if it was overlayfs already. Useful when playing with new configurations as it allows to preserve existing/stable configuration. Signed-off-by: Roman Yeryomin <roman@advem.lv>
* fix gcc format security error.Hauke Mehrtens2015-11-221-1/+1
| | | | Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
* libblkid-tiny: Add F2FS supportMartin Blumenstingl2015-10-293-0/+103
| | | | Signed-off-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
* libblkid-tiny: Update the code from util-linux's libblkidMartin Blumenstingl2015-10-2914-508/+775
| | | | | | | This updates the relevant source files to util-linux changeset 4419ffb9eff5801fdbd385a4a6199b3877f802ad. Signed-off-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
* overlay: use lstat rather than stat and make sure there are no trailing spacesJohn Crispin2015-08-261-3/+9
| | | | | | with this patch even uclibc wont deleted symlinked folders Signed-off-by: John Crispin <blogic@openwrt.org>
* make jffs2reset not iterate over symlinked foldersJohn Crispin2015-08-261-1/+3
| | | | Signed-off-by: John Crispin <blogic@openwrt.org>
* jffs2reset: add a -r (reboot) option to jffs2resetJohn Crispin2015-08-261-11/+30
| | | | Signed-off-by: John Crispin <blogic@openwrt.org>
* mount_root: use symlink instead of xattr to store initialization stateFelix Fietkau2015-05-251-16/+18
| | | | | | xattr seems to be unreliable with jffs2 Signed-off-by: Felix Fietkau <nbd@openwrt.org>
* jffs2reset: use jffs2_mark if rootfs_data isn't mountedRafał Miłecki2015-04-121-3/+5
| | | | | | | | | | | | | Erasing all rootfs_data blocks may cause some problems with partition identification. It won't contain MAGIC, but will be successfully mounted with delayed blocks marking. This may be really confusing when user reboots before JFFS2 finishes its blocks management. During the next boot rootfs_data will be a valid partition (possibly with data) but libblkid won't detect it. Also adjust message in jffs2_mark to make more sense when used together with jffs2_reset. Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
* jffs2reset: avoid code duplication in jffs2_reset and jffs2_markRafał Miłecki2015-04-121-31/+25
| | | | Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
* block: reject mount sections with relative targetsJo-Philipp Wich2015-04-121-0/+7
| | | | | | | | Specifying relative target paths leads to undefined results and confuses users. Explicitely reject relative paths with a warning instead of doing random stuff. Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>
* make sure to also scan for leading and ending " when looking for mtd devicesJohn Crispin2015-04-091-3/+3
| | | | Signed-off-by: John Crispin <blogic@openwrt.org>
* properly handle return codesJohn Crispin2015-03-286-20/+32
| | | | Signed-off-by: John Crispin <blogic@openwrt.org>
* mount_root: keep track of overlay initialization state (via xattr)Felix Fietkau2015-03-224-1/+73
| | | | | | Remove all files (except sysupgrade.tgz) if /etc/init.d/done was not called Signed-off-by: Felix Fietkau <nbd@openwrt.org>
* overlay: call volume_init() before mountFelix Fietkau2015-03-221-2/+2
| | | | Signed-off-by: Felix Fietkau <nbd@openwrt.org>
* overlay: create a common function for deleting all overlay data (optionally ↵Felix Fietkau2015-03-223-28/+42
| | | | | | excluding sysupgrade.tgz) Signed-off-by: Felix Fietkau <nbd@openwrt.org>
* switch to _DEFAULT_SOURCE for modern glibc compatJohn Crispin2015-03-121-1/+1
| | | | Signed-off-by: Jeff Waugh <jdub@bethesignal.org>
* mount_root: better log messages for ram overlay casesJo-Philipp Wich2015-02-251-0/+4
| | | | Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>
* libfstools: clarify message when switching to internal overlayJo-Philipp Wich2015-02-251-1/+1
| | | | Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>
* libfstools: make mtd_volume_identify() less chattyJo-Philipp Wich2015-02-251-5/+0
| | | | Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>
* libfstools: remove dead source fileJo-Philipp Wich2015-02-251-236/+0
| | | | Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>
* libfstools: convert to ulog() apiJo-Philipp Wich2015-02-258-71/+73
| | | | Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>
* ubi: convert to ulog() apiJo-Philipp Wich2015-02-252-20/+22
| | | | Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>
* snapshot: convert to ulog() apiJo-Philipp Wich2015-02-251-16/+17
| | | | Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>
* jffs2reset: convert to ulog() apiJo-Philipp Wich2015-02-251-9/+11
| | | | Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>
* mount_root: convert to ulog() apiJo-Philipp Wich2015-02-251-2/+4
| | | | Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>
* block: convert to ulog() apiJo-Philipp Wich2015-02-251-81/+55
| | | | Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>
* block: don't declare find_root_dev with UBIFS_EXTROOTJo-Philipp Wich2015-02-251-1/+4
| | | | Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>
* libfstools: extroot: simplify kmodloader invocationJo-Philipp Wich2015-02-251-4/+3
| | | | | | | Now that kmodloader supports LD_LIBRARY_PATH and ignores argv[2] we can remove the extra argument and save one intermediate pointer. Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>
* libfstools: extroot: rework libdir and block tool discoveryJo-Philipp Wich2015-02-251-11/+26
| | | | | | Account for new upper/ directory component in recent overlayfs versions. Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>
* block: improve extroot error reportingJo-Philipp Wich2015-02-251-18/+61
| | | | Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>
* block: rework config loadingJo-Philipp Wich2015-02-181-16/+39
| | | | | | Account for the new upper/ directory component in recent overlayfs version. Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>
* block: add support for logging to dmesgJo-Philipp Wich2015-02-181-2/+31
| | | | Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>
* block: support finding root device by mount pointJo-Philipp Wich2015-02-171-2/+34
| | | | | | | | When checking extroot, fall back to using stat(/) to determine the root device node if no rootfs MTD partition can be found, e.g. on systems using an ext4 root filesystem. Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>
* block: extroot: remove unneeded rootfs testsJo-Philipp Wich2015-02-171-27/+0
| | | | | | | | The code testing for a "rootfs" MTD partition serves no actual purpose and the test results are not used either. On top of that it prevents working extroot on non-MTD systems, so drop the code. Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>
* block: support builtin fstab configJo-Philipp Wich2015-02-171-8/+10
| | | | | | Fall back to /etc/config/fstab if the file on the overlay cannot be loaded. Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>
* libfstools: extroot: support builtin blockJo-Philipp Wich2015-02-171-2/+5
| | | | | | | | | Fix regression introduced with migration to fs-tools. The old ubox based exroot did a fall back to /sbin/block if $cfg/sbin/block did not exist. Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>
* mount_root: try extroot even without mtd volumeJo-Philipp Wich2015-02-171-8/+8
| | | | | | | This is a precondition for supporting external overlays on ext4 root fs. Also rename volume pointer variables for better clarity. Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>
* jffs2reset: fix recursive file/directory removalFelix Fietkau2015-01-111-13/+13
| | | | Signed-off-by: Felix Fietkau <nbd@openwrt.org>
* libblkid-tiny: add btrfs probe infoDaniel Golle2015-01-073-1/+96
| | | | | | | | | | | | | | | This only adds the magic for btrfs to show btrfs volumes in block detect. In order to properly support btrfs with more than one device and avoid trying to mount the same device group once for each instance we have to make sure that only one device per group will be mounted (btrfs then automatically detects all other devices of the group). For unmounting, the opposite should be applied: umount if called for any of the devices in a mounted device group, unmount the filesystem. Signed-off-by: Daniel Golle <daniel@makrotopia.org> Signed-off-by: Felix Fietkau <nbd@openwrt.org>
* libfstools: ubi: rework reading volumesRafał Miłecki2015-01-061-7/+19
| | | | | | | | | | | | | UBI volume IDs don't have to be contiguous, this may happen if there were few and the not last one was removed. In such case we may have e.g. ubi0_0, ubi0_2. It means we can't simply read value from "volumes_count" and iterate from 0 to the count - 1. This patch rewrites ubi_part_match to read whole directory and look for ubi%d_%d entries in it. Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
* libfstools: ubi: avoid crash in volume finding functionRafał Miłecki2015-01-061-0/+4
| | | | | | | In case /sys/devices/virtual/ubi/ubi?/ubi?_?/name doesn't exist volname will be NULL and calling strlen for NULL isn't a good idea. Signed-off-by: Rafał Miłecki <zajec5@gmail.com>