Re: [OpenWrt-Devel] [PATCH 1/2] mvebu: move HARDEN_BRANCH_PREDICTOR to common config

2019-01-13 Thread Rosen Penev
On Sun, Jan 13, 2019 at 12:29 PM Tomasz Maciej Nowak  wrote:
>
> This symbol is enabled in all subtargets, move it to common kernel
> config.
>
> Signed-off-by: Tomasz Maciej Nowak 
> ---
>  target/linux/mvebu/config-4.14  | 1 +
>  target/linux/mvebu/cortexa53/config-default | 1 -
>  target/linux/mvebu/cortexa72/config-default | 1 -
>  target/linux/mvebu/cortexa9/config-default  | 1 -
>  4 files changed, 1 insertion(+), 3 deletions(-)
>  delete mode 100644 target/linux/mvebu/cortexa9/config-default
>
> diff --git a/target/linux/mvebu/config-4.14 b/target/linux/mvebu/config-4.14
> index 296da5a109..cb26a927f9 100644
> --- a/target/linux/mvebu/config-4.14
> +++ b/target/linux/mvebu/config-4.14
> @@ -212,6 +212,7 @@ CONFIG_GPIO_PCA953X_IRQ=y
>  CONFIG_GPIO_SYSFS=y
>  # CONFIG_GRO_CELLS is not set
>  CONFIG_HANDLE_DOMAIN_IRQ=y
> +CONFIG_HARDEN_BRANCH_PREDICTOR=y
>  CONFIG_HARDIRQS_SW_RESEND=y
>  CONFIG_HAS_DMA=y
>  CONFIG_HAS_IOMEM=y
> diff --git a/target/linux/mvebu/cortexa53/config-default 
> b/target/linux/mvebu/cortexa53/config-default
> index b631c30f5f..c5fcc0f3f8 100644
> --- a/target/linux/mvebu/cortexa53/config-default
> +++ b/target/linux/mvebu/cortexa53/config-default
> @@ -65,7 +65,6 @@ CONFIG_GENERIC_CSUM=y
>  CONFIG_GENERIC_IRQ_MIGRATION=y
>  CONFIG_GENERIC_PINCONF=y
>  CONFIG_GENERIC_TIME_VSYSCALL=y
> -CONFIG_HARDEN_BRANCH_PREDICTOR=y
>  CONFIG_HAVE_ALIGNED_STRUCT_PAGE=y
>  CONFIG_HAVE_ARCH_HUGE_VMAP=y
>  CONFIG_HAVE_ARCH_KASAN=y
> diff --git a/target/linux/mvebu/cortexa72/config-default 
> b/target/linux/mvebu/cortexa72/config-default
> index 50b8d21c32..b855aa21d1 100644
> --- a/target/linux/mvebu/cortexa72/config-default
> +++ b/target/linux/mvebu/cortexa72/config-default
> @@ -63,7 +63,6 @@ CONFIG_GENERIC_CSUM=y
>  CONFIG_GENERIC_IRQ_MIGRATION=y
>  CONFIG_GENERIC_PINCONF=y
>  CONFIG_GENERIC_TIME_VSYSCALL=y
> -CONFIG_HARDEN_BRANCH_PREDICTOR=y
>  CONFIG_HAVE_ALIGNED_STRUCT_PAGE=y
>  CONFIG_HAVE_ARCH_HUGE_VMAP=y
>  CONFIG_HAVE_ARCH_KASAN=y
> diff --git a/target/linux/mvebu/cortexa9/config-default 
> b/target/linux/mvebu/cortexa9/config-default
> deleted file mode 100644
> index c9f039ba96..00
> --- a/target/linux/mvebu/cortexa9/config-default
> +++ /dev/null
> @@ -1 +0,0 @@
> -CONFIG_HARDEN_BRANCH_PREDICTOR=y
Acked-by: Rosen Penev 

I've been carrying this in my tree since it got introduced as it broke
my builds (probably needed a new .config file).
> --
> 2.20.1
>
>
> ___
> openwrt-devel mailing list
> openwrt-devel@lists.openwrt.org
> https://lists.openwrt.org/mailman/listinfo/openwrt-devel

___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] [PATCH] e2fsprogs: Update to 1.43.5

2019-01-13 Thread Rosen Penev
On Sun, Jan 13, 2019 at 3:50 AM Jo-Philipp Wich  wrote:
>
> Hi,
>
> > Remove patch 000-relocatable.patch as it seems to be no longer needed.
>
> did you verify that the generated compile_et and make_cmds scripts are
> installed without absolute paths in the host staging directory?
This is what I got for the former:

mangix@mangix-pc:~/devstuff/openwrt/staging_dir$ find | grep compile_et
./hostpkg/bin/compile_et
./host/share/man/man1/compile_et.1
./host/bin/compile_et

none are symlinks.

The datarootdir variable got removed, which is most of the patch.
>
> If not, then removing this path will result in very hard to debug SDK
> build failures for packages relying on libcom_err or libss.
>
> ~ Jo
>
> ___
> openwrt-devel mailing list
> openwrt-devel@lists.openwrt.org
> https://lists.openwrt.org/mailman/listinfo/openwrt-devel

___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [RFC 6/6] grub2: add preinit hook for bootloader upgrade

2019-01-13 Thread Tomasz Maciej Nowak
The current OpenWrt installations lack the necessary bits to upgrade
bootloader on sysupgrade, therefore add preinit hook which will perform
upgrade of bootloader on first boot.

Signed-off-by: Tomasz Maciej Nowak 
---
 package/boot/grub2/Makefile   |  6 ++
 .../boot/grub2/files/81_upgrade_bootloader| 20 +++
 2 files changed, 26 insertions(+)
 create mode 100644 package/boot/grub2/files/81_upgrade_bootloader

diff --git a/package/boot/grub2/Makefile b/package/boot/grub2/Makefile
index 4445a30ea8..a0ab36f328 100644
--- a/package/boot/grub2/Makefile
+++ b/package/boot/grub2/Makefile
@@ -143,6 +143,9 @@ define Package/grub2-generic/install
$(1)/usr/lib/grub/grub2/
printf 
'BL=$(PKG_NAME)\nBL_VARIANT=generic\nBL_VERSION=$(PKG_VERSION)\nBL_RELEASE=$(PKG_RELEASE)\n'
 \
> $(1)/usr/lib/grub/grub2/bl-release
+
+   $(INSTALL_DIR) $(1)/lib/preinit
+   $(CP) ./files/81_upgrade_bootloader $(1)/lib/preinit/
 endef
 
 define Package/grub2-legacy/install
@@ -155,6 +158,9 @@ define Package/grub2-legacy/install
$(1)/usr/lib/grub/grub2/
printf 
'BL=$(PKG_NAME)\nBL_VARIANT=legacy\nBL_VERSION=$(PKG_VERSION)\nBL_RELEASE=$(PKG_RELEASE)\n'
 \
> $(1)/usr/lib/grub/grub2/bl-release
+
+   $(INSTALL_DIR) $(1)/lib/preinit
+   $(CP) ./files/81_upgrade_bootloader $(1)/lib/preinit/
 endef
 
 $(eval $(call HostBuild))
diff --git a/package/boot/grub2/files/81_upgrade_bootloader 
b/package/boot/grub2/files/81_upgrade_bootloader
new file mode 100644
index 00..c1f2325cc0
--- /dev/null
+++ b/package/boot/grub2/files/81_upgrade_bootloader
@@ -0,0 +1,20 @@
+#!/bin/sh
+
+upgrade_bootloader() {
+   local diskdev
+
+   . /lib/upgrade/common.sh
+
+   if [ ! -f /boot/bl-release ] && export_bootdevice && export_partdevice 
diskdev 0; then
+   echo "(hd0) /dev/$diskdev" > /tmp/device.map
+   echo "- bootloader upgrade -"
+   /usr/sbin/grub-bios-setup \
+   -m "/tmp/device.map" \
+   -d "/usr/lib/grub/grub2" \
+   -r "hd0,msdos1" \
+   "/dev/$diskdev" \
+   && cp -f /usr/lib/grub/grub2/bl-release /boot/
+   fi
+}
+
+[ "$INITRAMFS" = "1" ] || boot_hook_add preinit_main upgrade_bootloader
-- 
2.20.1


___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [RFC 0/6] x86: switch to generic image generation code and

2019-01-13 Thread Tomasz Maciej Nowak
This is aftermath of partially failed series [1].
When I was searching for ways to upgrade of bootloader on existing
OpenWrt installations, I noticed that it'll be difficult to add this
feature within existing code creating x86 target images. I decided to
switch this code to generic one, wich is used in most of the OpenWrt
targets. Both of the chages are rather intrusive hence te RFC tag.
Please voice Your concerns and opinions.

https://patchwork.ozlabs.org/cover/1000625

Tomasz Maciej Nowak (6):
  x86/grub2: move grub2 image creation to grub2 package
  x86: switch image generation to new code
  x86: remove obsolete profiles
  x86: geode: shrink amount of default packages
  x86/grub2: add bootloader upgrade on sysupgrade
  grub2: add preinit hook for bootloader upgrade

 config/Config-images.in   |  22 +-
 include/image.mk  |   1 -
 package/boot/grub2/Makefile   |  79 ++-
 .../boot/grub2/files/81_upgrade_bootloader|  20 ++
 .../boot/grub2/files}/grub-early.cfg  |   0
 target/linux/x86/64/profiles/000-Generic.mk   |  15 --
 target/linux/x86/64/target.mk |   2 +-
 target/linux/x86/Makefile |   4 +-
 .../x86/base-files/lib/upgrade/platform.sh|  27 ++-
 .../linux/x86/generic/profiles/000-Generic.mk |  18 --
 target/linux/x86/generic/target.mk|   2 +-
 .../linux/x86/geode/profiles/000-Generic.mk   |  20 --
 target/linux/x86/geode/profiles/100-Geos.mk   |  19 --
 target/linux/x86/geode/target.mk  |  14 +-
 target/linux/x86/image/64.mk  |   5 +
 target/linux/x86/image/Makefile   | 199 +++---
 target/linux/x86/image/generic.mk |   8 +
 target/linux/x86/image/geode.mk   |  16 ++
 target/linux/x86/image/grub-iso.cfg   |   2 +-
 .../linux/x86/image/{grub.cfg => grub-pc.cfg} |   4 +-
 target/linux/x86/image/legacy.mk  |   8 +
 .../linux/x86/legacy/profiles/000-Generic.mk  |  18 --
 target/linux/x86/legacy/target.mk |   1 +
 23 files changed, 255 insertions(+), 249 deletions(-)
 create mode 100644 package/boot/grub2/files/81_upgrade_bootloader
 rename {target/linux/x86/image => package/boot/grub2/files}/grub-early.cfg 
(100%)
 delete mode 100644 target/linux/x86/64/profiles/000-Generic.mk
 delete mode 100644 target/linux/x86/generic/profiles/000-Generic.mk
 delete mode 100644 target/linux/x86/geode/profiles/000-Generic.mk
 delete mode 100644 target/linux/x86/geode/profiles/100-Geos.mk
 create mode 100644 target/linux/x86/image/64.mk
 create mode 100644 target/linux/x86/image/generic.mk
 create mode 100644 target/linux/x86/image/geode.mk
 rename target/linux/x86/image/{grub.cfg => grub-pc.cfg} (57%)
 create mode 100644 target/linux/x86/image/legacy.mk
 delete mode 100644 target/linux/x86/legacy/profiles/000-Generic.mk

-- 
2.20.1


___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [RFC 1/6] x86/grub2: move grub2 image creation to grub2 package

2019-01-13 Thread Tomasz Maciej Nowak
Let the grub2 package take care of creating installable grub2 images,
this will allow creating grub2 images without first calling x86 image
generation recipe. Also as side effect, since those images are now
shared, it'll reduce the number of calling grub-mkimage.

Signed-off-by: Tomasz Maciej Nowak 
---
 package/boot/grub2/Makefile   | 31 +++
 .../boot/grub2/files}/grub-early.cfg  |  0
 target/linux/x86/image/Makefile   | 28 +
 3 files changed, 39 insertions(+), 20 deletions(-)
 rename {target/linux/x86/image => package/boot/grub2/files}/grub-early.cfg 
(100%)

diff --git a/package/boot/grub2/Makefile b/package/boot/grub2/Makefile
index d6af65128e..cefc4ed92e 100644
--- a/package/boot/grub2/Makefile
+++ b/package/boot/grub2/Makefile
@@ -83,6 +83,37 @@ define Host/Configure
$(Host/Configure/Default)
 endef
 
+define Host/Install
+   $(call Host/Install/Default)
+
+   $(INSTALL_DIR) $(STAGING_DIR_HOST)/lib/grub/grub2-generic
+   $(STAGING_DIR_HOST)/bin/grub-mkimage \
+   -d $(STAGING_DIR_HOST)/lib/grub/i386-pc \
+   -p /boot/grub \
+   -O i386-pc \
+   -c ./files/grub-early.cfg \
+   -o $(STAGING_DIR_HOST)/lib/grub/grub2-generic/core.img \
+   at_keyboard biosdisk boot chain configfile ext2 linux ls 
part_msdos reboot serial vga
+
+   $(INSTALL_DIR) $(STAGING_DIR_HOST)/lib/grub/grub2-iso
+   $(STAGING_DIR_HOST)/bin/grub-mkimage \
+   -d $(STAGING_DIR_HOST)/lib/grub/i386-pc \
+   -p /boot/grub \
+   -O i386-pc \
+   -c ./files/grub-early.cfg \
+   -o $(STAGING_DIR_HOST)/lib/grub/grub2-iso/eltorito.img \
+   at_keyboard biosdisk boot chain configfile iso9660 linux ls 
part_msdos reboot serial vga
+
+   $(INSTALL_DIR) $(STAGING_DIR_HOST)/lib/grub/grub2-legacy
+   $(STAGING_DIR_HOST)/bin/grub-mkimage \
+   -d $(STAGING_DIR_HOST)/lib/grub/i386-pc \
+   -p /boot/grub \
+   -O i386-pc \
+   -c ./files/grub-early.cfg \
+   -o $(STAGING_DIR_HOST)/lib/grub/grub2-legacy/core.img \
+   biosdisk boot chain configfile ext2 linux ls part_msdos reboot 
serial vga
+endef
+
 define Package/grub2-editenv/install
$(INSTALL_DIR) $(1)/usr/sbin
$(INSTALL_BIN) $(PKG_BUILD_DIR)/grub-editenv $(1)/usr/sbin/
diff --git a/target/linux/x86/image/grub-early.cfg 
b/package/boot/grub2/files/grub-early.cfg
similarity index 100%
rename from target/linux/x86/image/grub-early.cfg
rename to package/boot/grub2/files/grub-early.cfg
diff --git a/target/linux/x86/image/Makefile b/target/linux/x86/image/Makefile
index d799a0ba03..91cd2f9a04 100644
--- a/target/linux/x86/image/Makefile
+++ b/target/linux/x86/image/Makefile
@@ -9,8 +9,7 @@ include $(INCLUDE_DIR)/image.mk
 
 export PATH=$(TARGET_PATH):/sbin
 
-GRUB2_MODULES = biosdisk boot chain configfile ext2 linux ls part_msdos reboot 
serial vga
-GRUB2_MODULES_ISO = biosdisk boot chain configfile iso9660 linux ls part_msdos 
reboot serial vga
+GRUB2_VARIANT =
 GRUB_TERMINALS =
 GRUB_SERIAL_CONFIG =
 GRUB_TERMINAL_CONFIG =
