Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
L
lxc
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Chen Yisong
lxc
Commits
f9d0d2cb
Commit
f9d0d2cb
authored
Mar 05, 2012
by
InformatiQ
Committed by
Daniel Lezcano
Mar 05, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix cached rootfs update* fix rootfs path* add handling of systemd
Signed-off-by:
InformatiQ
<
rhanna@informatiq.org
>
Signed-off-by:
Daniel Lezcano
<
dlezcano@fr.ibm.com
>
parent
fc3c7f7f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
27 additions
and
8 deletions
+27
-8
lxc-fedora.in
templates/lxc-fedora.in
+27
-8
No files found.
templates/lxc-fedora.in
View file @
f9d0d2cb
...
@@ -69,11 +69,6 @@ EOF
...
@@ -69,11 +69,6 @@ EOF
127.0.0.1 localhost
$name
127.0.0.1 localhost
$name
EOF
EOF
sed
-i
's|.sbin.start_udev||'
${
rootfs_path
}
/etc/rc.sysinit
sed
-i
's|.sbin.start_udev||'
${
rootfs_path
}
/etc/rc.d/rc.sysinit
chroot
${
rootfs_path
}
chkconfig udev-post off
chroot
${
rootfs_path
}
chkconfig network on
dev_path
=
"
${
rootfs_path
}
/dev"
dev_path
=
"
${
rootfs_path
}
/dev"
rm
-rf
$dev_path
rm
-rf
$dev_path
mkdir
-p
$dev_path
mkdir
-p
$dev_path
...
@@ -99,6 +94,23 @@ EOF
...
@@ -99,6 +94,23 @@ EOF
return
0
return
0
}
}
configure_fedora_init
()
{
sed
-i
's|.sbin.start_udev||'
${
rootfs_path
}
/etc/rc.sysinit
sed
-i
's|.sbin.start_udev||'
${
rootfs_path
}
/etc/rc.d/rc.sysinit
chroot
${
rootfs_path
}
chkconfig udev-post off
chroot
${
rootfs_path
}
chkconfig network on
}
configure_fedora_systemd
()
{
unlink
${
rootfs_path
}
/etc/systemd/system/default.target
touch
${
rootfs_path
}
/etc/fstab
chroot
${
rootfs_path
}
ln
-s
/dev/null //etc/systemd/system/udev.service
chroot
${
rootfs_path
}
ln
-s
/lib/systemd/system/multi-user.target /etc/systemd/system/default.target
#dependency on a device unit fails it specially that we disabled udev
sed
-i
's/After=dev-%i.device/After=/'
${
rootfs_path
}
/lib/systemd/system/getty
\@
.service
}
download_fedora
()
download_fedora
()
{
{
...
@@ -170,7 +182,8 @@ copy_fedora()
...
@@ -170,7 +182,8 @@ copy_fedora()
update_fedora
()
update_fedora
()
{
{
chroot
$cache
/rootfs yum
-y
update
YUM
=
"yum --installroot
$cache
/rootfs -y --nogpgcheck"
$YUM
update
}
}
install_fedora
()
install_fedora
()
...
@@ -353,7 +366,7 @@ if [ "$(id -u)" != "0" ]; then
...
@@ -353,7 +366,7 @@ if [ "$(id -u)" != "0" ]; then
fi
fi
rootfs_path
=
$path
/
$name
/
rootfs
rootfs_path
=
$path
/rootfs
config_path
=
$default_path
/
$name
config_path
=
$default_path
/
$name
cache
=
$cache_base
/
$release
cache
=
$cache_base
/
$release
...
@@ -362,7 +375,7 @@ revert()
...
@@ -362,7 +375,7 @@ revert()
echo
"Interrupted, so cleaning up"
echo
"Interrupted, so cleaning up"
lxc-destroy
-n
$name
lxc-destroy
-n
$name
# maybe was interrupted before copy config
# maybe was interrupted before copy config
rm
-rf
$path
/
$name
rm
-rf
$path
rm
-rf
$default_path
/
$name
rm
-rf
$default_path
/
$name
echo
"exiting..."
echo
"exiting..."
exit
1
exit
1
...
@@ -388,6 +401,12 @@ if [ $? -ne 0 ]; then
...
@@ -388,6 +401,12 @@ if [ $? -ne 0 ]; then
exit
1
exit
1
fi
fi
type
/bin/systemd
>
/dev/null 2>&1
if
[
$?
-ne
0
]
;
then
configure_fedora_init
else
configure_fedora_systemd
fi
if
[
!
-z
$clean
]
;
then
if
[
!
-z
$clean
]
;
then
clean
||
exit
1
clean
||
exit
1
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment