From 5dda0ade5a5e3d2ba5b6be88150ace237dbedf73 Mon Sep 17 00:00:00 2001 From: Markham Date: Fri, 7 Oct 2022 14:48:35 +0200 Subject: [PATCH] bump version ofgwrite-4.6.1 --- ...eutrino.patch => ofg-4.6.1-neutrino.patch} | 71 +++++++++--------- archive-patches/ofgwrite/ofgwrite | 20 +++++ archive-patches/ofgwrite/ofgwrite.patch | 14 ---- archive-patches/ofgwrite/ofgwrite_caller | 75 +++++++++++++++++++ make/archives.mk | 3 - make/ofgwrite.mk | 30 +------- make/versions.mk | 3 - 7 files changed, 131 insertions(+), 85 deletions(-) rename archive-patches/ofgwrite/{ofgwrite-neutrino.patch => ofg-4.6.1-neutrino.patch} (75%) create mode 100755 archive-patches/ofgwrite/ofgwrite delete mode 100644 archive-patches/ofgwrite/ofgwrite.patch create mode 100755 archive-patches/ofgwrite/ofgwrite_caller diff --git a/archive-patches/ofgwrite/ofgwrite-neutrino.patch b/archive-patches/ofgwrite/ofg-4.6.1-neutrino.patch similarity index 75% rename from archive-patches/ofgwrite/ofgwrite-neutrino.patch rename to archive-patches/ofgwrite/ofg-4.6.1-neutrino.patch index 79f9d5f..22d096f 100644 --- a/archive-patches/ofgwrite/ofgwrite-neutrino.patch +++ b/archive-patches/ofgwrite/ofg-4.6.1-neutrino.patch @@ -45,44 +45,35 @@ set_step_progress(time * 100 / max_time); } -@@ -780,6 +783,7 @@ int umount_rootfs(int steps) - // create directories - ret += chdir("/newroot"); - ret += mkdir("/newroot/bin", 777); -+ ret += mkdir("/newroot/boot", 777); // M - ret += mkdir("/newroot/dev", 777); - ret += mkdir("/newroot/etc", 777); - ret += mkdir("/newroot/dev/pts", 777); -@@ -792,11 +796,13 @@ int umount_rootfs(int steps) +@@ -792,11 +795,11 @@ int umount_rootfs(int steps) ret += mkdir("/newroot/run", 777); ret += mkdir("/newroot/sbin", 777); ret += mkdir("/newroot/sys", 777); - ret += mkdir("/newroot/usr", 777); - ret += mkdir("/newroot/usr/lib", 777); - ret += mkdir("/newroot/usr/lib/autofs", 777); -- ret += mkdir("/newroot/var", 777); ++// ret += mkdir("/newroot/usr", 777); // M ++// ret += mkdir("/newroot/usr/lib", 777); // M ++// ret += mkdir("/newroot/usr/lib/autofs", 777); // M + ret += mkdir("/newroot/var", 777); - ret += mkdir("/newroot/var/volatile", 777); -+//M ret += mkdir("/newroot/usr", 777); -+//M ret += mkdir("/newroot/usr/lib", 777); -+//M ret += mkdir("/newroot/usr/lib/autofs", 777); -+ ret += mkdir("/newroot/lib", 777); // M -+ ret += mkdir("/newroot/lib/autofs", 777); //M -+ ret += mkdir("/newroot/var", 777); //M -+//M ret += mkdir("/newroot/var/volatile", 777); ++// ret += mkdir("/newroot/var/volatile", 777); // M /* if (multilib) -@@ -917,7 +923,9 @@ int umount_rootfs(int steps) +@@ -916,8 +919,9 @@ int umount_rootfs(int steps) + */ // Switch to user mode 1 - my_printf("Switching to user mode 2\n"); -+/* // M - ret = system("init 2"); -+*/ +- my_printf("Switching to user mode 2\n"); +- ret = system("init 2"); ++// my_printf("Switching to user mode 2\n"); // ++// ret = system("init 2"); // M ++ if (ret) { my_printf("Error switching runmode!\n"); -@@ -928,12 +936,15 @@ int umount_rootfs(int steps) +@@ -928,12 +932,15 @@ int umount_rootfs(int steps) // it can take several seconds until Neutrino is shut down // wait because otherwise remounting read only is not possible @@ -98,7 +89,7 @@ return 0; } -@@ -941,8 +952,10 @@ int umount_rootfs(int steps) +@@ -941,8 +948,10 @@ int umount_rootfs(int steps) // reopen framebuffer to show the GUI close_framebuffer(); init_framebuffer(steps); @@ -109,7 +100,7 @@ set_step_without_incr("Start flashing"); sleep(2); -@@ -952,19 +965,26 @@ int umount_rootfs(int steps) +@@ -952,7 +961,9 @@ int umount_rootfs(int steps) my_printf("Error executing pivot_root!\n"); set_error_text("Error pivot_root! Abort flashing."); sleep(5); @@ -119,14 +110,10 @@ return 0; } - ret = chdir("/"); - // move mounts to new root - ret = mount("/oldroot/dev/", "dev/", NULL, MS_MOVE, NULL); -+ ret = mount("/oldroot/boot/", "boot/", NULL, MS_MOVE, NULL); // M +@@ -962,9 +973,12 @@ int umount_rootfs(int steps) ret += mount("/oldroot/proc/", "proc/", NULL, MS_MOVE, NULL); ret += mount("/oldroot/sys/", "sys/", NULL, MS_MOVE, NULL); ret += mount("/oldroot/mnt/", "mnt/", NULL, MS_MOVE, NULL); -+ ret += mount("/oldroot/var/lib/nfs/", "var/lib/nfs/", NULL, MS_MOVE, NULL); // M +/* // M ret += mount("/oldroot/var/volatile", "var/volatile/", NULL, MS_MOVE, NULL); + @@ -136,7 +123,7 @@ if (ret != 0) { my_printf("Error move mounts to newroot\n"); -@@ -1004,6 +1024,8 @@ int umount_rootfs(int steps) +@@ -1004,6 +1018,8 @@ int umount_rootfs(int steps) // create link for mount/umount for autofs ret = symlink("/bin/busybox", "/bin/mount"); ret += symlink("/bin/busybox", "/bin/umount"); @@ -145,7 +132,16 @@ /* // try to restart autofs -@@ -1309,7 +1331,7 @@ void find_kernel_rootfs_device() +@@ -1015,7 +1031,7 @@ int umount_rootfs(int steps) + */ + + // restart init process +- ret = system("exec init u"); ++// ret = system("exec init u"); // M + sleep(3); + + // kill all remaining open processes which prevent umounting rootfs +@@ -1309,7 +1325,7 @@ void find_kernel_rootfs_device() if (((current_rootfs_sub_dir[0] == '\0' && strcmp(rootfs_device, current_rootfs_device) != 0 && rootfs_flash_mode != MTD) || ( current_rootfs_sub_dir[0] != '\0' && strcmp(current_rootfs_sub_dir, rootfs_sub_dir) != 0 ) @@ -154,7 +150,7 @@ ) { stop_neutrino_needed = 0; -@@ -1461,7 +1483,18 @@ int main(int argc, char *argv[]) +@@ -1461,7 +1477,18 @@ int main(int argc, char *argv[]) return EXIT_FAILURE; my_printf("\n"); @@ -174,7 +170,7 @@ if (flash_kernel && !flash_rootfs) // flash only kernel { if (!quiet) -@@ -1486,7 +1519,10 @@ int main(int argc, char *argv[]) +@@ -1486,7 +1513,10 @@ int main(int argc, char *argv[]) { my_printf("failed. System won't boot. Please flash backup!\n"); set_error_text1("Error flashing kernel. System won't boot!"); @@ -186,7 +182,7 @@ sleep(60); } closelog(); -@@ -1545,6 +1581,7 @@ int main(int argc, char *argv[]) +@@ -1545,6 +1575,7 @@ int main(int argc, char *argv[]) ret = system("/etc/init.d/samba stop"); // stop autofs ret = system("/etc/init.d/autofs stop"); @@ -194,7 +190,7 @@ // ignore return values, because the processes might not run } -@@ -1553,8 +1590,9 @@ int main(int argc, char *argv[]) +@@ -1553,8 +1584,9 @@ int main(int argc, char *argv[]) set_step("Syncing filesystem"); sync(); sleep(1); @@ -205,7 +201,7 @@ if (!no_write && stop_neutrino_needed) { if (!daemonize()) -@@ -1666,6 +1704,7 @@ int main(int argc, char *argv[]) +@@ -1666,6 +1698,7 @@ int main(int argc, char *argv[]) sleep(3); if (!no_write && stop_neutrino_needed) { @@ -213,3 +209,4 @@ my_printf("Rebooting in 3 seconds...\n"); set_step("Successfully flashed! Rebooting in 3 seconds..."); sleep(3); +Gemeinsame Unterverzeichnisse: ofgwrite-max_orig.git/ubi-utils und ofgwrite-max.git/ubi-utils. diff --git a/archive-patches/ofgwrite/ofgwrite b/archive-patches/ofgwrite/ofgwrite new file mode 100755 index 0000000..3ab7a35 --- /dev/null +++ b/archive-patches/ofgwrite/ofgwrite @@ -0,0 +1,20 @@ +#!/bin/sh + +prefix= + +echo "Creating /newroot" +mkdir -p /newroot + +echo "Mounting /newroot to tempfs" +mount -t tmpfs tmpfs /newroot + +if [ -e /tmp/backup_flash.tar.gz ]; then + echo "Moving /tmp/backup_flash.tar.gz to /newroot" + mv /tmp/backup_flash.tar.gz /newroot/ +fi + +echo "Copying ofgwrite_bin to /newroot" +cp $prefix/bin/ofgwrite_bin /newroot/ + +echo "Calling /newroot/ofgwrite_bin $@" +/newroot/ofgwrite_bin "$@" diff --git a/archive-patches/ofgwrite/ofgwrite.patch b/archive-patches/ofgwrite/ofgwrite.patch deleted file mode 100644 index 2d9e37f..0000000 --- a/archive-patches/ofgwrite/ofgwrite.patch +++ /dev/null @@ -1,14 +0,0 @@ ---- a/ofgwrite.c -+++ b/ofgwrite.c -@@ -942,9 +942,9 @@ - ret += mount("/oldroot/proc/", "proc/", NULL, MS_MOVE, NULL); - ret += mount("/oldroot/sys/", "sys/", NULL, MS_MOVE, NULL); - ret += mount("/oldroot/mnt/", "mnt/", NULL, MS_MOVE, NULL); -- ret += mount("/oldroot/var/volatile", "var/volatile/", NULL, MS_MOVE, NULL); -+ //ret += mount("/oldroot/var/volatile", "var/volatile/", NULL, MS_MOVE, NULL); - // create link for tmp -- ret += symlink("/var/volatile/tmp", "/tmp"); -+ //ret += symlink("/var/volatile/tmp", "/tmp"); - if (ret != 0) - { - my_printf("Error move mounts to newroot\n"); diff --git a/archive-patches/ofgwrite/ofgwrite_caller b/archive-patches/ofgwrite/ofgwrite_caller new file mode 100755 index 0000000..0264072 --- /dev/null +++ b/archive-patches/ofgwrite/ofgwrite_caller @@ -0,0 +1,75 @@ +#!/bin/sh + +if [ $# -lt 2 ]; then + echo "[${0##*/}] Usage: $0 [options]" + exit 1 +fi + +echo "Starting ${0##*/} $@" + +echo "Creating tempdir" +workdir=$(mktemp -d "$1"/update-XXXXXX) +cd $workdir + +echo "Unpacking $2 to $workdir" +if [ "${2##*.}" = "tgz" ]; then + tar zxvf $2 +elif [ "${2##*.}" = "zip" ]; then + unzip -oj $2 -x *disk.img* +else + exit 1 +fi + +if [ "${2:0:5}" == "/tmp/" ]; then + echo "Delete: $2" + rm -f $2 +fi + +echo "Shifting options" +shift 2 + +if [ -e /boot/STARTUP ]; then + echo "Check for VU+ 4K" + model=`cat /proc/stb/info/model` + [ -e /proc/stb/info/vumodel ] && vumodel=`cat /proc/stb/info/vumodel` + [ "$model" == "dm8000" ] && [ "$vumodel" == "solo4k" ] && model=$vumodel + [ "$model" == "dm8000" ] && [ "$vumodel" == "duo4k" ] && model=$vumodel + [ "$model" == "dm8000" ] && [ "$vumodel" == "duo4kse" ] && model=$vumodel + [ "$model" == "dm8000" ] && [ "$vumodel" == "ultimo4k" ] && model=$vumodel + [ "$model" == "dm8000" ] && [ "$vumodel" == "uno4k" ] && model=$vumodel + [ "$model" == "dm8000" ] && [ "$vumodel" == "uno4kse" ] && model=$vumodel + [ "$model" == "dm8000" ] && [ "$vumodel" == "zero4k" ] && model=$vumodel + case $model in + solo4k|duo4k|duo4kse|ultimo4k|uno4k|uno4kse|zero4k) + echo "VU+ 4K model found." + PART=`echo $@ | grep "\-m" | cut -d "m" -f2 | cut -d " " -f1` + echo "PART=$PART" + if [ "$PART" != "" ]; then + echo "VU+ 4K - multi part - renaming kernel and root to kernel${PART}_auto.bin and rootfs${PART}.tar.bz2." + [ -e $workdir/kernel1_auto.bin -o -e $workdir/kernel2_auto.bin -o -e $workdir/kernel3_auto.bin -o -e $workdir/kernel4_auto.bin ] && [ -e $workdir/kernel_auto.bin ] && rm $workdir/kernel_auto.bin* && find $workdir -name "kernel?_auto.bin" -exec mv -f {} $workdir/kernel${PART}_auto.bin \; || mv -f $workdir/kernel_auto.bin $workdir/kernel${PART}_auto.bin + [ -e $workdir/kernel1_auto.bin -o -e $workdir/kernel2_auto.bin -o -e $workdir/kernel3_auto.bin -o -e $workdir/kernel4_auto.bin ] && find $workdir -name "kernel?_auto.bin" -exec mv -f {} $workdir/kernel${PART}_auto.bin \; || mv -f $workdir/kernel_auto.bin $workdir/kernel${PART}_auto.bin + [ -e $workdir/rootfs1.tar.bz2 -o -e $workdir/rootfs2.tar.bz2 -o -e $workdir/rootfs3.tar.bz2 -o -e $workdir/rootfs4.tar.bz2 ] && [ -e $workdir/rootfs.tar.bz2 ] && rm $workdir/rootfs.tar.bz2* && find $workdir -name "rootfs?.tar.bz2" -exec mv -f {} $workdir/rootfs${PART}.tar.bz2 \; || mv -f $workdir/rootfs.tar.bz2 $workdir/rootfs${PART}.tar.bz2 + [ -e $workdir/rootfs1.tar.bz2 -o -e $workdir/rootfs2.tar.bz2 -o -e $workdir/rootfs3.tar.bz2 -o -e $workdir/rootfs4.tar.bz2 ] && find $workdir -name "rootfs?.tar.bz2" -exec mv -f {} $workdir/rootfs${PART}.tar.bz2 \; || mv -f $workdir/rootfs.tar.bz2 $workdir/rootfs${PART}.tar.bz2 + else + echo "VU+ 4K - no multi part." + fi + ;; + *) + echo "No VU+ 4K model." + ;; + esac +fi + +echo "Calling ofgwrite $@ $workdir" +ofgwrite $@ $workdir + +cd /tmp + +#echo "Unmounting /newroot" +#umount /newroot + +#echo "Removing /newroot" +#rm -rf /newroot + +#echo "Removing tempdir" +#rm -rf $workdir diff --git a/make/archives.mk b/make/archives.mk index e7d4f9c..5e60832 100755 --- a/make/archives.mk +++ b/make/archives.mk @@ -387,9 +387,6 @@ $(ARCHIVE)/hd-idle-$(HD_IDLE_VER).tgz: $(ARCHIVE)/tzdata$(TZ_VER).tar.gz: $(WGET) ftp://ftp.iana.org/tz/releases/tzdata$(TZ_VER).tar.gz -$(ARCHIVE)/ofgwrite-git-$(OFGWRITE_VER).tar.bz2: - get-git-archive.sh https://bitbucket.org/max_10/ofgwrite-nmp.git $(OFGWRITE_VER) $(notdir $@) $(ARCHIVE) - $(ARCHIVE)/u-boot-$(U-BOOT_VER).tar.bz2: $(WGET) ftp://ftp.denx.de/pub/u-boot/u-boot-$(U-BOOT_VER).tar.bz2 diff --git a/make/ofgwrite.mk b/make/ofgwrite.mk index 144f8a3..ec4c81f 100644 --- a/make/ofgwrite.mk +++ b/make/ofgwrite.mk @@ -5,16 +5,12 @@ OFGWRITE_VERSION = git OFGWRITE_SOURCE = ofgwrite-max.$(OFGWRITE_VERSION) OFGWRITE_SITE = https://github.com/MaxWiesel/$(OFGWRITE_SOURCE) -OFGWRITE_PATCH = ofgwrite-neutrino.patch -#OFGWRITE_PATCH += ofgwrite.patch -OFGWRITE_PATCH += ofgwrite_bin.patch - +OFGWRITE_PATCH = ofg-4.6.1-neutrino.patch $(ARCHIVE)/$(OFGWRITE_SOURCE).tar.bz2: get-git-archive.sh $(OFGWRITE_SITE) master $(notdir $@) $(ARCHIVE) -$(D)/ofgwrite_new: $(ARCHIVE)/$(OFGWRITE_SOURCE).tar.bz2 | $(TARGETREFIX) - echo $(OFGWRITE_SOURCE) +$(D)/ofgwrite: $(ARCHIVE)/$(OFGWRITE_SOURCE).tar.bz2 | $(TARGETREFIX) $(START_BUILD) $(REMOVE)/$(OFGWRITE_SOURCE) $(UNTAR)/$(OFGWRITE_SOURCE).tar.bz2 @@ -30,25 +26,3 @@ $(D)/ofgwrite_new: $(ARCHIVE)/$(OFGWRITE_SOURCE).tar.bz2 | $(TARGETREFIX) install -m 0755 $(BUILD_TMP)/$(OFGWRITE_SOURCE)/ofgwrite $(TARGETPREFIX)/bin $(REMOVE)/$(OFGWRITE_SOURCE) $(TOUCH) - -# -# ofgwrite -# -$(D)/ofgwrite: $(ARCHIVE)/ofgwrite-git-$(OFGWRITE_VER).tar.bz2 | $(TARGETPREFIX) - $(START_BUILD) - $(REMOVE)/ofgwrite-git-$(OFGWRITE_VER) - $(UNTAR)/ofgwrite-git-$(OFGWRITE_VER).tar.bz2 - set -e; cd $(BUILD_TMP)/ofgwrite-git-$(OFGWRITE_VER); \ - $(PATCH)/ofgwrite.patch; \ - $(PATCH)/ofgwrite-neutrino.patch; \ - $(PATCH)/ofgwrite-fix-build-with-glibc-2.25.patch; \ - $(PATCH)/ofgwrite-fix-build-with-gcc10-fno-common.patch; \ - export CC=$(TARGET)-gcc && \ - export AR=$(TARGET)-ar && \ - $(BUILDENV); \ - $(MAKE); - install -m 0755 $(PATCHES)/ofgwrite/ofgwrite $(TARGETPREFIX)/bin - install -m 0755 $(PATCHES)/ofgwrite/ofgwrite_caller $(TARGETPREFIX)/bin - install -m 0755 $(BUILD_TMP)/ofgwrite-git-$(OFGWRITE_VER)/ofgwrite_bin $(TARGETPREFIX)/bin - $(REMOVE)/ofgwrite-git-$(OFGWRITE_VER) - $(TOUCH) \ No newline at end of file diff --git a/make/versions.mk b/make/versions.mk index 081b372..5459bd7 100644 --- a/make/versions.mk +++ b/make/versions.mk @@ -205,9 +205,6 @@ NTFS_3G_VER=2016.2.22 # ntp; synchronize system clock over a network NTP_VER=4.2.8p15 -# ofgwrite from Betacentauri: Based upon: mtd-utils-native-1.5.1 and busybox 1.24.1 -OFGWRITE_VER = b2823ee - # openssl; toolkit for the SSL v2/v3 and TLS v1 protocol OPENSSL_VER=1.1.1 OPENSSL_SUBVER=q -- 2.39.5