* [PATCH rebase] Make rebaseall a wrapper around the autorebase postinstall, script
@ 2022-07-20 20:14 Ken Brown
2022-07-21 9:09 ` Corinna Vinschen
0 siblings, 1 reply; 4+ messages in thread
From: Ken Brown @ 2022-07-20 20:14 UTC (permalink / raw)
To: cygwin-apps
[-- Attachment #1: Type: text/plain, Size: 15 bytes --]
Patch attached.
[-- Attachment #2: 0001-Make-rebaseall-a-wrapper-around-the-autorebase-posti.patch --]
[-- Type: text/plain, Size: 7460 bytes --]
From bcbc7f9768854a6e6aaf1a450cdaabc61241ea9d Mon Sep 17 00:00:00 2001
From: Ken Brown <kbrown@cornell.edu>
Date: Wed, 20 Jul 2022 12:14:42 -0400
Subject: [PATCH] Make rebaseall a wrapper around the autorebase postinstall
script
Do this on Cygwin only; the behavior on MinGW and MSYS is unchanged.
Bump version to 4.6.1.
---
NEWS | 5 +++
README | 30 ++++++++--------
configure.ac | 2 +-
rebaseall.in | 100 +++++++++++++++++++--------------------------------
4 files changed, 56 insertions(+), 81 deletions(-)
diff --git a/NEWS b/NEWS
index f982c32..c824d5b 100644
--- a/NEWS
+++ b/NEWS
@@ -1,5 +1,10 @@
$Id$
+4.6.1
+==============================================================================
+ * Make rebaseall a wrapper around /etc/postinstall/0p_000_autorebase.dash
+ (Cygwin only).
+
4.3.0
==============================================================================
* Add --oblivious/-O option: do not touch files already in the
diff --git a/README b/README
index 6383fcf..9456b5e 100644
--- a/README
+++ b/README
@@ -53,9 +53,13 @@ the following will be displayed when the problem is triggered:
C:\cygwin\bin\python.exe: *** unable to remap C:\cygwin\bin\cygssl.dll to same address as parent(0xDF0000) != 0xE00000
-Note that rebaseall is only a stop-gap measure. Eventually the rebase
-functionality will be added to Cygwin's setup.exe, so that rebasing will
-happen automatically.
+On Cygwin, rebaseall has been replaced by the postinstall script
+/etc/postinstall/0p_000_autorebase.dash, provided by the _autorebase
+package. This script runs every time Cygwin's setup program is run.
+See /usr/share/doc/Cygwin/_autorebase.README.
+
+For the convenience of users who may wish to rebase between runs of
+setup, rebaseall is now a wrapper around that postinstall script.
On Vista and newer, it is possible to employ the Address Space Layout
Randomization facility to help solve the image load address clashing
@@ -163,7 +167,7 @@ the next section.
Command line syntax
================================================================================
-rebaseall
+rebaseall (MinGW and MSYS only)
--------------------------------------------------------------------------------
The following is the rebaseall command line syntax:
@@ -358,31 +362,25 @@ Issues:
================================================================================
The following are the known Cygwin rebase issues:
-1. rebase should be integrated with Cygwin's setup.exe.
-
-2. rebase does not handle in-use DLLs.
+1. rebase does not handle in-use DLLs.
-3. rebase skips read-only DLLs.
+2. rebase skips read-only DLLs.
-Issues #1, #2, and #3 also apply to the peflags utility.
+These issues also apply to the peflags utility.
Homepage:
================================================================================
The primary rebase web site is:
- http://www.tishler.net/jason/software/rebase/
+ https://cygwin.com/git/?p=cygwin-apps/rebase.git
Download:
================================================================================
-The primary rebase download site is:
-
- http://www.tishler.net/jason/software/rebase/
-
-Access to the CVS development sources is available:
+Access to the git development sources is available:
- cvs -d:pserver:anoncvs@cygwin.com:/cvs/cygwin-apps co rebase
+ git clone git://cygwin.com/git/cygwin-apps/rebase.git
Mailing Lists:
diff --git a/configure.ac b/configure.ac
index 91415d5..f66c2a6 100644
--- a/configure.ac
+++ b/configure.ac
@@ -2,7 +2,7 @@
# configure.ac for rebase
AC_PREREQ([2.64])
-AC_INIT([rebase], [4.6.0], [cygwin@cygwin.com])
+AC_INIT([rebase], [4.6.1], [cygwin@cygwin.com])
AC_CONFIG_AUX_DIR([build-aux])
AC_CONFIG_SRCDIR([peflags.c])
AC_PREFIX_DEFAULT([/usr])
diff --git a/rebaseall.in b/rebaseall.in
index af4fe3f..b624939 100644
--- a/rebaseall.in
+++ b/rebaseall.in
@@ -38,6 +38,32 @@ DefaultVerbose=
DefaultFileList=
DefaultSuffixes='dll|so|oct'
+# Determine platform
+Platform=`uname -s`
+case $Platform in
+ *MINGW* | *mingw* ) Platform=mingw ;;
+ *CYGWIN* | *cygwin* ) Platform=cygwin ;;
+ *MSYS* | *msys* ) Platform=msys ;;
+ * )
+ echo "Unsupported platform: $Platform" 1>&2
+ exit 1
+ ;;
+esac
+
+# On Cygwin, just call the _autorebase postinstall script
+case $Platform in
+ cygwin)
+ if [ "$#" -gt 0 ]
+ then
+ echo "usage: ${ProgramName}"
+ exit 1
+ fi
+ exec /etc/postinstall/0p_000_autorebase.dash
+ ;;
+ *)
+ ;;
+esac
+
# Define functions
usage()
{
@@ -76,27 +102,6 @@ case `uname -m` in
;;
esac
-# Determine platform
-Platform=`uname -s`
-case $Platform in
- *MINGW* | *mingw* ) Platform=mingw ;;
- *CYGWIN* | *cygwin* ) Platform=cygwin ;;
- *MSYS* | *msys* ) Platform=msys ;;
- * )
- echo "Unsupported platform: $Platform" 1>&2
- exit 1
- ;;
-esac
-
-# On x86_64 Cygwin, set DefaultAddressBase to 0x4:00000000
-case $Platform in
- cygwin )
- [ `uname -m` = "x86_64" ] && DefaultBaseAddress=0x400000000
- ;;
- * )
- ;;
-esac
-
# Parse command line arguments
while getopts "${ProgramOptions}" Option "$@"
do
@@ -132,9 +137,7 @@ done
if [ "${check_for_dash_only}" != "no" ]
then
ProcessResult=0
- case $Platform in
- mingw|msys )
- /bin/ps -s | /bin/gawk '\
+ /bin/ps -s | /bin/gawk '\
# Count number of running ash or dash. \
/\/bin\/(d)?ash(\.exe)?$/{ ash_cnt++; } \
# Count number of ps and gawk. \
@@ -153,13 +156,7 @@ then
# All is well. \
exit 1; \
}'
- ProcessResult=$?
- ;;
- cygwin )
- grep -E -q -i -v '/d?ash(.exe)?$' /proc/[0-9]*/exename
- ProcessResult=$?
- ;;
- esac
+ ProcessResult=$?
if [ $ProcessResult -eq 0 -a -z "${RebaseDebug}" ]
then
echo "${ProgramName}: only ash or dash processes are allowed during rebasing"
@@ -208,39 +205,14 @@ SortedFile="$TmpDir/rebase.lst"
TmpFile="${SortedFile}.in"
# Create rebase list
-case $Platform in
- cygwin)
- find /etc/setup -name '*.lst.gz' | xargs gzip -d -c |
- grep -E "\.($Suffixes)\$" |
- sed -e '/\/cygwin1\.dll$/d' -e '/\/cyglsa.*\.dll$/d' \
- -e '/sys-root\/mingw/d' -e 's/^/\//' \
- -e '/\/d\?ash\.exe$/d' -e '/\/rebase\.exe$/d' >"${TmpFile}"
- # some interpreters include a method for installing addons outside of the
- # package manager, such as CPAN and RubyGems.
- for d in /usr/lib/perl5/site_perl /usr/lib/py*/site-packages \
- /usr/lib/php /usr/lib/R/site-library /usr/lib/rub*/gems \
- /usr/lib/octave/site
- do
- if [ -d $d ]
- then
- find $d -type f | grep -E "\.($Suffixes)\$" >>"${TmpFile}"
- fi
- done
- # Unconditionally add the -n flag so rebased DLLs get the
- # dynamicbase flag removed.
- NoDyn='-n'
- ;;
- mingw|msys)
- for f in /bin /lib
- do
- find $f -type f |
- grep -E "\.($Suffixes)\$" |
- sed -e '/\/msys-1\.0.*\.dll$/d' -e '/\/cygwin1\.dll$/d' \
- -e '/\/cyglsa.*\.dll$/d' -e '/\/d\?ash\.exe$/d' \
- -e '/\/rebase\.exe$/d' >>"$TmpFile"
- done
- ;;
-esac
+for f in /bin /lib
+do
+ find $f -type f |
+ grep -E "\.($Suffixes)\$" |
+ sed -e '/\/msys-1\.0.*\.dll$/d' -e '/\/cygwin1\.dll$/d' \
+ -e '/\/cyglsa.*\.dll$/d' -e '/\/d\?ash\.exe$/d' \
+ -e '/\/rebase\.exe$/d' >>"$TmpFile"
+done
# Append user supplied file list, if any
if [ -n "${FileList}" ]
--
2.37.1
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH rebase] Make rebaseall a wrapper around the autorebase postinstall, script
2022-07-20 20:14 [PATCH rebase] Make rebaseall a wrapper around the autorebase postinstall, script Ken Brown
@ 2022-07-21 9:09 ` Corinna Vinschen
2022-07-21 13:50 ` Ken Brown
0 siblings, 1 reply; 4+ messages in thread
From: Corinna Vinschen @ 2022-07-21 9:09 UTC (permalink / raw)
To: cygwin-apps
Hi Ken,
On Jul 20 16:14, Ken Brown wrote:
> Patch attached.
> From bcbc7f9768854a6e6aaf1a450cdaabc61241ea9d Mon Sep 17 00:00:00 2001
> Homepage:
> ================================================================================
> The primary rebase web site is:
>
> - http://www.tishler.net/jason/software/rebase/
> + https://cygwin.com/git/?p=cygwin-apps/rebase.git
Shouldn't that be https://sourceware.org/cygwin-apps/ ?
I mean, it's the only real web page apart from git access.
Also
https://cygwin.com/git/?p=cygwin-apps/rebase.git
vs.
https://cygwin.com/git/cygwin-apps/rebase.git
Both work but the 2nd URL avoids that ugly ?p=.
We're using the "?p=" URLs on the cygin-apps website, too. Maybe it's
just me, but to me it looks better if we change this to the 2nd form
where possible. What do you think?
> Download:
> ================================================================================
> -The primary rebase download site is:
> -
> - http://www.tishler.net/jason/software/rebase/
> -
> -Access to the CVS development sources is available:
> +Access to the git development sources is available:
>
> - cvs -d:pserver:anoncvs@cygwin.com:/cvs/cygwin-apps co rebase
> + git clone git://cygwin.com/git/cygwin-apps/rebase.git
Better use https here, rather than git.
> DefaultFileList=
> DefaultSuffixes='dll|so|oct'
>
> +# Determine platform
> +Platform=`uname -s`
> +case $Platform in
> + *MINGW* | *mingw* ) Platform=mingw ;;
> + *CYGWIN* | *cygwin* ) Platform=cygwin ;;
> + *MSYS* | *msys* ) Platform=msys ;;
> + * )
> + echo "Unsupported platform: $Platform" 1>&2
> + exit 1
> + ;;
> +esac
> +
> +# On Cygwin, just call the _autorebase postinstall script
> +case $Platform in
> + cygwin)
> + if [ "$#" -gt 0 ]
> + then
> + echo "usage: ${ProgramName}"
> + exit 1
> + fi
> + exec /etc/postinstall/0p_000_autorebase.dash
> + ;;
> + *)
> + ;;
> +esac
> +
> # Define functions
> usage()
> {
Just a style issue, but the two functions should stay first in the file.
Please move this code just right before the trap call.
Other than that, LGTM.
Thanks,
Corinna
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH rebase] Make rebaseall a wrapper around the autorebase postinstall, script
2022-07-21 9:09 ` Corinna Vinschen
@ 2022-07-21 13:50 ` Ken Brown
2022-07-21 14:09 ` Corinna Vinschen
0 siblings, 1 reply; 4+ messages in thread
From: Ken Brown @ 2022-07-21 13:50 UTC (permalink / raw)
To: cygwin-apps
On 7/21/2022 5:09 AM, Corinna Vinschen wrote:
> We're using the "?p=" URLs on the cygin-apps website, too. Maybe it's
> just me, but to me it looks better if we change this to the 2nd form
> where possible. What do you think?
I agree that it looks better without the ?p=. I have no idea why the latter is
used on the cygwin-apps website.
> Just a style issue, but the two functions should stay first in the file.
> Please move this code just right before the trap call.
>
> Other than that, LGTM.
I've made all the changes you suggested and pushed it.
Ken
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH rebase] Make rebaseall a wrapper around the autorebase postinstall, script
2022-07-21 13:50 ` Ken Brown
@ 2022-07-21 14:09 ` Corinna Vinschen
0 siblings, 0 replies; 4+ messages in thread
From: Corinna Vinschen @ 2022-07-21 14:09 UTC (permalink / raw)
To: cygwin-apps
On Jul 21 09:50, Ken Brown wrote:
> On 7/21/2022 5:09 AM, Corinna Vinschen wrote:
> > We're using the "?p=" URLs on the cygin-apps website, too. Maybe it's
> > just me, but to me it looks better if we change this to the 2nd form
> > where possible. What do you think?
>
> I agree that it looks better without the ?p=. I have no idea why the latter
> is used on the cygwin-apps website.
>
> > Just a style issue, but the two functions should stay first in the file.
> > Please move this code just right before the trap call.
> >
> > Other than that, LGTM.
>
> I've made all the changes you suggested and pushed it.
Great, I pushed a patch to simplify the URLs and added a link from
the Cygwin homepage to the cygwin apps homepage.
Thanks,
Corinna
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2022-07-21 14:09 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-07-20 20:14 [PATCH rebase] Make rebaseall a wrapper around the autorebase postinstall, script Ken Brown
2022-07-21 9:09 ` Corinna Vinschen
2022-07-21 13:50 ` Ken Brown
2022-07-21 14:09 ` Corinna Vinschen
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).