Skip to contentSkip to conversation

Make kernel build deterministic

PATCH Applied Michal Marek 27 participants 123 messages Apr 5, 2011 – May 26, 2011 2 messages not in the archive

Subsystems (33)
lore
Share & tools
lore
#0 lore raw

cover Make kernel build deterministic

Hi,

this series makes it possible to build bit-identical kernel image and modules from identical sources. Of course the build is already deterministic in terms of behavior of the code, but the various timestamps embedded in the object files make it hard to compare two builds, for instance to verify that a makefile cleanup didn't accidentally change something. A prime example is /proc/config.gz, which has both a timestamp in the gzip header and a timestamp in the payload data. With this series applied, a script like this will produce identical kernels each time:

#!/bin/bash
rm -rf /dev/shm/{source,build}{,1,2}
export KCONFIG_NOTIMESTAMP=1
export KBUILD_BUILD_TIMESTAMP='Sun May 1 12:00:00 CEST 2011' export KBUILD_BUILD_USER=user
export KBUILD_BUILD_HOST=host
export ROOT_DEV=FLOPPY
for i in 1 2; do
mkdir /dev/shm/source
# randomize the inode order just for fun
git ls-tree -r -z --name-only HEAD | sort -R -z | xargs -0 \
cp --parents --target=/dev/shm/source
pushd /dev/shm/source
mkdir /dev/shm/build
>/dev/shm/build/all.config
for opt in GCOV_KERNEL UBIFS_FS_DEBUG; do
echo "# CONFIG_$opt is not set" >>"/dev/shm/build"/all.config
done
make O="/dev/shm/build" KCONFIG_ALLCONFIG=1 allmodconfig make O="/dev/shm/build" -j64
popd
mv /dev/shm/source /dev/shm/source$i
mv /dev/shm/build /dev/shm/build$i
done
diff -rq /dev/shm/build{1,2}

Unfortunatelly, this cannot be used to validate indentation-only patches, even if CONFIG_DEBUG_INFO is turned off. This is because of the __FILE__ and __LINE__ macros used in many places. For the same reason, the source and build directory needs to be the same, otherwise the results will differ. This was tested on x86_64/{defconfig,allmodconfig,allyesconfig} and ppc64/defconfig. The series is also available at

git://git.kernel.org/pub/scm/linux/kernel/git/mmarek/kbuild-2.6.git deterministic-build-v1

Michal

Michal Marek (34):
kconfig: Do not record timestamp in auto.conf and autoconf.h
kbuild: Call gzip with -n
powerpc: Call gzip with -n
kbuild: Use the deterministic mode of ar
powerpc: Use the deterministic mode of ar
kbuild: Drop unused LINUX_COMPILE_TIME and LINUX_COMPILE_DOMAIN
macros
kbuild: Allow to override LINUX_COMPILE_BY and LINUX_COMPILE_HOST
macros
initramfs: Use KBUILD_BUILD_TIMESTAMP for generated entries
x86: Allow to override the ROOT_DEV variable
cyclades: Drop __TIME__ usage
nozomi: Drop __TIME__ usage
isdn/diva: Drop __TIME__ usage
media/radio-maxiradio: Drop __TIME__ usage
media/cx231xx: Drop __TIME__ usage
baycom: Drop __TIME__ usage
nand/denali: Drop __TIME__ usage
hdlcdrv: Drop __TIME__ usage
wan/pc300: Drop __TIME__ usage
rt2x00: Drop __TIME__ usage
parport: Drop __TIME__ usage
aacraid: Drop __TIME__ usage
scsi/in2000: Drop __TIME__ usage
scsi/wd33c93: Drop __TIME__ usage
usb/u132-hcd: Drop __TIME__ usage
usb/ftdi-elan: Drop __TIME__ usage
dlm: Drop __TIME__ usage
gfs2: Drop __TIME__ usage
atm: Drop __TIME__ usage
tipc: Drop __TIME__ usage
rio: Drop __DATE__ usage
edac: Drop __DATE__ usage
pmcraid: Drop __DATE__ usage
usb/lh7a40x_udc: Drop __DATE__ usage
checkpatch: Warn about usage of __DATE__, __TIME__ and __TIMESTAMP__

 Documentation/kbuild/kbuild.txt              |   12 ++++++++++
 arch/powerpc/boot/Makefile                   |    2 +-
 arch/powerpc/boot/wrapper                    |    6 ++--
 arch/x86/boot/Makefile                       |    2 +-
 drivers/char/cyclades.c                      |    3 +-
 drivers/char/nozomi.c                        |    3 +-
 drivers/char/rio/rioinit.c                   |    2 +-
 drivers/edac/amd76x_edac.c                   |    2 +-
 drivers/edac/amd8111_edac.c                  |    2 +-
 drivers/edac/amd8131_edac.c                  |    2 +-
 drivers/edac/cpc925_edac.c                   |    2 +-
 drivers/edac/e752x_edac.c                    |    2 +-
 drivers/edac/e7xxx_edac.c                    |    2 +-
 drivers/edac/edac_module.c                   |    2 +-
 drivers/edac/i5000_edac.c                    |    2 +-
 drivers/edac/i5400_edac.c                    |    2 +-
 drivers/edac/i7300_edac.c                    |    2 +-
 drivers/edac/i7core_edac.c                   |    2 +-
 drivers/edac/i82860_edac.c                   |    2 +-
 drivers/edac/i82875p_edac.c                  |    2 +-
 drivers/edac/i82975x_edac.c                  |    2 +-
 drivers/edac/mpc85xx_edac.h                  |    2 +-
 drivers/edac/mv64x60_edac.h                  |    2 +-
 drivers/edac/ppc4xx_edac.c                   |    2 +-
 drivers/edac/r82600_edac.c                   |    2 +-
 drivers/isdn/hardware/eicon/divasfunc.c      |    5 +--
 drivers/media/radio/radio-maxiradio.c        |    3 +-
 drivers/media/video/cx231xx/cx231xx-avcore.c |    2 +-
 drivers/mtd/nand/denali.c                    |    3 +-
 drivers/net/hamradio/baycom_epp.c            |    2 +-
 drivers/net/hamradio/baycom_par.c            |    2 +-
 drivers/net/hamradio/baycom_ser_fdx.c        |    2 +-
 drivers/net/hamradio/baycom_ser_hdx.c        |    2 +-
 drivers/net/hamradio/hdlcdrv.c               |    2 +-
 drivers/net/wan/pc300_drv.c                  |    3 +-
 drivers/net/wireless/rt2x00/rt2x00debug.c    |    1 -
 drivers/parport/parport_ip32.c               |    1 -
 drivers/scsi/aacraid/linit.c                 |    3 +-
 drivers/scsi/in2000.c                        |    2 +-
 drivers/scsi/pmcraid.c                       |    9 +++----
 drivers/scsi/pmcraid.h                       |    1 -
 drivers/scsi/wd33c93.c                       |    7 ++---
 drivers/usb/gadget/lh7a40x_udc.c             |    7 ++---
 drivers/usb/host/u132-hcd.c                  |    3 +-
 drivers/usb/misc/ftdi-elan.c                 |    3 +-
 fs/dlm/main.c                                |    2 +-
 fs/gfs2/main.c                               |    2 +-
 net/atm/lec.c                                |    2 +-
 net/atm/mpc.c                                |    2 +-
 net/tipc/core.c                              |    3 +-
 scripts/Makefile.build                       |    4 +-
 scripts/Makefile.lib                         |    2 +-
 scripts/checkpatch.pl                        |    5 ++++
 scripts/gen_initramfs_list.sh                |    8 +++++-
 scripts/kconfig/confdata.c                   |    8 +-----
 scripts/mkcompile_h                          |   30 ++++++++++++-------------
 usr/gen_init_cpio.c                          |   17 +++++++++-----
 57 files changed, 109 insertions(+), 105 deletions(-)
Signature · 1 line
1.7.4.1
#1 lore raw

PATCH 1/34 kconfig: Do not record timestamp in auto.conf and autoconf.h

Timestamps in file data are useless and there is already one in .config

---
 scripts/kconfig/confdata.c |    8 ++------
 1 files changed, 2 insertions(+), 6 deletions(-)
scripts/kconfig/confdata.c +2 -6
index 61c35bf..834eecb 100644
@@ -784,7 +784,6 @@ int conf_write_autoconf(void)
 	const char *str;
 	const char *name;
 	FILE *out, *tristate, *out_h;
-	time_t now;
 	int i;
 
 	sym_clear_all_valid();
@@ -811,22 +810,19 @@ int conf_write_autoconf(void)
 		return 1;
 	}
 
-	time(&now);
 	fprintf(out, "#\n"
 		     "# Automatically generated make config: don't edit\n"
 		     "# %s\n"
-		     "# %s"
 		     "#\n",
-		     rootmenu.prompt->text, ctime(&now));
+		     rootmenu.prompt->text);
 	fprintf(tristate, "#\n"
 			  "# Automatically generated - do not edit\n"
 			  "\n");
 	fprintf(out_h, "/*\n"
 		       " * Automatically generated C config: don't edit\n"
 		       " * %s\n"
-		       " * %s"
 		       " */\n",
-		       rootmenu.prompt->text, ctime(&now));
+		       rootmenu.prompt->text);
 
 	for_all_symbols(i, sym) {
 		sym_calc_value(sym);
Signature · 1 line
1.7.4.1
#2 lore raw

Re: [PATCH 01/34] kconfig: Do not record timestamp in auto.conf and autoconf.h

Hi,

Quoted 2 lines · Michal Marek

Timestamps in file data are useless and there is already one in .config

hum, shouldn't this be tunable via KCONFIG_NOTIMESTAMP ? This might be useful to know when the file was generated, independently of the .config, as conf_write() and conf_write_autoconf() are independent from one another.

- Arnaud

Quoted 50 lines

---
 scripts/kconfig/confdata.c |    8 ++------

 1 files changed, 2 insertions(+), 6 deletions(-)
scripts/kconfig/confdata.c +0 -2
index 61c35bf..834eecb 100644
@@ -784,7 +784,6 @@ int conf_write_autoconf(void)
        const char *str;
        const char *name;
        FILE *out, *tristate, *out_h;
-       time_t now;
        int i;
 
        sym_clear_all_valid();
@@ -811,22 +810,19 @@ int conf_write_autoconf(void)
                return 1;
        }
 
-       time(&now);

       fprintf(out, "#\n"
                    "# Automatically generated make config: don't edit\n" "# %s\n"
-                    "# %s"
                    "#\n",
-                    rootmenu.prompt->text, ctime(&now));
+                    rootmenu.prompt->text); fprintf(tristate, "#\n"
                         "# Automatically generated - do not edit\n" "\n");
       fprintf(out_h, "/*\n"
                      " * Automatically generated C config: don't edit\n" " * %s\n"
-                      " * %s"
                      " */\n",
-                      rootmenu.prompt->text, ctime(&now));
+                      rootmenu.prompt->text);

       for_all_symbols(i, sym) {
               sym_calc_value(sym);
--
1.7.4.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kbuild" in the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

#3 lore raw

Re: [PATCH 01/34] kconfig: Do not record timestamp in auto.conf and autoconf.h

Quoted 9 lines · Arnaud Lacombe

Hi,

Quoted 2 lines · Michal Marek

Timestamps in file data are useless and there is already one in .config

hum, shouldn't this be tunable via KCONFIG_NOTIMESTAMP ? This might be useful to know when the file was generated, independently of the .config, as conf_write() and conf_write_autoconf() are independent from one another.

Yeah, but ls -l include/generated/autoconf.h will tell you the same, won't it?

Michal

#4 lore raw

Re: [PATCH 01/34] kconfig: Do not record timestamp in auto.conf and autoconf.h

Hi,

Quoted 6 lines · Michal Marek
Quoted 5 lines · Arnaud Lacombe

Hi,

Quoted 2 lines · Michal Marek

Timestamps in file data are useless and there is already one in .config

Quoted 8 lines
Quoted 4 lines

hum, shouldn't this be tunable via KCONFIG_NOTIMESTAMP ? This might be useful to know when the file was generated, independently of the .config, as conf_write() and conf_write_autoconf() are independent from one another.

Yeah, but ls -l include/generated/autoconf.h will tell you the same, won't it?

Not if the file is spread to other machine/fs. Not that I care much though, but for consistency, either KCONFIG_NOTIMESTAMP is honored in every places where timestamps are used, or it should be killed altogether.

- Arnaud

#5 lore raw

Re: [PATCH 01/34] kconfig: Do not record timestamp in auto.conf and autoconf.h

Quoted 14 lines · Arnaud Lacombe

Hi,

Quoted 11 lines · Michal Marek
Quoted 9 lines · Arnaud Lacombe

Hi,

Quoted 2 lines · Michal Marek

Timestamps in file data are useless and there is already one in .config

hum, shouldn't this be tunable via KCONFIG_NOTIMESTAMP ? This might be useful to know when the file was generated, independently of the .config, as conf_write() and conf_write_autoconf() are independent from one another.

Quoted 7 lines
Quoted 3 lines

Yeah, but ls -l include/generated/autoconf.h will tell you the same, won't it?

Not if the file is spread to other machine/fs. Not that I care much though, but for consistency, either KCONFIG_NOTIMESTAMP is honored in every places where timestamps are used, or it should be killed altogether.

Or we kill the timestamps in the other places :). auto.conf and autoconf.h are "internal" files, .config is the file supplied and edited by the user and I can see that some might find the embedded timestamp useful. But I doubt that anyone needs the timestamp in auto.conf and autoconf.h.

Michal

#6 lore raw

Re: [PATCH 01/34] kconfig: Do not record timestamp in auto.conf and autoconf.h

In reply to Michal Marek
Quoted 6 lines · Michal Marek

Timestamps in file data are useless and there is already one in .config

---
 scripts/kconfig/confdata.c |    8 ++------
 1 files changed, 2 insertions(+), 6 deletions(-)

I pushed this to kbuild-2.6.git#kconfig.

Michal

#7 lore raw

PATCH 2/34 kbuild: Call gzip with -n

In reply to Michal Marek

The timestamps recorded in the .gz files add no value.

---
 scripts/Makefile.lib          |    2 +-
 scripts/gen_initramfs_list.sh |    4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)
scripts/Makefile.lib +1 -1
index 1c702ca..93b2b59 100644
@@ -197,7 +197,7 @@ cmd_objcopy = $(OBJCOPY) $(OBJCOPYFLAGS) $(OBJCOPYFLAGS_$(@F)) $< $@
 # ---------------------------------------------------------------------------
 
 quiet_cmd_gzip = GZIP    $@
-cmd_gzip = (cat $(filter-out FORCE,$^) | gzip -f -9 > $@) || \
+cmd_gzip = (cat $(filter-out FORCE,$^) | gzip -n -f -9 > $@) || \
 	(rm -f $@ ; false)
 
 # DTC
scripts/gen_initramfs_list.sh +2 -2
index 55caecd..4a43fe1 100644
@@ -226,7 +226,7 @@ cpio_list=
 output="/dev/stdout"
 output_file=""
 is_cpio_compressed=
-compr="gzip -9 -f"
+compr="gzip -n -9 -f"
 
 arg="$1"
 case "$arg" in
@@ -240,7 +240,7 @@ case "$arg" in
 		output_file="$1"
 		cpio_list="$(mktemp ${TMPDIR:-/tmp}/cpiolist.XXXXXX)"
 		output=${cpio_list}
-		echo "$output_file" | grep -q "\.gz$" && compr="gzip -9 -f"
+		echo "$output_file" | grep -q "\.gz$" && compr="gzip -n -9 -f"
 		echo "$output_file" | grep -q "\.bz2$" && compr="bzip2 -9 -f"
 		echo "$output_file" | grep -q "\.lzma$" && compr="lzma -9 -f"
 		echo "$output_file" | grep -q "\.xz$" && \
Signature · 1 line
1.7.4.1
#8 lore raw

Re: [PATCH 02/34] kbuild: Call gzip with -n

Quoted 7 lines · Michal Marek

The timestamps recorded in the .gz files add no value.

---
 scripts/Makefile.lib          |    2 +-
 scripts/gen_initramfs_list.sh |    4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

Pushed to kbuild-2.6.git#kbuild.

Michal

#9 lore raw

PATCH 3/34 powerpc: Call gzip with -n

In reply to Michal Marek

The timestamps recorded in the .gz files add no value.

Cc Benjamin Herrenschmidt <[email protected]>
Cc Paul Mackerras <[email protected]>
---
 arch/powerpc/boot/wrapper |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)
arch/powerpc/boot/wrapper +3 -3
index cb97e75..854797b 100755
@@ -251,7 +251,7 @@ if [ -z "$cacheit" -o ! -f "$vmz$gzip" -o "$vmz$gzip" -ot "$kernel" ]; then
     ${CROSS}objcopy $objflags "$kernel" "$vmz.$$"
 
     if [ -n "$gzip" ]; then
-        gzip -f -9 "$vmz.$$"
+        gzip -n -f -9 "$vmz.$$"
     fi
 
     if [ -n "$cacheit" ]; then
@@ -336,7 +336,7 @@ coff)
     $objbin/hack-coff "$ofile"
     ;;
 cuboot*)
-    gzip -f -9 "$ofile"
+    gzip -n -f -9 "$ofile"
     ${MKIMAGE} -A ppc -O linux -T kernel -C gzip -a "$base" -e "$entry" \
             $uboot_version -d "$ofile".gz "$ofile"
     ;;
@@ -383,6 +383,6 @@ ps3)
 
     odir="$(dirname "$ofile.bin")"
     rm -f "$odir/otheros.bld"
-    gzip --force -9 --stdout "$ofile.bin" > "$odir/otheros.bld"
+    gzip -n --force -9 --stdout "$ofile.bin" > "$odir/otheros.bld"
     ;;
 esac
Signature · 1 line
1.7.4.1
#10 lore raw

PATCH 4/34 kbuild: Use the deterministic mode of ar

In reply to Michal Marek
---
 scripts/Makefile.build |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
scripts/Makefile.build +2 -2
index 4eb99ab..c792698 100644
@@ -311,7 +311,7 @@ quiet_cmd_link_o_target = LD      $@
 cmd_link_o_target = $(if $(strip $(obj-y)),\
 		      $(LD) $(ld_flags) -r -o $@ $(filter $(obj-y), $^) \
 		      $(cmd_secanalysis),\
-		      rm -f $@; $(AR) rcs $@)
+		      rm -f $@; $(AR) rcsD $@)
 
 $(builtin-target): $(obj-y) FORCE
 	$(call if_changed,link_o_target)
@@ -337,7 +337,7 @@ $(modorder-target): $(subdir-ym) FORCE
 #
 ifdef lib-target
 quiet_cmd_link_l_target = AR      $@
-cmd_link_l_target = rm -f $@; $(AR) rcs $@ $(lib-y)
+cmd_link_l_target = rm -f $@; $(AR) rcsD $@ $(lib-y)
 
 $(lib-target): $(lib-y) FORCE
 	$(call if_changed,link_l_target)
Signature · 1 line
1.7.4.1
#11 lore raw

Re: [PATCH 04/34] kbuild: Use the deterministic mode of ar

Quoted 4 lines · Michal Marek
---
 scripts/Makefile.build |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

Pushed to kbuild-2.6.git#kbuild.

Michal

#12 lore raw

PATCH 5/34 powerpc: Use the deterministic mode of ar

In reply to Michal Marek
Cc Benjamin Herrenschmidt <[email protected]>
Cc Paul Mackerras <[email protected]>
---
 arch/powerpc/boot/Makefile |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