@@ -19,8 +18,9 @@ GRUB_CONSOLE_CMDLINE =
 USE_ATKBD = generic 64
 
 ifneq ($(strip $(foreach 
subtarget,$(USE_ATKBD),$(CONFIG_TARGET_x86_$(subtarget,)
-  GRUB2_MODULES += at_keyboard
-  GRUB2_MODULES_ISO += at_keyboard
+  GRUB2_VARIANT := generic
+else
+  GRUB2_VARIANT := legacy
 endif
 
 ifneq ($(CONFIG_GRUB_CONSOLE),)
@@ -63,14 +63,9 @@ ifneq ($(CONFIG_GRUB_IMAGES),)
# left here because the image builder doesnt need these
$(INSTALL_DIR) $(KDIR)/root.grub/boot/grub $(KDIR)/grub2
$(CP) $(KDIR)/bzImage $(KDIR)/root.grub/boot/vmlinuz
-   grub-mkimage \
-   -p /boot/grub \
-   -d $(STAGING_DIR_HOST)/lib/grub/i386-pc \
-   -o $(KDIR)/grub2/core.img \
-   -O i386-pc \
-   -c ./grub-early.cfg \
-   $(GRUB2_MODULES)
-   $(CP) $(STAGING_DIR_HOST)/lib/grub/i386-pc/*.img $(KDIR)/grub2/
+   $(CP) $(STAGING_DIR_HOST)/lib/grub/i386-pc/*.img \
+   $(STAGING_DIR_HOST)/lib/grub/grub2-$(strip 
$(GRUB2_VARIANT))/core.img \
+   $(KDIR)/grub2/
echo '(hd0) $(BIN_DIR)/$(IMG_PREFIX)-combined-$(1).img' > 
$(KDIR)/grub2/device.map
sed \
-e 's#@SERIAL_CONFIG@#$(strip $(GRUB_SERIAL_CONFIG))#g' \
@@ -100,16 +95,9 @@ endef
 define Image/Build/iso
$(INSTALL_DIR) $(KDIR)/root.grub/boot/grub $(KDIR)/grub2
$(CP) $(KDIR)/bzImage $(KDIR)/root.grub/boot/vmlinuz
-   grub-mkimage \
-   -p /boot/grub \
-   -d $(STAGING_DIR_HOST)/lib/grub/i386-pc \
-   -o $(KDIR)/grub2/eltorito.img \
-   -O i386-pc \
-   -c ./grub-early.cfg \
-   $(GRUB2_MODULES_ISO)
cat \
$(STAGING_DIR_HOST)/lib/grub/i386-pc/cdboot.img \
-  

[OpenWrt-Devel] [RFC 5/6] x86/grub2: add bootloader upgrade on sysupgrade

2019-01-13 Thread Tomasz Maciej Nowak
Enable bootloader upgrade on sysupgrade for all x86 subtargets to keep
it up to date. To achieve this grub2 user installable packages are
created, with appropriate variant added to subtarget default packages.
The bootloader upgrade is performed on each sysupgrade process.

Signed-off-by: Tomasz Maciej Nowak 
---
 package/boot/grub2/Makefile   | 42 ++-
 target/linux/x86/64/target.mk |  2 +-
 .../x86/base-files/lib/upgrade/platform.sh| 27 +++-
 target/linux/x86/generic/target.mk|  2 +-
 target/linux/x86/geode/target.mk  |  2 +-
 target/linux/x86/legacy/target.mk |  1 +
 6 files changed, 71 insertions(+), 5 deletions(-)

diff --git a/package/boot/grub2/Makefile b/package/boot/grub2/Makefile
index cefc4ed92e..4445a30ea8 100644
--- a/package/boot/grub2/Makefile
+++ b/package/boot/grub2/Makefile
@@ -31,7 +31,7 @@ include $(INCLUDE_DIR)/package.mk
 define Package/grub2
   CATEGORY:=Boot Loaders
   SECTION:=boot
-  TITLE:=GRand Unified Bootloader
+  TITLE:=GRand Unified Bootloader $(1)
   URL:=http://www.gnu.org/software/grub/
   DEPENDS:=@TARGET_x86
 endef
@@ -49,6 +49,20 @@ define Package/grub2-editenv/description
Edit grub2 environment files.
 endef
 
+define Package/grub2-generic
+  $(call Package/grub2,for 64 and generic subtargets)
+  DEPENDS:=@TARGET_x86_64||TARGET_x86_generic
+  PROVIDES+=grub2
+  HIDDEN:=y
+endef
+
+define Package/grub2-legacy
+  $(call Package/grub2,for geode and legacy subtargets)
+  DEPENDS:=@TARGET_x86_geode||TARGET_x86_legacy
+  PROVIDES+=grub2
+  HIDDEN:=y
+endef
+
 HOST_BUILD_PREFIX := $(STAGING_DIR_HOST)
 
 CONFIGURE_VARS += \
@@ -119,6 +133,32 @@ define Package/grub2-editenv/install
$(INSTALL_BIN) $(PKG_BUILD_DIR)/grub-editenv $(1)/usr/sbin/
 endef
 
+define Package/grub2-generic/install
+   $(INSTALL_DIR) $(1)/usr/sbin
+   $(INSTALL_BIN) $(PKG_BUILD_DIR)/grub-bios-setup $(1)/usr/sbin/
+
+   $(INSTALL_DIR) $(1)/usr/lib/grub/grub2
+   $(CP) $(STAGING_DIR_HOST)/lib/grub/grub2-generic/core.img \
+   $(STAGING_DIR_HOST)/lib/grub/i386-pc/*.img \
+   $(1)/usr/lib/grub/grub2/
+   printf 
'BL=$(PKG_NAME)\nBL_VARIANT=generic\nBL_VERSION=$(PKG_VERSION)\nBL_RELEASE=$(PKG_RELEASE)\n'
 \
+   > $(1)/usr/lib/grub/grub2/bl-release
+endef
+
+define Package/grub2-legacy/install
+   $(INSTALL_DIR) $(1)/usr/sbin
+   $(INSTALL_BIN) $(PKG_BUILD_DIR)/grub-bios-setup $(1)/usr/sbin/
+
+   $(INSTALL_DIR) $(1)/usr/lib/grub/grub2
+   $(CP) $(STAGING_DIR_HOST)/lib/grub/grub2-legacy/core.img \
+   $(STAGING_DIR_HOST)/lib/grub/i386-pc/*.img \
+   $(1)/usr/lib/grub/grub2/
+   printf 
'BL=$(PKG_NAME)\nBL_VARIANT=legacy\nBL_VERSION=$(PKG_VERSION)\nBL_RELEASE=$(PKG_RELEASE)\n'
 \
+   > $(1)/usr/lib/grub/grub2/bl-release
+endef
+
 $(eval $(call HostBuild))
 $(eval $(call BuildPackage,grub2))
 $(eval $(call BuildPackage,grub2-editenv))
+$(eval $(call BuildPackage,grub2-generic))
+$(eval $(call BuildPackage,grub2-legacy))
diff --git a/target/linux/x86/64/target.mk b/target/linux/x86/64/target.mk
index 5dd0015a03..4035dda289 100644
--- a/target/linux/x86/64/target.mk
+++ b/target/linux/x86/64/target.mk
@@ -1,6 +1,6 @@
 ARCH:=x86_64
 BOARDNAME:=x86_64
-DEFAULT_PACKAGES += kmod-button-hotplug kmod-e1000e kmod-e1000 kmod-r8169 
kmod-igb kmod-bnx2
+DEFAULT_PACKAGES += grub2-generic kmod-button-hotplug kmod-e1000e kmod-e1000 
kmod-r8169 kmod-igb kmod-bnx2
 
 define Target/Description
 Build images for 64 bit systems including virtualized guests.
diff --git a/target/linux/x86/base-files/lib/upgrade/platform.sh 
b/target/linux/x86/base-files/lib/upgrade/platform.sh
index 439ba8f512..0a2a9592c2 100644
--- a/target/linux/x86/base-files/lib/upgrade/platform.sh
+++ b/target/linux/x86/base-files/lib/upgrade/platform.sh
@@ -45,7 +45,7 @@ platform_copy_config() {
 }
 
 platform_do_upgrade() {
-   local diskdev partdev diff
+   local diskdev partdev diff bootdev rootdev
 
export_bootdevice && export_partdevice diskdev 0 || {
echo "Unable to determine upgrade device"
@@ -92,4 +92,29 @@ platform_do_upgrade() {
#copy partition uuid
echo "Writing new UUID to /dev/$diskdev..."
get_image "$@" | dd of="/dev/$diskdev" bs=1 skip=440 count=4 seek=440 
conv=fsync
+
+   #upgrade bootloader
+   if export_partdevice bootdev 1; then
+   mkdir -p /tmp/boot
+   mount -o rw,noatime "/dev/$bootdev" /tmp/boot
+
+   if export_partdevice rootdev 2; then
+   mount -o noatime "/dev/$rootdev" /mnt
+
+   echo "(hd0) /dev/$diskdev" > /tmp/device.map
+
+   echo "Upgrading bootloader on /dev/$diskdev..."
+   type /mnt/usr/sbin/grub-bios-setup >/dev/null 
2>/dev/null \
+   && /mnt/usr/sbin/grub-bios-setup \
+  

[OpenWrt-Devel] [RFC 3/6] x86: remove obsolete profiles

2019-01-13 Thread Tomasz Maciej Nowak
Rely on device profiles instead for packages selection.

Signed-off-by: Tomasz Maciej Nowak 
---
 target/linux/x86/64/profiles/000-Generic.mk   | 15 --
 .../linux/x86/generic/profiles/000-Generic.mk | 18 -
 .../linux/x86/geode/profiles/000-Generic.mk   | 20 ---
 target/linux/x86/geode/profiles/100-Geos.mk   | 19 --
 .../linux/x86/legacy/profiles/000-Generic.mk  | 18 -
 5 files changed, 90 deletions(-)
 delete mode 100644 target/linux/x86/64/profiles/000-Generic.mk
 delete mode 100644 target/linux/x86/generic/profiles/000-Generic.mk
 delete mode 100644 target/linux/x86/geode/profiles/000-Generic.mk
 delete mode 100644 target/linux/x86/geode/profiles/100-Geos.mk
 delete mode 100644 target/linux/x86/legacy/profiles/000-Generic.mk

diff --git a/target/linux/x86/64/profiles/000-Generic.mk 
b/target/linux/x86/64/profiles/000-Generic.mk
deleted file mode 100644
index ccd125afa2..00
--- a/target/linux/x86/64/profiles/000-Generic.mk
+++ /dev/null
@@ -1,15 +0,0 @@
-#
-# Copyright (C) 2006-2015 OpenWrt.org
-#
-# This is free software, licensed under the GNU General Public License v2.
-# See /LICENSE for more information.
-#
-
-define Profile/Generic
-  NAME:=Generic
-endef
-
-define Profile/Generic/Description
-   Generic Profile
-endef
-$(eval $(call Profile,Generic))
diff --git a/target/linux/x86/generic/profiles/000-Generic.mk 
b/target/linux/x86/generic/profiles/000-Generic.mk
deleted file mode 100644
index 90f989a91d..00
--- a/target/linux/x86/generic/profiles/000-Generic.mk
+++ /dev/null
@@ -1,18 +0,0 @@
-#
-# Copyright (C) 2006-2009 OpenWrt.org
-#
-# This is free software, licensed under the GNU General Public License v2.
-# See /LICENSE for more information.
-#
-
-define Profile/Generic
-  NAME:=Generic
-  PACKAGES:=kmod-3c59x kmod-e100 kmod-e1000 kmod-natsemi kmod-ne2k-pci \
-   kmod-pcnet32 kmod-8139too kmod-r8169 kmod-sis900 kmod-tg3 \
-   kmod-via-rhine kmod-via-velocity
-endef
-
-define Profile/Generic/Description
-   Generic Profile
-endef
-$(eval $(call Profile,Generic))
diff --git a/target/linux/x86/geode/profiles/000-Generic.mk 
b/target/linux/x86/geode/profiles/000-Generic.mk
deleted file mode 100644
index 58dc3c641c..00
--- a/target/linux/x86/geode/profiles/000-Generic.mk
+++ /dev/null
@@ -1,20 +0,0 @@
-#
-# Copyright (C) 2006-2009 OpenWrt.org
-#
-# This is free software, licensed under the GNU General Public License v2.
-# See /LICENSE for more information.
-#
-
-define Profile/Generic
-  NAME:=Generic
-  PACKAGES:= \
-   soloscli linux-atm br2684ctl ppp-mod-pppoa pppdump pppstats \
-   hwclock flashrom tc kmod-pppoa kmod-8139cp kmod-mppe \
-   kmod-usb-ohci-pci kmod-hwmon-lm90 \
-   kmod-via-rhine
-endef
-
-define Profile/Generic/Description
-   Generic Profile for all Geode boards.
-endef
-$(eval $(call Profile,Generic))
diff --git a/target/linux/x86/geode/profiles/100-Geos.mk 
b/target/linux/x86/geode/profiles/100-Geos.mk
deleted file mode 100644
index 94e501edf4..00
--- a/target/linux/x86/geode/profiles/100-Geos.mk
+++ /dev/null
@@ -1,19 +0,0 @@
-#
-# Copyright (C) 2006-2009 OpenWrt.org
-#
-# This is free software, licensed under the GNU General Public License v2.
-# See /LICENSE for more information.
-#
-
-define Profile/Geos
-  NAME:=Geos
-  PACKAGES:= \
-   soloscli linux-atm br2684ctl ppp-mod-pppoa pppdump pppstats \
-   hwclock flashrom tc kmod-pppoa kmod-8139cp kmod-mppe \
-   kmod-usb-ohci-pci kmod-hwmon-lm90
-endef
-
-define Profile/Geos/Description
-   Traverse Technologies Geos ADSL router
-endef
-$(eval $(call Profile,Geos))
diff --git a/target/linux/x86/legacy/profiles/000-Generic.mk 
b/target/linux/x86/legacy/profiles/000-Generic.mk
deleted file mode 100644
index 90f989a91d..00
--- a/target/linux/x86/legacy/profiles/000-Generic.mk
+++ /dev/null
@@ -1,18 +0,0 @@
-#
-# Copyright (C) 2006-2009 OpenWrt.org
-#
-# This is free software, licensed under the GNU General Public License v2.
-# See /LICENSE for more information.
-#
-
-define Profile/Generic
-  NAME:=Generic
-  PACKAGES:=kmod-3c59x kmod-e100 kmod-e1000 kmod-natsemi kmod-ne2k-pci \
-   kmod-pcnet32 kmod-8139too kmod-r8169 kmod-sis900 kmod-tg3 \
-   kmod-via-rhine kmod-via-velocity
-endef
-
-define Profile/Generic/Description
-   Generic Profile
-endef
-$(eval $(call Profile,Generic))
-- 
2.20.1


___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [RFC 2/6] x86: switch image generation to new code

2019-01-13 Thread Tomasz Maciej Nowak
This commit introduces few related changes which need to be done in
single commit to keep images buildable between git revisions. In result
it retains all previous image creation possibilities with slight name
change of generated images. Brief summary of the commit:

* Split up image generation recipe to smaller chunks to make it more
  generic and reusable.

* Make iso images x86 specific and drop their definition as root
  filesystem.

* Convert image creation process to generic code specified in image.mk.

* Make geode subtarget inherit features from the main target instead of
  redefining them.

* For subtargets create device definitions with basic packages set.

Signed-off-by: Tomasz Maciej Nowak 
---
 config/Config-images.in   |  22 +--
 include/image.mk  |   1 -
 target/linux/x86/Makefile |   4 +-
 target/linux/x86/geode/target.mk  |   2 +-
 target/linux/x86/image/64.mk  |   5 +
 target/linux/x86/image/Makefile   | 181 +++---
 target/linux/x86/image/generic.mk |   8 +
 target/linux/x86/image/geode.mk   |  16 ++
 target/linux/x86/image/grub-iso.cfg   |   2 +-
 .../linux/x86/image/{grub.cfg => grub-pc.cfg} |   4 +-
 target/linux/x86/image/legacy.mk  |   8 +
 11 files changed, 124 insertions(+), 129 deletions(-)
 create mode 100644 target/linux/x86/image/64.mk
 create mode 100644 target/linux/x86/image/generic.mk
 create mode 100644 target/linux/x86/image/geode.mk
 rename target/linux/x86/image/{grub.cfg => grub-pc.cfg} (57%)
 create mode 100644 target/linux/x86/image/legacy.mk

diff --git a/config/Config-images.in b/config/Config-images.in
index 3eb8113fb3..8adede41b6 100644
--- a/config/Config-images.in
+++ b/config/Config-images.in
@@ -119,13 +119,6 @@ menu "Target Images"
help
  Create an ext4 filesystem with a journal.
 
-   config TARGET_ROOTFS_ISO
-   bool "iso"
-   default n
-   depends on TARGET_x86_generic
-   help
- Create a bootable ISO image.
-
config TARGET_ROOTFS_JFFS2
bool "jffs2"
depends on USES_JFFS2
@@ -190,7 +183,7 @@ menu "Target Images"
config GRUB_IMAGES
bool "Build GRUB images (Linux x86 or x86_64 host only)"
depends on TARGET_x86
-   depends on TARGET_ROOTFS_EXT4FS || TARGET_ROOTFS_ISO || 
TARGET_ROOTFS_JFFS2 || TARGET_ROOTFS_SQUASHFS
+   depends on TARGET_ROOTFS_EXT4FS || TARGET_ROOTFS_JFFS2 || 
TARGET_ROOTFS_SQUASHFS
select PACKAGE_grub2
default y
 
@@ -236,6 +229,11 @@ menu "Target Images"
  This is the title of the GRUB menu entry.
  If unspecified, it defaults to OpenWrt.
 
+   config ISO_IMAGES
+   bool "Build LiveCD image (ISO)"
+   depends on TARGET_x86_generic
+   select GRUB_IMAGES
+
config VDI_IMAGES
bool "Build VirtualBox image files (VDI)"
depends on TARGET_x86
@@ -251,12 +249,12 @@ menu "Target Images"
select PACKAGE_kmod-e1000
 
config TARGET_IMAGES_PAD
-   bool "Pad images to filesystem size (for JFFS2)"
+   bool "Pad images to filesystem size"
depends on GRUB_IMAGES
 
config TARGET_IMAGES_GZIP
bool "GZip images"
-   depends on TARGET_IMAGES_PAD || TARGET_ROOTFS_EXT4FS || 
TARGET_x86
+   depends on TARGET_ROOTFS_EXT4FS
default y
 
comment "Image Options"
@@ -265,13 +263,13 @@ menu "Target Images"
 
config TARGET_KERNEL_PARTSIZE
int "Kernel partition size (in MB)"
-   depends on GRUB_IMAGES || USES_BOOT_PART
+   depends on USES_BOOT_PART
default 8 if TARGET_apm821xx_sata
default 16
 
config TARGET_ROOTFS_PARTSIZE
int "Root filesystem partition size (in MB)"
-   depends on GRUB_IMAGES || USES_ROOTFS_PART || 
TARGET_ROOTFS_EXT4FS || TARGET_mvebu || TARGET_rb532 || TARGET_sunxi || 
TARGET_uml
+   depends on USES_ROOTFS_PART || TARGET_ROOTFS_EXT4FS || 
TARGET_mvebu || TARGET_rb532 || TARGET_sunxi || TARGET_uml
default 256
help
  Select the root filesystem partition size.
diff --git a/include/image.mk b/include/image.mk
index a2b106d909..bbcd231e4e 100644
--- a/include/image.mk
+++ b/include/image.mk
@@ -90,7 +90,6 @@ fs-types-$(CONFIG_TARGET_ROOTFS_SQUASHFS) += squashfs
 fs-types-$(CONFIG_TARGET_ROOTFS_JFFS2) += $(addprefix 
jffs2-,$(JFFS2_BLOCKSIZE))
 fs-types-$(CONFIG_TARGET_ROOTFS_JFFS2_NAND) += $(addprefix 
jffs2-nand-,$(NAND_BLOCKSIZE))
 fs-types-$(CONFIG_TARGET_ROOTFS_EXT4FS) += ext4
-fs-types-$(CONFIG_TARGET_ROOTFS_ISO) += iso
 

[OpenWrt-Devel] [RFC 4/6] x86: geode: shrink amount of default packages

2019-01-13 Thread Tomasz Maciej Nowak
Drop excesive amount of default packages, instead, rely on packages
specified in device definitions.

Signed-off-by: Tomasz Maciej Nowak 
---
 target/linux/x86/geode/target.mk | 12 +---
 1 file changed, 1 insertion(+), 11 deletions(-)

diff --git a/target/linux/x86/geode/target.mk b/target/linux/x86/geode/target.mk
index 5473d2a32b..cd7afef944 100644
--- a/target/linux/x86/geode/target.mk
+++ b/target/linux/x86/geode/target.mk
@@ -1,16 +1,6 @@
 BOARDNAME:=AMD Geode based systems
 FEATURES+=pci usb gpio
-DEFAULT_PACKAGES += \
-   kmod-crypto-hw-geode kmod-crypto-cbc \
-   kmod-ath5k kmod-ath9k \
-   kmod-button-hotplug \
-   kmod-ledtrig-heartbeat kmod-ledtrig-gpio \
-   kmod-ledtrig-netdev hwclock wpad-basic
-# Geos
-DEFAULT_PACKAGES += \
-   soloscli linux-atm br2684ctl ppp-mod-pppoa pppdump pppstats \
-   hwclock flashrom tc kmod-pppoa kmod-8139cp kmod-mppe \
-   kmod-usb-ohci-pci kmod-hwmon-lm90
+DEFAULT_PACKAGES+=kmod-button-hotplug
 
 define Target/Description
Build firmware images for AMD Geode GX/LX based systems (net5501, alix, 
geos)
-- 
2.20.1


___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH 3/3] rssileds: change rssileds.init STOP index

2019-01-13 Thread Joseph Tingiris
This patch is in a series to allow additional STOP indexes after
umount, so that other block devices may stop cleanly.

rssileds.init is now STOP=89

Signed-off-by: Joseph Tingiris 
---
 package/network/utils/rssileds/Makefile| 2 +-
 package/network/utils/rssileds/files/rssileds.init | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/package/network/utils/rssileds/Makefile 
b/package/network/utils/rssileds/Makefile
index d3fb66a..27cdb4c 100644
--- a/package/network/utils/rssileds/Makefile
+++ b/package/network/utils/rssileds/Makefile
@@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=rssileds
 PKG_VERSION:=0.2
-PKG_RELEASE:=1
+PKG_RELEASE:=2
 PKG_LICNESE:=GPL-2.0+
 
 include $(INCLUDE_DIR)/package.mk
diff --git a/package/network/utils/rssileds/files/rssileds.init 
b/package/network/utils/rssileds/files/rssileds.init
index b0d2627..4c9b549 100644
--- a/package/network/utils/rssileds/files/rssileds.init
+++ b/package/network/utils/rssileds/files/rssileds.init
@@ -2,7 +2,7 @@
 # (C) 2012 Daniel Golle, Allnet GmbH 
 
 START=96
-STOP=96
+STOP=89
 RSSILEDS_BIN="/usr/sbin/rssileds"
 
 SERVICE_DAEMONIZE=1
-- 
1.8.3.1


___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH 2/3] kexec-tools: change kdump.init STOP index

2019-01-13 Thread Joseph Tingiris
This patch is in a series to allow additional STOP indexes after umount,
so that other block devices may stop cleanly.

kdumpinit is now STOP=90

Signed-off-by: Joseph Tingiris 
---
 package/boot/kexec-tools/Makefile | 2 +-
 package/boot/kexec-tools/files/kdump.init | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/package/boot/kexec-tools/Makefile 
b/package/boot/kexec-tools/Makefile
index 76ea46f..8d62a23 100644
--- a/package/boot/kexec-tools/Makefile
+++ b/package/boot/kexec-tools/Makefile
@@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=kexec-tools
 PKG_VERSION:=2.0.16
-PKG_RELEASE:=1
+PKG_RELEASE:=2
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
 PKG_SOURCE_URL:=@KERNEL/linux/utils/kernel/kexec
diff --git a/package/boot/kexec-tools/files/kdump.init 
b/package/boot/kexec-tools/files/kdump.init
index 6a6a94c..0955047 100755
--- a/package/boot/kexec-tools/files/kdump.init
+++ b/package/boot/kexec-tools/files/kdump.init
@@ -1,7 +1,7 @@
 #!/bin/sh /etc/rc.common
 
 START=41
-STOP=98
+STOP=90
 
 EXTRA_COMMANDS="status"
 EXTRA_HELP="status  Print crashkernel status"
-- 
1.8.3.1


___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH 1/3] base-files: change boot & umount STOP indexes

2019-01-13 Thread Joseph Tingiris
This patch is in a series to allow additional STOP indexes after umount,
so that other block devices may stop cleanly.

boot is now STOP=90
umount is now STOP=90

After this patch series, the resulting STOP indexes in the 80s & 90s
will be:

STOP=85 odhcpd.init
STOP=89 conntrackd.init
STOP=89 log.init
STOP=89 rssileds.init
STOP=90 boot
STOP=90 kdump.init
STOP=90 network
STOP=90 sysfixtime
STOP=90 umount
STOP=98 mdadm.init (note: will be addressed in a separate patch)

Signed-off-by: Joseph Tingiris 
---
 package/base-files/Makefile| 2 +-
 package/base-files/files/etc/init.d/boot   | 2 +-
 package/base-files/files/etc/init.d/umount | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/package/base-files/Makefile b/package/base-files/Makefile
index ea1e4eb..226dd26 100644
--- a/package/base-files/Makefile
+++ b/package/base-files/Makefile
@@ -12,7 +12,7 @@ include $(INCLUDE_DIR)/version.mk
 include $(INCLUDE_DIR)/feeds.mk
 
 PKG_NAME:=base-files
-PKG_RELEASE:=196
+PKG_RELEASE:=197
 PKG_FLAGS:=nonshared
 
 PKG_FILE_DEPENDS:=$(PLATFORM_DIR)/ $(GENERIC_PLATFORM_DIR)/base-files/
diff --git a/package/base-files/files/etc/init.d/boot 
b/package/base-files/files/etc/init.d/boot
index 31f245f..09b7f44 100755
--- a/package/base-files/files/etc/init.d/boot
+++ b/package/base-files/files/etc/init.d/boot
@@ -2,7 +2,7 @@
 # Copyright (C) 2006-2011 OpenWrt.org
 
 START=10
-STOP=98
+STOP=90
 
 uci_apply_defaults() {
. /lib/functions/system.sh
diff --git a/package/base-files/files/etc/init.d/umount 
b/package/base-files/files/etc/init.d/umount
index 349b2b3..57a4a6d 100755
--- a/package/base-files/files/etc/init.d/umount
+++ b/package/base-files/files/etc/init.d/umount
@@ -1,7 +1,7 @@
 #!/bin/sh /etc/rc.common
 # Copyright (C) 2006 OpenWrt.org
 
-STOP=99
+STOP=90
 stop() {
sync
/bin/umount -a -d -r
-- 
1.8.3.1


___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [RFC] [PATCH] iw: Fix rootfs opkg with PER_DEVICE_ROOTFS and iw

2019-01-13 Thread Daniel Dickinson
From: "Daniel F. Dickinson" 

With PER_DEVICE_ROOTFS on ath79 and brcm2708 package/install step fails
because it cannot satisfy the dependency on iw.  The quick solution
(this patch) is to add DEFAULT:=y if cfg80211 to Package/iw.  A better
solution would be to defer installation to imagebuilder, or a step done
like imagebuild, in which when uses a temporary package repository so
opkg can do proper resolving of dependencies.

The root cause is that for the package/Makefile call of opkg from
rootfs.mk the package list isn't managed through the opkg resolver
and is rather done through Kconfig and make, and as such is less
capable than opkg's resolver and therefore can handle the iw vs.
iw-full VARIANT situation when a cfg80211-based wireless driver
DEPENDS on iw.

Signed-off-by: Daniel F. Dickinson 
---
 package/network/utils/iw/Makefile | 1 +
 1 file changed, 1 insertion(+)

diff --git a/package/network/utils/iw/Makefile 
b/package/network/utils/iw/Makefile
index ef39ee6724..0e29a96e2c 100644
--- a/package/network/utils/iw/Makefile
+++ b/package/network/utils/iw/Makefile
@@ -28,6 +28,7 @@ define Package/iw
   URL:=http://wireless.kernel.org/en/users/Documentation/iw
   DEPENDS:= +libnl-tiny
   VARIANT:=tiny
+  DEFAULT:=y if cfg80211
 endef
 
 define Package/iw-full
-- 
2.11.0


___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] [PATCH 1/3] base-files: change boot & umount STOP levels -2

2019-01-13 Thread Jo-Philipp Wich
Hi Joseph,

I've been thinking that we maybe should lower the STOP index even
further, to at least 90.

Apart from that the patch looks good.


~ Jo



signature.asc
Description: OpenPGP digital signature
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH] x86: image: add test module to bootloader

2019-01-13 Thread Tomasz Maciej Nowak
It was previously added in 546fced, which was part of "intel-microcode:
load as early as possible" series.
Unfortunately the conditionals added to GRUB config caused error on boot,
because on sysupgrade, bootloader is not updated and is left with old
features/modules. Since this module is needed for early microcode load
and transition to this needs to be done step by step, enable the test
module now, so that every newly created image has it already embedded.

Signed-off-by: Tomasz Maciej Nowak 
---
 target/linux/x86/image/Makefile | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/target/linux/x86/image/Makefile b/target/linux/x86/image/Makefile
index dbf8a8594b..f8c3700d32 100644
--- a/target/linux/x86/image/Makefile
+++ b/target/linux/x86/image/Makefile
@@ -9,8 +9,8 @@ include $(INCLUDE_DIR)/image.mk
 
 export PATH=$(TARGET_PATH):/sbin
 
-GRUB2_MODULES = biosdisk boot chain configfile ext2 linux ls part_msdos reboot 
serial vga
-GRUB2_MODULES_ISO = biosdisk boot chain configfile iso9660 linux ls part_msdos 
reboot serial vga
+GRUB2_MODULES = biosdisk boot chain configfile ext2 linux ls part_msdos reboot 
serial test vga
+GRUB2_MODULES_ISO = biosdisk boot chain configfile iso9660 linux ls part_msdos 
reboot serial test vga
 GRUB_TERMINALS =
 GRUB_SERIAL_CONFIG =
 GRUB_TERMINAL_CONFIG =
-- 
2.20.1


___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH] build: remove leftovers from previous x86 commits

2019-01-13 Thread Tomasz Maciej Nowak
VBoxManage is not used and the image is created with proper permisions:
0f5d0f6  image: use internal qemu-img for vmdk and vdi images drop host
 dependencies on qemu-utils and VirtualBox

Unreachable config symbols:
9e0759e  x86: merge all geode based subtargets into one

No need to define those symbols since x86_64 is subtarget of x86:
196fb76  x86: make x86_64 a subtarget instead of a standalone target

Unreachable config symbols, so remove GRUB_ROOT:
371b382  x86: remove the xen_domu subtarget

Signed-off-by: Tomasz Maciej Nowak 
---
 config/Config-images.in | 9 +++--
 package/boot/grub2/Makefile | 4 ++--
 target/linux/x86/image/Makefile | 8 
 target/linux/x86/image/grub.cfg | 2 +-
 4 files changed, 6 insertions(+), 17 deletions(-)

diff --git a/config/Config-images.in b/config/Config-images.in
index 245aed098b..3eb8113fb3 100644
--- a/config/Config-images.in
+++ b/config/Config-images.in
@@ -197,14 +197,12 @@ menu "Target Images"
config GRUB_CONSOLE
bool "Use Console Terminal (in addition to Serial)"
depends on GRUB_IMAGES
-   default n if (TARGET_x86_generic_Soekris45xx || 
TARGET_x86_generic_Soekris48xx || TARGET_x86_net5501 || TARGET_x86_geos || 
TARGET_x86_alix2)
default y
 
config GRUB_SERIAL
string "Serial port device"
depends on GRUB_IMAGES
-   default "hvc0" if TARGET_x86_xen_domu
-   default "ttyS0" if ! TARGET_x86_xen_domu
+   default "ttyS0"
 
config GRUB_BAUDRATE
int "Serial port baud rate"
@@ -220,7 +218,6 @@ menu "Target Images"
config GRUB_BOOTOPTS
string "Extra kernel boot options"
depends on GRUB_IMAGES
-   default "xencons=hvc" if TARGET_x86_xen_domu
help
  If you don't know, just leave it blank.
 
@@ -241,14 +238,14 @@ menu "Target Images"
 
config VDI_IMAGES
bool "Build VirtualBox image files (VDI)"
-   depends on TARGET_x86 || TARGET_x86_64
+   depends on TARGET_x86
select GRUB_IMAGES
select TARGET_IMAGES_PAD
select PACKAGE_kmod-e1000
 
config VMDK_IMAGES
bool "Build VMware image files (VMDK)"
-   depends on TARGET_x86 || TARGET_x86_64
+   depends on TARGET_x86
select GRUB_IMAGES
select TARGET_IMAGES_PAD
select PACKAGE_kmod-e1000
diff --git a/package/boot/grub2/Makefile b/package/boot/grub2/Makefile
index e4c19cd00f..d6af65128e 100644
--- a/package/boot/grub2/Makefile
+++ b/package/boot/grub2/Makefile
@@ -33,7 +33,7 @@ define Package/grub2
   SECTION:=boot
   TITLE:=GRand Unified Bootloader
   URL:=http://www.gnu.org/software/grub/
-  DEPENDS:=@TARGET_x86||TARGET_x86_64
+  DEPENDS:=@TARGET_x86
 endef
 
 define Package/grub2-editenv
@@ -42,7 +42,7 @@ define Package/grub2-editenv
   SUBMENU:=Boot Loaders
   TITLE:=Grub2 Environment editor
   URL:=http://www.gnu.org/software/grub/
-  DEPENDS:=@TARGET_x86||TARGET_x86_64
+  DEPENDS:=@TARGET_x86
 endef
 
 define Package/grub2-editenv/description
diff --git a/target/linux/x86/image/Makefile b/target/linux/x86/image/Makefile
index dbf8a8594b..d799a0ba03 100644
--- a/target/linux/x86/image/Makefile
+++ b/target/linux/x86/image/Makefile
@@ -15,7 +15,6 @@ GRUB_TERMINALS =
 GRUB_SERIAL_CONFIG =
 GRUB_TERMINAL_CONFIG =
 GRUB_CONSOLE_CMDLINE =
-GRUB_ROOT = hd0,msdos1
 
 USE_ATKBD = generic 64
 
@@ -48,10 +47,6 @@ ROOTPART:=$(if 
$(ROOTPART),$(ROOTPART),PARTUUID=$(SIGNATURE)-02)
 GRUB_TIMEOUT:=$(call qstrip,$(CONFIG_GRUB_TIMEOUT))
 GRUB_TITLE:=$(call qstrip,$(CONFIG_GRUB_TITLE))
 
-ifneq ($(CONFIG_TARGET_x86_xen_domu),)
-  GRUB_ROOT = xen/xvda,msdos1
-endif
-
 ifneq ($(CONFIG_GRUB_IMAGES),)
 
   BOOTOPTS:=$(call qstrip,$(CONFIG_GRUB_BOOTOPTS))
@@ -82,7 +77,6 @@ ifneq ($(CONFIG_GRUB_IMAGES),)
-e 's#@TERMINAL_CONFIG@#$(strip $(GRUB_TERMINAL_CONFIG))#g' \
-e 's#@CMDLINE@#$(strip $(call Image/cmdline/$(1)) $(BOOTOPTS) 
$(GRUB_CONSOLE_CMDLINE))#g' \
-e 's#@TIMEOUT@#$(GRUB_TIMEOUT)#g' \
-   -e 's#@ROOT@#$(GRUB_ROOT)#g' \
-e 's#@TITLE@#$(GRUB_TITLE)#g' \
./grub.cfg > $(KDIR)/root.grub/boot/grub/grub.cfg
-$(CP) $(STAGING_DIR_ROOT)/boot/. $(KDIR)/root.grub/boot/
@@ -135,8 +129,6 @@ ifneq ($(CONFIG_VDI_IMAGES),)
qemu-img convert -f raw -O vdi \
$(BIN_DIR)/$(IMG_PREFIX)-combined-$(1).img \
$(BIN_DIR)/$(IMG_PREFIX)-combined-$(1).vdi
-   # XXX: VBoxManage insists on setting perms to 0600
-   chmod 0644 $(BIN_DIR)/$(IMG_PREFIX)-combined-$(1).vdi
   endef
 endif
 
diff --git a/target/linux/x86/image/grub.cfg b/target/linux/x86/image/grub.cfg
index dedfa0a636..76a9885544 100644
--- a/target/linux/x86/image/grub.cfg
+++ 

[OpenWrt-Devel] [PATCH 2/3] mvebu: espressobin: correct spi node in dts

2019-01-13 Thread Tomasz Maciej Nowak
Drop customizations in:
508-arm64-dts-armada-3720-espressobin-wire-up-spi-flash.patch
and move them to separate patch, with broader explanation.

Signed-off-by: Tomasz Maciej Nowak 
---
 ...a-3720-espressobin-wire-up-spi-flash.patch | 27 ++---
 ...da-3720-espressobin-correct-spi-node.patch | 58 +++
 2 files changed, 77 insertions(+), 8 deletions(-)
 create mode 100644 
target/linux/mvebu/patches-4.14/521-arm64-dts-armada-3720-espressobin-correct-spi-node.patch

diff --git 
a/target/linux/mvebu/patches-4.14/508-arm64-dts-armada-3720-espressobin-wire-up-spi-flash.patch
 
b/target/linux/mvebu/patches-4.14/508-arm64-dts-armada-3720-espressobin-wire-up-spi-flash.patch
index fb80db7e89..840897473f 100644
--- 
a/target/linux/mvebu/patches-4.14/508-arm64-dts-armada-3720-espressobin-wire-up-spi-flash.patch
+++ 
b/target/linux/mvebu/patches-4.14/508-arm64-dts-armada-3720-espressobin-wire-up-spi-flash.patch
@@ -14,16 +14,13 @@ Tested-by: Gregory CLEMENT 
 Signed-off-by: Ellie Reeves 
 Signed-off-by: Uwe Kleine-König 
 Signed-off-by: Gregory CLEMENT 
-
-[drop partitions, not every U-Boot has same layout]
-Signed-off-by: Tomasz Maciej Nowak 
 ---
- .../dts/marvell/armada-3720-espressobin.dts   | 13 +
- 1 file changed, 13 insertions(+)
+ .../dts/marvell/armada-3720-espressobin.dts   | 27 +++
+ 1 file changed, 27 insertions(+)
 
 --- a/arch/arm64/boot/dts/marvell/armada-3720-espressobin.dts
 +++ b/arch/arm64/boot/dts/marvell/armada-3720-espressobin.dts
-@@ -96,6 +96,19 @@
+@@ -96,6 +96,33 @@
status = "okay";
  };
  
@@ -31,12 +28,26 @@ Signed-off-by: Tomasz Maciej Nowak 
 +  status = "okay";
 +
 +  flash@0 {
-+  #address-cells = <1>;
-+  #size-cells = <1>;
 +  reg = <0>;
 +  compatible = "winbond,w25q32dw", "jedec,spi-flash";
 +  spi-max-frequency = <10400>;
 +  m25p,fast-read;
++
++  partitions {
++  compatible = "fixed-partitions";
++  #address-cells = <1>;
++  #size-cells = <1>;
++
++  partition@0 {
++  label = "uboot";
++  reg = <0 0x18>;
++  };
++
++  partition@18 {
++  label = "ubootenv";
++  reg = <0x18 0x1>;
++  };
++  };
 +  };
 +};
 +
diff --git 
a/target/linux/mvebu/patches-4.14/521-arm64-dts-armada-3720-espressobin-correct-spi-node.patch
 
b/target/linux/mvebu/patches-4.14/521-arm64-dts-armada-3720-espressobin-correct-spi-node.patch
new file mode 100644
index 00..1d2bdfca75
--- /dev/null
+++ 
b/target/linux/mvebu/patches-4.14/521-arm64-dts-armada-3720-espressobin-correct-spi-node.patch
@@ -0,0 +1,58 @@
+From 3217cdfe8a3eae76fafbebbe407be5985a7fd4c2 Mon Sep 17 00:00:00 2001
+From: Tomasz Maciej Nowak 
+Date: Mon, 31 Dec 2018 14:18:50 +0100
+Subject: [PATCH] arm64: dts: armada-3720-espressobin: correct spi node
+
+The manufacturer of this board, ships it with various SPI NOR chips and
+increments U-Boot bootloader version along the time. There is no way to
+tell which is placed on the board since no revision bump takes place.
+This creates two issues.
+
+The first, cosmetic. Since the SPI chip may differ, there's message on
+boot stating that kernel expected w25q32dw and found different one. To
+correct this, remove optional device-specific compatible string. Being
+here lets replace bogus "spi-flash" string with proper one.
+
+The second is linked to partitions layout, it changed after commit [1]
+in Marvells downstream U-Boot fork, shifting environment location to the
+end of boot device. Since the new boards can have U-Boot with this
+change it can lead to improper results writing or reading from these
+partitions. We can't tell if users will update bootloader to recent
+version, so let's drop current layout.
+
+1. 
https://github.com/MarvellEmbeddedProcessors/u-boot-marvell/commit/81e7251252aefe1a6b829ed05f3586320cb45372
+
+Signed-off-by: Tomasz Maciej Nowak 
+---
+ .../dts/marvell/armada-3720-espressobin.dts| 18 +-
+ 1 file changed, 1 insertion(+), 17 deletions(-)
+
+--- a/arch/arm64/boot/dts/marvell/armada-3720-espressobin.dts
 b/arch/arm64/boot/dts/marvell/armada-3720-espressobin.dts
+@@ -101,25 +101,9 @@
+ 
+   flash@0 {
+   reg = <0>;
+-  compatible = "winbond,w25q32dw", "jedec,spi-flash";
++  compatible = "jedec,spi-nor";
+   spi-max-frequency = <10400>;
+   m25p,fast-read;
+-
+-  partitions {
+-  compatible = "fixed-partitions";
+-  #address-cells = <1>;
+-  #size-cells = <1>;
+-
+-  partition@0 {
+-  label = "uboot";
+-  reg = 

[OpenWrt-Devel] [PATCH 1/3] mvebu: sort armada 37xx upstream patches chronologically

2019-01-13 Thread Tomasz Maciej Nowak
Signed-off-by: Tomasz Maciej Nowak 
---
 ... => 500-arm64-dts-marvell-Fix-A37xx-UART0-register-size.patch} | 0
 ...01-spi-a3700-Change-SPI-mode-before-asserting-chip-sele.patch} | 0
 ...tch => 502-arm64-dts-marvell-armada-37xx-add-UART-clock.patch} | 0
 ...ch => 503-clk-mvebu-armada-37xx-periph-cosmetic-changes.patch} | 0
 ...04-clk-mvebu-armada-37xx-periph-prepare-cpu-clk-to-be-u.patch} | 0
 ...05-clk-mvebu-armada-37xx-periph-add-DVFS-support-for-cp.patch} | 0
 ...x.patch => 506-cpufreq-Add-DVFS-support-for-Armada-37xx.patch} | 0
 ...508-arm64-dts-armada-3720-espressobin-wire-up-spi-flash.patch} | 0
 ...ck-leak.patch => 509-cpufreq-armada-37xx-Fix-clock-leak.patch} | 0
 9 files changed, 0 insertions(+), 0 deletions(-)
 rename 
target/linux/mvebu/patches-4.14/{505-arm64-dts-marvell-Fix-A37xx-UART0-register-size.patch
 => 500-arm64-dts-marvell-Fix-A37xx-UART0-register-size.patch} (100%)
 rename 
target/linux/mvebu/patches-4.14/{504-spi-a3700-Change-SPI-mode-before-asserting-chip-sele.patch
 => 501-spi-a3700-Change-SPI-mode-before-asserting-chip-sele.patch} (100%)
 rename 
target/linux/mvebu/patches-4.14/{506-arm64-dts-marvell-armada-37xx-add-UART-clock.patch
 => 502-arm64-dts-marvell-armada-37xx-add-UART-clock.patch} (100%)
 rename 
target/linux/mvebu/patches-4.14/{500-clk-mvebu-armada-37xx-periph-cosmetic-changes.patch
 => 503-clk-mvebu-armada-37xx-periph-cosmetic-changes.patch} (100%)
 rename 
target/linux/mvebu/patches-4.14/{501-clk-mvebu-armada-37xx-periph-prepare-cpu-clk-to-be-u.patch
 => 504-clk-mvebu-armada-37xx-periph-prepare-cpu-clk-to-be-u.patch} (100%)
 rename 
target/linux/mvebu/patches-4.14/{502-clk-mvebu-armada-37xx-periph-add-DVFS-support-for-cp.patch
 => 505-clk-mvebu-armada-37xx-periph-add-DVFS-support-for-cp.patch} (100%)
 rename 
target/linux/mvebu/patches-4.14/{503-cpufreq-Add-DVFS-support-for-Armada-37xx.patch
 => 506-cpufreq-Add-DVFS-support-for-Armada-37xx.patch} (100%)
 rename 
target/linux/mvebu/patches-4.14/{521-arm64-dts-armada-3720-espressobin-wire-up-spi-flash.patch
 => 508-arm64-dts-armada-3720-espressobin-wire-up-spi-flash.patch} (100%)
 rename 
target/linux/mvebu/patches-4.14/{508-cpufreq-armada-37xx-Fix-clock-leak.patch 
=> 509-cpufreq-armada-37xx-Fix-clock-leak.patch} (100%)

diff --git 
a/target/linux/mvebu/patches-4.14/505-arm64-dts-marvell-Fix-A37xx-UART0-register-size.patch
 
b/target/linux/mvebu/patches-4.14/500-arm64-dts-marvell-Fix-A37xx-UART0-register-size.patch
similarity index 100%
rename from 
target/linux/mvebu/patches-4.14/505-arm64-dts-marvell-Fix-A37xx-UART0-register-size.patch
rename to 
target/linux/mvebu/patches-4.14/500-arm64-dts-marvell-Fix-A37xx-UART0-register-size.patch
diff --git 
a/target/linux/mvebu/patches-4.14/504-spi-a3700-Change-SPI-mode-before-asserting-chip-sele.patch
 
b/target/linux/mvebu/patches-4.14/501-spi-a3700-Change-SPI-mode-before-asserting-chip-sele.patch
similarity index 100%
rename from 
target/linux/mvebu/patches-4.14/504-spi-a3700-Change-SPI-mode-before-asserting-chip-sele.patch
rename to 
target/linux/mvebu/patches-4.14/501-spi-a3700-Change-SPI-mode-before-asserting-chip-sele.patch
diff --git 
a/target/linux/mvebu/patches-4.14/506-arm64-dts-marvell-armada-37xx-add-UART-clock.patch
 
b/target/linux/mvebu/patches-4.14/502-arm64-dts-marvell-armada-37xx-add-UART-clock.patch
similarity index 100%
rename from 
target/linux/mvebu/patches-4.14/506-arm64-dts-marvell-armada-37xx-add-UART-clock.patch
rename to 
target/linux/mvebu/patches-4.14/502-arm64-dts-marvell-armada-37xx-add-UART-clock.patch
diff --git 
a/target/linux/mvebu/patches-4.14/500-clk-mvebu-armada-37xx-periph-cosmetic-changes.patch
 
b/target/linux/mvebu/patches-4.14/503-clk-mvebu-armada-37xx-periph-cosmetic-changes.patch
similarity index 100%
rename from 
target/linux/mvebu/patches-4.14/500-clk-mvebu-armada-37xx-periph-cosmetic-changes.patch
rename to 
target/linux/mvebu/patches-4.14/503-clk-mvebu-armada-37xx-periph-cosmetic-changes.patch
diff --git 
a/target/linux/mvebu/patches-4.14/501-clk-mvebu-armada-37xx-periph-prepare-cpu-clk-to-be-u.patch
 
b/target/linux/mvebu/patches-4.14/504-clk-mvebu-armada-37xx-periph-prepare-cpu-clk-to-be-u.patch
similarity index 100%
rename from 
target/linux/mvebu/patches-4.14/501-clk-mvebu-armada-37xx-periph-prepare-cpu-clk-to-be-u.patch
rename to 
target/linux/mvebu/patches-4.14/504-clk-mvebu-armada-37xx-periph-prepare-cpu-clk-to-be-u.patch
diff --git 
a/target/linux/mvebu/patches-4.14/502-clk-mvebu-armada-37xx-periph-add-DVFS-support-for-cp.patch
 
b/target/linux/mvebu/patches-4.14/505-clk-mvebu-armada-37xx-periph-add-DVFS-support-for-cp.patch
similarity index 100%
rename from 
target/linux/mvebu/patches-4.14/502-clk-mvebu-armada-37xx-periph-add-DVFS-support-for-cp.patch
rename to 
target/linux/mvebu/patches-4.14/505-clk-mvebu-armada-37xx-periph-add-DVFS-support-for-cp.patch
diff --git 
a/target/linux/mvebu/patches-4.14/503-cpufreq-Add-DVFS-support-for-Armada-37xx.patch
 

[OpenWrt-Devel] [PATCH 3/3] mvebu: backport upstream fixes for armada 37xx

2019-01-13 Thread Tomasz Maciej Nowak
Upstream patches for processor frequency scaling, which fix possible
system hard lockups.

Signed-off-by: Tomasz Maciej Nowak 
---
 ...-37xx-periph-Fix-switching-CPU-rate-.patch | 92 +++
 ...-37xx-periph-Fix-wrong-return-value-.patch | 33 +++
 ...-37xx-periph-Remove-unused-var-num_p.patch | 33 +++
 3 files changed, 158 insertions(+)
 create mode 100644 
target/linux/mvebu/patches-4.14/510-clk-mvebu-armada-37xx-periph-Fix-switching-CPU-rate-.patch
 create mode 100644 
target/linux/mvebu/patches-4.14/511-clk-mvebu-armada-37xx-periph-Fix-wrong-return-value-.patch
 create mode 100644 
target/linux/mvebu/patches-4.14/512-clk-mvebu-armada-37xx-periph-Remove-unused-var-num_p.patch

diff --git 
a/target/linux/mvebu/patches-4.14/510-clk-mvebu-armada-37xx-periph-Fix-switching-CPU-rate-.patch
 
b/target/linux/mvebu/patches-4.14/510-clk-mvebu-armada-37xx-periph-Fix-switching-CPU-rate-.patch
new file mode 100644
index 00..42bfef7b7e
--- /dev/null
+++ 
b/target/linux/mvebu/patches-4.14/510-clk-mvebu-armada-37xx-periph-Fix-switching-CPU-rate-.patch
@@ -0,0 +1,92 @@
+From 61c40f35f5cd6f67ccbd7319a1722eb78c815989 Mon Sep 17 00:00:00 2001
+From: Gregory CLEMENT 
+Date: Tue, 19 Jun 2018 14:34:45 +0200
+Subject: [PATCH] clk: mvebu: armada-37xx-periph: Fix switching CPU rate from
+ 300Mhz to 1.2GHz
+
+Switching the CPU from the L2 or L3 frequencies (300 and 200 Mhz
+respectively) to L0 frequency (1.2 Ghz) requires a significant amount
+of time to let VDD stabilize to the appropriate voltage. This amount of
+time is large enough that it cannot be covered by the hardware
+countdown register. Due to this, the CPU might start operating at L0
+before the voltage is stabilized, leading to CPU stalls.
+
+To work around this problem, we prevent switching directly from the
+L2/L3 frequencies to the L0 frequency, and instead switch to the L1
+frequency in-between. The sequence therefore becomes:
+
+1. First switch from L2/L3(200/300MHz) to L1(600MHZ)
+2. Sleep 20ms for stabling VDD voltage
+3. Then switch from L1(600MHZ) to L0(1200Mhz).
+
+It is based on the work done by Ken Ma 
+
+Cc: sta...@vger.kernel.org
+Fixes: 2089dc33ea0e ("clk: mvebu: armada-37xx-periph: add DVFS support for cpu 
clocks")
+Signed-off-by: Gregory CLEMENT 
+Signed-off-by: Stephen Boyd 
+---
+ drivers/clk/mvebu/armada-37xx-periph.c | 38 ++
+ 1 file changed, 38 insertions(+)
+
+--- a/drivers/clk/mvebu/armada-37xx-periph.c
 b/drivers/clk/mvebu/armada-37xx-periph.c
+@@ -35,6 +35,7 @@
+ #define CLK_SEL   0x10
+ #define CLK_DIS   0x14
+ 
++#define  ARMADA_37XX_DVFS_LOAD_1 1
+ #define LOAD_LEVEL_NR 4
+ 
+ #define ARMADA_37XX_NB_L0L1   0x18
+@@ -507,6 +508,40 @@ static long clk_pm_cpu_round_rate(struct
+   return -EINVAL;
+ }
+ 
++/*
++ * Switching the CPU from the L2 or L3 frequencies (300 and 200 Mhz
++ * respectively) to L0 frequency (1.2 Ghz) requires a significant
++ * amount of time to let VDD stabilize to the appropriate
++ * voltage. This amount of time is large enough that it cannot be
++ * covered by the hardware countdown register. Due to this, the CPU
++ * might start operating at L0 before the voltage is stabilized,
++ * leading to CPU stalls.
++ *
++ * To work around this problem, we prevent switching directly from the
++ * L2/L3 frequencies to the L0 frequency, and instead switch to the L1
++ * frequency in-between. The sequence therefore becomes:
++ * 1. First switch from L2/L3(200/300MHz) to L1(600MHZ)
++ * 2. Sleep 20ms for stabling VDD voltage
++ * 3. Then switch from L1(600MHZ) to L0(1200Mhz).
++ */
++static void clk_pm_cpu_set_rate_wa(unsigned long rate, struct regmap *base)
++{
++  unsigned int cur_level;
++
++  if (rate != 1200 * 1000 * 1000)
++  return;
++
++  regmap_read(base, ARMADA_37XX_NB_CPU_LOAD, _level);
++  cur_level &= ARMADA_37XX_NB_CPU_LOAD_MASK;
++  if (cur_level <= ARMADA_37XX_DVFS_LOAD_1)
++  return;
++
++  regmap_update_bits(base, ARMADA_37XX_NB_CPU_LOAD,
++ ARMADA_37XX_NB_CPU_LOAD_MASK,
++ ARMADA_37XX_DVFS_LOAD_1);
++  msleep(20);
++}
++
+ static int clk_pm_cpu_set_rate(struct clk_hw *hw, unsigned long rate,
+  unsigned long parent_rate)
+ {
+@@ -537,6 +572,9 @@ static int clk_pm_cpu_set_rate(struct cl
+*/
+   reg = ARMADA_37XX_NB_CPU_LOAD;
+   mask = ARMADA_37XX_NB_CPU_LOAD_MASK;
++
++  clk_pm_cpu_set_rate_wa(rate, base);
++
+   regmap_update_bits(base, reg, mask, load_level);
+ 
+   return rate;
diff --git 
a/target/linux/mvebu/patches-4.14/511-clk-mvebu-armada-37xx-periph-Fix-wrong-return-value-.patch
 
b/target/linux/mvebu/patches-4.14/511-clk-mvebu-armada-37xx-periph-Fix-wrong-return-value-.patch
new file mode 100644
index 00..389a13a2b4
--- /dev/null
+++ 

[OpenWrt-Devel] [PATCH 2/2] mvebu: remove default profile

2019-01-13 Thread Tomasz Maciej Nowak
When using Image Builder and building image for Cortex A53 or
A72 subtargets, it'll fail with following message:

Collected errors:
 * opkg_install_cmd: Cannot install package mwlwifi-firmware-88w8864.
 * opkg_install_cmd: Cannot install package mwlwifi-firmware-88w8964.
make[2]: *** [Makefile:153: package_install] Error 255
make[1]: *** [Makefile:114: _call_image] Error 2

This is beacuse both packages are available only for Cortex A9 subtarget
and are included in PACKAGES array in default profile. Instead patching
this, let's remove profiles completely, since all necessary packages are
specified in DEVICE_PACKAGES array for each device.

Signed-off-by: Tomasz Maciej Nowak 
---
 target/linux/mvebu/image/Makefile  |  1 -
 target/linux/mvebu/profiles/000-Default.mk | 18 --
 2 files changed, 19 deletions(-)
 delete mode 100644 target/linux/mvebu/profiles/000-Default.mk

diff --git a/target/linux/mvebu/image/Makefile 
b/target/linux/mvebu/image/Makefile
index be01623e86..22519bd9d0 100644
--- a/target/linux/mvebu/image/Makefile
+++ b/target/linux/mvebu/image/Makefile
@@ -81,7 +81,6 @@ define Build/omnia-medkit-initramfs
 endef
 
 define Device/Default
-  PROFILES := Default
   DEVICE_DTS := $(1)
   BOARD_NAME = $$(DEVICE_DTS)
   KERNEL_NAME := zImage
diff --git a/target/linux/mvebu/profiles/000-Default.mk 
b/target/linux/mvebu/profiles/000-Default.mk
deleted file mode 100644
index 8690dd8da5..00
--- a/target/linux/mvebu/profiles/000-Default.mk
+++ /dev/null
@@ -1,18 +0,0 @@
-#
-# Copyright (C) 2015 OpenWrt.org
-#
-# This is free software, licensed under the GNU General Public License v2.
-# See /LICENSE for more information.
-#
-
-define Profile/Default
-   NAME:=Default Profile (all drivers)
-   PACKAGES:= kmod-mwlwifi wpad-basic swconfig mkf2fs e2fsprogs \
-  mwlwifi-firmware-88w8864 mwlwifi-firmware-88w8964
-endef
-
-define Profile/Default/Description
-   Default package set compatible with most boards.
-endef
-
-$(eval $(call Profile,Default))
-- 
2.20.1


___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH 1/2] mvebu: move HARDEN_BRANCH_PREDICTOR to common config

2019-01-13 Thread Tomasz Maciej Nowak
This symbol is enabled in all subtargets, move it to common kernel
config.

Signed-off-by: Tomasz Maciej Nowak 
---
 target/linux/mvebu/config-4.14  | 1 +
 target/linux/mvebu/cortexa53/config-default | 1 -
 target/linux/mvebu/cortexa72/config-default | 1 -
 target/linux/mvebu/cortexa9/config-default  | 1 -
 4 files changed, 1 insertion(+), 3 deletions(-)
 delete mode 100644 target/linux/mvebu/cortexa9/config-default

diff --git a/target/linux/mvebu/config-4.14 b/target/linux/mvebu/config-4.14
index 296da5a109..cb26a927f9 100644
--- a/target/linux/mvebu/config-4.14
+++ b/target/linux/mvebu/config-4.14
@@ -212,6 +212,7 @@ CONFIG_GPIO_PCA953X_IRQ=y
 CONFIG_GPIO_SYSFS=y
 # CONFIG_GRO_CELLS is not set
 CONFIG_HANDLE_DOMAIN_IRQ=y
+CONFIG_HARDEN_BRANCH_PREDICTOR=y
 CONFIG_HARDIRQS_SW_RESEND=y
 CONFIG_HAS_DMA=y
 CONFIG_HAS_IOMEM=y
diff --git a/target/linux/mvebu/cortexa53/config-default 
b/target/linux/mvebu/cortexa53/config-default
index b631c30f5f..c5fcc0f3f8 100644
--- a/target/linux/mvebu/cortexa53/config-default
+++ b/target/linux/mvebu/cortexa53/config-default
@@ -65,7 +65,6 @@ CONFIG_GENERIC_CSUM=y
 CONFIG_GENERIC_IRQ_MIGRATION=y
 CONFIG_GENERIC_PINCONF=y
 CONFIG_GENERIC_TIME_VSYSCALL=y
-CONFIG_HARDEN_BRANCH_PREDICTOR=y
 CONFIG_HAVE_ALIGNED_STRUCT_PAGE=y
 CONFIG_HAVE_ARCH_HUGE_VMAP=y
 CONFIG_HAVE_ARCH_KASAN=y
diff --git a/target/linux/mvebu/cortexa72/config-default 
b/target/linux/mvebu/cortexa72/config-default
index 50b8d21c32..b855aa21d1 100644
--- a/target/linux/mvebu/cortexa72/config-default
+++ b/target/linux/mvebu/cortexa72/config-default
@@ -63,7 +63,6 @@ CONFIG_GENERIC_CSUM=y
 CONFIG_GENERIC_IRQ_MIGRATION=y
 CONFIG_GENERIC_PINCONF=y
 CONFIG_GENERIC_TIME_VSYSCALL=y
-CONFIG_HARDEN_BRANCH_PREDICTOR=y
 CONFIG_HAVE_ALIGNED_STRUCT_PAGE=y
 CONFIG_HAVE_ARCH_HUGE_VMAP=y
 CONFIG_HAVE_ARCH_KASAN=y
diff --git a/target/linux/mvebu/cortexa9/config-default 
b/target/linux/mvebu/cortexa9/config-default
deleted file mode 100644
index c9f039ba96..00
--- a/target/linux/mvebu/cortexa9/config-default
+++ /dev/null
@@ -1 +0,0 @@
-CONFIG_HARDEN_BRANCH_PREDICTOR=y
-- 
2.20.1


___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH 1/3] base-files: change boot & umount STOP levels -2

2019-01-13 Thread Joseph Tingiris
This patch is in a series to allow STOP levels after umount, so that
other block devices may stop cleanly.

boot is now STOP=96
umount is now STOP=97

Signed-off-by: Joseph Tingiris 
---
 package/base-files/Makefile| 2 +-
 package/base-files/files/etc/init.d/boot   | 2 +-
 package/base-files/files/etc/init.d/umount | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/package/base-files/Makefile b/package/base-files/Makefile
index ea1e4eb..226dd26 100644
--- a/package/base-files/Makefile
+++ b/package/base-files/Makefile
@@ -12,7 +12,7 @@ include $(INCLUDE_DIR)/version.mk
 include $(INCLUDE_DIR)/feeds.mk
 
 PKG_NAME:=base-files
-PKG_RELEASE:=196
+PKG_RELEASE:=197
 PKG_FLAGS:=nonshared
 
 PKG_FILE_DEPENDS:=$(PLATFORM_DIR)/ $(GENERIC_PLATFORM_DIR)/base-files/
diff --git a/package/base-files/files/etc/init.d/boot 
b/package/base-files/files/etc/init.d/boot
index 31f245f..16f66d6 100755
--- a/package/base-files/files/etc/init.d/boot
+++ b/package/base-files/files/etc/init.d/boot
@@ -2,7 +2,7 @@
 # Copyright (C) 2006-2011 OpenWrt.org
 
 START=10
-STOP=98
+STOP=96
 
 uci_apply_defaults() {
. /lib/functions/system.sh
diff --git a/package/base-files/files/etc/init.d/umount 
b/package/base-files/files/etc/init.d/umount
index 349b2b3..63b4223 100755
--- a/package/base-files/files/etc/init.d/umount
+++ b/package/base-files/files/etc/init.d/umount
@@ -1,7 +1,7 @@
 #!/bin/sh /etc/rc.common
 # Copyright (C) 2006 OpenWrt.org
 
-STOP=99
+STOP=97
 stop() {
sync
/bin/umount -a -d -r
-- 
1.8.3.1


___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH 3/3] kexec-tools: change kdump.init STOP level -2

2019-01-13 Thread Joseph Tingiris
This patch is in a series to allow STOP levels after umount, so
that other block devices may stop cleanly.

kdump.init is now STOP=96

Signed-off-by: Joseph Tingiris 
---
 package/boot/kexec-tools/Makefile | 2 +-
 package/boot/kexec-tools/files/kdump.init | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/package/boot/kexec-tools/Makefile 
b/package/boot/kexec-tools/Makefile
index 76ea46f..8d62a23 100644
--- a/package/boot/kexec-tools/Makefile
+++ b/package/boot/kexec-tools/Makefile
@@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=kexec-tools
 PKG_VERSION:=2.0.16
-PKG_RELEASE:=1
+PKG_RELEASE:=2
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
 PKG_SOURCE_URL:=@KERNEL/linux/utils/kernel/kexec
diff --git a/package/boot/kexec-tools/files/kdump.init 
b/package/boot/kexec-tools/files/kdump.init
index 6a6a94c..7e79827 100755
--- a/package/boot/kexec-tools/files/kdump.init
+++ b/package/boot/kexec-tools/files/kdump.init
@@ -1,7 +1,7 @@
 #!/bin/sh /etc/rc.common
 
 START=41
-STOP=98
+STOP=96
 
 EXTRA_COMMANDS="status"
 EXTRA_HELP="status  Print crashkernel status"
-- 
1.8.3.1


___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH 2/3] rssileds: change rssileds.init STOP level -2

2019-01-13 Thread Joseph Tingiris
This patch is in a series to allow STOP levels after umount, so
that other block devices may stop cleanly.

rssileds.init is now STOP=94

Signed-off-by: Joseph Tingiris 
---
 package/network/utils/rssileds/Makefile| 2 +-
 package/network/utils/rssileds/files/rssileds.init | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/package/network/utils/rssileds/Makefile 
b/package/network/utils/rssileds/Makefile
index d3fb66a..27cdb4c 100644
--- a/package/network/utils/rssileds/Makefile
+++ b/package/network/utils/rssileds/Makefile
@@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=rssileds
 PKG_VERSION:=0.2
-PKG_RELEASE:=1
+PKG_RELEASE:=2
 PKG_LICNESE:=GPL-2.0+
 
 include $(INCLUDE_DIR)/package.mk
diff --git a/package/network/utils/rssileds/files/rssileds.init 
b/package/network/utils/rssileds/files/rssileds.init
index b0d2627..ef7d470 100644
--- a/package/network/utils/rssileds/files/rssileds.init
+++ b/package/network/utils/rssileds/files/rssileds.init
@@ -2,7 +2,7 @@
 # (C) 2012 Daniel Golle, Allnet GmbH 
 
 START=96
-STOP=96
+STOP=94
 RSSILEDS_BIN="/usr/sbin/rssileds"
 
 SERVICE_DAEMONIZE=1
-- 
1.8.3.1


___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] Add Support for 2nd USB Port of Fritz!Box 7320 and 7330

2019-01-13 Thread Robert Resch
Hi,

Please don't commit this patch as i want do do some further checks if
there is no problem with the 7320. i only could test at a 7330 for now.

Sorry

Yours, Robert

Am 13.01.2019 um 17:08 schrieb Robert Resch:
> Hi,
> 
> I managed to get the second USB Port of my FritzBox working with
> OpenWRT. The dts File only enabled one port but the Box has two.
> 
> Find attached a simple Patch adding support.
> 
> commit subject: lantiq: add support for 2nd USB Port for FRITZ7320
> 
> description: adds support for the 2nd USB Port of the Fritz!Boxes 7320
> and 7330
> 
> Signed-off-by: Robert Resch 
> 
> 
> ___
> openwrt-devel mailing list
> openwrt-devel@lists.openwrt.org
> https://lists.openwrt.org/mailman/listinfo/openwrt-devel
> 

___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] Add Support for 2nd USB Port of Fritz!Box 7320 and 7330

2019-01-13 Thread Robert Resch
Hi,

I managed to get the second USB Port of my FritzBox working with
OpenWRT. The dts File only enabled one port but the Box has two.

Find attached a simple Patch adding support.

commit subject: lantiq: add support for 2nd USB Port for FRITZ7320

description: adds support for the 2nd USB Port of the Fritz!Boxes 7320
and 7330

Signed-off-by: Robert Resch 
--- target/linux/lantiq/files-4.14/arch/mips/boot/dts/FRITZ7320.dts.old 
2019-01-13 16:33:48.927626207 +0100
+++ target/linux/lantiq/files-4.14/arch/mips/boot/dts/FRITZ7320.dts 
2019-01-13 16:34:15.352145597 +0100
@@ -159,6 +159,14 @@
status = "okay";
 };

+_phy1 {
+   status = "okay";
+};
+
  {
status = "okay";
 };
+
+ {
+   status = "okay";
+};
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] Notes on (dangerous ?) sysupgrade

