kickstart post-installation script issues

Hi There, I have a problem to run the kickstart post-installation script on Red Hat/CentOS. The script is quite simple as follows: %post --log=/root/ks-post.log mkdir /home/tmp cd /root wget -nH http://192.168.1.10/afile -P /root/ %end Basically, I tried to make a directory /home/tmp, and cd to /root and copy a file called "afile" to /root. The log file "ks-post.log" was created correctly, but the /home/tmp was create with a question mark at the end: /home/tmp? The file "afile" was copied to /root/? The log file showed the following error message: cd /root^M No such file or directory I have tried "--nochroot" option and prepend every directory name with /mnt/sysimage/, but I have still got the same issues. Cd to /home/tmp showed cd /home/tmp^M/ Thanks in advance for any help. Cheers, Bill

DOS linefeed/carriage return characters maybe? On Tue, Sep 9, 2014 at 8:53 PM, Bill <billy2048@gmail.com> wrote:
Hi There,
I have a problem to run the kickstart post-installation script on Red Hat/CentOS. The script is quite simple as follows:
%post --log=/root/ks-post.log
mkdir /home/tmp
cd /root
wget -nH http://192.168.1.10/afile -P /root/
%end
Basically, I tried to make a directory /home/tmp, and cd to /root and copy a file called “afile” to /root.
The log file “ks-post.log” was created correctly, but the /home/tmp was create with a question mark at the end: /home/tmp?
The file “afile” was copied to /root/?
The log file showed the following error message:
cd /root^M No such file or directory
I have tried "--nochroot" option and prepend every directory name with /mnt/sysimage/, but I have still got the same issues. Cd to /home/tmp showed cd /home/tmp^M/
Thanks in advance for any help.
Cheers,
Bill
_______________________________________________ luv-main mailing list luv-main@luv.asn.au http://lists.luv.asn.au/listinfo/luv-main

It looks like DOS linefeed/carriage return characters issue, however, the kickstart file was created on Red Hat machine using vi. From: Richard Andrews [mailto:bflatmaj7th@gmail.com] Sent: Tuesday, September 09, 2014 9:13 PM To: Bill Cc: luv-main@luv.asn.au Subject: Re: kickstart post-installation script issues DOS linefeed/carriage return characters maybe? On Tue, Sep 9, 2014 at 8:53 PM, Bill <billy2048@gmail.com> wrote: Hi There, I have a problem to run the kickstart post-installation script on Red Hat/CentOS. The script is quite simple as follows: %post --log=/root/ks-post.log mkdir /home/tmp cd /root wget -nH http://192.168.1.10/afile -P /root/ %end Basically, I tried to make a directory /home/tmp, and cd to /root and copy a file called “afile” to /root. The log file “ks-post.log” was created correctly, but the /home/tmp was create with a question mark at the end: /home/tmp? The file “afile” was copied to /root/? The log file showed the following error message: cd /root^M No such file or directory I have tried "--nochroot" option and prepend every directory name with /mnt/sysimage/, but I have still got the same issues. Cd to /home/tmp showed cd /home/tmp^M/ Thanks in advance for any help. Cheers, Bill _______________________________________________ luv-main mailing list luv-main@luv.asn.au http://lists.luv.asn.au/listinfo/luv-main

On 09.09.14 21:19, Bill wrote:
It looks like DOS linefeed/carriage return characters issue, however, the kickstart file was created on Red Hat machine using vi.
On opening the file again, on the Red Hat machine using vi, what is the result of typing: :set ff ? <CR> If it's "fileformat=dos", then vi (which is mostly aliased to vim these days) has been influenced to produce LF/CR line endings, either by configuration or by opening a tainted file to make the new file. To repair, type: :set ff=unix :wq Now the file should be good. Erik -- Animals can be driven crazy by putting too many in too small a pen. Homo sapiens is the only animal that voluntarily does this to himself. - Lazarus Long

Thanks very much Erik, The problem solved. Didn't know this trick of vi. The script is working very well now. Cheers, Bill -----Original Message----- From: luv-main-bounces@luv.asn.au [mailto:luv-main-bounces@luv.asn.au] On Behalf Of Erik Christiansen Sent: Tuesday, September 09, 2014 9:50 PM To: luv-main@luv.asn.au Subject: Re: kickstart post-installation script issues On 09.09.14 21:19, Bill wrote:
It looks like DOS linefeed/carriage return characters issue, however, the kickstart file was created on Red Hat machine using vi.
On opening the file again, on the Red Hat machine using vi, what is the result of typing: :set ff ? <CR> If it's "fileformat=dos", then vi (which is mostly aliased to vim these days) has been influenced to produce LF/CR line endings, either by configuration or by opening a tainted file to make the new file. To repair, type: :set ff=unix :wq Now the file should be good. Erik -- Animals can be driven crazy by putting too many in too small a pen. Homo sapiens is the only animal that voluntarily does this to himself. - Lazarus Long _______________________________________________ luv-main mailing list luv-main@luv.asn.au http://lists.luv.asn.au/listinfo/luv-main

On 09.09.14 22:16, Bill wrote:
Thanks very much Erik,
We all try to throw a small lump of cheese back into the fondue, now and then.
The problem solved. Didn't know this trick of vi.
TBT, venerable traditional vi can't do everything that we take for granted in the modern "vi" which is included in distros today. If on e.g ubuntu 10.04.1 you try: $ vi --version VIM - Vi IMproved 7.2 it reveals itself to be vim, i.e. vi on steroids. And in vim: :help ff chucks up a help window, which admits that the fileformat capability is "{not in Vi}". (But a genuine ancient vi can only be encountered in the older pyramids at Ghiza, where the source code is bound to be found inscribed on the walls, I think.) I'm not sure that it's possible to master all that vim (or emacs) can do, but it's enough fun to pick up what makes life easier as we go. When I figured out how to set up text folding to suit my needs, the improvement in big documents was giddying.
The script is working very well now.
Ah, Richard's snapshot diagnosis was spot on, then. Erik -- The future is a race between education and catastrophe. - H. G. Wells
participants (3)
-
Bill
-
Erik Christiansen
-
Richard Andrews