* [PPC BOOT] Create otheros.bld next to specified output file, not in $object directory.
@ 2007-12-03 2:48 David Woodhouse
2007-12-03 2:49 ` [PPC BOOT] Find device-tree source file in default directory David Woodhouse
2007-12-03 3:33 ` [PPC BOOT] Create otheros.bld next to specified output file, not in $object directory Geoff Levand
0 siblings, 2 replies; 7+ messages in thread
From: David Woodhouse @ 2007-12-03 2:48 UTC (permalink / raw)
To: linuxppc-dev
The bootwrapper script currently generates an 'otheros.bld' file in
addition to the file specified by the -o option, when asked to build a
wrapper for PS3.
It should do that in the same directory as the output, not the directory
where the wrapper objects are kept (which might potentially not be
writable when the script runs).
Arguably, the 'otheros.bld' ought to be created with the filename
specified as the -o argument. But that's a more intrusive change.
Signed-off-by: David Woodhouse <dwmw2@infradead.org>
--- a/arch/powerpc/boot/wrapper
+++ b/arch/powerpc/boot/wrapper
@@ -287,8 +289,6 @@ ps3)
overlay_dest="256"
overlay_size="256"
- rm -f "$object/otheros.bld"
-
${CROSS}objcopy -O binary "$ofile" "$ofile.bin"
dd if="$ofile.bin" of="$ofile.bin" conv=notrunc \
@@ -299,6 +299,8 @@ ps3)
skip=$system_reset_overlay seek=$overlay_dest \
count=$overlay_size bs=1
- gzip --force -9 --stdout "$ofile.bin" > "$object/otheros.bld"
+ odir="$(dirname "$ofile.bin")"
+ rm -f "$odir/otheros.bld"
+ gzip --force -9 --stdout "$ofile.bin" > "$odir/otheros.bld"
;;
esac
--
dwmw2
^ permalink raw reply [flat|nested] 7+ messages in thread
* [PPC BOOT] Find device-tree source file in default directory.
2007-12-03 2:48 [PPC BOOT] Create otheros.bld next to specified output file, not in $object directory David Woodhouse
@ 2007-12-03 2:49 ` David Woodhouse
2007-12-03 2:52 ` [PPC BOOT] Allow for bootwrapper utilities being in different directory to objects David Woodhouse
2007-12-03 15:08 ` [PPC BOOT] Find device-tree source file in default directory Scott Wood
2007-12-03 3:33 ` [PPC BOOT] Create otheros.bld next to specified output file, not in $object directory Geoff Levand
1 sibling, 2 replies; 7+ messages in thread
From: David Woodhouse @ 2007-12-03 2:49 UTC (permalink / raw)
To: linuxppc-dev
If a .dts file is given to the bootwrapper script without a full path
name, look in a sensible place for it.
Signed-off-by: David Woodhouse <dwmw2@infradead.org>
--- a/arch/powerpc/boot/wrapper
+++ b/arch/powerpc/boot/wrapper
@@ -116,6 +118,9 @@ while [ "$#" -gt 0 ]; do
done
if [ -n "$dts" ]; then
+ if [ ! -r "$dts" -a -r "$object/dts/$dts" ]; then
+ dts="$object/dts/$dts"
+ fi
if [ -z "$dtb" ]; then
dtb="$platform.dtb"
fi
--
dwmw2
^ permalink raw reply [flat|nested] 7+ messages in thread
* [PPC BOOT] Allow for bootwrapper utilities being in different directory to objects
2007-12-03 2:49 ` [PPC BOOT] Find device-tree source file in default directory David Woodhouse
@ 2007-12-03 2:52 ` David Woodhouse
2007-12-03 2:56 ` [PPC BOOT] 'make bootwrapper_install' David Woodhouse
2007-12-03 15:08 ` [PPC BOOT] Find device-tree source file in default directory Scott Wood
1 sibling, 1 reply; 7+ messages in thread
From: David Woodhouse @ 2007-12-03 2:52 UTC (permalink / raw)
To: linuxppc-dev
It's possible that the executables which are built as helpers for the
bootwrapper stuff might end up in a different place to the intermediate
object files. Handle that.
Signed-off-by: David Woodhouse <dwmw2@infradead.org>
diff --git a/arch/powerpc/boot/wrapper b/arch/powerpc/boot/wrapper
index 31147a0..ef86a70 100755
--- a/arch/powerpc/boot/wrapper
+++ b/arch/powerpc/boot/wrapper
@@ -45,6 +45,7 @@ CROSS=
# directory for object and other files used by this script
object=arch/powerpc/boot
+objbin=$object
# directory for working files
tmpdir=.
@@ -95,6 +96,7 @@ while [ "$#" -gt 0 ]; do
shift
[ "$#" -gt 0 ] || usage
object="$1"
+ objbin="$1"
;;
-W)
shift
@@ -246,11 +248,11 @@ fi
# post-processing needed for some platforms
case "$platform" in
pseries|chrp)
- $object/addnote "$ofile"
+ $objbin/addnote "$ofile"
;;
coff)
${CROSS}objcopy -O aixcoff-rs6000 --set-start "$entry" "$ofile"
- $object/hack-coff "$ofile"
+ $objbin/hack-coff "$ofile"
;;
cuboot*)
gzip -f -9 "$ofile"
@@ -259,7 +261,7 @@ cuboot*)
;;
treeboot*)
mv "$ofile" "$ofile.elf"
- $object/mktree "$ofile.elf" "$ofile" "$base" "$entry"
+ $objbin/mktree "$ofile.elf" "$ofile" "$base" "$entry"
if [ -z "$cacheit" ]; then
rm -f "$ofile.elf"
fi
--
dwmw2
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [PPC BOOT] 'make bootwrapper_install'
2007-12-03 2:52 ` [PPC BOOT] Allow for bootwrapper utilities being in different directory to objects David Woodhouse
@ 2007-12-03 2:56 ` David Woodhouse
0 siblings, 0 replies; 7+ messages in thread
From: David Woodhouse @ 2007-12-03 2:56 UTC (permalink / raw)
To: linuxppc-dev
This adds a 'bootwrapper_install' make target for the powerpc
architecture, which installs the wrapper script, intermediate object
files and device-tree sources for later use.
This will then allow bootable zImages to be created other than in the
context of a kernel build.
Signed-off-by: David Woodhouse <dwmw2@infradead.org>
diff --git a/arch/powerpc/boot/Makefile b/arch/powerpc/boot/Makefile
index 18e3271..acf3641 100644
--- a/arch/powerpc/boot/Makefile
+++ b/arch/powerpc/boot/Makefile
@@ -243,3 +243,51 @@ clean-kernel := vmlinux.strip vmlinux.bin
clean-kernel += $(addsuffix .gz,$(clean-kernel))
# If not absolute clean-files are relative to $(obj).
clean-files += $(addprefix $(objtree)/, $(clean-kernel))
+
+WRAPPER_OBJDIR := /usr/lib/kernel-wrapper
+WRAPPER_DTSDIR := /usr/lib/kernel-wrapper/dts
+WRAPPER_BINDIR := /usr/sbin
+INSTALL := install
+
+extra-installed := $(patsubst $(obj)/%, $(DESTDIR)$(WRAPPER_OBJDIR)/%, $(extra-y))
+hostprogs-installed := $(patsubst %, $(DESTDIR)$(WRAPPER_BINDIR)/%, $(hostprogs-y))
+wrapper-installed := $(DESTDIR)$(WRAPPER_BINDIR)/wrapper
+dts-installed := $(patsubst $(obj)/dts/%, $(DESTDIR)$(WRAPPER_DTSDIR)/%, $(wildcard $(obj)/dts/*.dts))
+
+all-installed := $(extra-installed) $(hostprogs-installed) $(wrapper-installed) $(dts-installed)
+
+quiet_cmd_mkdir = MKDIR $(patsubst $(INSTALL_HDR_PATH)/%,%,$@)
+ cmd_mkdir = mkdir -p $@
+
+quiet_cmd_install = INSTALL $(patsubst $(DESTDIR)$(WRAPPER_OBJDIR)/%,%,$@)
+ cmd_install = $(INSTALL) -m0644 $(patsubst $(DESTDIR)$(WRAPPER_OBJDIR)/%,$(obj)/%,$@) $@
+
+quiet_cmd_install_dts = INSTALL $(patsubst $(DESTDIR)$(WRAPPER_DTSDIR)/%,dts/%,$@)
+ cmd_install_dts = $(INSTALL) -m0644 $(patsubst $(DESTDIR)$(WRAPPER_DTSDIR)/%,$(srctree)/$(obj)/dts/%,$@) $@
+
+quiet_cmd_install_exe = INSTALL $(patsubst $(DESTDIR)$(WRAPPER_BINDIR)/%,%,$@)
+ cmd_install_exe = $(INSTALL) -m0755 $(patsubst $(DESTDIR)$(WRAPPER_BINDIR)/%,$(obj)/%,$@) $@
+
+quiet_cmd_install_wrapper = INSTALL $(patsubst $(DESTDIR)$(WRAPPER_BINDIR)/%,%,$@)
+ cmd_install_wrapper = $(INSTALL) -m0755 $(patsubst $(DESTDIR)$(WRAPPER_BINDIR)/%,$(srctree)/$(obj)/%,$@) $@ ;\
+ sed -i $@ -e 's%^object=.*%object=$(WRAPPER_OBJDIR)%' \
+ -e 's%^objbin=.*%objbin=$(WRAPPER_BINDIR)%' \
+
+
+$(DESTDIR)$(WRAPPER_OBJDIR) $(DESTDIR)$(WRAPPER_DTSDIR) $(DESTDIR)$(WRAPPER_BINDIR):
+ $(call cmd,mkdir)
+
+$(extra-installed) : $(DESTDIR)$(WRAPPER_OBJDIR)/% : $(obj)/% | $(DESTDIR)$(WRAPPER_OBJDIR)
+ $(call cmd,install)
+
+$(hostprogs-installed) : $(DESTDIR)$(WRAPPER_BINDIR)/% : $(obj)/% | $(DESTDIR)$(WRAPPER_BINDIR)
+ $(call cmd,install_exe)
+
+$(dts-installed) : $(DESTDIR)$(WRAPPER_DTSDIR)/% : $(srctree)/$(obj)/dts/% | $(DESTDIR)$(WRAPPER_DTSDIR)
+ $(call cmd,install_dts)
+
+$(wrapper-installed): $(DESTDIR)$(WRAPPER_BINDIR) $(srctree)/$(obj)/wrapper | $(DESTDIR)$(WRAPPER_BINDIR)
+ $(call cmd,install_wrapper)
+
+$(obj)/bootwrapper_install: $(all-installed)
+
diff --git a/arch/powerpc/Makefile b/arch/powerpc/Makefile
index bd87626..f70df9b 100644
--- a/arch/powerpc/Makefile
+++ b/arch/powerpc/Makefile
@@ -167,6 +167,9 @@ boot := arch/$(ARCH)/boot
$(BOOT_TARGETS): vmlinux
$(Q)$(MAKE) ARCH=ppc64 $(build)=$(boot) $(patsubst %,$(boot)/%,$@)
+bootwrapper_install:
+ $(Q)$(MAKE) ARCH=ppc64 $(build)=$(boot) $(patsubst %,$(boot)/%,$@)
+
define archhelp
@echo '* zImage - Compressed kernel image (arch/$(ARCH)/boot/zImage.*)'
@echo ' install - Install kernel using'
--
dwmw2
^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [PPC BOOT] Create otheros.bld next to specified output file, not in $object directory.
2007-12-03 2:48 [PPC BOOT] Create otheros.bld next to specified output file, not in $object directory David Woodhouse
2007-12-03 2:49 ` [PPC BOOT] Find device-tree source file in default directory David Woodhouse
@ 2007-12-03 3:33 ` Geoff Levand
1 sibling, 0 replies; 7+ messages in thread
From: Geoff Levand @ 2007-12-03 3:33 UTC (permalink / raw)
To: David Woodhouse; +Cc: linuxppc-dev
David Woodhouse wrote:
> The bootwrapper script currently generates an 'otheros.bld' file in
> addition to the file specified by the -o option, when asked to build a
> wrapper for PS3.
>
> It should do that in the same directory as the output, not the directory
> where the wrapper objects are kept (which might potentially not be
> writable when the script runs).
Seems reasonable for installs from read-only media.
> Arguably, the 'otheros.bld' ought to be created with the filename
> specified as the -o argument. But that's a more intrusive change.
Yes, I think it makes sense. ps3-flash-util can handle any file
name, so there is no real reason to have it named otheros.bld.
> Signed-off-by: David Woodhouse <dwmw2@infradead.org>
Acked-by: Geoff Levand <geoffrey.levand@am.sony.com>
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PPC BOOT] Find device-tree source file in default directory.
2007-12-03 2:49 ` [PPC BOOT] Find device-tree source file in default directory David Woodhouse
2007-12-03 2:52 ` [PPC BOOT] Allow for bootwrapper utilities being in different directory to objects David Woodhouse
@ 2007-12-03 15:08 ` Scott Wood
2007-12-03 15:13 ` David Woodhouse
1 sibling, 1 reply; 7+ messages in thread
From: Scott Wood @ 2007-12-03 15:08 UTC (permalink / raw)
To: David Woodhouse; +Cc: linuxppc-dev
On Mon, Dec 03, 2007 at 02:49:24AM +0000, David Woodhouse wrote:
> If a .dts file is given to the bootwrapper script without a full path
> name, look in a sensible place for it.
>
> Signed-off-by: David Woodhouse <dwmw2@infradead.org>
>
> --- a/arch/powerpc/boot/wrapper
> +++ b/arch/powerpc/boot/wrapper
> @@ -116,6 +118,9 @@ while [ "$#" -gt 0 ]; do
> done
>
> if [ -n "$dts" ]; then
> + if [ ! -r "$dts" -a -r "$object/dts/$dts" ]; then
> + dts="$object/dts/$dts"
> + fi
> if [ -z "$dtb" ]; then
> dtb="$platform.dtb"
> fi
Shouldn't this be $srctree (which doesn't seem to be passed to wrapper at
the moment), not $object?
BTW, if we do this, we should remove the part in arch/powerpc/boot/Makefile
where this is done.
-Scott
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PPC BOOT] Find device-tree source file in default directory.
2007-12-03 15:08 ` [PPC BOOT] Find device-tree source file in default directory Scott Wood
@ 2007-12-03 15:13 ` David Woodhouse
0 siblings, 0 replies; 7+ messages in thread
From: David Woodhouse @ 2007-12-03 15:13 UTC (permalink / raw)
To: Scott Wood; +Cc: linuxppc-dev
On Mon, 2007-12-03 at 09:08 -0600, Scott Wood wrote:
> Shouldn't this be $srctree (which doesn't seem to be passed to wrapper at
> the moment), not $object?
>
> BTW, if we do this, we should remove the part in arch/powerpc/boot/Makefile
> where this is done.
It wasn't really done for the benefit of the in-kernel invocation -- it
was done so that the installed standalone copy of the wrapper doesn't
need a full path.
We _could_ make the in-kernel setup use it -- but then you just have to
pass the directory as a separate argument, instead of prepending it to
the name of the dts file, as you observe... so there didn't seem to be a
lot of point.
--
dwmw2
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2007-12-03 15:13 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-12-03 2:48 [PPC BOOT] Create otheros.bld next to specified output file, not in $object directory David Woodhouse
2007-12-03 2:49 ` [PPC BOOT] Find device-tree source file in default directory David Woodhouse
2007-12-03 2:52 ` [PPC BOOT] Allow for bootwrapper utilities being in different directory to objects David Woodhouse
2007-12-03 2:56 ` [PPC BOOT] 'make bootwrapper_install' David Woodhouse
2007-12-03 15:08 ` [PPC BOOT] Find device-tree source file in default directory Scott Wood
2007-12-03 15:13 ` David Woodhouse
2007-12-03 3:33 ` [PPC BOOT] Create otheros.bld next to specified output file, not in $object directory Geoff Levand
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).