Hello community, here is the log from the commit of package mkinitrd for openSUSE:Factory checked in at 2012-05-31 17:07:14 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/mkinitrd (Old) and /work/SRC/openSUSE:Factory/.mkinitrd.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Package is "mkinitrd", Maintainer is "MMarek@suse.com" Changes: -------- --- /work/SRC/openSUSE:Factory/mkinitrd/mkinitrd.changes 2012-05-08 06:46:58.000000000 +0200 +++ /work/SRC/openSUSE:Factory/.mkinitrd.new/mkinitrd.changes 2012-05-31 17:07:26.000000000 +0200 @@ -1,0 +2,10 @@ +Tue May 29 07:38:50 UTC 2012 - werner@suse.de + +- Fix clock scriptlet by adding `then' + +------------------------------------------------------------------- +Wed May 23 12:48:47 UTC 2012 - werner@suse.de + +- Make warpclock working with upstream systemd HW clock management + +------------------------------------------------------------------- New: ---- mkinitrd_systemd_adjtime.patch ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ mkinitrd.spec ++++++ --- /var/tmp/diff_new_pack.K1VHdT/_old 2012-05-31 17:07:28.000000000 +0200 +++ /var/tmp/diff_new_pack.K1VHdT/_new 2012-05-31 17:07:28.000000000 +0200 @@ -56,6 +56,7 @@ Patch2: mkinitrd-firmware-in-usr Patch3: mkinitrd_cp_umount_mount_dmesg_in_usr.patch Patch4: mkinitrd-add-logitech-unity +Patch5: mkinitrd_systemd_adjtime.patch Url: http://gitorious.org/opensuse/mkinitrd %description @@ -91,6 +92,7 @@ %patch2 -p1 %patch3 %patch4 -p1 +%patch5 %build %__cc $RPM_OPT_FLAGS -Wall -Os -o lib/mkinitrd/bin/run-init src/run-init.c ++++++ mkinitrd_systemd_adjtime.patch ++++++ --- scripts/boot-clock.sh +++ scripts/boot-clock.sh 2012-05-29 07:33:46.222065636 +0000 @@ -12,4 +12,14 @@ then *-l*) /bin/warpclock > /dev/shm/warpclock esac +elif test -e /etc/adjtime -a -e /etc/localtime +then + while read line + do + if test "$line" = LOCAL + then + /bin/warpclock + > /dev/shm/warpclock + fi + done < /etc/adjtime fi --- scripts/setup-clock.sh +++ scripts/setup-clock.sh 2012-05-29 07:36:08.966565401 +0000 @@ -15,6 +15,14 @@ fi if test -e /etc/sysconfig/clock then . /etc/sysconfig/clock - mkdir -m 0755 -p $tmp_mnt/etc/sysconfig - echo HWCLOCK='"'"$HWCLOCK"'"' > $tmp_mnt/etc/sysconfig/clock + if test -n "$HWCLOCK" + then + mkdir -m 0755 -p $tmp_mnt/etc/sysconfig + echo HWCLOCK='"'"$HWCLOCK"'"' > $tmp_mnt/etc/sysconfig/clock + fi +fi +if test -e /etc/adjtime +then + mkdir -m 0755 -p $tmp_mnt/etc + cp -p /etc/adjtime $tmp_mnt/etc/ fi --- src/warpclock.c +++ src/warpclock.c 2012-05-24 10:44:18.000000000 +0000 @@ -82,7 +82,7 @@ int main() time_t now, delta, gmtoff; struct stat st; int universal = 1; - int count; + int count, adj; err = "warpclock: /etc/localtime"; if (stat("/etc/localtime", &st) < 0) @@ -92,9 +92,16 @@ int main() memset(&zone, 0, sizeof(struct timezone)); - err = "warpclock: /etc/sysconfig/clock"; - if ((conf = fopen("/etc/sysconfig/clock", "r")) == (FILE *)0) - goto err; + adj = 1; + err = "warpclock: /etc/adjtime"; + if ((conf = fopen("/etc/adjtime", "r")) == (FILE *)0) { + if (errno != ENOENT) + goto err; + adj = 0; + err = "warpclock: /etc/sysconfig/clock"; + if ((conf = fopen("/etc/sysconfig/clock", "r")) == (FILE *)0) + goto err; + } while ((fgets(&buffer[0], sizeof(buffer), conf))) { const char * ptr = &buffer[0]; while (isblank(*ptr)) @@ -103,7 +110,15 @@ int main() continue; if (*ptr == '\n') continue; - if (strncmp("HWCLOCK=", ptr, 8) == 0) { + if (adj) { + char *end; + if ((end = strrchr(ptr, '\n'))) + *end = '\0'; + if (strcmp("UTC", ptr) == 0) { + universal = 1; + break; + } + } else if (strncmp("HWCLOCK=", ptr, 8) == 0) { universal = !strstr(ptr, "-l"); break; } -- To unsubscribe, e-mail: opensuse-commit+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-commit+help@opensuse.org