arch/powerpc/boot/Makefile +1 -1
index 8917816..d028a65 100644
@@ -127,7 +127,7 @@ quiet_cmd_bootas = BOOTAS  $@
       cmd_bootas = $(CROSS32CC) -Wp,-MD,$(depfile) $(BOOTAFLAGS) -c -o $@ $<
 
 quiet_cmd_bootar = BOOTAR  $@
-      cmd_bootar = $(CROSS32AR) -cr $@.$$$$ $(filter-out FORCE,$^); mv $@.$$$$ $@
+      cmd_bootar = $(CROSS32AR) -crD $@.$$$$ $(filter-out FORCE,$^); mv $@.$$$$ $@
 
 $(obj-libfdt): $(obj)/%.o: $(srctree)/scripts/dtc/libfdt/%.c FORCE
 	$(call if_changed_dep,bootcc)
Signature · 1 line
1.7.4.1
#13 lore raw

PATCH v2 1/1 powerpc: Use the deterministic mode of ar

Cc Benjamin Herrenschmidt <[email protected]>
Cc Paul Mackerras <[email protected]>

---

Hi,

this version fixes build with binutils <= 2.19 by first checking if ar(1) supports the D option. It depends on a previous patch in the kbuild tree, commit 40df759e (kbuild: Fix build with binutils <= 2.19) in linux-next, so it will need to go through the kbuild tree. But feedback from the PPC maintainers would be appreciated.

Thanks
Michal

---
 arch/powerpc/boot/Makefile |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
arch/powerpc/boot/Makefile +1 -1
index 8917816..f0543f8 100644
@@ -127,7 +127,7 @@ quiet_cmd_bootas = BOOTAS  $@
       cmd_bootas = $(CROSS32CC) -Wp,-MD,$(depfile) $(BOOTAFLAGS) -c -o $@ $<
 
 quiet_cmd_bootar = BOOTAR  $@
-      cmd_bootar = $(CROSS32AR) -cr $@.$$$$ $(filter-out FORCE,$^); mv $@.$$$$ $@
+      cmd_bootar = $(CROSS32AR) -cr$(KBUILD_ARFLAGS) $@.$$$$ $(filter-out FORCE,$^); mv $@.$$$$ $@
 
 $(obj-libfdt): $(obj)/%.o: $(srctree)/scripts/dtc/libfdt/%.c FORCE
 	$(call if_changed_dep,bootcc)
Signature · 1 line
1.7.4.1
#14 lore raw

PATCH 6/34 kbuild: Drop unused LINUX_COMPILE_TIME and LINUX_COMPILE_DOMAIN macros

In reply to Michal Marek
---
 scripts/mkcompile_h |   16 ++--------------
 1 files changed, 2 insertions(+), 14 deletions(-)
scripts/mkcompile_h +2 -14
index 50ad317..82416a8 100755
@@ -63,21 +63,9 @@ UTS_TRUNCATE="cut -b -$UTS_LEN"
 
   echo \#define UTS_VERSION \"`echo $UTS_VERSION | $UTS_TRUNCATE`\"
 
-  echo \#define LINUX_COMPILE_TIME \"`date +%T`\"
   echo \#define LINUX_COMPILE_BY \"`whoami`\"
   echo \#define LINUX_COMPILE_HOST \"`hostname | $UTS_TRUNCATE`\"
 
-  domain=`dnsdomainname 2> /dev/null`
-  if [ -z "$domain" ]; then
-    domain=`domainname 2> /dev/null`
-  fi
-
-  if [ -n "$domain" ]; then
-    echo \#define LINUX_COMPILE_DOMAIN \"`echo $domain | $UTS_TRUNCATE`\"
-  else
-    echo \#define LINUX_COMPILE_DOMAIN
-  fi
-
   echo \#define LINUX_COMPILER \"`$CC -v 2>&1 | tail -n 1`\"
 ) > .tmpcompile
 
@@ -91,8 +79,8 @@ UTS_TRUNCATE="cut -b -$UTS_LEN"
 # first line.
 
 if [ -r $TARGET ] && \
-      grep -v 'UTS_VERSION\|LINUX_COMPILE_TIME' $TARGET > .tmpver.1 && \
-      grep -v 'UTS_VERSION\|LINUX_COMPILE_TIME' .tmpcompile > .tmpver.2 && \
+      grep -v 'UTS_VERSION' $TARGET > .tmpver.1 && \
+      grep -v 'UTS_VERSION' .tmpcompile > .tmpver.2 && \
       cmp -s .tmpver.1 .tmpver.2; then
    rm -f .tmpcompile
 else
Signature · 1 line
1.7.4.1
#15 lore raw

Re: [PATCH 06/34] kbuild: Drop unused LINUX_COMPILE_TIME and LINUX_COMPILE_DOMAIN macros

Quoted 4 lines · Michal Marek
---
 scripts/mkcompile_h |   16 ++--------------
 1 files changed, 2 insertions(+), 14 deletions(-)

Pushed to kbuild-2.6.git#kbuild.

Michal

#16 lore raw

PATCH 7/34 kbuild: Allow to override LINUX_COMPILE_BY and LINUX_COMPILE_HOST macros

In reply to Michal Marek

Make it possible to override the user@host string displayed during boot and in /proc/version by the environment variables KBUILD_BUILD_USER and KBUILD_BUILD_HOST. Several distributions patch scripts/mkcompile_h to achieve this, so let's provide an official way.

---
 Documentation/kbuild/kbuild.txt |   12 ++++++++++++
 scripts/mkcompile_h             |   14 ++++++++++++--
 2 files changed, 24 insertions(+), 2 deletions(-)
Documentation/kbuild/kbuild.txt +12 -0
index 4a99031..27d7928 100644
@@ -196,3 +196,15 @@ to be included in the databases, separated by blank space. E.g.:
 To get all available archs you can also specify all. E.g.:
 
     $ make ALLSOURCE_ARCHS=all tags
+
+KBUILD_BUILD_TIMESTAMP
+--------------------------------------------------
+Setting this to a date string overrides the timestamp used in the
+UTS_VERSION definition (uname -v in the running kernel). The default value
+is the output of the date command at one point during build.
+
+KBUILD_BUILD_USER, KBUILD_BUILD_HOST
+--------------------------------------------------
+These two variables allow to override the user@host string displayed during
+boot and in /proc/version. The default value is the output of the commands
+whoami and host, respectively.
scripts/mkcompile_h +12 -2
index 82416a8..82c4e1d 100755
@@ -42,6 +42,16 @@ if [ -z "$KBUILD_BUILD_TIMESTAMP" ]; then
 else
 	TIMESTAMP=$KBUILD_BUILD_TIMESTAMP
 fi
+if test -z "$KBUILD_BUILD_USER"; then
+	LINUX_COMPILE_BY=`whoami`
+else
+	LINUX_COMPILE_BY=$KBUILD_BUILD_USER
+fi
+if test -z "$KBUILD_BUILD_HOST"; then
+	LINUX_COMPILE_HOST=`hostname`
+else
+	LINUX_COMPILE_HOST=$KBUILD_BUILD_HOST
+fi
 
 UTS_VERSION="#$VERSION"
 CONFIG_FLAGS=""
@@ -63,8 +73,8 @@ UTS_TRUNCATE="cut -b -$UTS_LEN"
 
   echo \#define UTS_VERSION \"`echo $UTS_VERSION | $UTS_TRUNCATE`\"
 
-  echo \#define LINUX_COMPILE_BY \"`whoami`\"
-  echo \#define LINUX_COMPILE_HOST \"`hostname | $UTS_TRUNCATE`\"
+  echo \#define LINUX_COMPILE_BY \"`echo $KBUILD_BUILD_USER | $UTS_TRUNCATE`\"
+  echo \#define LINUX_COMPILE_HOST \"`echo $KBUILD_BUILD_HOST | $UTS_TRUNCATE`\"
 
   echo \#define LINUX_COMPILER \"`$CC -v 2>&1 | tail -n 1`\"
 ) > .tmpcompile
Signature · 1 line
1.7.4.1
#17 lore raw

Re: [PATCH 07/34] kbuild: Allow to override LINUX_COMPILE_BY and LINUX_COMPILE_HOST macros

scripts/mkcompile_h UTS_TRUNCATE="cut -b -$UTS_LEN" · line 77

Quoted 4 lines · Michal Marek
scripts/mkcompile_h +2 -2
-  echo \#define LINUX_COMPILE_BY \"`whoami`\"
-  echo \#define LINUX_COMPILE_HOST \"`hostname | $UTS_TRUNCATE`\"
+  echo \#define LINUX_COMPILE_BY \"`echo $KBUILD_BUILD_USER | $UTS_TRUNCATE`\"
+  echo \#define LINUX_COMPILE_HOST \"`echo $KBUILD_BUILD_HOST | $UTS_TRUNCATE`\"

Shouldn't these be the variables defined above otherwise we get empty LINUX_COMPILE_{BY,HOST} in the case the corresponding environment variable is unset.

Thanks,

Jack

#18 lore raw

Re: [PATCH 07/34] kbuild: Allow to override LINUX_COMPILE_BY and LINUX_COMPILE_HOST macros

Dne 5.4.2011 17:52, Jack Stone napsal(a):

Quoted 9 lines · Michal Marek

scripts/mkcompile_h UTS_TRUNCATE="cut -b -$UTS_LEN" · line 77

Quoted 4 lines
scripts/mkcompile_h +2 -2
-  echo \#define LINUX_COMPILE_BY \"`whoami`\"
-  echo \#define LINUX_COMPILE_HOST \"`hostname | $UTS_TRUNCATE`\"
+  echo \#define LINUX_COMPILE_BY \"`echo $KBUILD_BUILD_USER | $UTS_TRUNCATE`\"
+  echo \#define LINUX_COMPILE_HOST \"`echo $KBUILD_BUILD_HOST | $UTS_TRUNCATE`\"

Shouldn't these be the variables defined above otherwise we get empty LINUX_COMPILE_{BY,HOST} in the case the corresponding environment variable is unset.

Good catch. I'll fix it.

Thanks for the review.

Michal

#19 lore raw

PATCH v2 1/1 kbuild: Allow to override LINUX_COMPILE_BY and LINUX_COMPILE_HOST macros

In reply to Jack Stone

Make it possible to override the user@host string displayed during boot and in /proc/version by the environment variables KBUILD_BUILD_USER and KBUILD_BUILD_HOST. Several distributions patch scripts/mkcompile_h to achieve this, so let's provide an official way.

---
 Documentation/kbuild/kbuild.txt |   12 ++++++++++++
 scripts/mkcompile_h             |   14 ++++++++++++--
 2 files changed, 24 insertions(+), 2 deletions(-)
Documentation/kbuild/kbuild.txt +12 -0
index 4a99031..27d7928 100644
@@ -196,3 +196,15 @@ to be included in the databases, separated by blank space. E.g.:
 To get all available archs you can also specify all. E.g.:
 
     $ make ALLSOURCE_ARCHS=all tags
+
+KBUILD_BUILD_TIMESTAMP
+--------------------------------------------------
+Setting this to a date string overrides the timestamp used in the
+UTS_VERSION definition (uname -v in the running kernel). The default value
+is the output of the date command at one point during build.
+
+KBUILD_BUILD_USER, KBUILD_BUILD_HOST
+--------------------------------------------------
+These two variables allow to override the user@host string displayed during
+boot and in /proc/version. The default value is the output of the commands
+whoami and host, respectively.
scripts/mkcompile_h +12 -2
index 82416a8..7ad6bf7 100755
@@ -42,6 +42,16 @@ if [ -z "$KBUILD_BUILD_TIMESTAMP" ]; then
 else
 	TIMESTAMP=$KBUILD_BUILD_TIMESTAMP
 fi
+if test -z "$KBUILD_BUILD_USER"; then
+	LINUX_COMPILE_BY=`whoami`
+else
+	LINUX_COMPILE_BY=$KBUILD_BUILD_USER
+fi
+if test -z "$KBUILD_BUILD_HOST"; then
+	LINUX_COMPILE_HOST=`hostname`
+else
+	LINUX_COMPILE_HOST=$KBUILD_BUILD_HOST
+fi
 
 UTS_VERSION="#$VERSION"
 CONFIG_FLAGS=""
@@ -63,8 +73,8 @@ UTS_TRUNCATE="cut -b -$UTS_LEN"
 
   echo \#define UTS_VERSION \"`echo $UTS_VERSION | $UTS_TRUNCATE`\"
 
-  echo \#define LINUX_COMPILE_BY \"`whoami`\"
-  echo \#define LINUX_COMPILE_HOST \"`hostname | $UTS_TRUNCATE`\"
+  echo \#define LINUX_COMPILE_BY \"`echo $LINUX_COMPILE_BY | $UTS_TRUNCATE`\"
+  echo \#define LINUX_COMPILE_HOST \"`echo $LINUX_COMPILE_HOST | $UTS_TRUNCATE`\"
 
   echo \#define LINUX_COMPILER \"`$CC -v 2>&1 | tail -n 1`\"
 ) > .tmpcompile
Signature · 1 line
1.7.4.1
#20 lore raw

Re: [PATCH v2] kbuild: Allow to override LINUX_COMPILE_BY and LINUX_COMPILE_HOST macros

Documentation/kbuild/kbuild.txt to be included in the databases, separated by blank space. E.g.: · line 200

Quoted 6 lines · Michal Marek

Make it possible to override the user@host string displayed during boot and in /proc/version by the environment variables KBUILD_BUILD_USER and KBUILD_BUILD_HOST.

Documentation/kbuild/kbuild.txt +2 -0
+
+KBUILD_BUILD_TIMESTAMP

Changelog section doesn't match actual patch. Other than that, I'm OK on this.

#21 lore raw

Re: [PATCH v2] kbuild: Allow to override LINUX_COMPILE_BY and LINUX_COMPILE_HOST macros

Quoted 9 lines · On 12.4.2011 05:25, [email protected] wrote:

Documentation/kbuild/kbuild.txt to be included in the databases, separated by blank space. E.g.: · line 200

Quoted 6 lines · Michal Marek

Make it possible to override the user@host string displayed during boot and in /proc/version by the environment variables KBUILD_BUILD_USER and KBUILD_BUILD_HOST.

Documentation/kbuild/kbuild.txt +2 -0
+
+KBUILD_BUILD_TIMESTAMP

Changelog section doesn't match actual patch. Other than that, I'm OK on this.

I changed it to

Make it possible to override the user@host string displayed during boot and in /proc/version by the environment variables KBUILD_BUILD_USER and KBUILD_BUILD_HOST. Several distributions patch scripts/mkcompile_h to achieve this, so let's provide an official way. Also, document the KBUILD_BUILD_TIMESTAMP variable while at it.

Michal

#22 lore raw

Re: [PATCH v2] kbuild: Allow to override LINUX_COMPILE_BY and LINUX_COMPILE_HOST macros

Quoted 11 lines · Michal Marek
Quoted 9 lines · On 12.4.2011 05:25, [email protected] wrote:

Documentation/kbuild/kbuild.txt to be included in the databases, separated by blank space. E.g.: · line 200

Quoted 6 lines · Michal Marek

Make it possible to override the user@host string displayed during boot and in /proc/version by the environment variables KBUILD_BUILD_USER and KBUILD_BUILD_HOST.

Documentation/kbuild/kbuild.txt +2 -0
+
+KBUILD_BUILD_TIMESTAMP

Changelog section doesn't match actual patch. Other than that, I'm OK on this.

Quoted 7 lines

I changed it to

Make it possible to override the user@host string displayed during boot and in /proc/version by the environment variables KBUILD_BUILD_USER and KBUILD_BUILD_HOST. Several distributions patch scripts/mkcompile_h to achieve this, so let's provide an official way. Also, document the KBUILD_BUILD_TIMESTAMP variable while at it.

Pushed to kbuild-2.6.git#kbuild.

Michal

#23 lore raw

PATCH 8/34 initramfs: Use KBUILD_BUILD_TIMESTAMP for generated entries

In reply to Michal Marek

gen_init_cpio uses the current time for symlinks, special files and directories. Make it possible to override this with the KBUILD_BUILD_TIMESTAMP variable for reproducible builds.

---
 scripts/gen_initramfs_list.sh |    4 ++++
 usr/gen_init_cpio.c           |   17 +++++++++++------
 2 files changed, 15 insertions(+), 6 deletions(-)
