* [parisc-linux] kernel install.sh patch/enhancement?
@ 2006-01-23 15:53 Joel Soete
2006-02-04 18:15 ` Joel Soete
0 siblings, 1 reply; 2+ messages in thread
From: Joel Soete @ 2006-01-23 15:53 UTC (permalink / raw)
To: parisc-linux
[-- Attachment #1: Type: text/plain, Size: 4193 bytes --]
Hello pa*,
Just some small hunck to (I hope) improve our kernel install.sh.
1/ align on the other arch:
--- arch/parisc/install.sh.Orig 2006-01-23 14:18:28.000000000 +0100
+++ arch/parisc/install.sh 2006-01-23 14:26:48.000000000 +0100
@@ -19,10 +19,28 @@
# $4 - default install path (blank if root directory)
#
+verify () {
+ if [ ! -f "$1" ]; then
+ echo "" 1>&2
+ echo " *** Missing file: $1" 1>&2
+ echo ' *** You need to run "make" before "make install".' 1>&2
+ echo "" 1>&2
+ exit 1
+ fi
+}
+
+# Make sure the files actually exist
+verify "$2"
+verify "$3"
+
# User may have a custom install script
-if [ -x ~/bin/installkernel ]; then exec ~/bin/installkernel "$@"; fi
-if [ -x /sbin/installkernel ]; then exec /sbin/installkernel "$@"; fi
+if [ -x ~/bin/${CROSS_COMPILE}installkernel ]; then
+ exec ~/bin/${CROSS_COMPILE}installkernel "$@"
+fi
+if [ -x /sbin/${CROSS_COMPILE}installkernel ]; then
+ exec /sbin/${CROSS_COMPILE}installkernel "$@"
+fi
# Default install
====<>====
2/ append kernel version to filename (as many other arch too):
--- arch/parisc/install.sh.Orig 2006-01-23 14:30:17.000000000 +0100
+++ arch/parisc/install.sh 2006-01-23 15:30:30.000000000 +0100
@@ -19,6 +19,8 @@
# $4 - default install path (blank if root directory)
#
+KCONF=".config"
+
verify () {
if [ ! -f "$1" ]; then
echo "" 1>&2
@@ -32,6 +34,7 @@
# Make sure the files actually exist
verify "$2"
verify "$3"
+verify "$KCONF"
# User may have a custom install script
@@ -44,13 +47,18 @@
# Default install
-if [ -f $4/vmlinux ]; then
- mv $4/vmlinux $4/vmlinux.old
+if [ -f $4/vmlinux-$1 ]; then
+ mv $4/vmlinux-$1 $4/vmlinux.old
+fi
+
+if [ -f $4/System.map-$1 ]; then
+ mv $4/System.map-$1 $4/System.old
fi
-if [ -f $4/System.map ]; then
- mv $4/System.map $4/System.old
+if [ -f $4/config-$1 ]; then
+ mv $4/config-$1 $4/config.old
fi
-cat $2 > $4/vmlinux
-cp $3 $4/System.map
+cat $2 > $4/vmlinux-$1
+cp $3 $4/System.map-$1
+cp .config $4/config-$1
3/ my paranoid check (because by /boot is a fs usualy mounted in ro, as I
presume most of sysadm ;-?)
--- arch/parisc/install.sh.Orig 2006-01-23 15:32:42.000000000 +0100
+++ arch/parisc/install.sh 2006-01-23 15:57:24.000000000 +0100
@@ -19,6 +19,26 @@
# $4 - default install path (blank if root directory)
#
+# Verify default install path
+if [ -d $4 ]; then
+ cat /dev/null > $4/banner
+ RC=$?
+ if [ $RC -ne 0 ]; then
+ echo "" 1>&2
+ echo " *** Verify your access to $4" 1>&2
+ echo "" 1>&2
+ exit 1
+ else
+ rm -f $4/banner
+ fi
+else
+ echo "" 1>&2
+ echo " *** Missing directory: $1" 1>&2
+ echo ' *** You need to run "make -p $4" before.' 1>&2
+ echo "" 1>&2
+ exit 1
+fi
+
KCONF=".config"
verify () {
@@ -62,3 +82,13 @@
cat $2 > $4/vmlinux-$1
cp $3 $4/System.map-$1
cp .config $4/config-$1
+
+if [ -h $4/vmlinux ]; then
+ mv $4/vmlinux $4/vmlinux.prev
+ ln -sf $4/vmlinux-$1 $4/vmlinux
+fi
+
+if [ -h $4/System.map ]; then
+ mv $4/System.map $4/System.prev
+ ln -sf $4/System.map-$1 $4/System.map
+fi
====<>====
Don't hesistate to ci the stuff you fill of best interest (no cvs ci access).
TIA,
Joel
PS: also attached those 3 hunk because quiet sure of bad wraping, though.
---------------------------------------------------------------
A free anti-spam and anti-virus filter on all Scarlet mailboxes
More info on http://www.scarlet.be/
[-- Attachment #2: arch_parisc_install.sh.diff-1 --]
[-- Type: application/octet-stream, Size: 911 bytes --]
--- arch/parisc/install.sh.Orig 2006-01-23 14:18:28.000000000 +0100
+++ arch/parisc/install.sh 2006-01-23 14:26:48.000000000 +0100
@@ -19,10 +19,28 @@
# $4 - default install path (blank if root directory)
#
+verify () {
+ if [ ! -f "$1" ]; then
+ echo "" 1>&2
+ echo " *** Missing file: $1" 1>&2
+ echo ' *** You need to run "make" before "make install".' 1>&2
+ echo "" 1>&2
+ exit 1
+ fi
+}
+
+# Make sure the files actually exist
+verify "$2"
+verify "$3"
+
# User may have a custom install script
-if [ -x ~/bin/installkernel ]; then exec ~/bin/installkernel "$@"; fi
-if [ -x /sbin/installkernel ]; then exec /sbin/installkernel "$@"; fi
+if [ -x ~/bin/${CROSS_COMPILE}installkernel ]; then
+ exec ~/bin/${CROSS_COMPILE}installkernel "$@"
+fi
+if [ -x /sbin/${CROSS_COMPILE}installkernel ]; then
+ exec /sbin/${CROSS_COMPILE}installkernel "$@"
+fi
# Default install
[-- Attachment #3: arch_parisc_install.sh.diff-2 --]
[-- Type: application/octet-stream, Size: 932 bytes --]
--- arch/parisc/install.sh.Orig 2006-01-23 14:30:17.000000000 +0100
+++ arch/parisc/install.sh 2006-01-23 15:30:30.000000000 +0100
@@ -19,6 +19,8 @@
# $4 - default install path (blank if root directory)
#
+KCONF=".config"
+
verify () {
if [ ! -f "$1" ]; then
echo "" 1>&2
@@ -32,6 +34,7 @@
# Make sure the files actually exist
verify "$2"
verify "$3"
+verify "$KCONF"
# User may have a custom install script
@@ -44,13 +47,18 @@
# Default install
-if [ -f $4/vmlinux ]; then
- mv $4/vmlinux $4/vmlinux.old
+if [ -f $4/vmlinux-$1 ]; then
+ mv $4/vmlinux-$1 $4/vmlinux.old
+fi
+
+if [ -f $4/System.map-$1 ]; then
+ mv $4/System.map-$1 $4/System.old
fi
-if [ -f $4/System.map ]; then
- mv $4/System.map $4/System.old
+if [ -f $4/config-$1 ]; then
+ mv $4/config-$1 $4/config.old
fi
-cat $2 > $4/vmlinux
-cp $3 $4/System.map
+cat $2 > $4/vmlinux-$1
+cp $3 $4/System.map-$1
+cp .config $4/config-$1
[-- Attachment #4: arch_parisc_install.sh.diff-3 --]
[-- Type: application/octet-stream, Size: 950 bytes --]
--- arch/parisc/install.sh.Orig 2006-01-23 15:32:42.000000000 +0100
+++ arch/parisc/install.sh 2006-01-23 15:57:24.000000000 +0100
@@ -19,6 +19,26 @@
# $4 - default install path (blank if root directory)
#
+# Verify default install path
+if [ -d $4 ]; then
+ cat /dev/null > $4/banner
+ RC=$?
+ if [ $RC -ne 0 ]; then
+ echo "" 1>&2
+ echo " *** Verify your access to $4" 1>&2
+ echo "" 1>&2
+ exit 1
+ else
+ rm -f $4/banner
+ fi
+else
+ echo "" 1>&2
+ echo " *** Missing directory: $1" 1>&2
+ echo ' *** You need to run "make -p $4" before.' 1>&2
+ echo "" 1>&2
+ exit 1
+fi
+
KCONF=".config"
verify () {
@@ -62,3 +82,13 @@
cat $2 > $4/vmlinux-$1
cp $3 $4/System.map-$1
cp .config $4/config-$1
+
+if [ -h $4/vmlinux ]; then
+ mv $4/vmlinux $4/vmlinux.prev
+ ln -sf $4/vmlinux-$1 $4/vmlinux
+fi
+
+if [ -h $4/System.map ]; then
+ mv $4/System.map $4/System.prev
+ ln -sf $4/System.map-$1 $4/System.map
+fi
[-- Attachment #5: Type: text/plain, Size: 169 bytes --]
_______________________________________________
parisc-linux mailing list
parisc-linux@lists.parisc-linux.org
http://lists.parisc-linux.org/mailman/listinfo/parisc-linux
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [parisc-linux] kernel install.sh patch/enhancement?
2006-01-23 15:53 [parisc-linux] kernel install.sh patch/enhancement? Joel Soete
@ 2006-02-04 18:15 ` Joel Soete
0 siblings, 0 replies; 2+ messages in thread
From: Joel Soete @ 2006-02-04 18:15 UTC (permalink / raw)
To: parisc-linux; +Cc: Joel Soete
Hello pa*,
Joel Soete wrote:
> Hello pa*,
>
> Just some small hunck to (I hope) improve our kernel install.sh.
>
snip
> 2/ append kernel version to filename (as many other arch too):
> --- arch/parisc/install.sh.Orig 2006-01-23 14:30:17.000000000 +0100
> +++ arch/parisc/install.sh 2006-01-23 15:30:30.000000000 +0100
snip
> @@ -44,13 +47,18 @@
>
> # Default install
>
> -if [ -f $4/vmlinux ]; then
> - mv $4/vmlinux $4/vmlinux.old
> +if [ -f $4/vmlinux-$1 ]; then
> + mv $4/vmlinux-$1 $4/vmlinux.old
> +fi
> +
> +if [ -f $4/System.map-$1 ]; then
> + mv $4/System.map-$1 $4/System.old
> fi
>
> -if [ -f $4/System.map ]; then
> - mv $4/System.map $4/System.old
> +if [ -f $4/config-$1 ]; then
> + mv $4/config-$1 $4/config.old
> fi
>
> -cat $2 > $4/vmlinux
> -cp $3 $4/System.map
> +cat $2 > $4/vmlinux-$1
> +cp $3 $4/System.map-$1
> +cp .config $4/config-$1
>
> 3/ my paranoid check (because by /boot is a fs usualy mounted in ro, as I
> presume most of sysadm ;-?)
> --- arch/parisc/install.sh.Orig 2006-01-23 15:32:42.000000000 +0100
> +++ arch/parisc/install.sh 2006-01-23 15:57:24.000000000 +0100
snip
> @@ -62,3 +82,13 @@
> cat $2 > $4/vmlinux-$1
> cp $3 $4/System.map-$1
> cp .config $4/config-$1
> +
> +if [ -h $4/vmlinux ]; then
> + mv $4/vmlinux $4/vmlinux.prev
> + ln -sf $4/vmlinux-$1 $4/vmlinux
> +fi
> +
> +if [ -h $4/System.map ]; then
> + mv $4/System.map $4/System.prev
> + ln -sf $4/System.map-$1 $4/System.map
> +fi
> ====<>====
>
There was obviously some small bugs in those to hunk which I change like:
--- arch/parisc/install.sh.Orig 2006-02-03 14:34:17.000000000 +0100
+++ arch/parisc/install.sh 2006-02-03 14:17:12.000000000 +0100
@@ -68,27 +68,29 @@
# Default install
if [ -f $4/vmlinux-$1 ]; then
- mv $4/vmlinux-$1 $4/vmlinux.old
+ mv $4/vmlinux-$1 $4/vmlinux-$1.old
fi
if [ -f $4/System.map-$1 ]; then
- mv $4/System.map-$1 $4/System.old
+ mv $4/System.map-$1 $4/System.map-$1.old
fi
if [ -f $4/config-$1 ]; then
- mv $4/config-$1 $4/config.old
+ mv $4/config-$1 $4/config-1$.old
fi
cat $2 > $4/vmlinux-$1
cp $3 $4/System.map-$1
cp .config $4/config-$1
-if [ -h $4/vmlinux ]; then
- mv $4/vmlinux $4/vmlinux.prev
- ln -sf $4/vmlinux-$1 $4/vmlinux
+cd $4
+if [ -h vmlinux ]; then
+ mv vmlinux vmlinux.prev
+ ln -sf vmlinux-$1 vmlinux
fi
-if [ -h $4/System.map ]; then
- mv $4/System.map $4/System.prev
- ln -sf $4/System.map-$1 $4/System.map
+if [ -h System.map ]; then
+ mv System.map System.map.prev
+ ln -sf System.map-$1 System.map
fi
+cd -
====<>====
Tx,
Joel
_______________________________________________
parisc-linux mailing list
parisc-linux@lists.parisc-linux.org
http://lists.parisc-linux.org/mailman/listinfo/parisc-linux
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2006-02-04 18:15 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-01-23 15:53 [parisc-linux] kernel install.sh patch/enhancement? Joel Soete
2006-02-04 18:15 ` Joel Soete
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox