diff mbox series

[v2,1/9] boot/apex: Restore the APEX boot loader

Message ID 20230928-ixp4xx-v2-1-ce011eef8239@linaro.org
State Superseded
Headers show
Series Resurrect OpenWrt IXP4xx support | expand

Commit Message

Linus Walleij Sept. 28, 2023, 1:28 p.m. UTC
This is a partial revert of the deletion of the IXP4xx
target: we restore the APEX boot loader so we can use it
for the NSLU2 and related targets.

The APEX upstream is as dead as it gets so I have applied
OpenWrts old patches on top of the never released
v1.6.10 version and forked it into an OpenWrt variant
on GitHub. If the upstream comes back alive I will
happily switch over to it.

The file refers to the external GitHub, I suppose when
integrating this patch the file should be copied to OpenWrts
file repository and the file link changed.

Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
---
ChangeLog v1->v2:
- Do not default to "y", instead make the device target
  select apex by default.
- Do not package the boot loader into the rootfs image.
  Who wants that.
---
 package/boot/apex/Makefile | 55 ++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 55 insertions(+)

Comments

Robert Marko Oct. 4, 2023, 12:50 p.m. UTC | #1
On Thu, 28 Sept 2023 at 15:29, Linus Walleij <linus.walleij@linaro.org> wrote:
>
> This is a partial revert of the deletion of the IXP4xx
> target: we restore the APEX boot loader so we can use it
> for the NSLU2 and related targets.
>
> The APEX upstream is as dead as it gets so I have applied
> OpenWrts old patches on top of the never released
> v1.6.10 version and forked it into an OpenWrt variant
> on GitHub. If the upstream comes back alive I will
> happily switch over to it.
>
> The file refers to the external GitHub, I suppose when
> integrating this patch the file should be copied to OpenWrts
> file repository and the file link changed.
>
> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
> ---
> ChangeLog v1->v2:
> - Do not default to "y", instead make the device target
>   select apex by default.
> - Do not package the boot loader into the rootfs image.
>   Who wants that.
> ---
>  package/boot/apex/Makefile | 55 ++++++++++++++++++++++++++++++++++++++++++++++
>  1 file changed, 55 insertions(+)
>
> diff --git a/package/boot/apex/Makefile b/package/boot/apex/Makefile
> new file mode 100644
> index 000000000000..817e15d8e643
> --- /dev/null
> +++ b/package/boot/apex/Makefile
> @@ -0,0 +1,55 @@
> +# SPDX-License-Identifier: GPL-2.0-only
> +#
> +# Copyright (C) 2006-2023 OpenWrt.org
> +
> +include $(TOPDIR)/rules.mk
> +include $(INCLUDE_DIR)/kernel.mk
> +
> +PKG_NAME:=apex
> +# This version was created from the stalled and unreleased v1.6.10
> +# with some patches on top.
> +PKG_VERSION:=1.6.10-openwrt
> +PKG_RELEASE:=1
> +
> +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
> +PKG_SOURCE_URL:=https://github.com/linusw/apex/releases/download/v1.6.10-openwrt/
> +PKG_HASH:=034baa99574014f4bcb8d36baf830fa942bef816b22e228eabd7c5663612c640
> +PKG_TARGETS:=bin
> +
> +include $(INCLUDE_DIR)/package.mk
> +
> +export GCC_HONOUR_COPTS=s
> +
> +define Package/apex
> +  SECTION:=boot
> +  CATEGORY:=Boot Loaders
> +  DEPENDS:=@TARGET_ixp4xx

This will probably break the package if one tries to bisect as there
is no ixp4xx target yet.