scripts/gen_initramfs_list.sh +4 -0
index 4a43fe1..18cde32 100644
@@ -283,6 +283,10 @@ while [ $# -gt 0 ]; do
 	esac
 done
 
+if test -n "$KBUILD_BUILD_TIMESTAMP"; then
+	export CPIO_TIMESTAMP=$(date -d"$KBUILD_BUILD_TIMESTAMP" +%s)
+fi
+
 # If output_file is set we will generate cpio archive and compress it
 # we are carefull to delete tmp files
 if [ ! -z ${output_file} ]; then
usr/gen_init_cpio.c +11 -6
index 7f06884..11f604d 100644
@@ -22,6 +22,7 @@
 
 static unsigned int offset;
 static unsigned int ino = 721;
+static time_t default_mtime;
 
 struct file_handler {
 	const char *type;
@@ -102,7 +103,6 @@ static int cpio_mkslink(const char *name, const char *target,
 			 unsigned int mode, uid_t uid, gid_t gid)
 {
 	char s[256];
-	time_t mtime = time(NULL);
 
 	if (name[0] == '/')
 		name++;
@@ -114,7 +114,7 @@ static int cpio_mkslink(const char *name, const char *target,
 		(long) uid,		/* uid */
 		(long) gid,		/* gid */
 		1,			/* nlink */
-		(long) mtime,		/* mtime */
+		(long) default_mtime,	/* mtime */
 		(unsigned)strlen(target)+1, /* filesize */
 		3,			/* major */
 		1,			/* minor */
@@ -152,7 +152,6 @@ static int cpio_mkgeneric(const char *name, unsigned int mode,
 		       uid_t uid, gid_t gid)
 {
 	char s[256];
-	time_t mtime = time(NULL);
 
 	if (name[0] == '/')
 		name++;
@@ -164,7 +163,7 @@ static int cpio_mkgeneric(const char *name, unsigned int mode,
 		(long) uid,		/* uid */
 		(long) gid,		/* gid */
 		2,			/* nlink */
-		(long) mtime,		/* mtime */
+		(long) default_mtime,	/* mtime */
 		0,			/* filesize */
 		3,			/* major */
 		1,			/* minor */
@@ -242,7 +241,6 @@ static int cpio_mknod(const char *name, unsigned int mode,
 		       unsigned int maj, unsigned int min)
 {
 	char s[256];
-	time_t mtime = time(NULL);
 
 	if (dev_type == 'b')
 		mode |= S_IFBLK;
@@ -259,7 +257,7 @@ static int cpio_mknod(const char *name, unsigned int mode,
 		(long) uid,		/* uid */
 		(long) gid,		/* gid */
 		1,			/* nlink */
-		(long) mtime,		/* mtime */
+		(long) default_mtime,	/* mtime */
 		0,			/* filesize */
 		3,			/* major */
 		1,			/* minor */
@@ -529,6 +527,7 @@ int main (int argc, char *argv[])
 	char *args, *type;
 	int ec = 0;
 	int line_nr = 0;
+	const char *env;
 
 	if (2 != argc) {
 		usage(argv[0]);
@@ -544,6 +543,12 @@ int main (int argc, char *argv[])
 		exit(1);
 	}
 
+	env = getenv("CPIO_TIMESTAMP");
+	if (env)
+		default_mtime = atol(env);
+	if (!default_mtime)
+		default_mtime = time(NULL);
+
 	while (fgets(line, LINE_SIZE, cpio_list)) {
 		int type_idx;
 		size_t slen = strlen(line);
Signature · 1 line
1.7.4.1
#24 lore raw

Re: [08/34] initramfs: Use KBUILD_BUILD_TIMESTAMP for generated entries

Quoted 3 lines · Michal Marek

gen_init_cpio uses the current time for symlinks, special files and directories.

gen_init_cpio gets the current time and uses it for each symlink, special file, and directory.

Grab the current time once, and ...

Quoted 1 line

Make it possible to override this with the

(s/this/it/)

Quoted 10 lines

KBUILD_BUILD_TIMESTAMP variable for reproducible builds.

---
scripts/gen_initramfs_list.sh | 4 ++++

 usr/gen_init_cpio.c           |   17 +++++++++++------
 2 files changed, 15 insertions(+), 6 deletions(-)
scripts/gen_initramfs_list.sh +0 -0

snip

Quoted 4 lines
usr/gen_init_cpio.c +0 -0
index 7f06884..11f604d 100644

snip

Quoted 9 lines
usr/gen_init_cpio.c +1 -0
@@ -529,6 +527,7 @@ int main (int argc, char *argv[])
 	char *args, *type;
 	int ec = 0;
 	int line_nr = 0;
+	const char *env;
 
 	if (2 != argc) {
 		usage(argv[0]);

usr/gen_init_cpio.c int main (int argc, char *argv[]) · line 551

Quoted 9 lines
usr/gen_init_cpio.c +6 -0
@@ -544,6 +543,12 @@ int main (int argc, char *argv[])
 		exit(1);
 	}
 
+	env = getenv("CPIO_TIMESTAMP");
+	if (env)
+		default_mtime = atol(env);
+	if (!default_mtime)
+		default_mtime = time(NULL);
+

Please pass it via an explicit flag in argv instead of magic env variables.

The other current use of the environment (the expansion of variables in the location name) is via explicit reference in the input file.

Also, please use strol and check that the whole string is consumed.

milton

#25 lore raw

Re: [08/34] initramfs: Use KBUILD_BUILD_TIMESTAMP for generated entries

Dne 5.4.2011 19:31, Milton Miller napsal(a):

Quoted 14 lines · Michal Marek
Quoted 3 lines

gen_init_cpio uses the current time for symlinks, special files and directories.

gen_init_cpio gets the current time and uses it for each symlink, special file, and directory.

Grab the current time once, and ...

Quoted 1 line

Make it possible to override this with the

(s/this/it/)

Quoted 2 lines

KBUILD_BUILD_TIMESTAMP variable for reproducible builds.

...

Quoted 9 lines

usr/gen_init_cpio.c int main (int argc, char *argv[]) · line 551

Quoted 6 lines
usr/gen_init_cpio.c +6 -0
+	env = getenv("CPIO_TIMESTAMP");
+	if (env)
+		default_mtime = atol(env);
+	if (!default_mtime)
+		default_mtime = time(NULL);
+

Please pass it via an explicit flag in argv instead of magic env variables.

Quoted 4 lines

The other current use of the environment (the expansion of variables in the location name) is via explicit reference in the input file.

Also, please use strol and check that the whole string is consumed.

Yeah, I was too lazy. I'll do it properly in v2.

Thanks for the review.

Michal

#26 lore raw

PATCH v2 1/1 initramfs: Use KBUILD_BUILD_TIMESTAMP for generated entries

In reply to Milton Miller

gen_init_cpio gets the current time and uses it for each symlink, special file, and directory. Grab the current time once and make it possible to override it with the KBUILD_BUILD_TIMESTAMP variable for reproducible builds.

---
 Documentation/kbuild/kbuild.txt |    3 +-
 scripts/gen_initramfs_list.sh   |    9 ++++++-
 usr/gen_init_cpio.c             |   53 +++++++++++++++++++++++++++++---------
 3 files changed, 50 insertions(+), 15 deletions(-)
Documentation/kbuild/kbuild.txt +2 -1
index 27d7928..46e6cb8 100644
@@ -200,7 +200,8 @@ To get all available archs you can also specify all. E.g.:
 KBUILD_BUILD_TIMESTAMP
 --------------------------------------------------
 Setting this to a date string overrides the timestamp used in the
-UTS_VERSION definition (uname -v in the running kernel). The default value
+UTS_VERSION definition (uname -v in the running kernel). The value has to
+be a string that can be passed to date -d. The default value
 is the output of the date command at one point during build.
 
 KBUILD_BUILD_USER, KBUILD_BUILD_HOST
scripts/gen_initramfs_list.sh +8 -1
index 4a43fe1..d44cf67 100644
@@ -287,8 +287,15 @@ done
 # we are carefull to delete tmp files
 if [ ! -z ${output_file} ]; then
 	if [ -z ${cpio_file} ]; then
+		timestamp=
+		if test -n "$KBUILD_BUILD_TIMESTAMP"; then
+			timestamp="$(date -d"$KBUILD_BUILD_TIMESTAMP" +%s || :)"
+			if test -n "$timestamp"; then
+				timestamp="-t $timestamp"
+			fi
+		fi
 		cpio_tfile="$(mktemp ${TMPDIR:-/tmp}/cpiofile.XXXXXX)"
-		usr/gen_init_cpio ${cpio_list} > ${cpio_tfile}
+		usr/gen_init_cpio $timestamp ${cpio_list} > ${cpio_tfile}
 	else
 		cpio_tfile=${cpio_file}
 	fi
usr/gen_init_cpio.c +40 -13

119 lines not on this page · raw message

Signature · 1 line
1.7.4.1
#27 lore raw

Re: [PATCH v2] initramfs: Use KBUILD_BUILD_TIMESTAMP for generated entries

Quoted 11 lines · Michal Marek

gen_init_cpio gets the current time and uses it for each symlink, special file, and directory. Grab the current time once and make it possible to override it with the KBUILD_BUILD_TIMESTAMP variable for reproducible builds.

---
 Documentation/kbuild/kbuild.txt |    3 +-
 scripts/gen_initramfs_list.sh   |    9 ++++++-
 usr/gen_init_cpio.c             |   53 +++++++++++++++++++++++++++++---------
 3 files changed, 50 insertions(+), 15 deletions(-)

Pushed to kbuild-2.6.git#kbuild.

Michal

#28 lore raw

PATCH 9/34 x86: Allow to override the ROOT_DEV variable

In reply to Michal Marek
Cc Thomas Gleixner <[email protected]>
Cc Ingo Molnar <[email protected]>
Cc "H. Peter Anvin" <[email protected]>
---
 arch/x86/boot/Makefile |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
arch/x86/boot/Makefile +1 -1
index f7cb086..7a70c60 100644
@@ -13,7 +13,7 @@
 # This can be either FLOPPY, CURRENT, /dev/xxxx or empty, in which case
 # the default of FLOPPY is used by 'build'.
 
-ROOT_DEV	:= CURRENT
+ROOT_DEV	?= CURRENT
 
 # If you want to preset the SVGA mode, uncomment the next line and
 # set SVGA_MODE to whatever number you want.
Signature · 1 line
1.7.4.1
#29 lore raw

Re: [PATCH 09/34] x86: Allow to override the ROOT_DEV variable

Quoted 14 lines · Michal Marek
Cc Thomas Gleixner <[email protected]>
Cc Ingo Molnar <[email protected]>
Cc "H. Peter Anvin" <[email protected]>
---
 arch/x86/boot/Makefile |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
arch/x86/boot/Makefile +0 -0
index f7cb086..7a70c60 100644

arch/x86/boot/Makefile line 19

Quoted 8 lines
arch/x86/boot/Makefile +1 -1
@@ -13,7 +13,7 @@
 # This can be either FLOPPY, CURRENT, /dev/xxxx or empty, in which case
 # the default of FLOPPY is used by 'build'.
 
-ROOT_DEV	:= CURRENT
+ROOT_DEV	?= CURRENT
 
 # If you want to preset the SVGA mode, uncomment the next line and
 # set SVGA_MODE to whatever number you want.

Is this a good thing? As far as I understand ?= it may mean picking something up from the outside environment.

Since ROOT_DEV has been obsolete for 15 years or more, this would seem to be a needless new error mode.

-hpa

Signature · 2 lines
H. Peter Anvin, Intel Open Source Technology Center
I work for Intel.  I don't speak on their behalf.
#30 lore raw

Re: [PATCH 09/34] x86: Allow to override the ROOT_DEV variable

Quoted 9 lines · H. Peter Anvin
Quoted 9 lines
arch/x86/boot/Makefile +1 -1
@@ -13,7 +13,7 @@
 # This can be either FLOPPY, CURRENT, /dev/xxxx or empty, in which case
 # the default of FLOPPY is used by 'build'.
 
-ROOT_DEV	:= CURRENT
+ROOT_DEV	?= CURRENT
 
Quoted 8 lines

arch/x86/boot/Makefile line 19

Quoted 2 lines
arch/x86/boot/Makefile +0 -0
 # If you want to preset the SVGA mode, uncomment the next line and
 # set SVGA_MODE to whatever number you want.

Is this a good thing? As far as I understand ?= it may mean picking something up from the outside environment.

Since ROOT_DEV has been obsolete for 15 years or more, this would seem to be a needless new error mode.

So can we just set the default root device to (0, 0)?

Michal

#31 lore raw

Re: [PATCH 09/34] x86: Allow to override the ROOT_DEV variable

Quoted 16 lines · Michal Marek
Quoted 15 lines · H. Peter Anvin

arch/x86/boot/Makefile line 19

Quoted 11 lines
arch/x86/boot/Makefile +1 -1
@@ -13,7 +13,7 @@
 # This can be either FLOPPY, CURRENT, /dev/xxxx or empty, in which case
 # the default of FLOPPY is used by 'build'.
 
-ROOT_DEV	:= CURRENT
+ROOT_DEV	?= CURRENT
 
 # If you want to preset the SVGA mode, uncomment the next line and
 # set SVGA_MODE to whatever number you want.

Is this a good thing? As far as I understand ?= it may mean picking something up from the outside environment.

Quoted 4 lines
Quoted 2 lines

Since ROOT_DEV has been obsolete for 15 years or more, this would seem to be a needless new error mode.

So can we just set the default root device to (0, 0)?

Like this?

Subject: [PATCH] x86: Do not set the rood_dev field in bzImage

This has been obsoleted by the root= commandline for several years. People who still depend on this will surely have a copy of the rdev command around, the rest of the world gets rid of another piece of buildhost-dependent data in the build.

Cc Thomas Gleixner <[email protected]>
Cc Ingo Molnar <[email protected]>
Cc "H. Peter Anvin" <[email protected]>
---
 arch/x86/boot/Makefile |    9 +--------
 1 files changed, 1 insertions(+), 8 deletions(-)
arch/x86/boot/Makefile +1 -8
index f7cb086..95365a8 100644
@@ -9,12 +9,6 @@
 # Changed by many, many contributors over the years.
 #
 
-# ROOT_DEV specifies the default root-device when making the image.
-# This can be either FLOPPY, CURRENT, /dev/xxxx or empty, in which case
-# the default of FLOPPY is used by 'build'.
-
-ROOT_DEV	:= CURRENT
-
 # If you want to preset the SVGA mode, uncomment the next line and
 # set SVGA_MODE to whatever number you want.
 # Set it to -DSVGA_MODE=NORMAL_VGA if you just want the EGA/VGA mode.
@@ -75,8 +69,7 @@ GCOV_PROFILE := n
 $(obj)/bzImage: asflags-y  := $(SVGA_MODE)
 
 quiet_cmd_image = BUILD   $@
-cmd_image = $(obj)/tools/build $(obj)/setup.bin $(obj)/vmlinux.bin \
-	$(ROOT_DEV) > $@
+cmd_image = $(obj)/tools/build $(obj)/setup.bin $(obj)/vmlinux.bin > $@
 
 $(obj)/bzImage: $(obj)/setup.bin $(obj)/vmlinux.bin $(obj)/tools/build FORCE
 	$(call if_changed,image)
Signature · 1 line
1.7.4.1
#32 lore raw

Re: [PATCH 09/34] x86: Allow to override the ROOT_DEV variable

Quoted 3 lines · Michal Marek

Like this?

Subject: [PATCH] x86: Do not set the rood_dev field in bzImage

'rood'? ;)

arch/x86/boot/Makefile line 14

Quoted 3 lines
arch/x86/boot/Makefile +0 -3
-# ROOT_DEV specifies the default root-device when making the image.
-# This can be either FLOPPY, CURRENT, /dev/xxxx or empty, in which case
-# the default of FLOPPY is used by 'build'.

Does the default of FLOPPY still get used after this patch, or is this a stale comment? Also, I sort of expected to see more code removed that *used* the no-longer-passed value of ROOT_DEV.

(All my boxes have grub pass a root=, so I don't have a dog in this fight...)

#33 lore raw

Re: [PATCH 09/34] x86: Allow to override the ROOT_DEV variable

Quoted 1 line · On Mon, 2011-04-11 at 23:25 -0400, [email protected] wrote:

Does the default of FLOPPY still get used after this patch, or is this a stale comment?

It looks like a stale comment to me. The default currently actually is 0, 0 (major, minor). I'm not sure "FLOPPY" even works. Is 'stat("FLOPPY", ...)' legal?

Quoted 2 lines

Also, I sort of expected to see more code removed that *used* the no-longer-passed value of ROOT_DEV.

That's what I expect too. See my addendum to Michal's patch in the message I sent a few hours ago.

Paul Bolle

#34 lore raw

Re: [PATCH 09/34] x86: Allow to override the ROOT_DEV variable

In reply to Michal Marek
Quoted 10 lines · Michal Marek

Like this?

Subject: [PATCH] x86: Do not set the rood_dev field in bzImage

This has been obsoleted by the root= commandline for several years. People who still depend on this will surely have a copy of the rdev command around, the rest of the world gets rid of another piece of buildhost-dependent data in the build.

Works for me. "Several years" is even kind of an understatement ;)

-hpa

#35 lore raw

Re: [PATCH 09/34] x86: Allow to override the ROOT_DEV variable

In reply to Michal Marek
Quoted 34 lines · Michal Marek

Subject: [PATCH] x86: Do not set the rood_dev field in bzImage

This has been obsoleted by the root= commandline for several years. People who still depend on this will surely have a copy of the rdev command around, the rest of the world gets rid of another piece of buildhost-dependent data in the build.

Cc Thomas Gleixner <[email protected]>
Cc Ingo Molnar <[email protected]>
Cc "H. Peter Anvin" <[email protected]>
---
 arch/x86/boot/Makefile |    9 +--------
 1 files changed, 1 insertions(+), 8 deletions(-)
arch/x86/boot/Makefile +0 -6
index f7cb086..95365a8 100644
@@ -9,12 +9,6 @@
 # Changed by many, many contributors over the years.
 #
 
-# ROOT_DEV specifies the default root-device when making the image.
-# This can be either FLOPPY, CURRENT, /dev/xxxx or empty, in which case
-# the default of FLOPPY is used by 'build'.
-
-ROOT_DEV	:= CURRENT
-
 # If you want to preset the SVGA mode, uncomment the next line and
 # set SVGA_MODE to whatever number you want.
 # Set it to -DSVGA_MODE=NORMAL_VGA if you just want the EGA/VGA mode.

arch/x86/boot/Makefile GCOV_PROFILE := n · line 75

Quoted 9 lines
arch/x86/boot/Makefile +1 -2
@@ -75,8 +69,7 @@ GCOV_PROFILE := n
 $(obj)/bzImage: asflags-y  := $(SVGA_MODE)
 
 quiet_cmd_image = BUILD   $@
-cmd_image = $(obj)/tools/build $(obj)/setup.bin $(obj)/vmlinux.bin \
-	$(ROOT_DEV) > $@
+cmd_image = $(obj)/tools/build $(obj)/setup.bin $(obj)/vmlinux.bin > $@
 
 $(obj)/bzImage: $(obj)/setup.bin $(obj)/vmlinux.bin $(obj)/tools/build FORCE
 	$(call if_changed,image)

I'm not familiar with the rdev command. I assume it allows one to manipulate the two rootdev bytes in a kernel image. Anyhow, shouldn't the above patch be complemented with something like the following?

arch/x86/boot/tools/build.c +4 -29
index ee3a4ea..fdc60a0 100644
@@ -130,7 +130,7 @@ static void die(const char * str, ...)
 
 static void usage(void)
 {
-	die("Usage: build setup system [rootdev] [> image]");
+	die("Usage: build setup system [> image]");
 }
 
 int main(int argc, char ** argv)
@@ -138,39 +138,14 @@ int main(int argc, char ** argv)
 	unsigned int i, sz, setup_sectors;
 	int c;
 	u32 sys_size;
-	u8 major_root, minor_root;
 	struct stat sb;
 	FILE *file;
 	int fd;
 	void *kernel;
 	u32 crc = 0xffffffffUL;
 
-	if ((argc < 3) || (argc > 4))
+	if (argc != 3)
 		usage();
-	if (argc > 3) {
-		if (!strcmp(argv[3], "CURRENT")) {
-			if (stat("/", &sb)) {
-				perror("/");
-				die("Couldn't stat /");
-			}
-			major_root = major(sb.st_dev);
-			minor_root = minor(sb.st_dev);
-		} else if (strcmp(argv[3], "FLOPPY")) {
-			if (stat(argv[3], &sb)) {
-				perror(argv[3]);
-				die("Couldn't stat root device.");
-			}
-			major_root = major(sb.st_rdev);
-			minor_root = minor(sb.st_rdev);
-		} else {
-			major_root = 0;
-			minor_root = 0;
-		}
-	} else {
-		major_root = DEFAULT_MAJOR_ROOT;
-		minor_root = DEFAULT_MINOR_ROOT;
-	}
-	fprintf(stderr, "Root device is (%d, %d)\n", major_root, minor_root);
 
 	/* Copy the setup code */
 	file = fopen(argv[1], "r");
@@ -193,8 +168,8 @@ int main(int argc, char ** argv)
 	memset(buf+c, 0, i-c);
 
 	/* Set the default root device */
-	buf[508] = minor_root;
-	buf[509] = major_root;
+	buf[508] = DEFAULT_MINOR_ROOT;
+	buf[509] = DEFAULT_MAJOR_ROOT;
 
 	fprintf(stderr, "Setup is %d bytes (padded to %d bytes).\n", c, i);
 
#36 lore raw

Re: [PATCH 09/34] x86: Allow to override the ROOT_DEV variable

Quoted 2 lines · Paul Bolle
Quoted 1 line · Michal Marek

Subject: [PATCH] x86: Do not set the rood_dev field in bzImage

[...]

Quoted 2 lines

I'm not familiar with the rdev command. I assume it allows one to manipulate the two rootdev bytes in a kernel image.

Yes.

arch/x86/boot/tools/build.c

Quoted 5 lines

Anyhow, shouldn't
the above patch be complemented with something like the following?

arch/x86/boot/tools/build.c +0 -0
index ee3a4ea..fdc60a0 100644

That makes sense. Will you send it as a proper patch or should I fold it into my patch?

Michal

Quoted 65 lines
arch/x86/boot/tools/build.c +4 -29
@@ -130,7 +130,7 @@ static void die(const char * str, ...)
 
  static void usage(void)
  {
-	die("Usage: build setup system [rootdev] [>  image]");
+	die("Usage: build setup system [>  image]");
  }
 
  int main(int argc, char ** argv)
@@ -138,39 +138,14 @@ int main(int argc, char ** argv)
  	unsigned int i, sz, setup_sectors;
  	int c;
  	u32 sys_size;
-	u8 major_root, minor_root;
  	struct stat sb;
  	FILE *file;
  	int fd;
  	void *kernel;
  	u32 crc = 0xffffffffUL;
 
-	if ((argc<  3) || (argc>  4))
+	if (argc != 3)
  		usage();
-	if (argc>  3) {
-		if (!strcmp(argv[3], "CURRENT")) {
-			if (stat("/",&sb)) {
-				perror("/");
-				die("Couldn't stat /");
-			}
-			major_root = major(sb.st_dev);
-			minor_root = minor(sb.st_dev);
-		} else if (strcmp(argv[3], "FLOPPY")) {
-			if (stat(argv[3],&sb)) {
-				perror(argv[3]);
-				die("Couldn't stat root device.");
-			}
-			major_root = major(sb.st_rdev);
-			minor_root = minor(sb.st_rdev);
-		} else {
-			major_root = 0;
-			minor_root = 0;
-		}
-	} else {
-		major_root = DEFAULT_MAJOR_ROOT;
-		minor_root = DEFAULT_MINOR_ROOT;
-	}
-	fprintf(stderr, "Root device is (%d, %d)\n", major_root, minor_root);
 
  	/* Copy the setup code */
  	file = fopen(argv[1], "r");
@@ -193,8 +168,8 @@ int main(int argc, char ** argv)
  	memset(buf+c, 0, i-c);
 
  	/* Set the default root device */
-	buf[508] = minor_root;
-	buf[509] = major_root;
+	buf[508] = DEFAULT_MINOR_ROOT;
+	buf[509] = DEFAULT_MAJOR_ROOT;
 
  	fprintf(stderr, "Setup is %d bytes (padded to %d bytes).\n", c, i);
 
#37 lore raw

Re: [PATCH 09/34] x86: Allow to override the ROOT_DEV variable

Quoted 2 lines · Michal Marek

That makes sense. Will you send it as a proper patch or should I fold it into my patch?

I suggest you fold it into your patch, so everything is cleaned up in a single commit.

Paul Bolle

#38 lore raw

PATCH v2 1/1 x86: Do not set the root_dev field in bzImage

In reply to Michal Marek

This has been obsoleted by the root= commandline for several years. People who still depend on this will surely have a copy of the rdev command around, the rest of the world gets rid of another piece of buildhost-dependent data in the build. Thanks to Paul Bolle for the build.c cleanup.

Cc Thomas Gleixner <[email protected]>
Cc Ingo Molnar <[email protected]>
Cc "H. Peter Anvin" <[email protected]>
Cc Paul Bolle <[email protected]>
arch/x86/boot/Makefile +1 -8
index f7cb086..95365a8 100644
@@ -9,12 +9,6 @@
 # Changed by many, many contributors over the years.
 #
 
-# ROOT_DEV specifies the default root-device when making the image.
-# This can be either FLOPPY, CURRENT, /dev/xxxx or empty, in which case
-# the default of FLOPPY is used by 'build'.
-
-ROOT_DEV	:= CURRENT
-
 # If you want to preset the SVGA mode, uncomment the next line and
 # set SVGA_MODE to whatever number you want.
 # Set it to -DSVGA_MODE=NORMAL_VGA if you just want the EGA/VGA mode.
@@ -75,8 +69,7 @@ GCOV_PROFILE := n
 $(obj)/bzImage: asflags-y  := $(SVGA_MODE)
 
 quiet_cmd_image = BUILD   $@
-cmd_image = $(obj)/tools/build $(obj)/setup.bin $(obj)/vmlinux.bin \
-	$(ROOT_DEV) > $@
+cmd_image = $(obj)/tools/build $(obj)/setup.bin $(obj)/vmlinux.bin > $@
 
 $(obj)/bzImage: $(obj)/setup.bin $(obj)/vmlinux.bin $(obj)/tools/build FORCE
 	$(call if_changed,image)
arch/x86/boot/tools/build.c +4 -29
index ee3a4ea..fdc60a0 100644
@@ -130,7 +130,7 @@ static void die(const char * str, ...)
 
 static void usage(void)
 {
-	die("Usage: build setup system [rootdev] [> image]");
+	die("Usage: build setup system [> image]");
 }
 
 int main(int argc, char ** argv)
@@ -138,39 +138,14 @@ int main(int argc, char ** argv)
 	unsigned int i, sz, setup_sectors;
 	int c;
 	u32 sys_size;
-	u8 major_root, minor_root;
 	struct stat sb;
 	FILE *file;
 	int fd;
 	void *kernel;
 	u32 crc = 0xffffffffUL;
 
-	if ((argc < 3) || (argc > 4))
+	if (argc != 3)
 		usage();
-	if (argc > 3) {
-		if (!strcmp(argv[3], "CURRENT")) {
-			if (stat("/", &sb)) {
-				perror("/");
-				die("Couldn't stat /");
-			}
-			major_root = major(sb.st_dev);
-			minor_root = minor(sb.st_dev);
-		} else if (strcmp(argv[3], "FLOPPY")) {
-			if (stat(argv[3], &sb)) {
-				perror(argv[3]);
-				die("Couldn't stat root device.");
-			}
-			major_root = major(sb.st_rdev);
-			minor_root = minor(sb.st_rdev);
-		} else {
-			major_root = 0;
-			minor_root = 0;
-		}
-	} else {
-		major_root = DEFAULT_MAJOR_ROOT;
-		minor_root = DEFAULT_MINOR_ROOT;
-	}
-	fprintf(stderr, "Root device is (%d, %d)\n", major_root, minor_root);
 
 	/* Copy the setup code */
 	file = fopen(argv[1], "r");
@@ -193,8 +168,8 @@ int main(int argc, char ** argv)
 	memset(buf+c, 0, i-c);
 
 	/* Set the default root device */
-	buf[508] = minor_root;
-	buf[509] = major_root;
+	buf[508] = DEFAULT_MINOR_ROOT;
+	buf[509] = DEFAULT_MAJOR_ROOT;
 
 	fprintf(stderr, "Setup is %d bytes (padded to %d bytes).\n", c, i);
 
#39 lore raw

Re: [PATCH v2] x86: Do not set the root_dev field in bzImage

Quoted 6 lines · Michal Marek

This has been obsoleted by the root= commandline for several years. People who still depend on this will surely have a copy of the rdev command around, the rest of the world gets rid of another piece of buildhost-dependent data in the build. Thanks to Paul Bolle for the build.c cleanup.

Quoted 6 lines
Cc Thomas Gleixner<[email protected]>
Cc Ingo Molnar<[email protected]>
Cc "H. Peter Anvin"<[email protected]>
Cc Paul Bolle<[email protected]>

Hi,

Is this patch OK for the tip tree?

Michal

Quoted 97 lines
arch/x86/boot/Makefile +1 -8
index f7cb086..95365a8 100644
@@ -9,12 +9,6 @@
  # Changed by many, many contributors over the years.
  #
 
-# ROOT_DEV specifies the default root-device when making the image.
-# This can be either FLOPPY, CURRENT, /dev/xxxx or empty, in which case
-# the default of FLOPPY is used by 'build'.
-
-ROOT_DEV	:= CURRENT
-
  # If you want to preset the SVGA mode, uncomment the next line and
  # set SVGA_MODE to whatever number you want.
  # Set it to -DSVGA_MODE=NORMAL_VGA if you just want the EGA/VGA mode.
@@ -75,8 +69,7 @@ GCOV_PROFILE := n
  $(obj)/bzImage: asflags-y  := $(SVGA_MODE)
 
  quiet_cmd_image = BUILD   $@
-cmd_image = $(obj)/tools/build $(obj)/setup.bin $(obj)/vmlinux.bin \
-	$(ROOT_DEV)>  $@
+cmd_image = $(obj)/tools/build $(obj)/setup.bin $(obj)/vmlinux.bin>  $@
 
  $(obj)/bzImage: $(obj)/setup.bin $(obj)/vmlinux.bin $(obj)/tools/build FORCE
  	$(call if_changed,image)
arch/x86/boot/tools/build.c +4 -30
index ee3a4ea..fdc60a0 100644
@@ -130,7 +130,7 @@ static void die(const char * str, ...)
 
  static void usage(void)
  {
-	die("Usage: build setup system [rootdev] [>  image]");
+	die("Usage: build setup system [>  image]");
  }
 
  int main(int argc, char ** argv)
@@ -138,39 +138,14 @@ int main(int argc, char ** argv)
  	unsigned int i, sz, setup_sectors;
  	int c;
  	u32 sys_size;
-	u8 major_root, minor_root;
  	struct stat sb;
  	FILE *file;
  	int fd;
  	void *kernel;
  	u32 crc = 0xffffffffUL;
 
-	if ((argc<  3) || (argc>  4))
+	if (argc != 3)
  		usage();
-	if (argc>  3) {
-		if (!strcmp(argv[3], "CURRENT")) {
-			if (stat("/",&sb)) {
-				perror("/");
-				die("Couldn't stat /");
-			}
-			major_root = major(sb.st_dev);
-			minor_root = minor(sb.st_dev);
-		} else if (strcmp(argv[3], "FLOPPY")) {
-			if (stat(argv[3],&sb)) {
-				perror(argv[3]);
-				die("Couldn't stat root device.");
-			}
-			major_root = major(sb.st_rdev);
-			minor_root = minor(sb.st_rdev);
-		} else {
-			major_root = 0;
-			minor_root = 0;
-		}
-	} else {
-		major_root = DEFAULT_MAJOR_ROOT;
-		minor_root = DEFAULT_MINOR_ROOT;
-	}
-	fprintf(stderr, "Root device is (%d, %d)\n", major_root, minor_root);
 
  	/* Copy the setup code */
  	file = fopen(argv[1], "r");
@@ -193,8 +168,8 @@ int main(int argc, char ** argv)
  	memset(buf+c, 0, i-c);
 
  	/* Set the default root device */
-	buf[508] = minor_root;
-	buf[509] = major_root;
+	buf[508] = DEFAULT_MINOR_ROOT;
+	buf[509] = DEFAULT_MAJOR_ROOT;
 
  	fprintf(stderr, "Setup is %d bytes (padded to %d bytes).\n", c, i);
 
--

To unsubscribe from this list: send the line "unsubscribe linux-kbuild" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

#40 lore raw

Re: [PATCH v2] x86: Do not set the root_dev field in bzImage

Dne 11.5.2011 17:22, Michal Marek napsal(a):

Quoted 14 lines · Michal Marek
Quoted 6 lines

This has been obsoleted by the root= commandline for several years. People who still depend on this will surely have a copy of the rdev command around, the rest of the world gets rid of another piece of buildhost-dependent data in the build. Thanks to Paul Bolle for the build.c cleanup.

Quoted 6 lines
Cc Thomas Gleixner<[email protected]>
Cc Ingo Molnar<[email protected]>
Cc "H. Peter Anvin"<[email protected]>
Cc Paul Bolle<[email protected]>
Quoted 3 lines

Hi,

Is this patch OK for the tip tree?

Hi,

I don't see the patch in today's linux-next. Can I get an Acked-by: to apply it to kbuild-2.6.git or can someone apply it to the tip tree? Thanks a lot.

Michal

#41 lore raw

[tip:x86/build] x86, build: Do not set the root_dev field in bzImage

In reply to Michal Marek
Commit-ID:  079f85e624189292d1c818b47764916bf8cf84a8
Gitweb:     http://git.kernel.org/tip/079f85e624189292d1c818b47764916bf8cf84a8
Author:     Michal Marek <[email protected]>
AuthorDate: Tue, 12 Apr 2011 13:30:24 +0200
Committer:  H. Peter Anvin <[email protected]>
CommitDate: Wed, 25 May 2011 12:46:05 -0700

x86, build: Do not set the root_dev field in bzImage

This has been obsoleted by the root= commandline and the rdev utility for many, many years. People who still depend on this will surely have a copy of the rdev utility around, the rest of the world gets rid of another piece of buildhost-dependent data in the build. Thanks to Paul Bolle for the build.c cleanup.

---
 arch/x86/boot/Makefile      |    9 +--------
 arch/x86/boot/tools/build.c |   33 ++++-----------------------------
 2 files changed, 5 insertions(+), 37 deletions(-)
arch/x86/boot/Makefile +1 -8
index f7cb086..95365a8 100644
@@ -9,12 +9,6 @@
 # Changed by many, many contributors over the years.
 #
 
-# ROOT_DEV specifies the default root-device when making the image.
-# This can be either FLOPPY, CURRENT, /dev/xxxx or empty, in which case
-# the default of FLOPPY is used by 'build'.
-
-ROOT_DEV	:= CURRENT
-
 # If you want to preset the SVGA mode, uncomment the next line and
 # set SVGA_MODE to whatever number you want.
 # Set it to -DSVGA_MODE=NORMAL_VGA if you just want the EGA/VGA mode.
@@ -75,8 +69,7 @@ GCOV_PROFILE := n
 $(obj)/bzImage: asflags-y  := $(SVGA_MODE)
 
 quiet_cmd_image = BUILD   $@
-cmd_image = $(obj)/tools/build $(obj)/setup.bin $(obj)/vmlinux.bin \
-	$(ROOT_DEV) > $@
+cmd_image = $(obj)/tools/build $(obj)/setup.bin $(obj)/vmlinux.bin > $@
 
 $(obj)/bzImage: $(obj)/setup.bin $(obj)/vmlinux.bin $(obj)/tools/build FORCE
 	$(call if_changed,image)
arch/x86/boot/tools/build.c +4 -29
index ee3a4ea..fdc60a0 100644
@@ -130,7 +130,7 @@ static void die(const char * str, ...)
 
 static void usage(void)
 {
-	die("Usage: build setup system [rootdev] [> image]");
+	die("Usage: build setup system [> image]");
 }
 
 int main(int argc, char ** argv)
@@ -138,39 +138,14 @@ int main(int argc, char ** argv)
 	unsigned int i, sz, setup_sectors;
 	int c;
 	u32 sys_size;
-	u8 major_root, minor_root;
 	struct stat sb;
 	FILE *file;
 	int fd;
 	void *kernel;
 	u32 crc = 0xffffffffUL;
 
-	if ((argc < 3) || (argc > 4))
+	if (argc != 3)
 		usage();
-	if (argc > 3) {
-		if (!strcmp(argv[3], "CURRENT")) {
-			if (stat("/", &sb)) {
-				perror("/");
-				die("Couldn't stat /");
-			}
-			major_root = major(sb.st_dev);
-			minor_root = minor(sb.st_dev);
-		} else if (strcmp(argv[3], "FLOPPY")) {
-			if (stat(argv[3], &sb)) {
-				perror(argv[3]);
-				die("Couldn't stat root device.");
-			}
-			major_root = major(sb.st_rdev);
-			minor_root = minor(sb.st_rdev);
-		} else {
-			major_root = 0;
-			minor_root = 0;
-		}
-	} else {
-		major_root = DEFAULT_MAJOR_ROOT;
-		minor_root = DEFAULT_MINOR_ROOT;
-	}
-	fprintf(stderr, "Root device is (%d, %d)\n", major_root, minor_root);
 
 	/* Copy the setup code */
 	file = fopen(argv[1], "r");
@@ -193,8 +168,8 @@ int main(int argc, char ** argv)
 	memset(buf+c, 0, i-c);
 
 	/* Set the default root device */
-	buf[508] = minor_root;
-	buf[509] = major_root;
+	buf[508] = DEFAULT_MINOR_ROOT;
+	buf[509] = DEFAULT_MAJOR_ROOT;
 
 	fprintf(stderr, "Setup is %d bytes (padded to %d bytes).\n", c, i);
 
#42 lore raw

PATCH 10/34 cyclades: Drop __TIME__ usage

In reply to Michal Marek

The kernel already prints its build timestamp during boot, no need to repeat it in random drivers and produce different object files each time.

Cc Greg Kroah-Hartman <[email protected]>
---
 drivers/char/cyclades.c |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)
drivers/char/cyclades.c +1 -2
index 4f152c2..a82ad97 100644
@@ -4099,8 +4099,7 @@ static int __init cy_init(void)
 	if (!cy_serial_driver)
 		goto err;
 
-	printk(KERN_INFO "Cyclades driver " CY_VERSION " (built %s %s)\n",
-			__DATE__, __TIME__);
+	printk(KERN_INFO "Cyclades driver " CY_VERSION "\n");
 
 	/* Initialize the tty_driver structure */
 
Signature · 1 line
1.7.4.1
#43 lore raw

PATCH 11/34 nozomi: Drop __TIME__ usage

In reply to Michal Marek

The kernel already prints its build timestamp during boot, no need to repeat it in random drivers and produce different object files each time.

Cc Greg Kroah-Hartman <[email protected]>
---
 drivers/char/nozomi.c |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)
drivers/char/nozomi.c +1 -2
index 294d03e..33f6e6a 100644
@@ -61,8 +61,7 @@
 #include <linux/delay.h>
 
 
-#define VERSION_STRING DRIVER_DESC " 2.1d (build date: " \
-					__DATE__ " " __TIME__ ")"
+#define VERSION_STRING DRIVER_DESC " 2.1d"
 
 /*    Macros definitions */
 
Signature · 1 line
1.7.4.1
#44 lore raw

Re: [PATCH 10/34] cyclades: Drop __TIME__ usage

Quoted 9 lines · Michal Marek

The kernel already prints its build timestamp during boot, no need to repeat it in random drivers and produce different object files each time.

Cc Greg Kroah-Hartman <[email protected]>
---
 drivers/char/cyclades.c |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)
Quoted 9 lines · Michal Marek

The kernel already prints its build timestamp during boot, no need to repeat it in random drivers and produce different object files each time.

Cc Greg Kroah-Hartman <[email protected]>
---
 drivers/char/nozomi.c |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)

Applied both to kbuild-2.6.git#trivial.

Michal

#45 lore raw

PATCH 12/34 isdn/diva: Drop __TIME__ usage

In reply to Michal Marek

The kernel already prints its build timestamp during boot, no need to repeat it in random drivers and produce different object files each time.

---
 drivers/isdn/hardware/eicon/divasfunc.c |    5 ++---
 1 files changed, 2 insertions(+), 3 deletions(-)
drivers/isdn/hardware/eicon/divasfunc.c +2 -3
index d36a4c0..0bbee78 100644
@@ -113,9 +113,8 @@ void diva_xdi_didd_remove_adapter(int card)
 static void start_dbg(void)
 {
 	DbgRegister("DIVAS", DRIVERRELEASE_DIVAS, (debugmask) ? debugmask : DBG_DEFAULT);
-	DBG_LOG(("DIVA ISDNXDI BUILD (%s[%s]-%s-%s)",
-		 DIVA_BUILD, diva_xdi_common_code_build, __DATE__,
-		 __TIME__))
+	DBG_LOG(("DIVA ISDNXDI BUILD (%s[%s])",
+		 DIVA_BUILD, diva_xdi_common_code_build))
 }
 
 /*
Signature · 1 line
1.7.4.1
#46 lore raw

Re: [PATCH 12/34] isdn/diva: Drop __TIME__ usage

Quoted 3 lines · Michal Marek

The kernel already prints its build timestamp during boot, no need to repeat it in random drivers and produce different object files each time.

The module can be build separately from the kernel, therefore it can have an own build timestamp.

Armin

Quoted 32 lines

---
drivers/isdn/hardware/eicon/divasfunc.c | 5 ++---

1 files changed, 2 insertions(+), 3 deletions(-)
drivers/isdn/hardware/eicon/divasfunc.c +2 -3
index d36a4c0..0bbee78 100644
@@ -113,9 +113,8 @@ void diva_xdi_didd_remove_adapter(int card)
 static void start_dbg(void)
 {
 	DbgRegister("DIVAS", DRIVERRELEASE_DIVAS, (debugmask) ? debugmask : DBG_DEFAULT);
-	DBG_LOG(("DIVA ISDNXDI BUILD (%s[%s]-%s-%s)",
-		 DIVA_BUILD, diva_xdi_common_code_build, __DATE__,
-		 __TIME__))
+	DBG_LOG(("DIVA ISDNXDI BUILD (%s[%s])",
+		 DIVA_BUILD, diva_xdi_common_code_build))
 }
 
 /*
Signature · 7 lines
1.7.4.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/
#47 lore raw

Re: [PATCH 12/34] isdn/diva: Drop __TIME__ usage

Quoted 7 lines · Armin Schindler
Quoted 3 lines · Michal Marek

The kernel already prints its build timestamp during boot, no need to repeat it in random drivers and produce different object files each time.

The module can be build separately from the kernel, therefore it can have an own build timestamp.

[...]

If you want to distribute an out-of-tree version, that's your own business. It shouldn't limit what is done with the in-tree version. Perhaps we could make modpost add a build timestamp to OOT modules, though.

Ben.

Signature · 3 lines
Ben Hutchings, Senior Software Engineer, Solarflare
Not speaking for my employer; that's the marketing department's job.
They asked us to note that Solarflare product names are trademarked.
#48 lore raw

Re: [PATCH 12/34] isdn/diva: Drop __TIME__ usage

Quoted 6 lines · Ben Hutchings
Quoted 5 lines · Armin Schindler
Quoted 3 lines · Michal Marek

The kernel already prints its build timestamp during boot, no need to repeat it in random drivers and produce different object files each time.

Quoted 8 lines
Quoted 2 lines

The module can be build separately from the kernel, therefore it can have an own build timestamp.

[...]

If you want to distribute an out-of-tree version, that's your own business. It shouldn't limit what is done with the in-tree version. Perhaps we could make modpost add a build timestamp to OOT modules, though.

I know out-of-tree stuff doesn't matter here. But I'm thinking about just doing 'make modules'.

Armin

#49 lore raw

Re: [PATCH 12/34] isdn/diva: Drop __TIME__ usage

Quoted 11 lines · Armin Schindler
Quoted 10 lines · Ben Hutchings
Quoted 7 lines · Armin Schindler
Quoted 3 lines · Michal Marek

The kernel already prints its build timestamp during boot, no need to repeat it in random drivers and produce different object files each time.

The module can be build separately from the kernel, therefore it can have an own build timestamp.

[...]

Quoted 7 lines
Quoted 4 lines

If you want to distribute an out-of-tree version, that's your own business. It shouldn't limit what is done with the in-tree version. Perhaps we could make modpost add a build timestamp to OOT modules, though.

I know out-of-tree stuff doesn't matter here. But I'm thinking about just doing 'make modules'.

If we needs this somehow a generic solution is required. Ad hoc solutions in some modules is not the way to go.

Sam

#50 lore raw

Re: [PATCH 12/34] isdn/diva: Drop __TIME__ usage

In reply to Armin Schindler
Quoted 7 lines · Armin Schindler
Quoted 3 lines · Michal Marek

The kernel already prints its build timestamp during boot, no need to repeat it in random drivers and produce different object files each time.

The module can be build separately from the kernel, therefore it can have an own build timestamp.

If the same code is being built as an out-of-tree module, that's a possibly good reason for a code version variable, but what does the build timestamp actually tell you? If you already know foo_driver.c version 0.814 was buiilt against 2.6.41-rc2, in what cases does it matter if the compile was on Tuesday or Thursday - especially since an 'ls -l foo_driver.ko' will tell you? If it's a matter of "the target .config changed on Wednesday", a build timestamp still doesn't help over 'ls -l'.

#51 lore raw

Re: [PATCH 12/34] isdn/diva: Drop __TIME__ usage

Quoted 9 lines · On 5.4.2011 21:17, [email protected] wrote:
Quoted 7 lines · Armin Schindler
Quoted 3 lines · Michal Marek

The kernel already prints its build timestamp during boot, no need to repeat it in random drivers and produce different object files each time.

The module can be build separately from the kernel, therefore it can have an own build timestamp.

Quoted 7 lines

If the same code is being built as an out-of-tree module, that's a possibly good reason for a code version variable, but what does the build timestamp actually tell you? If you already know foo_driver.c version 0.814 was buiilt against 2.6.41-rc2, in what cases does it matter if the compile was on Tuesday or Thursday - especially since an 'ls -l foo_driver.ko' will tell you? If it's a matter of "the target .config changed on Wednesday", a build timestamp still doesn't help over 'ls -l'.

Exactly. Build timestamps are only a poor substitute for proper version tracking. If you want to be able to reproduce the build of a binary, you want it to embed some source revision, not the date when you built it. For the kernel, you can use KBUILD_BUILD_TIMESTAMP=<source timestamp>, for out-of-tree modules, you need to come up with something own.

Michal

#52 lore raw

Re: [PATCH 12/34] isdn/diva: Drop __TIME__ usage

In reply to Armin Schindler

Dne 5.4.2011 17:10, Armin Schindler napsal(a):

Quoted 7 lines · Michal Marek
Quoted 3 lines

The kernel already prints its build timestamp during boot, no need to repeat it in random drivers and produce different object files each time.

The module can be build separately from the kernel, therefore it can have an own build timestamp.

So the module timestamp and kernel timestamp vary by a couple of minutes. But is it really a problem? I don't think so. So is there an objection against applying this patch?

thanks,
Michal

#53 lore raw

Re: [PATCH 12/34] isdn/diva: Drop __TIME__ usage

Quoted 11 lines · Michal Marek

Dne 5.4.2011 17:10, Armin Schindler napsal(a):

Quoted 7 lines · Michal Marek
Quoted 3 lines

The kernel already prints its build timestamp during boot, no need to repeat it in random drivers and produce different object files each time.

The module can be build separately from the kernel, therefore it can have an own build timestamp.

So the module timestamp and kernel timestamp vary by a couple of minutes. But is it really a problem?

It could be a lot more than minutes. But it isn't a problem. I just tried to keep the sources in sync with out-of-tree version.

Quoted 2 lines

I don't think so. So is there an
objection against applying this patch?

No objection. Please go ahead with the patch.

Thanks
Armin

#54 lore raw

Re: [PATCH 12/34] isdn/diva: Drop __TIME__ usage

Quoted 13 lines · Armin Schindler
Quoted 11 lines · Michal Marek

Dne 5.4.2011 17:10, Armin Schindler napsal(a):

Quoted 7 lines · Michal Marek
Quoted 3 lines

The kernel already prints its build timestamp during boot, no need to repeat it in random drivers and produce different object files each time.

The module can be build separately from the kernel, therefore it can have an own build timestamp.

So the module timestamp and kernel timestamp vary by a couple of minutes. But is it really a problem?

Quoted 7 lines

It could be a lot more than minutes. But it isn't a problem. I just tried to keep the sources in sync with out-of-tree version.

Quoted 2 lines

I don't think so. So is there an
objection against applying this patch?

No objection. Please go ahead with the patch.

OK, thanks. Applied to kbuild-2.6.git#trivial.

Michal

#55 lore raw

PATCH 13/34 media/radio-maxiradio: Drop __TIME__ usage

In reply to Michal Marek

The kernel already prints its build timestamp during boot, no need to repeat it in random drivers and produce different object files each time.

---
 drivers/media/radio/radio-maxiradio.c |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)
drivers/media/radio/radio-maxiradio.c +1 -2
index 5c2a905..e83e840 100644
@@ -412,8 +412,7 @@ static int __devinit maxiradio_init_one(struct pci_dev *pdev, const struct pci_d
 		goto err_out_free_region;
 	}
 
-	v4l2_info(v4l2_dev, "version " DRIVER_VERSION
-			" time " __TIME__ "  " __DATE__ "\n");
+	v4l2_info(v4l2_dev, "version " DRIVER_VERSION "\n");
 
 	v4l2_info(v4l2_dev, "found Guillemot MAXI Radio device (io = 0x%x)\n",
 	       dev->io);
Signature · 1 line
1.7.4.1
#56 lore raw

Re: [PATCH 13/34] media/radio-maxiradio: Drop __TIME__ usage

Quoted 10 lines · Michal Marek

The kernel already prints its build timestamp during boot, no need to repeat it in random drivers and produce different object files each time.

---
 drivers/media/radio/radio-maxiradio.c |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)

Applied to kbuild-2.6.git#trivial.

Michal

#57 lore raw

PATCH 14/34 media/cx231xx: Drop __TIME__ usage

In reply to Michal Marek

The kernel already prints its build timestamp during boot, no need to repeat it in random drivers and produce different object files each time.

---
 drivers/media/video/cx231xx/cx231xx-avcore.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/media/video/cx231xx/cx231xx-avcore.c +1 -1
index c53e972..ff5cb50 100644
@@ -1356,7 +1356,7 @@ void cx231xx_dump_SC_reg(struct cx231xx *dev)
 {
 	u8 value[4] = { 0, 0, 0, 0 };
 	int status = 0;
-	cx231xx_info("cx231xx_dump_SC_reg %s!\n", __TIME__);
+	cx231xx_info("cx231xx_dump_SC_reg!\n");
 
 	status = cx231xx_read_ctrl_reg(dev, VRT_GET_REGISTER, BOARD_CFG_STAT,
 				 value, 4);
Signature · 1 line
1.7.4.1
#58 lore raw

Re: [PATCH 14/34] media/cx231xx: Drop __TIME__ usage

Quoted 10 lines · Michal Marek

The kernel already prints its build timestamp during boot, no need to repeat it in random drivers and produce different object files each time.

---
 drivers/media/video/cx231xx/cx231xx-avcore.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

Applied to kbuild-2.6.git#trivial.

Michal

#59 lore raw

PATCH 15/34 baycom: Drop __TIME__ usage

In reply to Michal Marek

The kernel already prints its build timestamp during boot, no need to repeat it in random drivers and produce different object files each time.

---
 drivers/net/hamradio/baycom_epp.c     |    2 +-
 drivers/net/hamradio/baycom_par.c     |    2 +-
 drivers/net/hamradio/baycom_ser_fdx.c |    2 +-
 drivers/net/hamradio/baycom_ser_hdx.c |    2 +-
 4 files changed, 4 insertions(+), 4 deletions(-)
drivers/net/hamradio/baycom_epp.c +1 -1
index a3c0dc9..9537aaa 100644
@@ -69,7 +69,7 @@ static const char paranoia_str[] = KERN_ERR
 
 static const char bc_drvname[] = "baycom_epp";
 static const char bc_drvinfo[] = KERN_INFO "baycom_epp: (C) 1998-2000 Thomas Sailer, HB9JNX/AE4WA\n"
-"baycom_epp: version 0.7 compiled " __TIME__ " " __DATE__ "\n";
+"baycom_epp: version 0.7\n";
 
 /* --------------------------------------------------------------------- */
 
drivers/net/hamradio/baycom_par.c +1 -1
index 5f5af9a..279d229 100644
@@ -102,7 +102,7 @@
 
 static const char bc_drvname[] = "baycom_par";
 static const char bc_drvinfo[] = KERN_INFO "baycom_par: (C) 1996-2000 Thomas Sailer, HB9JNX/AE4WA\n"
-"baycom_par: version 0.9 compiled " __TIME__ " " __DATE__ "\n";
+"baycom_par: version 0.9\n";
 
 /* --------------------------------------------------------------------- */
 
drivers/net/hamradio/baycom_ser_fdx.c +1 -1
index 3e25f10..99cdce3 100644
@@ -92,7 +92,7 @@
 
 static const char bc_drvname[] = "baycom_ser_fdx";
 static const char bc_drvinfo[] = KERN_INFO "baycom_ser_fdx: (C) 1996-2000 Thomas Sailer, HB9JNX/AE4WA\n"
-"baycom_ser_fdx: version 0.10 compiled " __TIME__ " " __DATE__ "\n";
+"baycom_ser_fdx: version 0.10\n";
 
 /* --------------------------------------------------------------------- */
 
drivers/net/hamradio/baycom_ser_hdx.c +1 -1
index 1686f6d..d92fe6c 100644
@@ -80,7 +80,7 @@
 
 static const char bc_drvname[] = "baycom_ser_hdx";
 static const char bc_drvinfo[] = KERN_INFO "baycom_ser_hdx: (C) 1996-2000 Thomas Sailer, HB9JNX/AE4WA\n"
-"baycom_ser_hdx: version 0.10 compiled " __TIME__ " " __DATE__ "\n";
+"baycom_ser_hdx: version 0.10\n";
 
 /* --------------------------------------------------------------------- */
 
Signature · 1 line
1.7.4.1

A message that is not in the archive (sent off-list or not yet received): [email protected]

#61 lore raw

Re: [PATCH 15/34] baycom: Drop __TIME__ usage

Quoted 10 lines · Thomas Sailer
Quoted 8 lines · Michal Marek

The kernel already prints its build timestamp during boot, no need to repeat it in random drivers and produce different object files each time.

I didn't found the commit in today's linux-next, so I applied this to kbuild-2.6.git#trivial.

Michal

#62 lore raw

PATCH 16/34 nand/denali: Drop __TIME__ usage

In reply to Michal Marek

The kernel already prints its build timestamp during boot, no need to repeat it in random drivers and produce different object files each time.

Cc Chuanxiao Dong <[email protected]>
Cc David Woodhouse <[email protected]>
---
 drivers/mtd/nand/denali.c |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)
drivers/mtd/nand/denali.c +1 -2
index 8c8d3c8..7a3cf8c 100644
@@ -1721,8 +1721,7 @@ static struct pci_driver denali_pci_driver = {
 
 static int __devinit denali_init(void)
 {
-	printk(KERN_INFO "Spectra MTD driver built on %s @ %s\n",
-			__DATE__, __TIME__);
+	printk(KERN_INFO "Spectra MTD driver\n");
 	return pci_register_driver(&denali_pci_driver);
 }
 
Signature · 1 line
1.7.4.1
Acked-by on v1 16/34
#63 lore raw

Re: [PATCH 16/34] nand/denali: Drop __TIME__ usage

Quoted 8 lines · Michal Marek

The kernel already prints its build timestamp during boot, no need to repeat it in random drivers and produce different object files each time.

Cc Chuanxiao Dong <[email protected]>
Cc David Woodhouse <[email protected]>

Do you want this to got via the MTD tree or you'd rather merge it with the rest of the patches via some other tree? In any case,

Signature · 2 lines
Best Regards,
Artem Bityutskiy (Артём Битюцкий)
#64 lore raw

Re: [PATCH 16/34] nand/denali: Drop __TIME__ usage

Quoted 5 lines · Artem Bityutskiy
Quoted 4 lines · Michal Marek

The kernel already prints its build timestamp during boot, no need to repeat it in random drivers and produce different object files each time.

Quoted 7 lines
Quoted 4 lines
Cc Chuanxiao Dong <[email protected]>
Cc David Woodhouse <[email protected]>

Do you want this to got via the MTD tree or you'd rather merge it with the rest of the patches via some other tree? In any case,

The patches do not depend on each other, so they should go via the usual trees.

Quoted 1 line

Thanks.
Michal

#65 lore raw

Re: [PATCH 16/34] nand/denali: Drop __TIME__ usage

In reply to Michal Marek
Quoted 11 lines · Michal Marek

The kernel already prints its build timestamp during boot, no need to repeat it in random drivers and produce different object files each time.

Cc Chuanxiao Dong <[email protected]>
Cc David Woodhouse <[email protected]>
---
 drivers/mtd/nand/denali.c |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)

Pushed to l2-mtd-2.6.git, thanks.

Signature · 2 lines
Best Regards,
Artem Bityutskiy (Артём Битюцкий)
#66 lore raw

PATCH 17/34 hdlcdrv: Drop __TIME__ usage

In reply to Michal Marek

The kernel already prints its build timestamp during boot, no need to repeat it in random drivers and produce different object files each time.

---
 drivers/net/hamradio/hdlcdrv.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/net/hamradio/hdlcdrv.c +1 -1
index 5b37579..a4a3516 100644
@@ -749,7 +749,7 @@ EXPORT_SYMBOL(hdlcdrv_unregister);
 static int __init hdlcdrv_init_driver(void)
 {
 	printk(KERN_INFO "hdlcdrv: (C) 1996-2000 Thomas Sailer HB9JNX/AE4WA\n");
-	printk(KERN_INFO "hdlcdrv: version 0.8 compiled " __TIME__ " " __DATE__ "\n");
+	printk(KERN_INFO "hdlcdrv: version 0.8\n");
 	return 0;
 }
 
Signature · 1 line
1.7.4.1
#67 lore raw

Re: [PATCH 17/34] hdlcdrv: Drop __TIME__ usage

Am 05.04.2011 16:59, schrieb Michal Marek:

Quoted 17 lines

The kernel already prints its build timestamp during boot, no need to repeat it in random drivers and produce different object files each time.

---
 drivers/net/hamradio/hdlcdrv.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/net/hamradio/hdlcdrv.c +0 -0
index 5b37579..a4a3516 100644

drivers/net/hamradio/hdlcdrv.c EXPORT_SYMBOL(hdlcdrv_unregister); · line 755

Quoted 8 lines
drivers/net/hamradio/hdlcdrv.c +1 -1
@@ -749,7 +749,7 @@ EXPORT_SYMBOL(hdlcdrv_unregister);
 static int __init hdlcdrv_init_driver(void)
 {
 	printk(KERN_INFO "hdlcdrv: (C) 1996-2000 Thomas Sailer HB9JNX/AE4WA\n");
-	printk(KERN_INFO "hdlcdrv: version 0.8 compiled " __TIME__ " " __DATE__ "\n");
+	printk(KERN_INFO "hdlcdrv: version 0.8\n");
 	return 0;
 }
 

Its a bit late but i am not a big fan of hard coded version id's. Does GIT provide something like that ? If not
IMHO the line
printk(KERN_INFO "hdlcdrv: version 0.8\n");
can be removed.

re,
wh

#68 lore raw

Re: [PATCH 17/34] hdlcdrv: Drop __TIME__ usage

Quoted 10 lines · walter harms

Am 05.04.2011 16:59, schrieb Michal Marek:

Quoted 9 lines
drivers/net/hamradio/hdlcdrv.c +1 -1
@@ -749,7 +749,7 @@ EXPORT_SYMBOL(hdlcdrv_unregister);
 static int __init hdlcdrv_init_driver(void)
 {
 	printk(KERN_INFO "hdlcdrv: (C) 1996-2000 Thomas Sailer HB9JNX/AE4WA\n");
-	printk(KERN_INFO "hdlcdrv: version 0.8 compiled " __TIME__ " " __DATE__ "\n");
+	printk(KERN_INFO "hdlcdrv: version 0.8\n");
 	return 0;
Quoted 8 lines

drivers/net/hamradio/hdlcdrv.c EXPORT_SYMBOL(hdlcdrv_unregister); · line 755

Quoted 2 lines
drivers/net/hamradio/hdlcdrv.c +0 -0
 }
 

Its a bit late but i am not a big fan of hard coded version id's. Does GIT provide something like that ? If not
IMHO the line
printk(KERN_INFO "hdlcdrv: version 0.8\n");
can be removed.

OK, submit a separate patch then. I personally don't care about version id's, as long as they do not embed any timestamp ;-).

Michal

A message that is not in the archive (sent off-list or not yet received): [email protected]

#70 lore raw

Re: [PATCH 17/34] hdlcdrv: Drop __TIME__ usage

Quoted 5 lines · Thomas Sailer
Quoted 4 lines · Michal Marek

The kernel already prints its build timestamp during boot, no need to repeat it in random drivers and produce different object files each time.

Quoted 7 lines
Quoted 4 lines

Ok with me

I didn't find the commit in today's linux-next, so I applied this to kbuild-2.6.git#trivial.

Michal

#71 lore raw

PATCH 18/34 wan/pc300: Drop __TIME__ usage

In reply to Michal Marek

The kernel already prints its build timestamp during boot, no need to repeat it in random drivers and produce different object files each time.

---
 drivers/net/wan/pc300_drv.c |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)
drivers/net/wan/pc300_drv.c +1 -2
index f875cfa..80ae503 100644
@@ -3242,8 +3242,7 @@ static inline void show_version(void)
 	rcsdate++;
 	tmp = strrchr(rcsdate, ' ');
 	*tmp = '\0';
-	printk(KERN_INFO "Cyclades-PC300 driver %s %s (built %s %s)\n", 
-		rcsvers, rcsdate, __DATE__, __TIME__);
+	printk(KERN_INFO "Cyclades-PC300 driver %s %s\n", rcsvers, rcsdate);
 }				/* show_version */
 
 static const struct net_device_ops cpc_netdev_ops = {
Signature · 1 line
1.7.4.1
#72 lore raw

Re: [PATCH 18/34] wan/pc300: Drop __TIME__ usage

Dne 5.4.2011 16:59, Michal Marek napsal(a):

Quoted 10 lines

The kernel already prints its build timestamp during boot, no need to repeat it in random drivers and produce different object files each time.

---
 drivers/net/wan/pc300_drv.c |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)

