2007-09-23 08:04:46 +00:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
# lh_chroot_symlinks(1) - convert symlinks
|
|
|
|
|
|
|
|
set -e
|
|
|
|
|
|
|
|
# Source common functions
|
|
|
|
for FUNCTION in /usr/share/live-helper/functions/*.sh
|
|
|
|
do
|
|
|
|
. ${FUNCTION}
|
|
|
|
done
|
|
|
|
|
|
|
|
# Reading configuration files
|
|
|
|
Read_conffile config/common
|
|
|
|
Read_conffile config/chroot
|
|
|
|
Set_defaults
|
|
|
|
|
|
|
|
# Requiring stage file
|
2007-09-23 08:04:47 +00:00
|
|
|
Require_stagefile .stage/bootstrap
|
2007-09-23 08:04:46 +00:00
|
|
|
|
|
|
|
# Checking lock file
|
2007-09-23 08:04:47 +00:00
|
|
|
Check_lockfile .lock
|
2007-09-23 08:04:46 +00:00
|
|
|
|
|
|
|
# Creating lock file
|
2007-09-23 08:04:47 +00:00
|
|
|
Create_lockfile .lock
|
2007-09-23 08:04:46 +00:00
|
|
|
|
|
|
|
# Checking stage file
|
2007-09-23 08:04:47 +00:00
|
|
|
Check_stagefile .stage/chroot_symlinks
|
2007-09-23 08:04:46 +00:00
|
|
|
|
|
|
|
if [ "${LIVE_SYMLINKS}" = "enabled" ]
|
|
|
|
then
|
2007-09-23 08:04:47 +00:00
|
|
|
if [ -f chroot/usr/bin/symlinks ]
|
2007-09-23 08:04:46 +00:00
|
|
|
then
|
|
|
|
SYMLINKS="true"
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [ -n "${SYMLINKS}" ]
|
|
|
|
then
|
|
|
|
# Installing symlinks
|
|
|
|
case "${LH_APT}" in
|
2007-09-23 08:04:47 +00:00
|
|
|
apt|apt-get)
|
2007-09-23 08:04:46 +00:00
|
|
|
Chroot "apt-get install --yes symlinks"
|
|
|
|
;;
|
|
|
|
|
|
|
|
aptitude)
|
|
|
|
Chroot "aptitude install --assume-yes symlinks"
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
fi
|
|
|
|
|
|
|
|
# Converting symlinks
|
|
|
|
Chroot "symlinks -c -r -s /"
|
|
|
|
|
|
|
|
if [ -n "${SYMLINKS}" ]
|
|
|
|
then
|
|
|
|
# Removing symlinks
|
|
|
|
case "${LH_APT}" in
|
2007-09-23 08:04:47 +00:00
|
|
|
apt|apt-get)
|
2007-09-23 08:04:46 +00:00
|
|
|
Chroot "apt-get remove --purge --yes symlinks"
|
|
|
|
;;
|
|
|
|
|
|
|
|
aptitude)
|
|
|
|
Chroot "aptitude purge --assume-yes symlinks"
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
fi
|
|
|
|
|
|
|
|
# Creating stage file
|
2007-09-23 08:04:47 +00:00
|
|
|
Create_stagefile .stage/chroot_symlinks
|
2007-09-23 08:04:46 +00:00
|
|
|
fi
|