Regards,
Robert
> +  TITLE:=Boot loader for NSLU2, FSG3, NAS100D and others
> +endef
> +
> +define build_apex
> +       $(MAKE) -C $(PKG_BUILD_DIR) \
> +               ARCH=arm \
> +               $(1)_config
> +       $(MAKE) -C $(PKG_BUILD_DIR) \
> +               $(TARGET_CONFIGURE_OPTS) \
> +               KBUILD_HAVE_NLS=no \
> +               ARCH=arm \
> +               clean all
> +       $(INSTALL_BIN) $(PKG_BUILD_DIR)/apex.bin $(PKG_BUILD_DIR)/out/apex-$(2).bin
> +endef
> +
> +define Build/Compile
> +       $(INSTALL_DIR) $(PKG_BUILD_DIR)/out
> +       $(call build_apex,openwrt-nslu2-armeb,nslu2-armeb)
> +       $(call build_apex,openwrt-nslu2-16mb-armeb,nslu2-16mb-armeb)
> +       $(call build_apex,openwrt-fsg3-armeb,fsg3-armeb)
> +       $(call build_apex,openwrt-nas100d-armeb,nas100d-armeb)
> +endef
> +
> +define Package/apex/install
> +       $(INSTALL_DIR) $(STAGING_DIR)/apex
> +       $(CP) $(PKG_BUILD_DIR)/out/*.bin $(1)/
> +endef
> +
> +$(eval $(call BuildPackage,apex))
>
> --
> 2.34.1
>
>
> _______________________________________________
> openwrt-devel mailing list
> openwrt-devel@lists.openwrt.org
> https://lists.openwrt.org/mailman/listinfo/openwrt-devel
Jonas Gorski Oct. 4, 2023, 1:17 p.m. UTC | #2
On Wed, 4 Oct 2023 at 14:51, Robert Marko <robimarko@gmail.com> wrote:
>
> On Thu, 28 Sept 2023 at 15:29, Linus Walleij <linus.walleij@linaro.org> wrote:
> >
> > This is a partial revert of the deletion of the IXP4xx
> > target: we restore the APEX boot loader so we can use it
> > for the NSLU2 and related targets.
> >
> > The APEX upstream is as dead as it gets so I have applied
> > OpenWrts old patches on top of the never released
> > v1.6.10 version and forked it into an OpenWrt variant
> > on GitHub. If the upstream comes back alive I will
> > happily switch over to it.
> >
> > The file refers to the external GitHub, I suppose when
> > integrating this patch the file should be copied to OpenWrts
> > file repository and the file link changed.
> >
> > Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
> > ---
> > ChangeLog v1->v2:
> > - Do not default to "y", instead make the device target
> >   select apex by default.
> > - Do not package the boot loader into the rootfs image.
> >   Who wants that.
> > ---
> >  package/boot/apex/Makefile | 55 ++++++++++++++++++++++++++++++++++++++++++++++
> >  1 file changed, 55 insertions(+)
> >
> > diff --git a/package/boot/apex/Makefile b/package/boot/apex/Makefile
> > new file mode 100644
> > index 000000000000..817e15d8e643
> > --- /dev/null
> > +++ b/package/boot/apex/Makefile
> > @@ -0,0 +1,55 @@
> > +# SPDX-License-Identifier: GPL-2.0-only
> > +#
> > +# Copyright (C) 2006-2023 OpenWrt.org
> > +
> > +include $(TOPDIR)/rules.mk
> > +include $(INCLUDE_DIR)/kernel.mk
> > +
> > +PKG_NAME:=apex
> > +# This version was created from the stalled and unreleased v1.6.10
> > +# with some patches on top.
> > +PKG_VERSION:=1.6.10-openwrt
> > +PKG_RELEASE:=1
> > +
> > +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
> > +PKG_SOURCE_URL:=https://github.com/linusw/apex/releases/download/v1.6.10-openwrt/
> > +PKG_HASH:=034baa99574014f4bcb8d36baf830fa942bef816b22e228eabd7c5663612c640
> > +PKG_TARGETS:=bin
> > +
> > +include $(INCLUDE_DIR)/package.mk
> > +
> > +export GCC_HONOUR_COPTS=s
> > +
> > +define Package/apex
> > +  SECTION:=boot
> > +  CATEGORY:=Boot Loaders
> > +  DEPENDS:=@TARGET_ixp4xx
>
> This will probably break the package if one tries to bisect as there
> is no ixp4xx target yet.

No it's fine, it just depends on a non-existing symbol, so will be
unselectable until the ixp4xx target is added.

So exactly the right order here.

Best Regards,
Jonas
diff mbox series

Patch

diff --git a/package/boot/apex/Makefile b/package/boot/apex/Makefile
new file mode 100644
index 000000000000..817e15d8e643
--- /dev/null
+++ b/package/boot/apex/Makefile
@@ -0,0 +1,55 @@ 
+# SPDX-License-Identifier: GPL-2.0-only
+#
+# Copyright (C) 2006-2023 OpenWrt.org
+
+include $(TOPDIR)/rules.mk
+include $(INCLUDE_DIR)/kernel.mk
+
+PKG_NAME:=apex
+# This version was created from the stalled and unreleased v1.6.10
+# with some patches on top.
+PKG_VERSION:=1.6.10-openwrt
+PKG_RELEASE:=1
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_SOURCE_URL:=https://github.com/linusw/apex/releases/download/v1.6.10-openwrt/
+PKG_HASH:=034baa99574014f4bcb8d36baf830fa942bef816b22e228eabd7c5663612c640
+PKG_TARGETS:=bin
+
+include $(INCLUDE_DIR)/package.mk
+
+export GCC_HONOUR_COPTS=s
+
+define Package/apex
+  SECTION:=boot
+  CATEGORY:=Boot Loaders
+  DEPENDS:=@TARGET_ixp4xx
+  TITLE:=Boot loader for NSLU2, FSG3, NAS100D and others
+endef
+
+define build_apex
+	$(MAKE) -C $(PKG_BUILD_DIR) \
+		ARCH=arm \
+		$(1)_config
+	$(MAKE) -C $(PKG_BUILD_DIR) \
+		$(TARGET_CONFIGURE_OPTS) \
+		KBUILD_HAVE_NLS=no \
+		ARCH=arm \
+		clean all
+	$(INSTALL_BIN) $(PKG_BUILD_DIR)/apex.bin $(PKG_BUILD_DIR)/out/apex-$(2).bin
+endef
+
+define Build/Compile
+	$(INSTALL_DIR) $(PKG_BUILD_DIR)/out
+	$(call build_apex,openwrt-nslu2-armeb,nslu2-armeb)
+	$(call build_apex,openwrt-nslu2-16mb-armeb,nslu2-16mb-armeb)
+	$(call build_apex,openwrt-fsg3-armeb,fsg3-armeb)
+	$(call build_apex,openwrt-nas100d-armeb,nas100d-armeb)
+endef
+
+define Package/apex/install
+	$(INSTALL_DIR) $(STAGING_DIR)/apex
+	$(CP) $(PKG_BUILD_DIR)/out/*.bin $(1)/
+endef
+
+$(eval $(call BuildPackage,apex))