Saturday, April 27, 2024
 Popular · Latest · Hot · Upcoming
15
rated 0 times [  15] [ 0]  / answers: 1 / hits: 38176  / 2 Years ago, sun, january 2, 2022, 2:46:45

So I'm looking at:



https://help.ubuntu.com/community/LiveCDCustomizationFromScratch



and trying the following within a bash script:



sudo chroot chroot

mount none -t proc /proc
mount none -t sysfs /sys
mount none -t devpts /dev/pts


Running the script drops to a shell at sudo chroot chroot. When I exit that I get the expected warnings about mount needing root. Is there a way I can keep all this within one shell script?



Edit: I want this to be a repeatable process, which is why I want to script the whole thing rather than type it in time and time again.


More From » bash

 Answers
0

Create a second script (e.g. chroot.sh) and place it in your chroot/ folder.



Now edit the command in your original script to this:



chroot chroot/ ./chroot.sh


Now the script chroot.sh will be executed inside your chroot.


[#22340] Tuesday, January 4, 2022, 2 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
tatoethin

Total Points: 377
Total Questions: 110
Total Answers: 98

Location: Saudi Arabia
Member since Sat, Aug 20, 2022
2 Years ago
;