public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* Re: help needed - transition from 32bits to 64bits
       [not found] <648ae4b3.170a0220.7a40.c67dSMTPIN_ADDED_BROKEN@mx.google.com>
@ 2023-06-15 12:47 ` marco atzeri
  2023-06-15 12:58   ` Dan Harkless
  2023-06-15 14:39   ` gh
  0 siblings, 2 replies; 6+ messages in thread
From: marco atzeri @ 2023-06-15 12:47 UTC (permalink / raw)
  To: gh; +Cc: cygwin

[-- Attachment #1: Type: text/plain, Size: 1849 bytes --]

On Thu, Jun 15, 2023 at 12:15 PM gh via Cygwin  wrote:
>
> Dear all,
>
> Sorry if this question was already answered somewhere in the FAQ.
>
>
>
> I am running a deprecated 32bits version, and want to switch to 64bits. Install procedure is easy, but does not cover one thing : I
> would like to preserve the list of packages I have installed, and minimize the change of paths in my windows environment (did not
> change anything for the last 10 years, so I don't want to dig into where are things).
>
>
>
> Currently, cygwin is in C:\cygwin, which I have moved to C:\cygwin-bck. I then want to install in the now almost empty C:\cygwin,
> but copying there the necessary config files so that setup-x86_64.exe knows which packages to download.
>
>
>
> Thanks in advance,
>
>
>
> Gilbert
>
Hi Gilbert,

No need to rename the directory as the Cygwin 64 bit will be installed
in C:\Cygwin64 folder

Attached the script that I use to reinstall my system on different computers.
It can be adapted to duplicate the 32bit in a 64 bit installation

Assuming your file list is not longer than 32K, this should work :

  chmod + x cyg-reinstall.sh
   sed -e "1d"  /etc/setup/installed.db | sed -e "s/ .*$//" > filelist.txt
  ./cyg-reinstall.sh -f  filelist.txt
  cp cyg-reinstall-x86.bat cyg-reinstall-x86_64.bat
  sed -i -e "s/setup-x86.exe/setup-x86_64.exe/" cyg-reinstall-x86_64.bat

if the  "filelist.txt" is too long you can split in multiple chunks, like:

   grep -v "^lib" filelist.txt > nolib-list.txt
   grep "^lib" filelist.txt > lib-list.txt

I usually need to split mine, as my installation hit the 32K limit of
command line

 wc -l *.txt
  2608 filelist.txt
  1297 lib-list.txt
  1311 nolib-list.txt

 ls -1s *.txt
40K filelist.txt
20K lib-list.txt
20K nolib-list.txt

Regards
Marco

[-- Attachment #2: cyg-reinstall.sh --]
[-- Type: text/x-sh, Size: 3663 bytes --]

#!/bin/bash
#Copyright (c) 2021, 2023 Marco Atzeri
#All rights reserved.

#Redistribution and use in source and binary forms, with or without
#modification, are permitted provided that the following conditions are met:
#1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
#2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
#3. All advertising materials mentioning features or use of this software must display the following acknowledgement: This product includes software developed by Marco Atzeri.
#4. Neither the name of the Marco Atzeri nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.

#THIS SOFTWARE IS PROVIDED BY MARCO ATZERI ''AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL MARCO ATZERI BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
#SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

# Create a batch file to reinstall using setup-{ARCH}.exe
# all packages or the ones reported as incomplete
# or install from a list or remove from a list

# If you hit the length limit of command line in bash or CMD
#
# https://devblogs.microsoft.com/oldnewthing/20031210-00/?p=41553
# https://learn.microsoft.com/en-us/troubleshoot/windows-client/shell-experience/command-line-string-limitation
#
# the best way is to split the installation in multiples chunks

print_error=1

if [ $# -eq 1 ]
  then
    if [ $1 == "-I" ]
    then
      lista=$(mktemp)
      cygcheck -c | grep "Incomplete" > $lista
      print_error=0
    fi
    if [ $1 == "-A" ]
    then
      lista=$(mktemp)
      cygcheck -cd | sed -e "1,2d" > $lista
      print_error=0
    fi
fi

if [ $# -eq 2 ]
  then
    if [ $1 == "-f" -o $1 == "-r" ]
    then
      lista=$2
      print_error=0
    fi
fi

# error message if options are incorrect.
if [ $print_error -eq 1 ]
then
        echo -n "Usage : " $(basename $0)
        echo " [ -A | -I | -f filelist | -r filelist ]"
        echo "  create cyg-reinstall-{ARC}.bat from"
        echo "  options"
        echo "    -A  :  install All packages as reported by cygcheck"
        echo "    -I  :  install Incomplete packages as reported by cygcheck"
        echo "    -f  :  install packages in filelist (one per row)"
        echo "    -r  :  remove packages in filelist (one per row)"
        exit 1
fi

if [ $(arch) == "x86_64" ]
then
  A="x86_64"
else
  A="x86"
fi

# writing header
echo -n -e "setup-${A}.exe  " > cyg-reinstall-${A}.bat

# option  -x remove and  -P install
# for re-install packages we need both
if [ $1 == "-I" -o $1 == "-r" ]
then
  awk 'BEGIN{printf(" -x ")} NR==1{printf $1}{printf ",%s", $1}' ${lista} >> cyg-reinstall-${A}.bat
fi

if [ $1 == "-I" -o $1 == "-A" -o $1 == "-f" ]
then
  awk 'BEGIN{printf(" -P ")} NR==1{printf $1}{printf ",%s", $1} END { printf "\r\n pause "}' ${lista} >> cyg-reinstall-${A}.bat
fi

# execution permission for the script
chmod +x cyg-reinstall-${A}.bat


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: help needed - transition from 32bits to 64bits
  2023-06-15 12:47 ` help needed - transition from 32bits to 64bits marco atzeri