2019-01-13 Thread Reiner Karlsberg

Am 13.01.2019 um 14:31 schrieb Jo-Philipp Wich:

Hi Reiner,


After having several unpleasant encounters using sysupgrade, I had a
quick glance at the code, after more or less successfully implementing
workarounds for incomplete sysupgrades, resulting in inconsistent systems.
My questions are:
- Is it safe, simply to kill running processes during sysupgrade ? As
there might be services, restarted automatically (by procd ?).


Roughly, the sysupgrade process is as follows:

1) /sbin/sysupgrade (shell script)

Parses arguments, sets default, assembles conffiles to backup, runs
partials scripts in /lib/upgrade, checks the image, ends with `ubus call
system sysupgrade`. All fatal exit conditions (such as invalid image)
should be handled here.

2) ubus call system sysupgrade (procd ubus procedure)

Invokes a procedure in procd that instructs procd to terminate itself
and exec into /sbin/upgraded (which has been copied to a ramdisk at
/tmp/root first), turning /tmp/root/sbin/upgraded into pid 1 and
releasing the pid 1 use of /.

3) /tmp/root/sbin/upgraded (binary)

Functions as pid 1 placeholder to prevent the kernel from panicking. It
does two things; keep serving the watchdog to prevent spontaneous resets
and executing /lib/upgrade/stage2