I don't see the patch in today's linux-next. Does anyone object against me applying it to kbuild-2.6.git?

Thanks,
Michal

Quoted 14 lines
drivers/net/wan/pc300_drv.c +1 -2
index f875cfa..80ae503 100644
@@ -3242,8 +3242,7 @@ static inline void show_version(void)
 	rcsdate++;
 	tmp = strrchr(rcsdate, ' ');
 	*tmp = '\0';
-	printk(KERN_INFO "Cyclades-PC300 driver %s %s (built %s %s)\n", 
-		rcsvers, rcsdate, __DATE__, __TIME__);
+	printk(KERN_INFO "Cyclades-PC300 driver %s %s\n", rcsvers, rcsdate);
 }				/* show_version */
 
 static const struct net_device_ops cpc_netdev_ops = {
maintainer Acked-by
#73 lore raw

Re: [PATCH 18/34] wan/pc300: Drop __TIME__ usage

From: Michal Marek <[email protected]>
Date: Wed, 25 May 2011 22:43:09 +0200

Quoted 12 lines

Dne 5.4.2011 16:59, Michal Marek napsal(a):

Quoted 10 lines

The kernel already prints its build timestamp during boot, no need to repeat it in random drivers and produce different object files each time.

---
 drivers/net/wan/pc300_drv.c |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)
Quoted 2 lines

I don't see the patch in today's linux-next. Does anyone object against me applying it to kbuild-2.6.git?

Just do it :-)

#74 lore raw

PATCH 19/34 rt2x00: Drop __TIME__ usage

In reply to Michal Marek

The kernel already prints its build timestamp during boot, no need to repeat it in random drivers and produce different object files each time.

---
 drivers/net/wireless/rt2x00/rt2x00debug.c |    1 -
 1 files changed, 0 insertions(+), 1 deletions(-)
drivers/net/wireless/rt2x00/rt2x00debug.c +0 -1
index c92db32..66166ef 100644
@@ -568,7 +568,6 @@ static struct dentry *rt2x00debug_create_file_driver(const char *name,
 	blob->data = data;
 	data += sprintf(data, "driver:\t%s\n", intf->rt2x00dev->ops->name);
 	data += sprintf(data, "version:\t%s\n", DRV_VERSION);
-	data += sprintf(data, "compiled:\t%s %s\n", __DATE__, __TIME__);
 	blob->size = strlen(blob->data);
 
 	return debugfs_create_blob(name, S_IRUSR, intf->driver_folder, blob);
Signature · 1 line
1.7.4.1
Acked-by on v1 19/34
#75 lore raw

Re: [PATCH 19/34] rt2x00: Drop __TIME__ usage

Quoted 9 lines · Michal Marek

The kernel already prints its build timestamp during boot, no need to repeat it in random drivers and produce different object files each time.

Note that this timestamp is not in the kernel log, but in a special debug file in debugfs.
However, I cannot see how a timestamp is actually useful for debugging the driver, so

Quoted 20 lines

---
 drivers/net/wireless/rt2x00/rt2x00debug.c |    1 -

 1 files changed, 0 insertions(+), 1 deletions(-)
drivers/net/wireless/rt2x00/rt2x00debug.c +0 -2
index c92db32..66166ef 100644
@@ -568,7 +568,6 @@ static struct dentry *rt2x00debug_create_file_driver(const char *name,
        blob->data = data;
        data += sprintf(data, "driver:\t%s\n", intf->rt2x00dev->ops->name);
        data += sprintf(data, "version:\t%s\n", DRV_VERSION);
-       data += sprintf(data, "compiled:\t%s %s\n", __DATE__, __TIME__);
        blob->size = strlen(blob->data);
 
        return debugfs_create_blob(name, S_IRUSR, intf->driver_folder, blob);
--

1.7.4.1

Signature · 2 lines
---
Gertjan
Acked-by on v1 19/34
#76 lore raw

Re: [PATCH 19/34] rt2x00: Drop __TIME__ usage

In reply to Michal Marek
Quoted 9 lines · Michal Marek

The kernel already prints its build timestamp during boot, no need to repeat it in random drivers and produce different object files each time.

Quoted 17 lines

---
 drivers/net/wireless/rt2x00/rt2x00debug.c |    1 -

 1 files changed, 0 insertions(+), 1 deletions(-)
drivers/net/wireless/rt2x00/rt2x00debug.c +0 -2
index c92db32..66166ef 100644
@@ -568,7 +568,6 @@ static struct dentry *rt2x00debug_create_file_driver(const char *name,
        blob->data = data;
        data += sprintf(data, "driver:\t%s\n", intf->rt2x00dev->ops->name);
        data += sprintf(data, "version:\t%s\n", DRV_VERSION);
-       data += sprintf(data, "compiled:\t%s %s\n", __DATE__, __TIME__);
        blob->size = strlen(blob->data);
 
        return debugfs_create_blob(name, S_IRUSR, intf->driver_folder, blob);
--
Quoted 3 lines

1.7.4.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kbuild" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

#77 lore raw

PATCH 20/34 parport: Drop __TIME__ usage

In reply to Michal Marek

The kernel already prints its build timestamp during boot, no need to repeat it in random drivers and produce different object files each time.

Cc Arnaud Giersch <[email protected]>
---
 drivers/parport/parport_ip32.c |    1 -
 1 files changed, 0 insertions(+), 1 deletions(-)
drivers/parport/parport_ip32.c +0 -1
index d3d7809..0dc34f1 100644
@@ -2203,7 +2203,6 @@ static __exit void parport_ip32_unregister_port(struct parport *p)
 static int __init parport_ip32_init(void)
 {
 	pr_info(PPIP32 "SGI IP32 built-in parallel port driver v0.6\n");
-	pr_debug1(PPIP32 "Compiled on %s, %s\n", __DATE__, __TIME__);
 	this_port = parport_ip32_probe_port();
 	return IS_ERR(this_port) ? PTR_ERR(this_port) : 0;
 }
Signature · 1 line
1.7.4.1
Acked-by on v1 20/34
#78 lore raw

Re: [PATCH 20/34] parport: Drop __TIME__ usage

Mardi 05 avril 2011, vers 16:59:07 (+0200), Michal Marek a écrit :

Quoted 9 lines

The kernel already prints its build timestamp during boot, no need to repeat it in random drivers and produce different object files each time.

Cc Arnaud Giersch <[email protected]>
---
 drivers/parport/parport_ip32.c |    1 -
 1 files changed, 0 insertions(+), 1 deletions(-)

I do not use this module anymore, but anyway...

Arnaud

#79 lore raw

Re: [PATCH 20/34] parport: Drop __TIME__ usage

Dne 5.4.2011 22:00, Arnaud Giersch napsal(a):

Quoted 12 lines
Quoted 9 lines · Michal Marek

The kernel already prints its build timestamp during boot, no need to repeat it in random drivers and produce different object files each time.

Cc Arnaud Giersch <[email protected]>
---
 drivers/parport/parport_ip32.c |    1 -
 1 files changed, 0 insertions(+), 1 deletions(-)
Quoted 3 lines

I do not use this module anymore, but anyway...

Applied to kbuild-2.6.git#trivial

Michal

#80 lore raw

PATCH 21/34 aacraid: Drop __TIME__ usage

In reply to Michal Marek

The kernel already prints its build timestamp during boot, no need to repeat it in random drivers and produce different object files each time.

Cc Adaptec OEM Raid Solutions <[email protected]>
---
 drivers/scsi/aacraid/linit.c |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)
drivers/scsi/aacraid/linit.c +1 -2
index 2c93d94..7babcbb 100644
@@ -58,7 +58,6 @@
 #ifndef AAC_DRIVER_BRANCH
 #define AAC_DRIVER_BRANCH		""
 #endif
-#define AAC_DRIVER_BUILD_DATE		__DATE__ " " __TIME__
 #define AAC_DRIVERNAME			"aacraid"
 
 #ifdef AAC_DRIVER_BUILD
@@ -66,7 +65,7 @@
 #define str(x) _str(x)
 #define AAC_DRIVER_FULL_VERSION	AAC_DRIVER_VERSION "[" str(AAC_DRIVER_BUILD) "]" AAC_DRIVER_BRANCH
 #else
-#define AAC_DRIVER_FULL_VERSION	AAC_DRIVER_VERSION AAC_DRIVER_BRANCH " " AAC_DRIVER_BUILD_DATE
+#define AAC_DRIVER_FULL_VERSION	AAC_DRIVER_VERSION AAC_DRIVER_BRANCH
 #endif
 
 MODULE_AUTHOR("Red Hat Inc and Adaptec");
Signature · 1 line
1.7.4.1
#81 lore raw

Re: [PATCH 21/34] aacraid: Drop __TIME__ usage

Quoted 10 lines · Michal Marek

The kernel already prints its build timestamp during boot, no need to repeat it in random drivers and produce different object files each time.

Cc Adaptec OEM Raid Solutions <[email protected]>
---
 drivers/scsi/aacraid/linit.c |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)

Applied to kbuild-2.6.git#trivial.

Michal

#82 lore raw

PATCH 22/34 scsi/in2000: Drop __TIME__ usage

In reply to Michal Marek

The kernel already prints its build timestamp during boot, no need to repeat it in random drivers and produce different object files each time.

---
 drivers/scsi/in2000.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/scsi/in2000.c +1 -1
index 6568aab..6096d93 100644
@@ -2228,7 +2228,7 @@ static int in2000_proc_info(struct Scsi_Host *instance, char *buf, char **start,
 	bp = buf;
 	*bp = '\0';
 	if (hd->proc & PR_VERSION) {
-		sprintf(tbuf, "\nVersion %s - %s. Compiled %s %s", IN2000_VERSION, IN2000_DATE, __DATE__, __TIME__);
+		sprintf(tbuf, "\nVersion %s - %s.", IN2000_VERSION, IN2000_DATE);
 		strcat(bp, tbuf);
 	}
 	if (hd->proc & PR_INFO) {
Signature · 1 line
1.7.4.1
#83 lore raw

Re: [PATCH 22/34] scsi/in2000: Drop __TIME__ usage

Quoted 10 lines · Michal Marek

The kernel already prints its build timestamp during boot, no need to repeat it in random drivers and produce different object files each time.

---
 drivers/scsi/in2000.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

Applied to kbuild-2.6.git#trivial.

Michal

#84 lore raw

PATCH 23/34 scsi/wd33c93: Drop __TIME__ usage

In reply to Michal Marek

The kernel already prints its build timestamp during boot, no need to repeat it in random drivers and produce different object files each time.

---
 drivers/scsi/wd33c93.c |    7 +++----
 1 files changed, 3 insertions(+), 4 deletions(-)
drivers/scsi/wd33c93.c +3 -4
index 5f697e0..6c983a2 100644
@@ -2052,8 +2052,7 @@ wd33c93_init(struct Scsi_Host *instance, const wd33c93_regs regs,
 	for (i = 0; i < MAX_SETUP_ARGS; i++)
 		printk("%s,", setup_args[i]);
 	printk("\n");
-	printk("           Version %s - %s, Compiled %s at %s\n",
-	       WD33C93_VERSION, WD33C93_DATE, __DATE__, __TIME__);
+	printk("           Version %s - %s\n", WD33C93_VERSION, WD33C93_DATE);
 }
 
 int
@@ -2133,8 +2132,8 @@ wd33c93_proc_info(struct Scsi_Host *instance, char *buf, char **start, off_t off
 	bp = buf;
 	*bp = '\0';
 	if (hd->proc & PR_VERSION) {
-		sprintf(tbuf, "\nVersion %s - %s. Compiled %s %s",
-			WD33C93_VERSION, WD33C93_DATE, __DATE__, __TIME__);
+		sprintf(tbuf, "\nVersion %s - %s.",
+			WD33C93_VERSION, WD33C93_DATE);
 		strcat(bp, tbuf);
 	}
 	if (hd->proc & PR_INFO) {
Signature · 1 line
1.7.4.1
#85 lore raw

Re: [PATCH 23/34] scsi/wd33c93: Drop __TIME__ usage

Quoted 10 lines · Michal Marek

The kernel already prints its build timestamp during boot, no need to repeat it in random drivers and produce different object files each time.

---
 drivers/scsi/wd33c93.c |    7 +++----
 1 files changed, 3 insertions(+), 4 deletions(-)

Applied to kbuild-2.6.git#trivial.

Michal

#86 lore raw

PATCH 24/34 usb/u132-hcd: Drop __TIME__ usage

In reply to Michal Marek

The kernel already prints its build timestamp during boot, no need to repeat it in random drivers and produce different object files each time.

---
 drivers/usb/host/u132-hcd.c |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)
drivers/usb/host/u132-hcd.c +1 -2
index fab7649..dc6dd22 100644
@@ -3229,8 +3229,7 @@ static int __init u132_hcd_init(void)
 	mutex_init(&u132_module_lock);
 	if (usb_disabled())
 		return -ENODEV;
-	printk(KERN_INFO "driver %s built at %s on %s\n", hcd_name, __TIME__,
-		__DATE__);
+	printk(KERN_INFO "driver %s\n", hcd_name);
 	workqueue = create_singlethread_workqueue("u132");
 	retval = platform_driver_register(&u132_platform_driver);
 	return retval;
Signature · 1 line
1.7.4.1
#87 lore raw

PATCH 25/34 usb/ftdi-elan: Drop __TIME__ usage

In reply to Michal Marek

The kernel already prints its build timestamp during boot, no need to repeat it in random drivers and produce different object files each time.

---
 drivers/usb/misc/ftdi-elan.c |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)
drivers/usb/misc/ftdi-elan.c +1 -2
index 7839c98..b16bd3c 100644
@@ -2889,8 +2889,7 @@ static struct usb_driver ftdi_elan_driver = {
 static int __init ftdi_elan_init(void)
 {
         int result;
-        printk(KERN_INFO "driver %s built at %s on %s\n", ftdi_elan_driver.name,
-	       __TIME__, __DATE__);
+        printk(KERN_INFO "driver %s\n", ftdi_elan_driver.name);
         mutex_init(&ftdi_module_lock);
         INIT_LIST_HEAD(&ftdi_static_list);
         status_queue = create_singlethread_workqueue("ftdi-status-control");
Signature · 1 line
1.7.4.1
#88 lore raw

Re: [PATCH 25/34] usb/ftdi-elan: Drop __TIME__ usage

Quoted 3 lines · Michal Marek

The kernel already prints its build timestamp during boot, no need to repeat it in random drivers and produce different object files each time.

What about drivers built as modules, which may be compiled at a different time than the rest of the kernel?

Matt

Signature · 6 lines
Matthew Dharm                              Home: [email protected] 
Maintainer, Linux USB Mass Storage Driver

Why am I talking to a toilet brush?
					-- CEO
User Friendly, 4/30/1998
#89 lore raw

Re: [PATCH 25/34] usb/ftdi-elan: Drop __TIME__ usage

Quoted 7 lines · Matthew Dharm
Quoted 3 lines · Michal Marek

The kernel already prints its build timestamp during boot, no need to repeat it in random drivers and produce different object files each time.

What about drivers built as modules, which may be compiled at a different time than the rest of the kernel?

We don't care :)

thanks,

greg k-h

#90 lore raw

PATCH 26/34 dlm: Drop __TIME__ usage

In reply to Michal Marek

The kernel already prints its build timestamp during boot, no need to repeat it in random drivers and produce different object files each time.

Cc Christine Caulfield <[email protected]>
Cc David Teigland <[email protected]>
---
 fs/dlm/main.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
fs/dlm/main.c +1 -1
index b80e0aa..5a59efa 100644
@@ -50,7 +50,7 @@ static int __init init_dlm(void)
 	if (error)
 		goto out_netlink;
 
-	printk("DLM (built %s %s) installed\n", __DATE__, __TIME__);
+	printk("DLM installed\n");
 
 	return 0;
 
Signature · 1 line
1.7.4.1
#91 lore raw

Re: [PATCH 26/34] dlm: Drop __TIME__ usage

Dne 5.4.2011 16:59, Michal Marek napsal(a):

Quoted 11 lines

The kernel already prints its build timestamp during boot, no need to repeat it in random drivers and produce different object files each time.

Cc Christine Caulfield <[email protected]>
Cc David Teigland <[email protected]>
---
 fs/dlm/main.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

Hi,

I don't see this patch in today's linux-next. Any objection against me applying it to the kbuild-2.6.git repository?

Thanks,
Michal

Quoted 14 lines
fs/dlm/main.c +1 -1
index b80e0aa..5a59efa 100644
@@ -50,7 +50,7 @@ static int __init init_dlm(void)
 	if (error)
 		goto out_netlink;
 
-	printk("DLM (built %s %s) installed\n", __DATE__, __TIME__);
+	printk("DLM installed\n");
 
 	return 0;
 
maintainer
#92 lore raw

Re: [PATCH 26/34] dlm: Drop __TIME__ usage

Quoted 13 lines · Michal Marek

Dne 5.4.2011 16:59, Michal Marek napsal(a):

Quoted 11 lines

The kernel already prints its build timestamp during boot, no need to repeat it in random drivers and produce different object files each time.

Cc Christine Caulfield <[email protected]>
Cc David Teigland <[email protected]>
Cc cluster-devel at redhat.com
---
 fs/dlm/main.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
Quoted 4 lines

Hi,

I don't see this patch in today's linux-next. Any objection against me applying it to the kbuild-2.6.git repository?

No, please do.
Thanks,
Dave

#93 lore raw

PATCH 27/34 gfs2: Drop __TIME__ usage

In reply to Michal Marek

The kernel already prints its build timestamp during boot, no need to repeat it in random drivers and produce different object files each time.

---
 fs/gfs2/main.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
fs/gfs2/main.c +1 -1
index 72c31a3..07d057b 100644
@@ -143,7 +143,7 @@ static int __init init_gfs2_fs(void)
 
 	gfs2_register_debugfs();
 
-	printk("GFS2 (built %s %s) installed\n", __DATE__, __TIME__);
+	printk("GFS2 installed\n");
 
 	return 0;
 
Signature · 1 line
1.7.4.1
#94 lore raw

Re: [PATCH 27/34] gfs2: Drop __TIME__ usage

Dne 5.4.2011 16:59, Michal Marek napsal(a):

Quoted 10 lines

The kernel already prints its build timestamp during boot, no need to repeat it in random drivers and produce different object files each time.

---
 fs/gfs2/main.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

Hi,

I don't see this patch in today's linux-next. Any objection against me applying it to the kbuild-2.6.git repository?

Thanks,
Michal

Quoted 13 lines
fs/gfs2/main.c +1 -1
index 72c31a3..07d057b 100644
@@ -143,7 +143,7 @@ static int __init init_gfs2_fs(void)
 
 	gfs2_register_debugfs();
 
-	printk("GFS2 (built %s %s) installed\n", __DATE__, __TIME__);
+	printk("GFS2 installed\n");
 
 	return 0;
 
#95 lore raw

Re: [PATCH 27/34] gfs2: Drop __TIME__ usage

Hi,

Quoted 12 lines · Michal Marek

Dne 5.4.2011 16:59, Michal Marek napsal(a):

Quoted 10 lines

The kernel already prints its build timestamp during boot, no need to repeat it in random drivers and produce different object files each time.

---
 fs/gfs2/main.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
Quoted 8 lines

Hi,

I don't see this patch in today's linux-next. Any objection against me applying it to the kbuild-2.6.git repository?

Thanks,
Michal

No, I think that should be ok. It was added as a method to spot when someone had compiled their own module against a distro kernel, but tbh this isn't a problem in practice, so I don't think it will be a problem,

Steve.

#96 lore raw

Re: [PATCH 27/34] gfs2: Drop __TIME__ usage

Quoted 6 lines · Steven Whitehouse
Quoted 3 lines

I don't see this patch in today's linux-next. Any objection against me applying it to the kbuild-2.6.git repository?

No, I think that should be ok. It was added as a method to spot when someone had compiled their own module against a distro kernel, but tbh this isn't a problem in practice, so I don't think it will be a problem,

OK, thanks. Applied to kbuild-2.6.git#trivial.

Michal

#97 lore raw

PATCH 28/34 atm: Drop __TIME__ usage

In reply to Michal Marek

The kernel already prints its build timestamp during boot, no need to repeat it in random drivers and produce different object files each time.

---
 net/atm/lec.c |    2 +-
 net/atm/mpc.c |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
net/atm/lec.c +1 -1
index 38754fd..cb14ddf 100644
@@ -1173,7 +1173,7 @@ static int __init lane_module_init(void)
 #endif
 
 	register_atm_ioctl(&lane_ioctl_ops);
-	pr_info("lec.c: " __DATE__ " " __TIME__ " initialized\n");
+	pr_info("lec.c: initialized\n");
 	return 0;
 }
 
net/atm/mpc.c +1 -1
index 644cdf0..3ccca42 100644
@@ -1482,7 +1482,7 @@ static __init int atm_mpoa_init(void)
 	if (mpc_proc_init() != 0)
 		pr_info("failed to initialize /proc/mpoa\n");
 
-	pr_info("mpc.c: " __DATE__ " " __TIME__ " initialized\n");
+	pr_info("mpc.c: initialized\n");
 
 	return 0;
 }
Signature · 1 line
1.7.4.1
#98 lore raw

Re: [PATCH 28/34] atm: Drop __TIME__ usage

Dne 5.4.2011 16:59, Michal Marek napsal(a):

Quoted 11 lines

The kernel already prints its build timestamp during boot, no need to repeat it in random drivers and produce different object files each time.

---
 net/atm/lec.c |    2 +-
 net/atm/mpc.c |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

Hi,

I don't see this patch in today's linux-next. Any objection against me applying it to the kbuild-2.6.git repository?

Thanks,
Michal

Quoted 26 lines
net/atm/lec.c +1 -1
index 38754fd..cb14ddf 100644
@@ -1173,7 +1173,7 @@ static int __init lane_module_init(void)
 #endif
 
 	register_atm_ioctl(&lane_ioctl_ops);
-	pr_info("lec.c: " __DATE__ " " __TIME__ " initialized\n");
+	pr_info("lec.c: initialized\n");
 	return 0;
 }
 
net/atm/mpc.c +1 -1
index 644cdf0..3ccca42 100644
@@ -1482,7 +1482,7 @@ static __init int atm_mpoa_init(void)
 	if (mpc_proc_init() != 0)
 		pr_info("failed to initialize /proc/mpoa\n");
 
-	pr_info("mpc.c: " __DATE__ " " __TIME__ " initialized\n");
+	pr_info("mpc.c: initialized\n");
 
 	return 0;
 }
maintainer Acked-by
#99 lore raw

Re: [PATCH 28/34] atm: Drop __TIME__ usage

From: Michal Marek <[email protected]>
Date: Wed, 25 May 2011 22:49:29 +0200

Quoted 13 lines

Dne 5.4.2011 16:59, Michal Marek napsal(a):

Quoted 11 lines

The kernel already prints its build timestamp during boot, no need to repeat it in random drivers and produce different object files each time.

---
 net/atm/lec.c |    2 +-
 net/atm/mpc.c |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
Quoted 4 lines

Hi,

I don't see this patch in today's linux-next. Any objection against me applying it to the kbuild-2.6.git repository?

Please apply it:

#100 lore raw

PATCH 29/34 tipc: Drop __TIME__ usage

In reply to Michal Marek

The kernel already prints its build timestamp during boot, no need to repeat it in random drivers and produce different object files each time.

---
 net/tipc/core.c |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)
