aboutsummaryrefslogtreecommitdiffstats
path: root/package/base-files/files/lib/upgrade/common.sh
Commit message (Collapse)AuthorAgeFilesLines
* x86: preserve partition table on sysupgradeJo-Philipp Wich2016-02-091-0/+1
| | | | | | | | | | | | | | With this patch sysupgrade will write directly to the partitions instead of to the main disk. The UUID is copied from the image to the MBR as well. This prevents the mbr from being completely overwritten and losing the partition table. The -p option has been added to maintain the original behavior and overwite the entire disk with the new image. Tests have been added to ensure that the image partitions match up with the active partitions. Signed-off-by: Rob Mosher <nyt-openwrt@countercultured.net> SVN-Revision: 48682
* base-files: fix sysupgrade 'wget' handling for uclient-fetchFelix Fietkau2016-01-251-3/+4
| | | | | | | | | | | | | change 48451 tried to add support for uclient-fetch by moving /usr/bin/wget to /bin/wget, but this change kept the symbolic link to /bin/busybox as install_bin creates links to param 1 the desired fix is to link to uclient-fetch to wget: install_bin /bin/uclient-fetch /bin/wget Signed-off-by: John Clark <inindev@gmail.com> SVN-Revision: 48483
* base-files: fix sysupgrade 'wget' handlingFelix Fietkau2016-01-221-1/+1
| | | | | | | | | | | with r48379 and r48386 the path of wget changed. respect that and adjust the dirname. this fixes #21680 Signed-off-by: Bastian Bittorf <bittorf@bluebottle.com> SVN-Revision: 48451
* base-files: sysupgrade: quote source image nameJohn Crispin2015-09-141-2/+2
| | | | | | | | | | | | | | | | | | | get_image() eval a filename without quoting it, resulting in errors with filenames containing characters that need to be escaped. $ sysupgrade -T -f ./cfg\(12\).tar.gz img.bin; echo $? Image check 'platform_check_image' failed. Invalid config file. Please use only .tar.gz files 1 $ mv cfg\(12\).tar.gz cfg_12.tar.gz $ mv img\(1\).bin img.bin sysupgrade -T -f ./cfg_12.tar.gz img.bin; echo $? 0 Enclose the content of $from in double quotes. Signed-off-by: Adrien Schildknecht <adrien+dev@schischi.me> SVN-Revision: 46919
* base-files: default_do_upgrade: accept & forward image extraction commandJohn Crispin2015-06-051-2/+6
| | | | | | | | | | | get_image allows passing 2nd argument that is used in a pipe for extracting firmware from a non-native format. By accepting such command in default_do_upgrade we allow platforms to use this helper for vendor specific images. Signed-off-by: Rafał Miłecki <zajec5@gmail.com> SVN-Revision: 45900
* base-files: remove ubi toolLuka Perkov2015-05-291-1/+0
| | | | | | | | ubi tool was removed from fstools in r41128. Signed-off-by: Luka Perkov <luka@openwrt.org> SVN-Revision: 45813
* base-files: supress errors from lddJonas Gorski2014-11-191-1/+1
| | | | | | | | | | | | ldd might be called for shell scrips during sysupgrade, causing it to complain that they are not a dynamic executables. This is a harmless error, so supress it to avoid confusing about them being serious ones. Signed-off-by: Jonas Gorski <jogo@openwrt.org> SVN-Revision: 43315
* base-files: properly fix copying ld*.so with eglibcJonas Gorski2014-11-181-4/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | r36107 ("base-files: sysupgrade fail with eglibc") tried to fix sysupgrade by changing the ld-soname to what is expected, but only fixed MIPS while breaking ARM. The underlying issue is that the ld.so name varies widely across different architectures for eglibc: eglibc-2.19-r25243$ grep -r "ld-soname :=" . | awk '{ print $3 }' | sort -u ld64.so.1 ld64.so.2 ld-linux-aarch64_be.so.1 ld-linux-aarch64.so.1 ld-linux-armhf.so.3 ld-linux-mipsn8.so.1 ld-linux.so.2 ld-linux.so.3 ld-linux-x32.so.2 ld-linux-x86-64.so.2 ld.so.1 Instead of adding each different soname to check for and copy it, replace the awk script with a sed script to extract it properly and drop the hardcoded so-name. Signed-off-by: Jonas Gorski <jogo@openwrt.org> SVN-Revision: 43295
* base-files: fix ldd definition if /usr/bin/ldd existsFelix Fietkau2014-10-191-1/+1
| | | | | | Signed-off-by: Felix Fietkau <nbd@openwrt.org> SVN-Revision: 42976
* sysupgrade: Enable killing of all processes under upgradedJohn Crispin2014-07-101-12/+27
| | | | | | | | | | If the sysupgrade scripts is called under upgraded, it will not kill all other processes as it should to avoid interference by locked filesystem. This patch checks the parent and if it is upgraded, it kills all. Signed-off-by: André Valentin <avalentin@marcant.net> SVN-Revision: 41563
* base-files: fix ramfs / nand upgradeJohn Crispin2014-07-011-1/+1
| | | | | | | | /lib/{imx6,lantiq,...}.sh are needed in the ramfs for sysupgrade to work. Signed-off-by: John Crispin <blogic@openwrt.org> SVN-Revision: 41440
* base-files: regenerate the /lib64 symlink when switching to a ramdiskJohn Crispin2014-06-201-0/+2
| | | | | | Signed-off-by: John Crispin <blogic@openwrt.org> SVN-Revision: 41284
* base-files: add upgraded to the list of daemons not killedJohn Crispin2014-06-191-1/+1
| | | | | | Signed-off-by: John Crispin <blogic@openwrt.org> SVN-Revision: 41268
* base-files: properly remove stderr from zcat/bzcatJohn Crispin2014-06-111-2/+2
| | | | | | Signed-off-by: John Crispin <blogic@openwrt.org> SVN-Revision: 41135
* base-files: include more ubi* tools in sysupgrade ramdiskJohn Crispin2014-06-111-1/+4
| | | | | | | | | Also add some more busybox symlinks which are useful for sysupgrade on UBI-enabled devices. Signed-off-by: Daniel Golle <daniel@makrotopia.org> SVN-Revision: 41125
* base-files: Allow installation of symlinks using RAMFS_COPY_BIN env var.John Crispin2014-06-021-1/+1
| | | | | | | | http://patchwork.openwrt.org/patch/5086/ Signed-off-by: karl.vogel@gmail.com SVN-Revision: 40943
* base-files: the ubi tol should be installed when jumping to ram_fsJohn Crispin2014-04-071-0/+1
| | | | | | Signed-off-by: John Crispin <blogic@openwrt.org> SVN-Revision: 40420
* base-files: make use of new fstoolsJohn Crispin2014-04-071-1/+2
| | | | | | Signed-off-by: John Crispin <blogic@openwrt.org> SVN-Revision: 40416
* /lib/functions.sh: move rarely used mtd and macaddr related functions to ↵Felix Fietkau2014-04-071-1/+1
| | | | | | | | /lib/functions/system.sh Signed-off-by: Felix Fietkau <nbd@openwrt.org> SVN-Revision: 40411
* ubi-utils: mini version of mtd-utils that only includes ubi toolsJohn Crispin2014-04-031-2/+9
| | | | | | Signed-off-by: John Crispin <blogic@openwrt.org> SVN-Revision: 40367
* fstools: add the new fstools packageJohn Crispin2014-03-121-0/+2
| | | | | | Signed-off-by: John Crispin <blogic@openwrt.org> SVN-Revision: 39895
* base-files: fix mount-utils incompatibilityJohn Crispin2013-12-271-12/+12
| | | | | | Signed-off-by: Toke Høiland-Jørgensen <toke@toke.dk> SVN-Revision: 39169
* base-files: fix whitespacesLuka Perkov2013-12-091-6/+6
| | | | | | Signed-off-by: Luka Perkov <luka@openwrt.org> SVN-Revision: 39006
* ar71xx: Unifi AP Pro sysupgrade patchFelix Fietkau2013-11-141-1/+1
| | | | | | | | | | | | | | | | | | The current implementation of mtd will not append the backup file created by sysupgrade to the correct partition, as mtd will append the data to first jffs2 partition it finds. As the kernel is also stored on a jffs2 partition (which resides before the overlay partition), the data will be appended to this partition. To fix this problem, a new option -s <number> skip the first n bytes when appending data to the jffs2 partiton, defaults to "0" is added to mtd. Signed-off-by: Peter Wagner <tripolar@gmx.at> SVN-Revision: 38807
* base-files: don't kill nas for sysupgradeHauke Mehrtens2013-11-111-1/+1
| | | | | | Signed-off-by: Nathan Hintz <nlhintz@hotmail.com> SVN-Revision: 38766
* kernel/base-files: clean up old code related to refreshing mtd partitions, ↵Felix Fietkau2013-07-141-18/+5
| | | | | | | | it is no longer used anywhere Signed-off-by: Felix Fietkau <nbd@openwrt.org> SVN-Revision: 37282
* sysupgrade: fixes broken pipe error during sysupgadeJohn Crispin2013-05-051-2/+2
| | | | | | Signed-off-by: John Crispin <blogic@openwrt.org> SVN-Revision: 36548
* base-files: sysupgrade fail with eglibcFlorian Fainelli2013-03-221-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | With eglibc, "ldd busybox" give us libcrypt.so.1 => /lib/libcrypt.so.1 (0x774be000) libm.so.6 => /lib/libm.so.6 (0x773e4000) libgcc_s.so.1 => /lib/libgcc_s.so.1 (0x773c0000) libc.so.6 => /lib/libc.so.6 (0x77276000) /lib/ld.so.1 (0x774fe000) Thus /lib/ld.so.1 is not printed by the libs fonction and isn't copied to the 'new' root before pivot root libs() { ldd $* | awk '{print $3}'; } https://dev.openwrt.org/browser/trunk/package/base-files/files/lib/upgrade/common.sh With uclibc the last line of "ldd busybox" is ld-uClibc.so.0 => /lib/ld-uClibc.so.0 (0x77ada000) Don't know for musl! This patch replace https://dev.openwrt.org/changeset/19167, as glibc is gone The other way around is to rework libs() Please apply the fix (mine or another) on trunk and AA Might fix https://dev.openwrt.org/ticket/12273 Signed-off-by: Etienne CHAMPETIER <etienne.champetier@free.fr> Signed-off-by: Florian Fainelli <florian@openwrt.org> SVN-Revision: 36107
* sysupgrade was broken as procd was getting killedJohn Crispin2013-03-141-1/+1
| | | | | | Signed-off-by: John Crispin <blogic@openwrt.org> SVN-Revision: 36031
* make basefiles aware of procdJohn Crispin2013-03-131-1/+1
| | | | | | Signed-off-by: John Crispin <blogic@openwrt.org> SVN-Revision: 36003
* hot-fix nameclash in sysupgrade: rename pivot() to supivot() in sysupgradeMirko Vogt2012-12-211-2/+2
| | | | | | | | | | | | Sysupgrade defines its very own pivot() function. Prior merging boot.sh and functions.sh sysupgrade just included boot.sh, now it includes functions.sh which defines pivot() as well, however slightly different which causes sysupgrade to fail. This is a hot-fix to unbreak sysupgrade, however those two pivot() functions should actually get merged. SVN-Revision: 34815
* Do not overload mount-call - trying to reduce confusionMirko Vogt2012-12-191-6/+6
| | | | | | | | | | | The behaviour of calling 'mount' differed depending on whether it called the busybox-mount, the mount of util-linux, the mount defined in /lib/functions.sh and /lib/functions/boot.sh /etc/preinit even included /lib/functions.sh and /lib/functions/boot.sh, both re-defining 'mount'. SVN-Revision: 34792
* base-files: ensure that /sys is available during sysupgrade, some essential ↵Jo-Philipp Wich2012-07-031-1/+5
| | | | | | services like om-watchdog need it SVN-Revision: 32587
* /etc/functions.sh => /lib/functions.shJo-Philipp Wich2012-06-051-1/+1
| | | | SVN-Revision: 32062
* base-files: kill ubusd and udhcpc on sysupgrade as wellFelix Fietkau2012-05-231-1/+1
| | | | SVN-Revision: 31852
* base-files: allow sysupgrade to kill netifd, fixes pppd shutdown on upgradeFelix Fietkau2012-05-231-1/+1
| | | | SVN-Revision: 31851
* package/base-files: copy /lib/functions.sh to the ramfs on sysupgradeGabor Juhos2012-05-231-1/+1
| | | | SVN-Revision: 31842
* base-files: rewrite killing of nonessential services to not rely on top, use ↵Jo-Philipp Wich2011-11-161-9/+17
| | | | | | the proc filesystem only SVN-Revision: 29187
* base-files: do not kill udhcpc on sysupgrade, it will tear down the ↵Jo-Philipp Wich2011-11-081-1/+1
| | | | | | interface if terminated SVN-Revision: 28863
* base-files: do not assume that "top" is busybox' top, but try to call the ↵Jo-Philipp Wich2011-11-081-1/+1
| | | | | | applet explicitely SVN-Revision: 28862
* base-files: add some more protected services to sysupgrade kill blacklistJo-Philipp Wich2011-11-031-1/+1
| | | | SVN-Revision: 28732
* base-files: fix typoJo-Philipp Wich2011-10-301-1/+1
| | | | SVN-Revision: 28681
* base-files: sysupgrade: kill all but essential processes before starting the ↵Jo-Philipp Wich2011-10-271-0/+24
| | | | | | update SVN-Revision: 28626
* base-files/sysupgrade: add more busybox applet symlinks to ramdiskGabor Juhos2011-10-271-1/+6
| | | | | | | | | Adds symlinks for printf and wc to make life happier in the sysupgrade ramdisk. Also make code more readable by escaping that overly long line. Signed-off-by: Daniel Golle <dgolle@allnet.de> SVN-Revision: 28616
* base-files: use "reboot -f" after sysupgrade to prevent executing deleted ↵Jo-Philipp Wich2011-07-251-1/+1
| | | | | | init scripts SVN-Revision: 27776
* package/base-files: add get_magic_long() to common upgrade scriptGabor Juhos2011-01-261-0/+4
| | | | | | Patch-by: Mark Mentovai <mark@moxienet.com> SVN-Revision: 25117
* change from /jffs to /overlay, patch from Daniel DickinsonFlorian Fainelli2010-03-211-5/+5
| | | | SVN-Revision: 20356
* base-files: sysupgade library coomon.sh has "bug" in glibc enviorement. For ↵Jo-Philipp Wich2010-01-161-0/+3
| | | | | | some reason ld-linux.so.3 is not installed at ramfs and sysupgrade always fails. Signed-off-by: Zintis Petersons <zintis.petersons@e-mail.lv> SVN-Revision: 19167
* base-files: fix sysupgrade get_magic_word() function to return proper values ↵Jo-Philipp Wich2009-08-191-1/+1
| | | | | | if the first two bytes are identical SVN-Revision: 17319
* base-files: Fix sysupgrade .tar.gz configuration restoringVasilis Tsiligiannis2009-06-291-12/+12
| | | | SVN-Revision: 16626