Re: How to run a script when the live system boots
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
On Sun, Nov 01, 2009 at 12:15:04PM +0100, os.news@gmx.de 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.
> Greetings,
> Oliver
>
> On Tue, 27 Oct 2009 21:05:56 +0100
> "os.news@gmx.de" <os.news@gmx.de> 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[1] (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.
[1] 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.
Regards
- -- tomás
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)
iD8DBQFK7nA0Bcgs9XrR2kYRAu5lAJ4jpIP8uK0GdQln8eCk2lhpef37PgCeKN92
ENqvgZ0w3yxi2cBXMx4YZ80=
=ghxj
-----END PGP SIGNATURE-----
Reply to: