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
bc24fe4d
Commit
bc24fe4d
authored
Jun 07, 2010
by
Wilhelm Meier
Committed by
Daniel Lezcano
Jun 07, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
few enhancement on the ubuntu template
Improved and cleanup the ubuntu template. Signed-off-by:
Daniel Lezcano
<
dlezcano@fr.ibm.com
>
Signed-off-by:
Wilhelm Meier
<
wilhelm.meier@fh-kl.de
>
parent
c01d62f2
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
15 deletions
+21
-15
lxc-ubuntu.in
templates/lxc-ubuntu.in
+21
-15
No files found.
templates/lxc-ubuntu.in
View file @
bc24fe4d
...
@@ -59,9 +59,10 @@ description "Container Upstart"
...
@@ -59,9 +59,10 @@ description "Container Upstart"
start on startup
start on startup
script
script
rm -rf /var/run/*
rm -rf /var/run/*.pid
/sbin/initctl emit stopped JOB=udevtrigger
rm -rf /var/run/network/*
/sbin/initctl emit started JOB=udev
/sbin/initctl emit stopped JOB=udevtrigger --no-wait
/sbin/initctl emit started JOB=udev --no-wait
end script
end script
EOF
EOF
...
@@ -82,32 +83,37 @@ EOF
...
@@ -82,32 +83,37 @@ EOF
# /lib/init/fstab: lxc system fstab
# /lib/init/fstab: lxc system fstab
none /spu spufs gid=spu,optional 0 0
none /spu spufs gid=spu,optional 0 0
none /tmp none defaults 0 0
none /tmp none defaults 0 0
none /var/run tmpfs mode=0755,nosuid,showthrough 0 0
none /var/lock tmpfs nodev,noexec,nosuid,showthrough 0 0
none /var/lock tmpfs nodev,noexec,nosuid,showthrough 0 0
none /lib/init/rw tmpfs mode=0755,nosuid,optional 0 0
none /lib/init/rw tmpfs mode=0755,nosuid,optional 0 0
EOF
EOF
# reconfigure some services
# reconfigure some services
chroot
$rootfs
locale-gen en_US.UTF-8
if
[
-z
"
$LANG
"
]
;
then
chroot
$rootfs
locale-gen en_US.UTF-8
chroot
$rootfs
update-locale
LANG
=
en_US.UTF-8
else
chroot
$rootfs
locale-gen
$LANG
chroot
$rootfs
update-locale
LANG
=
$LANG
fi
# remove pointless services in a container
# remove pointless services in a container
chroot
$rootfs
/usr/sbin/update-rc.d
-f
ondemand remove
chroot
$rootfs
/usr/sbin/update-rc.d
-f
ondemand remove
chroot
$rootfs
/bin/bash
-c
'cd /etc/init; for f in $(ls u*.conf); do
echo $f;
mv $f $f.orig; done'
chroot
$rootfs
/bin/bash
-c
'cd /etc/init; for f in $(ls u*.conf); do mv $f $f.orig; done'
chroot
$rootfs
/bin/bash
-c
'cd /etc/init; for f in $(ls tty[2-9].conf); do
echo $f;
mv $f $f.orig; done'
chroot
$rootfs
/bin/bash
-c
'cd /etc/init; for f in $(ls tty[2-9].conf); do mv $f $f.orig; done'
chroot
$rootfs
/bin/bash
-c
'cd /etc/init; for f in $(ls plymouth*.conf); do
echo $f;
mv $f $f.orig; done'
chroot
$rootfs
/bin/bash
-c
'cd /etc/init; for f in $(ls plymouth*.conf); do mv $f $f.orig; done'
chroot
$rootfs
/bin/bash
-c
'cd /etc/init; for f in $(ls hwclock*.conf); do
echo $f;
mv $f $f.orig; done'
chroot
$rootfs
/bin/bash
-c
'cd /etc/init; for f in $(ls hwclock*.conf); do mv $f $f.orig; done'
chroot
$rootfs
/bin/bash
-c
'cd /etc/init; for f in $(ls module*.conf); do
echo $f;
mv $f $f.orig; done'
chroot
$rootfs
/bin/bash
-c
'cd /etc/init; for f in $(ls module*.conf); do mv $f $f.orig; done'
echo
"Please change root-password !"
echo
"root:root"
|
chroot
$rootfs
chpasswd
echo
"root:root"
|
chroot
$rootfs
chpasswd
echo
"Root password is 'root', please change !"
return
0
return
0
}
}
download_ubuntu
()
download_ubuntu
()
{
{
packages
=
dialog,apt,resolvconf,iproute,inetutils-ping,vim,dhcp3-client,ssh,lsb-release
packages
=
dialog,apt,
apt-utils,
resolvconf,iproute,inetutils-ping,vim,dhcp3-client,ssh,lsb-release
cache
=
$1
cache
=
$1
arch
=
$2
arch
=
$2
...
@@ -270,8 +276,8 @@ EOF
...
@@ -270,8 +276,8 @@ EOF
options
=
$(
getopt
-o
hp:n:c
-l
help
,path:,name:,clean
--
"
$@
"
)
options
=
$(
getopt
-o
hp:n:c
-l
help
,path:,name:,clean
--
"
$@
"
)
if
[
$?
-ne
0
]
;
then
if
[
$?
-ne
0
]
;
then
usage
$(
basename
$0
)
usage
$(
basename
$0
)
exit
1
exit
1
fi
fi
eval set
--
"
$options
"
eval set
--
"
$options
"
...
@@ -283,7 +289,7 @@ do
...
@@ -283,7 +289,7 @@ do
-n
|
--name
)
name
=
$2
;
shift
2
;;
-n
|
--name
)
name
=
$2
;
shift
2
;;
-c
|
--clean
)
clean
=
$2
;
shift
2
;;
-c
|
--clean
)
clean
=
$2
;
shift
2
;;
--
)
shift
1
;
break
;;
--
)
shift
1
;
break
;;
*
)
break
;;
*
)
break
;;
esac
esac
done
done
...
...
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