net/tipc/core.c +1 -2
index e071579..33532fe 100644
@@ -185,8 +185,7 @@ static int __init tipc_init(void)
 	if (tipc_log_resize(CONFIG_TIPC_LOG) != 0)
 		warn("Unable to create log buffer\n");
 
-	info("Activated (version " TIPC_MOD_VER
-	     " compiled " __DATE__ " " __TIME__ ")\n");
+	info("Activated (version " TIPC_MOD_VER ")\n");
 
 	tipc_own_addr = 0;
 	tipc_remote_management = 1;
Signature · 1 line
1.7.4.1
#101 lore raw

Re: [PATCH 29/34] tipc: Drop __TIME__ usage

Quoted 3 lines · Michal Marek

The kernel already prints its build timestamp during boot, no need to repeat it in random drivers and produce different object files each time.

I'll make sure this gets bundled into the next batch of tipc updates
I proxy to DaveM. The ccache users should be happier.

Thanks,
Paul.

Quoted 27 lines

---
 net/tipc/core.c |    3 +--

 1 files changed, 1 insertions(+), 2 deletions(-)
net/tipc/core.c +1 -3
index e071579..33532fe 100644
@@ -185,8 +185,7 @@ static int __init tipc_init(void)
        if (tipc_log_resize(CONFIG_TIPC_LOG) != 0)
                warn("Unable to create log buffer\n");
 
-       info("Activated (version " TIPC_MOD_VER
-            " compiled " __DATE__ " " __TIME__ ")\n");
+       info("Activated (version " TIPC_MOD_VER ")\n");
 
        tipc_own_addr = 0;
        tipc_remote_management = 1;
--

1.7.4.1

Quoted 6 lines

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

--
To unsubscribe from this list: send the line "unsubscribe linux-kbuild" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

#102 lore raw

PATCH 30/34 rio: Drop __DATE__ usage

In reply to Michal Marek

The kernel already prints its build timestamp during boot, no need to repeat it in random drivers and produce different object files each time. As the buildDate field is part of the userspace API, I replaced it with the date of the last code change.

Cc Greg Kroah-Hartman <[email protected]>
---
 drivers/char/rio/rioinit.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/char/rio/rioinit.c +1 -1
index 24a282b..fb62b38 100644
@@ -381,7 +381,7 @@ struct rioVersion *RIOVersid(void)
 {
     strlcpy(stVersion.version, "RIO driver for linux V1.0",
 	    sizeof(stVersion.version));
-    strlcpy(stVersion.buildDate, __DATE__,
+    strlcpy(stVersion.buildDate, "Aug 15 2010",
 	    sizeof(stVersion.buildDate));
 
     return &stVersion;
Signature · 1 line
1.7.4.1
#103 lore raw

Re: [PATCH 30/34] rio: Drop __DATE__ usage

Quoted 10 lines · Michal Marek

The kernel already prints its build timestamp during boot, no need to repeat it in random drivers and produce different object files each time. As the buildDate field is part of the userspace API, I replaced it with the date of the last code change.

Cc Greg Kroah-Hartman <[email protected]>
---
 drivers/char/rio/rioinit.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

Applied to kbuild-2.6.git#trivial.

Michal

#104 lore raw

PATCH 31/34 edac: Drop __DATE__ usage

In reply to Michal Marek

The kernel already prints its build timestamp during boot, no need to repeat it in random drivers and produce different object files each time.

---
 drivers/edac/amd76x_edac.c  |    2 +-
 drivers/edac/amd8111_edac.c |    2 +-
 drivers/edac/amd8131_edac.c |    2 +-
 drivers/edac/cpc925_edac.c  |    2 +-
 drivers/edac/e752x_edac.c   |    2 +-
 drivers/edac/e7xxx_edac.c   |    2 +-
 drivers/edac/edac_module.c  |    2 +-
 drivers/edac/i5000_edac.c   |    2 +-
 drivers/edac/i5400_edac.c   |    2 +-
 drivers/edac/i7300_edac.c   |    2 +-
 drivers/edac/i7core_edac.c  |    2 +-
 drivers/edac/i82860_edac.c  |    2 +-
 drivers/edac/i82875p_edac.c |    2 +-
 drivers/edac/i82975x_edac.c |    2 +-
 drivers/edac/mpc85xx_edac.h |    2 +-
 drivers/edac/mv64x60_edac.h |    2 +-
 drivers/edac/ppc4xx_edac.c  |    2 +-
 drivers/edac/r82600_edac.c  |    2 +-
 18 files changed, 18 insertions(+), 18 deletions(-)
drivers/edac/amd76x_edac.c +1 -1
index cace0a7..e47e73b 100644
@@ -19,7 +19,7 @@
 #include <linux/edac.h>
 #include "edac_core.h"
 
-#define AMD76X_REVISION	" Ver: 2.0.2 "  __DATE__
+#define AMD76X_REVISION	" Ver: 2.0.2"
 #define EDAC_MOD_STR	"amd76x_edac"
 
 #define amd76x_printk(level, fmt, arg...) \
drivers/edac/amd8111_edac.c +1 -1
index 35b78d0..ddd8900 100644
@@ -33,7 +33,7 @@
 #include "edac_module.h"
 #include "amd8111_edac.h"
 
-#define AMD8111_EDAC_REVISION	" Ver: 1.0.0 " __DATE__
+#define AMD8111_EDAC_REVISION	" Ver: 1.0.0"
 #define AMD8111_EDAC_MOD_STR	"amd8111_edac"
 
 #define PCI_DEVICE_ID_AMD_8111_PCI	0x7460
drivers/edac/amd8131_edac.c +1 -1
index b432d60..a5c6805 100644
@@ -33,7 +33,7 @@
 #include "edac_module.h"
 #include "amd8131_edac.h"
 
-#define AMD8131_EDAC_REVISION	" Ver: 1.0.0 " __DATE__
+#define AMD8131_EDAC_REVISION	" Ver: 1.0.0"
 #define AMD8131_EDAC_MOD_STR	"amd8131_edac"
 
 /* Wrapper functions for accessing PCI configuration space */
drivers/edac/cpc925_edac.c +1 -1
index b9a781c..3400ae3 100644
@@ -30,7 +30,7 @@
 #include "edac_core.h"
 #include "edac_module.h"
 
-#define CPC925_EDAC_REVISION	" Ver: 1.0.0 " __DATE__
+#define CPC925_EDAC_REVISION	" Ver: 1.0.0"
 #define CPC925_EDAC_MOD_STR	"cpc925_edac"
 
 #define cpc925_printk(level, fmt, arg...) \
drivers/edac/e752x_edac.c +1 -1
index ec302d4..1af531a 100644
@@ -24,7 +24,7 @@
 #include <linux/edac.h>
 #include "edac_core.h"
 
-#define E752X_REVISION	" Ver: 2.0.2 " __DATE__
+#define E752X_REVISION	" Ver: 2.0.2"
 #define EDAC_MOD_STR	"e752x_edac"
 
 static int report_non_memory_errors;
drivers/edac/e7xxx_edac.c +1 -1
index 1731d72..6ffb6d2 100644
@@ -29,7 +29,7 @@
 #include <linux/edac.h>
 #include "edac_core.h"
 
-#define	E7XXX_REVISION " Ver: 2.0.2 " __DATE__
+#define	E7XXX_REVISION " Ver: 2.0.2"
 #define	EDAC_MOD_STR	"e7xxx_edac"
 
 #define e7xxx_printk(level, fmt, arg...) \
drivers/edac/edac_module.c +1 -1
index be4b075..5ddaa86 100644
@@ -15,7 +15,7 @@
 #include "edac_core.h"
 #include "edac_module.h"
 
-#define EDAC_VERSION "Ver: 2.1.0 " __DATE__
+#define EDAC_VERSION "Ver: 2.1.0"
 
 #ifdef CONFIG_EDAC_DEBUG
 /* Values of 0 to 4 will generate output */
drivers/edac/i5000_edac.c +1 -1
index a5cefab..3d0b726 100644
@@ -27,7 +27,7 @@
 /*
  * Alter this version for the I5000 module when modifications are made
  */
-#define I5000_REVISION    " Ver: 2.0.12 " __DATE__
+#define I5000_REVISION    " Ver: 2.0.12"
 #define EDAC_MOD_STR      "i5000_edac"
 
 #define i5000_printk(level, fmt, arg...) \
drivers/edac/i5400_edac.c +1 -1
index 38a9be9..fd362b4 100644
@@ -33,7 +33,7 @@
 /*
  * Alter this version for the I5400 module when modifications are made
  */
-#define I5400_REVISION    " Ver: 1.0.0 " __DATE__
+#define I5400_REVISION    " Ver: 1.0.0"
 
 #define EDAC_MOD_STR      "i5400_edac"
 
drivers/edac/i7300_edac.c +1 -1
index 05523b5..7ffc65c 100644
@@ -31,7 +31,7 @@
 /*
  * Alter this version for the I7300 module when modifications are made
  */
-#define I7300_REVISION    " Ver: 1.0.0 " __DATE__
+#define I7300_REVISION    " Ver: 1.0.0"
 
 #define EDAC_MOD_STR      "i7300_edac"
 
drivers/edac/i7core_edac.c +1 -1
index 81154ab..3f320ba 100644
@@ -59,7 +59,7 @@ MODULE_PARM_DESC(use_pci_fixup, "Enable PCI fixup to seek for hidden devices");
 /*
  * Alter this version for the module when modifications are made
  */
-#define I7CORE_REVISION    " Ver: 1.0.0 " __DATE__
+#define I7CORE_REVISION    " Ver: 1.0.0"
 #define EDAC_MOD_STR      "i7core_edac"
 
 /*
drivers/edac/i82860_edac.c +1 -1
index b8a95cf..931a057 100644
@@ -16,7 +16,7 @@
 #include <linux/edac.h>
 #include "edac_core.h"
 
-#define  I82860_REVISION " Ver: 2.0.2 " __DATE__
+#define  I82860_REVISION " Ver: 2.0.2"
 #define EDAC_MOD_STR	"i82860_edac"
 
 #define i82860_printk(level, fmt, arg...) \
drivers/edac/i82875p_edac.c +1 -1
index b2fd1e8..33864c6 100644
@@ -20,7 +20,7 @@
 #include <linux/edac.h>
 #include "edac_core.h"
 
-#define I82875P_REVISION	" Ver: 2.0.2 " __DATE__
+#define I82875P_REVISION	" Ver: 2.0.2"
 #define EDAC_MOD_STR		"i82875p_edac"
 
 #define i82875p_printk(level, fmt, arg...) \
drivers/edac/i82975x_edac.c +1 -1
index 3218819..4f366c2 100644
@@ -16,7 +16,7 @@
 #include <linux/edac.h>
 #include "edac_core.h"
 
-#define I82975X_REVISION	" Ver: 1.0.0 " __DATE__
+#define I82975X_REVISION	" Ver: 1.0.0"
 #define EDAC_MOD_STR		"i82975x_edac"
 
 #define i82975x_printk(level, fmt, arg...) \
drivers/edac/mpc85xx_edac.h +1 -1
index cb24df8..932016f 100644
@@ -11,7 +11,7 @@
 #ifndef _MPC85XX_EDAC_H_
 #define _MPC85XX_EDAC_H_
 
-#define MPC85XX_REVISION " Ver: 2.0.0 " __DATE__
+#define MPC85XX_REVISION " Ver: 2.0.0"
 #define EDAC_MOD_STR	"MPC85xx_edac"
 
 #define mpc85xx_printk(level, fmt, arg...) \
drivers/edac/mv64x60_edac.h +1 -1
index e042e2d..c7f209c 100644
@@ -12,7 +12,7 @@
 #ifndef _MV64X60_EDAC_H_
 #define _MV64X60_EDAC_H_
 
-#define MV64x60_REVISION " Ver: 2.0.0 " __DATE__
+#define MV64x60_REVISION " Ver: 2.0.0"
 #define EDAC_MOD_STR	"MV64x60_edac"
 
 #define mv64x60_printk(level, fmt, arg...) \
drivers/edac/ppc4xx_edac.c +1 -1
index b9f0c20..83863fd 100644
@@ -113,7 +113,7 @@
 #define EDAC_OPSTATE_UNKNOWN_STR	"unknown"
 
 #define PPC4XX_EDAC_MODULE_NAME		"ppc4xx_edac"
-#define PPC4XX_EDAC_MODULE_REVISION	"v1.0.0 " __DATE__
+#define PPC4XX_EDAC_MODULE_REVISION	"v1.0.0"
 
 #define PPC4XX_EDAC_MESSAGE_SIZE	256
 
drivers/edac/r82600_edac.c +1 -1
index 6a822c6..387997a 100644
@@ -22,7 +22,7 @@
 #include <linux/edac.h>
 #include "edac_core.h"
 
-#define R82600_REVISION	" Ver: 2.0.2 " __DATE__
+#define R82600_REVISION	" Ver: 2.0.2"
 #define EDAC_MOD_STR	"r82600_edac"
 
 #define r82600_printk(level, fmt, arg...) \
Signature · 1 line
1.7.4.1
#105 lore raw

Re: [PATCH 31/34] edac: Drop __DATE__ usage

Quoted 20 lines · Michal Marek

The kernel already prints its build timestamp during boot, no need to repeat it in random drivers and produce different object files each time.

---
 drivers/edac/amd76x_edac.c  |    2 +-
 drivers/edac/amd8111_edac.c |    2 +-
 drivers/edac/amd8131_edac.c |    2 +-
 drivers/edac/cpc925_edac.c  |    2 +-
 drivers/edac/e752x_edac.c   |    2 +-
 drivers/edac/e7xxx_edac.c   |    2 +-
 drivers/edac/edac_module.c  |    2 +-
 drivers/edac/i5000_edac.c   |    2 +-
 drivers/edac/i5400_edac.c   |    2 +-
 drivers/edac/i7300_edac.c   |    2 +-
 drivers/edac/i7core_edac.c  |    2 +-
Quoted 8 lines
 drivers/edac/i82860_edac.c  |    2 +-
 drivers/edac/i82875p_edac.c |    2 +-
 drivers/edac/i82975x_edac.c |    2 +-
 drivers/edac/mpc85xx_edac.h |    2 +-
 drivers/edac/mv64x60_edac.h |    2 +-
 drivers/edac/ppc4xx_edac.c  |    2 +-
 drivers/edac/r82600_edac.c  |    2 +-
 18 files changed, 18 insertions(+), 18 deletions(-)

Applied to kbuild-2.6.git#trivial.

Michal

#106 lore raw

PATCH 32/34 pmcraid: Drop __DATE__ usage

In reply to Michal Marek

The kernel already prints its build timestamp during boot, no need to repeat it in random drivers and produce different object files each time.

---
 drivers/scsi/pmcraid.c |    9 ++++-----
 drivers/scsi/pmcraid.h |    1 -
 2 files changed, 4 insertions(+), 6 deletions(-)
drivers/scsi/pmcraid.c +4 -5
index 321cf3a..7c13201 100644
@@ -4249,8 +4249,8 @@ static ssize_t pmcraid_show_drv_version(
 	char *buf
 )
 {
-	return snprintf(buf, PAGE_SIZE, "version: %s, build date: %s\n",
-			PMCRAID_DRIVER_VERSION, PMCRAID_DRIVER_DATE);
+	return snprintf(buf, PAGE_SIZE, "version: %s\n",
+			PMCRAID_DRIVER_VERSION);
 }
 
 static struct device_attribute pmcraid_driver_version_attr = {
@@ -6093,9 +6093,8 @@ static int __init pmcraid_init(void)
 	dev_t dev;
 	int error;
 
-	pmcraid_info("%s Device Driver version: %s %s\n",
-			 PMCRAID_DRIVER_NAME,
-			 PMCRAID_DRIVER_VERSION, PMCRAID_DRIVER_DATE);
+	pmcraid_info("%s Device Driver version: %s\n",
+			 PMCRAID_DRIVER_NAME, PMCRAID_DRIVER_VERSION);
 
 	error = alloc_chrdev_region(&dev, 0,
 				    PMCRAID_MAX_ADAPTERS,
drivers/scsi/pmcraid.h +0 -1
index 4db210d..d302737 100644
@@ -43,7 +43,6 @@
 #define PMCRAID_DRIVER_NAME		"PMC MaxRAID"
 #define PMCRAID_DEVFILE			"pmcsas"
 #define PMCRAID_DRIVER_VERSION		"1.0.3"
-#define PMCRAID_DRIVER_DATE		__DATE__
 
 #define PMCRAID_FW_VERSION_1		0x002
 
Signature · 1 line
1.7.4.1
#107 lore raw

Re: [PATCH 32/34] pmcraid: Drop __DATE__ usage

Quoted 11 lines · Michal Marek

The kernel already prints its build timestamp during boot, no need to repeat it in random drivers and produce different object files each time.

---
 drivers/scsi/pmcraid.c |    9 ++++-----
 drivers/scsi/pmcraid.h |    1 -
 2 files changed, 4 insertions(+), 6 deletions(-)

Applied to kbuild-2.6.git#trivial.

Michal

#108 lore raw

PATCH 33/34 usb/lh7a40x_udc: Drop __DATE__ usage

In reply to Michal Marek

The kernel already prints its build timestamp during boot, no need to repeat it in random drivers and produce different object files each time.

Cc Marc Singer <[email protected]>
Cc linux-arm-kernel at lists.infradead.org
Cc linux-usb at vger.kernel.org
---
 drivers/usb/gadget/lh7a40x_udc.c |    7 +++----
 1 files changed, 3 insertions(+), 4 deletions(-)
drivers/usb/gadget/lh7a40x_udc.c +3 -4
index 6b58bd8..1e99e03 100644
@@ -42,7 +42,6 @@
 #endif
 
 #define	DRIVER_DESC			"LH7A40x USB Device Controller"
-#define	DRIVER_VERSION		__DATE__
 
 #ifndef _BIT			/* FIXME - what happended to _BIT in 2.6.7bk18? */
 #define _BIT(x) (1<<(x))
@@ -209,10 +208,10 @@ udc_proc_read(char *page, char **start, off_t off, int count,
 	/* basic device status */
 	t = scnprintf(next, size,
 		      DRIVER_DESC "\n"
-		      "%s version: %s\n"
+		      "%s\n"
 		      "Gadget driver: %s\n"
 		      "Host: %s\n\n",
-		      driver_name, DRIVER_VERSION,
+		      driver_name,
 		      dev->driver ? dev->driver->driver.name : "(none)",
 		      is_usb_connected()? "full speed" : "disconnected");
 	size -= t;
@@ -2134,7 +2133,7 @@ static struct platform_driver udc_driver = {
 
 static int __init udc_init(void)
 {
-	DEBUG("%s: %s version %s\n", __func__, driver_name, DRIVER_VERSION);
+	DEBUG("%s: %s\n", __func__, driver_name);
 	return platform_driver_register(&udc_driver);
 }
 
Signature · 1 line
1.7.4.1
#109 lore raw

Re: [PATCH 33/34] usb/lh7a40x_udc: Drop __DATE__ usage

Quoted 3 lines · Michal Marek

The kernel already prints its build timestamp during boot, no need to repeat it in random drivers and produce different object files each time.

This file no longer exists.

#110 lore raw

Re: [PATCH 33/34] usb/lh7a40x_udc: Drop __DATE__ usage

Quoted 6 lines · Russell King - ARM Linux
Quoted 3 lines · Michal Marek

The kernel already prints its build timestamp during boot, no need to repeat it in random drivers and produce different object files each time.

This file no longer exists.

I only tested the series on top of 2.6.38. I dropped this patch now, sorry for the noise.

Michal

#111 lore raw

PATCH 34/34 checkpatch: Warn about usage of __DATE__, __TIME__ and __TIMESTAMP__

In reply to Michal Marek

The __TIME__ and __DATE__ macros are evil. Every C textbook mentions them, but forgets to add the tiny detail that they make sure that your code will never result in the same binary. __TIMESTAMP__ is a bit more sane, but again produces noise as soon as you switch branches back and forth, or apply a patch and revert it.

Cc Andy Whitcroft <[email protected]>
---
 scripts/checkpatch.pl |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)
scripts/checkpatch.pl +5 -0
index 4c0383d..dbcdf04 100755
@@ -2804,6 +2804,11 @@ sub process {
 			WARN("__func__ should be used instead of gcc specific __FUNCTION__\n"  . $herecurr);
 		}
 
+# check for pointless usage of __TIME__ and friends
+		if ($line =~ /\b__(TIME|DATE|TIMESTAMP)__\b/) {
+			WARN("Usage of __$1__ should be avoided to keep the build deterministic\n" . $herecurr);
+		}
+
 # check for semaphores initialized locked
 		if ($line =~ /^.\s*sema_init.+,\W?0\W?\)/) {
 			WARN("consider using a completion\n" . $herecurr);
Signature · 1 line
1.7.4.1
#112 lore raw

Re: [PATCH 34/34] checkpatch: Warn about usage of __DATE__, __TIME__ and __TIMESTAMP__

Quoted 11 lines · Michal Marek

The __TIME__ and __DATE__ macros are evil. Every C textbook mentions them, but forgets to add the tiny detail that they make sure that your code will never result in the same binary. __TIMESTAMP__ is a bit more sane, but again produces noise as soon as you switch branches back and forth, or apply a patch and revert it.

Cc Andy Whitcroft <[email protected]>
---
 scripts/checkpatch.pl |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

Hi Andy,

any comments about this patch?

Thanks,
Michal

Quoted 16 lines
scripts/checkpatch.pl +5 -0
index 4c0383d..dbcdf04 100755
@@ -2804,6 +2804,11 @@ sub process {
 			WARN("__func__ should be used instead of gcc specific __FUNCTION__\n"  . $herecurr);
 		}
 
+# check for pointless usage of __TIME__ and friends
+		if ($line =~ /\b__(TIME|DATE|TIMESTAMP)__\b/) {
+			WARN("Usage of __$1__ should be avoided to keep the build deterministic\n" . $herecurr);
+		}
+
 # check for semaphores initialized locked
 		if ($line =~ /^.\s*sema_init.+,\W?0\W?\)/) {
 			WARN("consider using a completion\n" . $herecurr);
maintainer
#113 lore raw

Re: [PATCH 34/34] checkpatch: Warn about usage of __DATE__, __TIME__ and __TIMESTAMP__

In reply to Michal Marek
Quoted 30 lines · Michal Marek

The __TIME__ and __DATE__ macros are evil. Every C textbook mentions them, but forgets to add the tiny detail that they make sure that your code will never result in the same binary. __TIMESTAMP__ is a bit more sane, but again produces noise as soon as you switch branches back and forth, or apply a patch and revert it.

Cc Andy Whitcroft <[email protected]>
---
 scripts/checkpatch.pl |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)
scripts/checkpatch.pl +5 -0
index 4c0383d..dbcdf04 100755
@@ -2804,6 +2804,11 @@ sub process {
 			WARN("__func__ should be used instead of gcc specific __FUNCTION__\n"  . $herecurr);
 		}
 
+# check for pointless usage of __TIME__ and friends
+		if ($line =~ /\b__(TIME|DATE|TIMESTAMP)__\b/) {
+			WARN("Usage of __$1__ should be avoided to keep the build deterministic\n" . $herecurr);
+		}
+
 # check for semaphores initialized locked
 		if ($line =~ /^.\s*sema_init.+,\W?0\W?\)/) {
 			WARN("consider using a completion\n" . $herecurr);
Signature · 1 line
1.7.4.1

Looks reasonable to me.

-apw

#114 lore raw
In reply to Michal Marek
Quoted 12 lines · Michal Marek

Hi,

this series makes it possible to build bit-identical kernel image and modules from identical sources. Of course the build is already deterministic in terms of behavior of the code, but the various timestamps embedded in the object files make it hard to compare two builds, for instance to verify that a makefile cleanup didn't accidentally change something. A prime example is /proc/config.gz, which has both a timestamp in the gzip header and a timestamp in the payload data. With this series applied, a script like this will produce identical kernels each time:

Very nice stuff. Do you want to take the individual patches through one of your trees, or do you mind if the subsystem maintainers take them through theirs?

thanks,

greg k-h

#115 lore raw
Quoted 14 lines · Greg KH
Quoted 12 lines · Michal Marek

Hi,

this series makes it possible to build bit-identical kernel image and modules from identical sources. Of course the build is already deterministic in terms of behavior of the code, but the various timestamps embedded in the object files make it hard to compare two builds, for instance to verify that a makefile cleanup didn't accidentally change something. A prime example is /proc/config.gz, which has both a timestamp in the gzip header and a timestamp in the payload data. With this series applied, a script like this will produce identical kernels each time:

Quoted 3 lines

Very nice stuff. Do you want to take the individual patches through one of your trees, or do you mind if the subsystem maintainers take them through theirs?

I'm happy for this to go through a single tree.

James

#116 lore raw

Em 05-04-2011 15:16, James Bottomley escreveu:

Quoted 15 lines · Greg KH
Quoted 14 lines · Michal Marek
Quoted 12 lines

Hi,

this series makes it possible to build bit-identical kernel image and modules from identical sources. Of course the build is already deterministic in terms of behavior of the code, but the various timestamps embedded in the object files make it hard to compare two builds, for instance to verify that a makefile cleanup didn't accidentally change something. A prime example is /proc/config.gz, which has both a timestamp in the gzip header and a timestamp in the payload data. With this series applied, a script like this will produce identical kernels each time:

Quoted 5 lines
Quoted 3 lines

Very nice stuff. Do you want to take the individual patches through one of your trees, or do you mind if the subsystem maintainers take them through theirs?

I'm happy for this to go through a single tree.

Me too.

With respect to the patches I was c/c (patches 13, 14, 31):

Thanks,
Mauro.

Acked-by
#117 lore raw
Quoted 20 lines · Mauro Carvalho Chehab

Em 05-04-2011 15:16, James Bottomley escreveu:

Quoted 19 lines · Greg KH
Quoted 17 lines · Michal Marek
Quoted 12 lines

Hi,

this series makes it possible to build bit-identical kernel image and modules from identical sources. Of course the build is already deterministic in terms of behavior of the code, but the various timestamps embedded in the object files make it hard to compare two builds, for instance to verify that a makefile cleanup didn't accidentally change something. A prime example is /proc/config.gz, which has both a timestamp in the gzip header and a timestamp in the payload data. With this series applied, a script like this will produce identical kernels each time:

Very nice stuff. Do you want to take the individual patches through one of your trees, or do you mind if the subsystem maintainers take them through theirs?

Quoted 7 lines
Quoted 1 line

I'm happy for this to go through a single tree.

Me too.

With respect to the patches I was c/c (patches 13, 14, 31):

Me too.

on the patches I was copied on.

thanks,

greg k-h

#118 lore raw
In reply to Greg KH
Quoted 14 lines · Greg KH
Quoted 12 lines · Michal Marek

Hi,

this series makes it possible to build bit-identical kernel image and modules from identical sources. Of course the build is already deterministic in terms of behavior of the code, but the various timestamps embedded in the object files make it hard to compare two builds, for instance to verify that a makefile cleanup didn't accidentally change something. A prime example is /proc/config.gz, which has both a timestamp in the gzip header and a timestamp in the payload data. With this series applied, a script like this will produce identical kernels each time:

Quoted 3 lines

Very nice stuff. Do you want to take the individual patches through one of your trees, or do you mind if the subsystem maintainers take them through theirs?

But unfortunately, it is very easy to break this and for sure it'll be broken very soon.

So additionally, I'd suggest:
1. Instrument checkpatch.pl and make it err or warn on timestamps.
2. Probably instrument linux-next to rise a warning when people break this.

Signature · 2 lines
Best Regards,
Artem Bityutskiy (???????? ?????)
#119 lore raw
Quoted 19 lines · Artem Bityutskiy
Quoted 14 lines · Greg KH
Quoted 12 lines · Michal Marek

Hi,

this series makes it possible to build bit-identical kernel image and modules from identical sources. Of course the build is already deterministic in terms of behavior of the code, but the various timestamps embedded in the object files make it hard to compare two builds, for instance to verify that a makefile cleanup didn't accidentally change something. A prime example is /proc/config.gz, which has both a timestamp in the gzip header and a timestamp in the payload data. With this series applied, a script like this will produce identical kernels each time:

Quoted 3 lines

Very nice stuff. Do you want to take the individual patches through one of your trees, or do you mind if the subsystem maintainers take them through theirs?

Quoted 5 lines

But unfortunately, it is very easy to break this and for sure it'll be broken very soon.

So additionally, I'd suggest:
1. Instrument checkpatch.pl and make it err or warn on timestamps.

See the grandparent mail:

checkpatch: Warn about usage of __DATE__, __TIME__ and __TIMESTAMP__

Thanks,

Ingo

#120 lore raw

[Removed CCs to spam people less]

Quoted 1 line · Ingo Molnar

checkpatch: Warn about usage of __DATE__, __TIME__ and __TIMESTAMP__

Great, thanks, did not see this!

Signature · 2 lines
Best Regards,
Artem Bityutskiy (Артём Битюцкий)
#121 lore raw
In reply to Artem Bityutskiy
Quoted 15 lines · Artem Bityutskiy
Quoted 14 lines · Greg KH
Quoted 12 lines · Michal Marek

Hi,

this series makes it possible to build bit-identical kernel image and modules from identical sources. Of course the build is already deterministic in terms of behavior of the code, but the various timestamps embedded in the object files make it hard to compare two builds, for instance to verify that a makefile cleanup didn't accidentally change something. A prime example is /proc/config.gz, which has both a timestamp in the gzip header and a timestamp in the payload data. With this series applied, a script like this will produce identical kernels each time:

Quoted 6 lines
Quoted 3 lines

Very nice stuff. Do you want to take the individual patches through one of your trees, or do you mind if the subsystem maintainers take them through theirs?

But unfortunately, it is very easy to break this and for sure it'll be broken very soon.

I'm not so pessimistic. 34 patches and 57 files might sound like a lot, but given that this has been accumulating since day one, the cleanup should last for some time.

Quoted 2 lines

So additionally, I'd suggest:
1. Instrument checkpatch.pl and make it err or warn on timestamps.

This is patch 34/34 in this series: https://lkml.org/lkml/2011/4/5/198

Quoted 2 lines

2. Probably instrument linux-next to rise a warning when people break this.

I'm not sure if Stephen has that much spare time, and I don't think it is necessary. I think the checkpatch check is sufficient and I'll check myself occasionally.

Michal

#122 lore raw
Quoted 4 lines · Michal Marek
Quoted 2 lines

So additionally, I'd suggest:
1. Instrument checkpatch.pl and make it err or warn on timestamps.

This is patch 34/34 in this series: https://lkml.org/lkml/2011/4/5/198

Yeah, great, did not notice, thanks!

Quoted 6 lines
Quoted 2 lines

2. Probably instrument linux-next to rise a warning when people break this.

I'm not sure if Stephen has that much spare time, and I don't think it is necessary. I think the checkpatch check is sufficient and I'll check myself occasionally.

Yes, that's fine, I just wanted to speak this out - there is a probability that someone gets excited and creates some instrumentation to kbuild to automatically detect bad things and then Stephen could easily use that.

WRT "not necessary" - well, I think it is always better to cut bad things before they are merged, rather than afterwards.

But anyway, let's forget about this.

Signature · 2 lines
Best Regards,
Artem Bityutskiy (????? ????????)
#123 lore raw
In reply to Greg KH
Quoted 3 lines · Greg KH

Very nice stuff. Do you want to take the individual patches through one of your trees, or do you mind if the subsystem maintainers take them through theirs?

I'd leave it up to the subsystem maintainers. I'll check once the merge window opens and send the remaining patches to Linus directly.

Michal

Acked-by on the v1 series
#124 lore raw
In reply to Michal Marek
Quoted 30 lines · Michal Marek

Hi,

this series makes it possible to build bit-identical kernel image and modules from identical sources. Of course the build is already deterministic in terms of behavior of the code, but the various timestamps embedded in the object files make it hard to compare two builds, for instance to verify that a makefile cleanup didn't accidentally change something. A prime example is /proc/config.gz, which has both a timestamp in the gzip header and a timestamp in the payload data. With this series applied, a script like this will produce identical kernels each time:

#!/bin/bash
rm -rf /dev/shm/{source,build}{,1,2}
export KCONFIG_NOTIMESTAMP=1
export KBUILD_BUILD_TIMESTAMP='Sun May 1 12:00:00 CEST 2011' export KBUILD_BUILD_USER=user
export KBUILD_BUILD_HOST=host
export ROOT_DEV=FLOPPY
for i in 1 2; do
mkdir /dev/shm/source
# randomize the inode order just for fun
git ls-tree -r -z --name-only HEAD | sort -R -z | xargs -0 \
cp --parents --target=/dev/shm/source
pushd /dev/shm/source
mkdir /dev/shm/build
>/dev/shm/build/all.config
for opt in GCOV_KERNEL UBIFS_FS_DEBUG; do
echo "# CONFIG_$opt is not set" >>"/dev/shm/build"/all.config

Quoted 8 lines

done
make O="/dev/shm/build" KCONFIG_ALLCONFIG=1 allmodconfig make O="/dev/shm/build" -j64
popd
mv /dev/shm/source /dev/shm/source$i
mv /dev/shm/build /dev/shm/build$i
done
diff -rq /dev/shm/build{1,2}

Nice!

Quoted 5 lines

Unfortunatelly, this cannot be used to validate indentation-only patches, even if CONFIG_DEBUG_INFO is turned off. This is because of the __FILE__ and __LINE__ macros used in many places. For the same reason, the source and build directory needs to be the same, otherwise the results will differ.

Nor can it be used to validate untrusted patches in general: a subtle change might be introduced in a piece of code that is dependent on a .config detail that is off for that particular build.

But in the common case it's nice to be able to have deterministic/reproducable builds.

Thanks,

Ingo