@ 2023-06-15 12:58   ` Dan Harkless
  2023-06-15 16:10     ` marco atzeri
  2023-06-15 14:39   ` gh
  1 sibling, 1 reply; 6+ messages in thread
From: Dan Harkless @ 2023-06-15 12:58 UTC (permalink / raw)
  To: cygwin

On 6/15/2023 5:47 AM, marco atzeri via Cygwin wrote:
> On Thu, Jun 15, 2023 at 12:15 PM gh via Cygwin  wrote:
> > Currently, cygwin is in C:\cygwin, which I have moved to C:\cygwin-bck. I then want to install in the now almost empty C:\cygwin,
>
> No need to rename the directory as the Cygwin 64 bit will be installed
> in C:\Cygwin64 folder

Right, but the OP _wanted_ to keep their old paths.  Gilbert, you can 
change the install path of Cygwin64 at install-time to be C:\cygwin.  
There's no requirement for the 64-bit version to be installed in a 
"cygwin64" directory.

Alternatively, you could let it install into C:\cygwin64 and then make a 
Junction or Symbolic Link (e.g. using mklink in a Command Prompt) from 
cygwin to cygwin64, but if it were me I'd probably go with your original 
intention.

--
Dan Harkless
http://harkless.org/dan/


^ permalink raw reply	[flat|nested] 6+ messages in thread

* RE: help needed - transition from 32bits to 64bits
  2023-06-15 12:47 ` help needed - transition from 32bits to 64bits marco atzeri
  2023-06-15 12:58   ` Dan Harkless
@ 2023-06-15 14:39   ` gh
  1 sibling, 0 replies; 6+ messages in thread
From: gh @ 2023-06-15 14:39 UTC (permalink / raw)
  To: 'marco atzeri'; +Cc: cygwin, gilbert.harrus

Thanks Marco, I will read and adapt the script if necessary.

Gilbert
PS: I don't want the cygwin64 directory, so as to avoid looking for everywhere I have used a hard cygwin path.

-----Original Message-----
From: marco atzeri [mailto:marco.atzeri@gmail.com] 
Sent: 15 June 2023 14:48
To: gh
Cc: cygwin@cygwin.com
Subject: Re: help needed - transition from 32bits to 64bits

On Thu, Jun 15, 2023 at 12:15 PM gh via Cygwin  wrote:
>
> Dear all,
>
> Sorry if this question was already answered somewhere in the FAQ.
>
>
>
> I am running a deprecated 32bits version, and want to switch to 
> 64bits. Install procedure is easy, but does not cover one thing : I 
> would like to preserve the list of packages I have installed, and minimize the change of paths in my windows environment (did not change anything for the last 10 years, so I don't want to dig into where are things).
>
>
>
> Currently, cygwin is in C:\cygwin, which I have moved to 
> C:\cygwin-bck. I then want to install in the now almost empty C:\cygwin, but copying there the necessary config files so that setup-x86_64.exe knows which packages to download.
>
>
>
> Thanks in advance,
>
>
>
> Gilbert
>
Hi Gilbert,

No need to rename the directory as the Cygwin 64 bit will be installed in C:\Cygwin64 folder

Attached the script that I use to reinstall my system on different computers.
It can be adapted to duplicate the 32bit in a 64 bit installation

Assuming your file list is not longer than 32K, this should work :

  chmod + x cyg-reinstall.sh
   sed -e "1d"  /etc/setup/installed.db | sed -e "s/ .*$//" > filelist.txt
  ./cyg-reinstall.sh -f  filelist.txt
  cp cyg-reinstall-x86.bat cyg-reinstall-x86_64.bat
  sed -i -e "s/setup-x86.exe/setup-x86_64.exe/" cyg-reinstall-x86_64.bat

if the  "filelist.txt" is too long you can split in multiple chunks, like:

   grep -v "^lib" filelist.txt > nolib-list.txt
   grep "^lib" filelist.txt > lib-list.txt

I usually need to split mine, as my installation hit the 32K limit of command line

 wc -l *.txt
  2608 filelist.txt
  1297 lib-list.txt
  1311 nolib-list.txt

 ls -1s *.txt
40K filelist.txt
20K lib-list.txt
20K nolib-list.txt

Regards
Marco


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: help needed - transition from 32bits to 64bits
  2023-06-15 12:58   ` Dan Harkless
@ 2023-06-15 16:10     ` marco atzeri
  0 siblings, 0 replies; 6+ messages in thread
From: marco atzeri @ 2023-06-15 16:10 UTC (permalink / raw)
  To: Dan Harkless; +Cc: cygwin

On Thu, Jun 15, 2023 at 2:59 PM Dan Harkless via Cygwin  wrote:
>
> On 6/15/2023 5:47 AM, marco atzeri via Cygwin wrote:
> > On Thu, Jun 15, 2023 at 12:15 PM gh via Cygwin  wrote:
> > > Currently, cygwin is in C:\cygwin, which I have moved to C:\cygwin-bck. I then want to install in the now almost empty C:\cygwin,
> >
> > No need to rename the directory as the Cygwin 64 bit will be installed
> > in C:\Cygwin64 folder
>
> Right, but the OP _wanted_ to keep their old paths.  Gilbert, you can
> change the install path of Cygwin64 at install-time to be C:\cygwin.
> There's no requirement for the 64-bit version to be installed in a
> "cygwin64" directory.
>
> Alternatively, you could let it install into C:\cygwin64 and then make a
> Junction or Symbolic Link (e.g. using mklink in a Command Prompt) from
> cygwin to cygwin64, but if it were me I'd probably go with your original
> intention.
>
> --
> Dan Harkless

just renaming the current c:\Cygwin folder to anything (e.g c:\Cygwin32 )
will leave a working Cygwin 32 installation, except any services installed
that of course will have the broken links and broken windows shortcut

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: help needed - transition from 32bits to 64bits
       [not found] <43976.2997253396$1686824142@news.gmane.org>
@ 2023-06-15 17:21 ` ASSI
  0 siblings, 0 replies; 6+ messages in thread
From: ASSI @ 2023-06-15 17:21 UTC (permalink / raw)
  To: cygwin

gh via Cygwin writes:
> Currently, cygwin is in C:\cygwin, which I have moved to
> C:\cygwin-bck. I then want to install in the now almost empty
> C:\cygwin, but copying there the necessary config files so that
> setup-x86_64.exe knows which packages to download.

Create the new target directory (or just do a base installation) and
copy over /etc/setup/installed.db from your backup.  Then make sure the
versions in that file are all out-of-date w.r.t. the mirrors:

sed -i.bak -re 's/( .*-)[0-9.]+-[0-9]+\.tar/\10-0.tar/' /etc/setup/installed.db

Then run setup again and (modulo obsolete and removed packages) it will
install all those packages that your old installation was having.  Of
course you will then also have to copy / re-create any customizations
that you did directly in the installation tree (like in fstab.d or sshd
keys from your old installation).


Regards,
Achim.
-- 
+<[Q+ Matrix-12 WAVE#46+305 Neuron microQkb Andromeda XTk Blofeld]>+

SD adaptations for KORG EX-800 and Poly-800MkII V0.9:
http://Synth.Stromeko.net/Downloads.html#KorgSDada

^ permalink raw reply	[flat|nested] 6+ messages in thread

* help needed - transition from 32bits to 64bits
@ 2023-06-15 10:15 gh
  0 siblings, 0 replies; 6+ messages in thread
From: gh @ 2023-06-15 10:15 UTC (permalink / raw)
  To: cygwin; +Cc: gilbert.harrus

[-- Attachment #1: Type: text/plain, Size: 706 bytes --]

Dear all,

 

Sorry if this question was already answered somewhere in the FAQ.

 

I am running a deprecated 32bits version, and want to switch to 64bits. Install procedure is easy, but does not cover one thing : I
would like to preserve the list of packages I have installed, and minimize the change of paths in my windows environment (did not
change anything for the last 10 years, so I don't want to dig into where are things).

 

Currently, cygwin is in C:\cygwin, which I have moved to C:\cygwin-bck. I then want to install in the now almost empty C:\cygwin,
but copying there the necessary config files so that setup-x86_64.exe knows which packages to download.

 

Thanks in advance,

 

Gilbert


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2023-06-15 17:21 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <648ae4b3.170a0220.7a40.c67dSMTPIN_ADDED_BROKEN@mx.google.com>
2023-06-15 12:47 ` help needed - transition from 32bits to 64bits marco atzeri
2023-06-15 12:58   ` Dan Harkless
2023-06-15 16:10     ` marco atzeri
2023-06-15 14:39   ` gh
     [not found] <43976.2997253396$1686824142@news.gmane.org>
2023-06-15 17:21 ` ASSI
2023-06-15 10:15 gh

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).