4) /lib/upgrade/stage2 (shell script)

Assemble backup tarball, write image, append backup tarball to just
written image. The exact procedure depends on the platform.


So yes, it is safe to simply kill processes in the sense that there will
be no procd running anymore at this point which would relaunch them.

Merely killing processes instead of shutting them down through their
respective init scripts is not ideal though, that eventually needs rework.

Ideally sysupgrade should try to cleanly stop as many services through
their respective init scripts as possible before invoking stage2, then
only do the 'kill TERM; sleep 3; kill KILL' sequence on processes that
somehow failed to stop initially (buggy init scripts, timeouts, ...).


-  What about a killed process, simply taking some time to shut down ?
(example: squid closing lot of open files on block-device; having
internal shutdown timer 30s by default)


Such services are not gracefully handled atm, see above.


- What about open swap file on block-device ?


 From a cursory look, it does not appear that sysupgrade currently
performs any swapoff at all, adding a `swapoff -a` after the process
termination would certainly make sense.


- What about mounted block-device for mass storage ?


Same as swap, there is no umount handling either as far as I can see. I
think this should be added as well along with the swapoff. Since the
sysupgrade runs off a pivot_root'ed /tmp/root at this point, all fses
should be free to umount. (Might still need two or three cycles due to
layered mounts).


- What about (slow) wwan connection, managed by pppd. When killed by
sysupgrade, will netifd restart pppd ?


It should not happen. Theoretically it could be that pppd is killed
first while netifd is still running, netifd will then try to restart
pppd shortly before netifd itself will get killed, but the second KILL
loop three seconds later should catch this rare circumstance.

However, as discussed above a graceful service shutdown would be better.


As a workaround, before calling sysupgrade I
- explicitly use /etc/init.d/most_services stop
- explicitly kill squid and wait for termination
- explicitly disable swap
- explicitly dismount mounted block-device
- ifdown wwan


That certainly makes a lot sense and most of this should probably go
into sysupgrade (stage1 aka /sbin/sysupgrade) directly. A slight
difficulty is see is how to identify "most_services" but I guess a
hardcoded whitelist for things like "dropbear", "openssh" or "telnetd"
will do.

As for awaiting squid termination - I think if its not already the case,
the squid init script should be reworked so that /etc/init.d/squid stop
does not return (successfully) before squid is actually stopped.


Before I had several cases, that
sysupgrade -n -v -f /tmp/newfiles.tar.gz /tmp/new_fw.bin
updated all files from /tmp/newfiles.tar.gz, but did not do the flash of
new_fw.bin


This is quite strange as appending the /tmp/newfiles.tar.gz archive will
only happen after /tmp/new_fw.bin has been written. I could only imagine
that the image write procedure itself somehow failed, but appending the
archive still worked.

