autoinstall early-commands

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

autoinstall early-commands

Jerry Geis
I am trying to write some commands in the early-commands section that
needs to check if /dev/sda1 exists, if so mount it , cp off /etc/sysconfig/network-scripts/ifcfg-eth to /target/root/ifcfg-eth0

however I dont know how to do the first mount such that autoinstall is happy and does not exit with error if /dev/sda1 does not exits.

How do you do that ?
Thanks,

Jerry

--
ubuntu-users mailing list
[hidden email]
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
Reply | Threaded
Open this post in threaded view
|

Re: autoinstall early-commands

ubuntu-users mailing list
On Sat, 16 Jan 2021 09:25:03 -0500, Jerry Geis wrote:
>I am trying to write some commands in the early-commands section that
>needs to check if /dev/sda1 exists, if so mount it , cp off
>/etc/sysconfig/network-scripts/ifcfg-eth to /target/root/ifcfg-eth0

IIUC "early-commands" are shell commands? If so, then just use the
shell command "if" ("test").

[rocketmouse@archlinux ~]$ test -e /dev/sdz1; echo $?
1
[rocketmouse@archlinux ~]$ test -e /dev/sda1; echo $?
0
[rocketmouse@archlinux ~]$ if [ -e /dev/sdz1 ]; then echo "mount && cp"; fi
[rocketmouse@archlinux ~]$ if [ -e /dev/sda1 ]; then echo "mount && cp"; fi
mount && cp
[rocketmouse@archlinux ~]$

--
ubuntu-users mailing list
[hidden email]
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
Reply | Threaded
Open this post in threaded view
|

Re: autoinstall early-commands

Jerry Geis


On Sat, Jan 16, 2021 at 12:26 PM Ralf Mardorf via ubuntu-users <[hidden email]> wrote:
On Sat, 16 Jan 2021 09:25:03 -0500, Jerry Geis wrote:
>I am trying to write some commands in the early-commands section that
>needs to check if /dev/sda1 exists, if so mount it , cp off
>/etc/sysconfig/network-scripts/ifcfg-eth to /target/root/ifcfg-eth0

IIUC "early-commands" are shell commands? If so, then just use the
shell command "if" ("test").

[rocketmouse@archlinux ~]$ test -e /dev/sdz1; echo $?
1
[rocketmouse@archlinux ~]$ test -e /dev/sda1; echo $?
0
[rocketmouse@archlinux ~]$ if [ -e /dev/sdz1 ]; then echo "mount && cp"; fi
[rocketmouse@archlinux ~]$ if [ -e /dev/sda1 ]; then echo "mount && cp"; fi
mount && cp
[rocketmouse@archlinux ~]$

--
ubuntu-users mailing list
[hidden email]
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users



Thanks Ralf!

Jerry 

--
ubuntu-users mailing list
[hidden email]
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users