Re: How to run a script when the live system boots
-----BEGIN PGP SIGNED MESSAGE-----
On Sun, Nov 01, 2009 at 12:15:04PM +0100, email@example.com wrote:
> It's a pity, but nobody replied to my (and Tim Legg's) post. I hope you don't mind, if I ask you again for your help. Thank you.
> On Tue, 27 Oct 2009 21:05:56 +0100
> "firstname.lastname@example.org" <email@example.com> wrote:
> > Hello,
> > I tried to run a script immediately after all other scripts when the live system boots. I read the FAQ and did the following:
> > mkdir -p config/chroot_local-includes/usr/share/initramfs-tools/scripts/live-bottom
> > Then I wrote the following script
> > #!/bin/sh
> > touch /root/test.txt
> > and saved it as "99script"
If this is doing what I think it's doing (sorry, no time to double-check
now, so take the following with a grain of salt), the script is running
at the "bottom" phase of the initramfs. At this point in time, the root
file system is mounted on /root (so I'd expect your file to appear
later as /test.txt, after the file system's root has been "pivot"ed),
and it is mounted read-only, so I'd expect the script to fail.
The least you'd have to do (if all my theories are correct) would be to
remount whatever is mounted on /root as read-write.
 The root file system (i.e. the one mounted on /) at this moment is a
RAM file system (whatever got unpacked from the initramfs image) while
the system tries to figure out what device to actually use as root.
- -- tomás
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)
-----END PGP SIGNATURE-----