How exactly this could fail depends on the platform. Can you provide
some more details about the device this issue occurred on?

~ Jo




I had these observations on my ZBT WE1026-5g.
I am running several special services, like squid, collectd, chilli, nginx, 
uhttpd, openvpn.
The WE1026-5g includes a SD-card, used for swap-file, squid-caching, logfiles 
(from squid and nginx).
Quectel EC25 is used for wwan (serial, 3g); but I _think_ I had same effects 
using wan instead of wwan, too.
Additionally, I have several simple private processes, like continuous ping to 
keep wwan 

Re: [OpenWrt-Devel] Notes on (dangerous ?) sysupgrade

2019-01-13 Thread Jo-Philipp Wich
Hi Reiner,

> After having several unpleasant encounters using sysupgrade, I had a
> quick glance at the code, after more or less successfully implementing
> workarounds for incomplete sysupgrades, resulting in inconsistent systems.
> My questions are:
> - Is it safe, simply to kill running processes during sysupgrade ? As
> there might be services, restarted automatically (by procd ?).

Roughly, the sysupgrade process is as follows:

1) /sbin/sysupgrade (shell script)

Parses arguments, sets default, assembles conffiles to backup, runs
partials scripts in /lib/upgrade, checks the image, ends with `ubus call
system sysupgrade`. All fatal exit conditions (such as invalid image)
should be handled here.

