FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Ubuntu > Ubuntu Studio User

 
 
LinkBack Thread Tools
 
Old 05-04-2010, 09:40 PM
David Cantrell
 
Default Rename geninitrdsz.c to gen-initrd-addr.c (#546422)

Rename the geninitrdsz.c program to gen-initrd-addr.c to more accurately
reflect what it's generating. Update Makefile.am and its usage in the
buildinstall scripts. The load address is provided as a shell variable
in scripts/mk-images.s390.
---
scripts/mk-images | 2 +-
scripts/mk-images.s390 | 9 +++--
utils/Makefile.am | 2 +-
utils/gen-initrd-addr.c | 81 +++++++++++++++++++++++++++++++++++++++++++++++
utils/geninitrdsz.c | 81 -----------------------------------------------
5 files changed, 89 insertions(+), 86 deletions(-)
create mode 100644 utils/gen-initrd-addr.c
delete mode 100644 utils/geninitrdsz.c

diff --git a/scripts/mk-images b/scripts/mk-images
index bf76ce3..a7e047e 100755
--- a/scripts/mk-images
+++ b/scripts/mk-images
@@ -160,7 +160,7 @@ mkdir -p $INSTIMGPATH
# Stuff that we need
TRIMPCIIDS=$IMGPATH/usr/lib/anaconda-runtime/trimpciids
GETKEYMAPS=$IMGPATH/usr/lib/anaconda-runtime/getkeymaps
-GENINITRDSZ=$IMGPATH/usr/lib/anaconda-runtime/geninitrdsz
+GENINITRDADDR=$IMGPATH/usr/lib/anaconda-runtime/gen-initrd-addr
MKS390CDBOOT=$IMGPATH/usr/lib/anaconda-runtime/mk-s390-cdboot
GENMODINFO=$IMGPATH/usr/lib/anaconda-runtime/genmodinfo
KEYMAPS=$TMPDIR/keymaps-$BUILDARCH.$$
diff --git a/scripts/mk-images.s390 b/scripts/mk-images.s390
index 2de6819..b2c4c92 100644
--- a/scripts/mk-images.s390
+++ b/scripts/mk-images.s390
@@ -17,6 +17,10 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#

+# initrd.img load address for generic.ins LPAR booting
+# See https://bugzilla.redhat.com/show_bug.cgi?id=546422 for details.
+INITRD_ADDR=0x2000000
+
getAllS390ModuleNames() {
s390dir="${KERNELROOT}/lib/modules/${version}/kernel/drivers/s390"
if [ -d "${s390dir}" ]; then
@@ -33,8 +37,7 @@ makeBootImages() {
--initrdsize 20000
--loaderbin loader
--modules "$INITRDMODS $(getAllS390ModuleNames)"
- sz=$(ls -l $TOPDESTPATH/images/initrd.img | awk '{print $5}')
- $GENINITRDSZ $sz $TOPDESTPATH/images/initrd.size
+ $GENINITRDADDR $INITRD_ADDR $TOPDESTPATH/images/initrd.addr
cp -vf $KERNELROOT/boot/${KERNELNAME}-${version} $TOPDESTPATH/images/kernel.img

cp -v $BOOTDISKDIR/redhat.exec $TOPDESTPATH/images/redhat.exec
@@ -51,7 +54,7 @@ makeBootImages() {
[images-$KERNELARCH]
kernel = images/kernel.img
initrd = images/initrd.img
-initrd.size = images/initrd.size
+initrd.addr = images/initrd.addr
generic.prm = images/generic.prm
generic.ins = generic.ins
cdboot.img = images/cdboot.img
diff --git a/utils/Makefile.am b/utils/Makefile.am
index bfc8fd4..a00e8c4 100644
--- a/utils/Makefile.am
+++ b/utils/Makefile.am
@@ -24,7 +24,7 @@ noinst_PROGRAMS = snarffont
dist_noinst_SCRIPTS = filtermoddeps

if IS_S390
-utils_PROGRAMS += geninitrdsz mk-s390-cdboot
+utils_PROGRAMS += gen-initrd-addr mk-s390-cdboot
endif

modlist_CFLAGS = -I$(top_srcdir)/loader $(GLIB_CFLAGS)
diff --git a/utils/gen-initrd-addr.c b/utils/gen-initrd-addr.c
new file mode 100644
index 0000000..68b8083
--- /dev/null
+++ b/utils/gen-initrd-addr.c
@@ -0,0 +1,81 @@
+/*
+ * gen-initrd-addr.c
+ * Generate initrd.addr file for s390x platforms.
+ * Takes an integer argument and writes out the binary representation of
+ * that value to the initrd.addr file.
+ * https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=197773
+ * https://bugzilla.redhat.com/show_bug.cgi?id=546422
+ *
+ * Copyright (C) 2007-2010 Red Hat, Inc. All rights reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <netinet/in.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <unistd.h>
+#include <fcntl.h>
+#include <unistd.h>
+#include <errno.h>
+#include <string.h>
+
+int main(int argc,char **argv) {
+ struct stat initrd_stat;
+ unsigned int addr = 0, size = 0, zero = 0;
+ int fd, rc;
+ char *tmp = NULL;
+
+ if (argc != 3) {
+ printf("Generate initrd.addr file used by the .ins LPAR load mechanism
");
+ printf("Usage: %s [address] [output file]
", basename(argv[0]));
+ printf("Example: %s 0x2000000 initrd.addr
", basename(argv[0]));
+ return EXIT_SUCCESS;
+ }
+
+ rc = stat(argv[2], &initrd_stat);
+ if (rc) {
+ perror("Error getting initrd stats ");
+ return rc;
+ }
+
+ addr = htonl(strtoul(argv[1], &tmp, 0));
+ size = initrd_stat.st_size;
+ fd = open(argv[2], O_CREAT | O_RDWR, S_IRUSR | S_IWUSR);
+
+ if (write(fd, &zero, sizeof(int)) == -1) {
+ perror("writing output file (zero) ");
+ return errno;
+ }
+
+ if (write(fd, &addr, sizeof(int)) == -1) {
+ perror("writing output file (addr) ");
+ return errno;
+ }
+
+ if (write(fd, &zero, sizeof(int)) == -1) {
+ perror("writing output file (zero) ");
+ return errno;
+ }
+
+ if (write(fd, &addr, sizeof(int)) == -1) {
+ perror("writing output file (addr) ");
+ return errno;
+ }
+
+ close(fd);
+ return 0;
+}
diff --git a/utils/geninitrdsz.c b/utils/geninitrdsz.c
deleted file mode 100644
index b8c824a..0000000
--- a/utils/geninitrdsz.c
+++ /dev/null
@@ -1,81 +0,0 @@
-/*
- * gen-initrd-addr.c
- * Generate initrd.addr file for s390x platforms.
- * Takes an integer argument and writes out the binary representation of
- * that value to the initrd.addr file.
- * https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=197773
- * https://bugzilla.redhat.com/show_bug.cgi?id=546422
- *
- * Copyright (C) 2007-2010 Red Hat, Inc. All rights reserved.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- */
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <netinet/in.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <unistd.h>
-#include <fcntl.h>
-#include <unistd.h>
-#include <errno.h>
-#include <string.h>
-
-int main(int argc,char **argv) {
- struct stat initrd_stat;
- unsigned int addr = 0, size = 0, zero = 0;
- int fd, rc;
- char *tmp = NULL;
-
- if (argc != 3) {
- printf("Generate initrd.addr file used by the .ins LPAR load mechanism
");
- printf("Usage: %s [address] [output file]
", basename(argv[0]));
- printf("Example: %s 0x2000000 initrd.size
", basename(argv[0]));
- return EXIT_SUCCESS;
- }
-
- rc = stat(argv[2], &initrd_stat);
- if (rc) {
- perror("Error getting initrd stats ");
- return rc;
- }
-
- addr = htonl(strtoul(argv[1], &tmp, 0));
- size = initrd_stat.st_size;
- fd = open(argv[2], O_CREAT | O_RDWR, S_IRUSR | S_IWUSR);
-
- if (write(fd, &zero, sizeof(int)) == -1) {
- perror("writing initrd.addr (zero) ");
- return errno;
- }
-
- if (write(fd, &addr, sizeof(int)) == -1) {
- perror("writing initrd.addr (zero) ");
- return errno;
- }
-
- if (write(fd, &zero, sizeof(int)) == -1) {
- perror("writing initrd.addr (zero) ");
- return errno;
- }
-
- if (write(fd, &addr, sizeof(int)) == -1) {
- perror("writing initrd.addr (zero) ");
- return errno;
- }
-
- close(fd);
- return 0;
-}
--
1.6.6.1

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@redhat.com
https://www.redhat.com/mailman/listinfo/anaconda-devel-list
 
Old 05-04-2010, 11:02 PM
Steffen Maier
 
Default Rename geninitrdsz.c to gen-initrd-addr.c (#546422)

On 05/04/2010 11:40 PM, David Cantrell wrote:
> Rename the geninitrdsz.c program to gen-initrd-addr.c to more accurately

Rename the geninitrdsz.c program to gen-initrd-patch.c to more accurately

> reflect what it's generating. Update Makefile.am and its usage in the
> buildinstall scripts. The load address is provided as a shell variable
> in scripts/mk-images.s390.
> ---
> scripts/mk-images | 2 +-
> scripts/mk-images.s390 | 9 +++--
> utils/Makefile.am | 2 +-
> utils/gen-initrd-addr.c | 81 +++++++++++++++++++++++++++++++++++++++++++++++
> utils/geninitrdsz.c | 81 -----------------------------------------------
> 5 files changed, 89 insertions(+), 86 deletions(-)
> create mode 100644 utils/gen-initrd-addr.c
> delete mode 100644 utils/geninitrdsz.c
>
> diff --git a/scripts/mk-images b/scripts/mk-images
> index bf76ce3..a7e047e 100755
> --- a/scripts/mk-images
> +++ b/scripts/mk-images
> @@ -160,7 +160,7 @@ mkdir -p $INSTIMGPATH
> # Stuff that we need
> TRIMPCIIDS=$IMGPATH/usr/lib/anaconda-runtime/trimpciids
> GETKEYMAPS=$IMGPATH/usr/lib/anaconda-runtime/getkeymaps
> -GENINITRDSZ=$IMGPATH/usr/lib/anaconda-runtime/geninitrdsz
> +GENINITRDADDR=$IMGPATH/usr/lib/anaconda-runtime/gen-initrd-addr

GENINITRDPATCH=$IMGPATH/usr/lib/anaconda-runtime/gen-initrd-patch

> MKS390CDBOOT=$IMGPATH/usr/lib/anaconda-runtime/mk-s390-cdboot
> GENMODINFO=$IMGPATH/usr/lib/anaconda-runtime/genmodinfo
> KEYMAPS=$TMPDIR/keymaps-$BUILDARCH.$$
> diff --git a/scripts/mk-images.s390 b/scripts/mk-images.s390
> index 2de6819..b2c4c92 100644
> --- a/scripts/mk-images.s390
> +++ b/scripts/mk-images.s390
> @@ -17,6 +17,10 @@
> # along with this program. If not, see <http://www.gnu.org/licenses/>.
> #
>
> +# initrd.img load address for generic.ins LPAR booting
> +# See https://bugzilla.redhat.com/show_bug.cgi?id=546422 for details.
> +INITRD_ADDR=0x2000000
> +
> getAllS390ModuleNames() {
> s390dir="${KERNELROOT}/lib/modules/${version}/kernel/drivers/s390"
> if [ -d "${s390dir}" ]; then
> @@ -33,8 +37,7 @@ makeBootImages() {
> --initrdsize 20000
> --loaderbin loader
> --modules "$INITRDMODS $(getAllS390ModuleNames)"
> - sz=$(ls -l $TOPDESTPATH/images/initrd.img | awk '{print $5}')
> - $GENINITRDSZ $sz $TOPDESTPATH/images/initrd.size
> + $GENINITRDADDR $INITRD_ADDR $TOPDESTPATH/images/initrd.addr

$GENINITRDPATCH $INITRD_ADDR $TOPDESTPATH/images/initrd.img
$TOPDESTPATH/images/initrd.patch

> cp -vf $KERNELROOT/boot/${KERNELNAME}-${version} $TOPDESTPATH/images/kernel.img
>
> cp -v $BOOTDISKDIR/redhat.exec $TOPDESTPATH/images/redhat.exec
> @@ -51,7 +54,7 @@ makeBootImages() {
> [images-$KERNELARCH]
> kernel = images/kernel.img
> initrd = images/initrd.img
> -initrd.size = images/initrd.size
> +initrd.addr = images/initrd.addr

initrd.patch = images/initrd.patch

> generic.prm = images/generic.prm
> generic.ins = generic.ins
> cdboot.img = images/cdboot.img
> diff --git a/utils/Makefile.am b/utils/Makefile.am
> index bfc8fd4..a00e8c4 100644
> --- a/utils/Makefile.am
> +++ b/utils/Makefile.am
> @@ -24,7 +24,7 @@ noinst_PROGRAMS = snarffont
> dist_noinst_SCRIPTS = filtermoddeps
>
> if IS_S390
> -utils_PROGRAMS += geninitrdsz mk-s390-cdboot
> +utils_PROGRAMS += gen-initrd-addr mk-s390-cdboot

utils_PROGRAMS += gen-initrd-patch mk-s390-cdboot

> endif
>
> modlist_CFLAGS = -I$(top_srcdir)/loader $(GLIB_CFLAGS)
> diff --git a/utils/gen-initrd-addr.c b/utils/gen-initrd-addr.c
> new file mode 100644
> index 0000000..68b8083
> --- /dev/null
> +++ b/utils/gen-initrd-addr.c

> diff --git a/utils/geninitrdsz.c b/utils/geninitrdsz.c
> deleted file mode 100644
> index b8c824a..0000000
> --- a/utils/geninitrdsz.c
> +++ /dev/null


Steffen

Linux on System z Development

IBM Deutschland Research & Development GmbH
Vorsitzender des Aufsichtsrats: Martin Jetter
Geschäftsführung: Dirk Wittkopp
Sitz der Gesellschaft: Böblingen
Registergericht: Amtsgericht Stuttgart, HRB 243294


_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@redhat.com
https://www.redhat.com/mailman/listinfo/anaconda-devel-list
 
Old 05-05-2010, 12:52 AM
David Cantrell
 
Default Rename geninitrdsz.c to gen-initrd-addr.c (#546422)

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

As stated in the other reply, I am not in favor of naming this file
"initrd.patch". .patch is a well-established standard for files generated by
diff(1). I do not care if we call it something other than initrd.addr.

On Wed, 5 May 2010, Steffen Maier wrote:




On 05/04/2010 11:40 PM, David Cantrell wrote:

Rename the geninitrdsz.c program to gen-initrd-addr.c to more accurately


Rename the geninitrdsz.c program to gen-initrd-patch.c to more accurately


reflect what it's generating. Update Makefile.am and its usage in the
buildinstall scripts. The load address is provided as a shell variable
in scripts/mk-images.s390.
---
scripts/mk-images | 2 +-
scripts/mk-images.s390 | 9 +++--
utils/Makefile.am | 2 +-
utils/gen-initrd-addr.c | 81 +++++++++++++++++++++++++++++++++++++++++++++++
utils/geninitrdsz.c | 81 -----------------------------------------------
5 files changed, 89 insertions(+), 86 deletions(-)
create mode 100644 utils/gen-initrd-addr.c
delete mode 100644 utils/geninitrdsz.c

diff --git a/scripts/mk-images b/scripts/mk-images
index bf76ce3..a7e047e 100755
--- a/scripts/mk-images
+++ b/scripts/mk-images
@@ -160,7 +160,7 @@ mkdir -p $INSTIMGPATH
# Stuff that we need
TRIMPCIIDS=$IMGPATH/usr/lib/anaconda-runtime/trimpciids
GETKEYMAPS=$IMGPATH/usr/lib/anaconda-runtime/getkeymaps
-GENINITRDSZ=$IMGPATH/usr/lib/anaconda-runtime/geninitrdsz
+GENINITRDADDR=$IMGPATH/usr/lib/anaconda-runtime/gen-initrd-addr


GENINITRDPATCH=$IMGPATH/usr/lib/anaconda-runtime/gen-initrd-patch


MKS390CDBOOT=$IMGPATH/usr/lib/anaconda-runtime/mk-s390-cdboot
GENMODINFO=$IMGPATH/usr/lib/anaconda-runtime/genmodinfo
KEYMAPS=$TMPDIR/keymaps-$BUILDARCH.$$
diff --git a/scripts/mk-images.s390 b/scripts/mk-images.s390
index 2de6819..b2c4c92 100644
--- a/scripts/mk-images.s390
+++ b/scripts/mk-images.s390
@@ -17,6 +17,10 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#

+# initrd.img load address for generic.ins LPAR booting
+# See https://bugzilla.redhat.com/show_bug.cgi?id=546422 for details.
+INITRD_ADDR=0x2000000
+
getAllS390ModuleNames() {
s390dir="${KERNELROOT}/lib/modules/${version}/kernel/drivers/s390"
if [ -d "${s390dir}" ]; then
@@ -33,8 +37,7 @@ makeBootImages() {
--initrdsize 20000
--loaderbin loader
--modules "$INITRDMODS $(getAllS390ModuleNames)"
- sz=$(ls -l $TOPDESTPATH/images/initrd.img | awk '{print $5}')
- $GENINITRDSZ $sz $TOPDESTPATH/images/initrd.size
+ $GENINITRDADDR $INITRD_ADDR $TOPDESTPATH/images/initrd.addr


$GENINITRDPATCH $INITRD_ADDR $TOPDESTPATH/images/initrd.img
$TOPDESTPATH/images/initrd.patch


cp -vf $KERNELROOT/boot/${KERNELNAME}-${version} $TOPDESTPATH/images/kernel.img

cp -v $BOOTDISKDIR/redhat.exec $TOPDESTPATH/images/redhat.exec
@@ -51,7 +54,7 @@ makeBootImages() {
[images-$KERNELARCH]
kernel = images/kernel.img
initrd = images/initrd.img
-initrd.size = images/initrd.size
+initrd.addr = images/initrd.addr


initrd.patch = images/initrd.patch


generic.prm = images/generic.prm
generic.ins = generic.ins
cdboot.img = images/cdboot.img
diff --git a/utils/Makefile.am b/utils/Makefile.am
index bfc8fd4..a00e8c4 100644
--- a/utils/Makefile.am
+++ b/utils/Makefile.am
@@ -24,7 +24,7 @@ noinst_PROGRAMS = snarffont
dist_noinst_SCRIPTS = filtermoddeps

if IS_S390
-utils_PROGRAMS += geninitrdsz mk-s390-cdboot
+utils_PROGRAMS += gen-initrd-addr mk-s390-cdboot


utils_PROGRAMS += gen-initrd-patch mk-s390-cdboot


endif

modlist_CFLAGS = -I$(top_srcdir)/loader $(GLIB_CFLAGS)
diff --git a/utils/gen-initrd-addr.c b/utils/gen-initrd-addr.c
new file mode 100644
index 0000000..68b8083
--- /dev/null
+++ b/utils/gen-initrd-addr.c



diff --git a/utils/geninitrdsz.c b/utils/geninitrdsz.c
deleted file mode 100644
index b8c824a..0000000
--- a/utils/geninitrdsz.c
+++ /dev/null



Steffen

Linux on System z Development

IBM Deutschland Research & Development GmbH
Vorsitzender des Aufsichtsrats: Martin Jetter
Geschäftsführung: Dirk Wittkopp
Sitz der Gesellschaft: Böblingen
Registergericht: Amtsgericht Stuttgart, HRB 243294


_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@redhat.com
https://www.redhat.com/mailman/listinfo/anaconda-devel-list



- --
David Cantrell <dcantrell@redhat.com>

Red Hat / Honolulu, HI

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)

iEYEARECAAYFAkvgwWUACgkQ5hsjjIy1VkkldwCfVfz0/MLVyF5JPFBcDpJkWLcK
rwgAn0NidKpy2v7Cjj7DdR4L7ByjAL+G
=uuiU
-----END PGP SIGNATURE-----_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@redhat.com
https://www.redhat.com/mailman/listinfo/anaconda-devel-list
 

Thread Tools




All times are GMT. The time now is 03:59 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright ©2007 - 2008, www.linux-archive.org