2) ubus call system sysupgrade (procd ubus procedure)

Invokes a procedure in procd that instructs procd to terminate itself
and exec into /sbin/upgraded (which has been copied to a ramdisk at
/tmp/root first), turning /tmp/root/sbin/upgraded into pid 1 and
releasing the pid 1 use of /.

3) /tmp/root/sbin/upgraded (binary)

Functions as pid 1 placeholder to prevent the kernel from panicking. It
does two things; keep serving the watchdog to prevent spontaneous resets
and executing /lib/upgrade/stage2

4) /lib/upgrade/stage2 (shell script)

Assemble backup tarball, write image, append backup tarball to just
written image. The exact procedure depends on the platform.


So yes, it is safe to simply kill processes in the sense that there will
be no procd running anymore at this point which would relaunch them.

Merely killing processes instead of shutting them down through their
respective init scripts is not ideal though, that eventually needs rework.

Ideally sysupgrade should try to cleanly stop as many services through
their respective init scripts as possible before invoking stage2, then
only do the 'kill TERM; sleep 3; kill KILL' sequence on processes that
somehow failed to stop initially (buggy init scripts, timeouts, ...).

> -  What about a killed process, simply taking some time to shut down ?
> (example: squid closing lot of open files on block-device; having
> internal shutdown timer 30s by default)

Such services are not gracefully handled atm, see above.

> - What about open swap file on block-device ?

From a cursory look, it does not appear that sysupgrade currently
performs any swapoff at all, adding a `swapoff -a` after the process
termination would certainly make sense.

> - What about mounted block-device for mass storage ?

Same as swap, there is no umount handling either as far as I can see. I
think this should be added as well along with the swapoff. Since the
sysupgrade runs off a pivot_root'ed /tmp/root at this point, all fses
should be free to umount. (Might still need two or three cycles due to
layered mounts).

> - What about (slow) wwan connection, managed by pppd. When killed by
> sysupgrade, will netifd restart pppd ?

It should not happen. Theoretically it could be that pppd is killed
first while netifd is still running, netifd will then try to restart
pppd shortly before netifd itself will get killed, but the second KILL
loop three seconds later should catch this rare circumstance.

However, as discussed above a graceful service shutdown would be better.

> As a workaround, before calling sysupgrade I
> - explicitly use /etc/init.d/most_services stop
> - explicitly kill squid and wait for termination
> - explicitly disable swap
> - explicitly dismount mounted block-device
> - ifdown wwan

That certainly makes a lot sense and most of this should probably go
into sysupgrade (stage1 aka /sbin/sysupgrade) directly. A slight
difficulty is see is how to identify "most_services" but I guess a
hardcoded whitelist for things like "dropbear", "openssh" or "telnetd"
will do.

As for awaiting squid termination - I think if its not already the case,
the squid init script should be reworked so that /etc/init.d/squid stop
does not return (successfully) before squid is actually stopped.

> Before I had several cases, that
> sysupgrade -n -v -f /tmp/newfiles.tar.gz /tmp/new_fw.bin
> updated all files from /tmp/newfiles.tar.gz, but did not do the flash of
> new_fw.bin

This is quite strange as appending the /tmp/newfiles.tar.gz archive will
only happen after /tmp/new_fw.bin has been written. I could only imagine
that the image write procedure itself somehow failed, but appending the
archive still worked.

How exactly this could fail depends on the platform. Can you provide
some more details about the device this issue occurred on?

~ Jo



signature.asc
Description: OpenPGP digital signature
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] Notes on (dangerous ?) sysupgrade

2019-01-13 Thread Sebastian Moeller
Mmmh, I have a hunch a recent observation of mine might be related 
(unfortunately I have no log data):

Within a set of recent master builds, sysupgrade from a system running for a 
few days resulted in the expected behavior in that sysupgrade disconnected the 
current ssh connection and the LED pattern on the router looked as if the 
device was updating itself but after the automatic reboot the router came back 
up still with the previous firmware. Redoing the sussupgrade on that just 
booted system so far always worked as expected. I think I only started to see 
this with builds from end of last year on. So far I brushed this off as signs 
that my trusty old wndr3700v2 might be reaching the end of its life, but with 
this report I am not so sure and will try to log things better the next time 
this happens.


> On Jan 13, 2019, at 11:08, Reiner Karlsberg  wrote:
> 
> I am an unhappy user of sysupgrade for remote installed devices.
> (Besides these ones:  
> https://forum.openwrt.org/t/sysupgrade-return-code-in-18-06-vs-17-01/22316/9)
> 
> After having several unpleasant encounters using sysupgrade, I had a quick 
> glance at the code, after more or less successfully implementing workarounds 
> for incomplete sysupgrades, resulting in inconsistent systems.
> My questions are:
> - Is it safe, simply to kill running processes during sysupgrade ? As there 
> might be services, restarted automatically (by procd ?).
> -  What about a killed process, simply taking some time to shut down ? 
> (example: squid closing lot of open files on block-device; having internal 
> shutdown timer 30s by default)
> - What about open swap file on block-device ?
> - What about mounted block-device for mass storage ?
> - What about (slow) wwan connection, managed by pppd. When killed by 
> sysupgrade, will netifd restart pppd ?
> 
> As a workaround, before calling sysupgrade I
> - explicitly use /etc/init.d/most_services stop
> - explicitly kill squid and wait for termination
> - explicitly disable swap
> - explicitly dismount mounted block-device
> - ifdown wwan
> 
> Before I had several cases, that
> sysupgrade -n -v -f /tmp/newfiles.tar.gz /tmp/new_fw.bin
> updated all files from /tmp/newfiles.tar.gz, but did not do the flash of 
> new_fw.bin
> Resulting in inconsistent system.
> 
> ___
> openwrt-devel mailing list
> openwrt-devel@lists.openwrt.org
> https://lists.openwrt.org/mailman/listinfo/openwrt-devel


___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] [PATCH] e2fsprogs: Update to 1.43.5

2019-01-13 Thread Jo-Philipp Wich
Hi,

> Remove patch 000-relocatable.patch as it seems to be no longer needed.

did you verify that the generated compile_et and make_cmds scripts are
installed without absolute paths in the host staging directory?

If not, then removing this path will result in very hard to debug SDK
build failures for packages relying on libcom_err or libss.

~ Jo



signature.asc
Description: OpenPGP digital signature
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] Notes on (dangerous ?) sysupgrade

2019-01-13 Thread Reiner Karlsberg

I am an unhappy user of sysupgrade for remote installed devices.
(Besides these ones:  
https://forum.openwrt.org/t/sysupgrade-return-code-in-18-06-vs-17-01/22316/9)

After having several unpleasant encounters using sysupgrade, I had a quick glance at the code, after more or less 
successfully implementing workarounds for incomplete sysupgrades, resulting in inconsistent systems.

My questions are:
- Is it safe, simply to kill running processes during sysupgrade ? As there might be services, restarted automatically 
(by procd ?).
-  What about a killed process, simply taking some time to shut down ? (example: squid closing lot of open files on 
block-device; having internal shutdown timer 30s by default)

- What about open swap file on block-device ?
- What about mounted block-device for mass storage ?
- What about (slow) wwan connection, managed by pppd. When killed by 
sysupgrade, will netifd restart pppd ?

As a workaround, before calling sysupgrade I
- explicitly use /etc/init.d/most_services stop
- explicitly kill squid and wait for termination
- explicitly disable swap
- explicitly dismount mounted block-device
- ifdown wwan

Before I had several cases, that
sysupgrade -n -v -f /tmp/newfiles.tar.gz /tmp/new_fw.bin
updated all files from /tmp/newfiles.tar.gz, but did not do the flash of 
new_fw.bin
Resulting in inconsistent system.

___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel