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
6ee795d2
Commit
6ee795d2
authored
Apr 04, 2014
by
Stéphane Graber
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Revert "archlinux: Code cleanups"
This reverts commit
34fd08f8
.
parent
34fd08f8
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
20 deletions
+13
-20
lxc-archlinux.in
templates/lxc-archlinux.in
+13
-20
No files found.
templates/lxc-archlinux.in
View file @
6ee795d2
...
@@ -71,10 +71,9 @@ split_string() {
...
@@ -71,10 +71,9 @@ split_string() {
# Arch-specific preconfiguration for container
# Arch-specific preconfiguration for container
configure_arch
()
{
configure_arch
()
{
#
on ArchLinux, read defaults from host systemd configuration
#
read locale and timezone defaults from system rc.conf if running on Arch
if
[
"
${
is_arch
}
"
]
;
then
if
[
"
${
is_arch
}
"
]
;
then
cp
-p
/etc/vconsole.conf /etc/locale.conf /etc/locale.gen
\
cp
-p
/etc/vconsole.conf /etc/locale.conf /etc/locale.gen
"
${
rootfs_path
}
/etc/"
"
${
rootfs_path
}
/etc/"
else
else
echo
"LANG=
${
default_lang
}
"
>
"
${
rootfs_path
}
/etc/locale.conf"
echo
"LANG=
${
default_lang
}
"
>
"
${
rootfs_path
}
/etc/locale.conf"
echo
"KEYMAP=us"
>
"
${
rootfs_path
}
/etc/vconsole.conf"
echo
"KEYMAP=us"
>
"
${
rootfs_path
}
/etc/vconsole.conf"
...
@@ -90,25 +89,22 @@ EOF
...
@@ -90,25 +89,22 @@ EOF
fi
fi
fi
fi
fi
fi
# hostname and nameservers
echo
"
${
name
}
"
>
"
${
rootfs_path
}
/etc/hostname"
echo
"
${
name
}
"
>
"
${
rootfs_path
}
/etc/hostname"
while
read
r
;
do
cat
>
"
${
rootfs_path
}
/etc/hosts"
<<
EOF
[[
$r
=
~ ^nameserver
]]
&&
echo
"
$r
"
127.0.0.1 localhost.localdomain localhost
${
name
}
done
< /etc/resolv.conf
>
"
${
rootfs_path
}
/etc/resolv.conf"
::1 localhost.localdomain localhost
EOF
grep
nameserver /etc/resolv.conf
>
"
${
rootfs_path
}
/etc/resolv.conf"
# chroot and configure system
arch-chroot
"
${
rootfs_path
}
"
/bin/bash
-s
<<
EOF
arch-chroot
"
${
rootfs_path
}
"
/bin/bash
-s
<<
EOF
mkdir /run/lock
mkdir /run/lock
locale-gen
locale-gen
ln -s /usr/share/zoneinfo/
${
default_timezone
}
/etc/localtime
ln -s /usr/share/zoneinfo/
${
default_timezone
}
/etc/localtime
# disable services unavailable for container
# disable services unavailable for container
for i in systemd-udevd.service \
ln -s /dev/null /etc/systemd/system/systemd-udevd.service
systemd-udevd-control.socket \
ln -s /dev/null /etc/systemd/system/systemd-udevd-control.socket
systemd-udevd-kernel.socket \
ln -s /dev/null /etc/systemd/system/systemd-udevd-kernel.socket
proc-sys-fs-binfmt_misc.automount; do
ln -s /dev/null /etc/systemd/system/proc-sys-fs-binfmt_misc.automount
ln -s /dev/null /etc/systemd/system/\
$i
done
# set default systemd target
# set default systemd target
ln -s /lib/systemd/system/multi-user.target /etc/systemd/system/default.target
ln -s /lib/systemd/system/multi-user.target /etc/systemd/system/default.target
# initialize pacman keyring
# initialize pacman keyring
...
@@ -145,6 +141,7 @@ lxc.cgroup.devices.allow = c 1:5 rwm
...
@@ -145,6 +141,7 @@ lxc.cgroup.devices.allow = c 1:5 rwm
lxc.cgroup.devices.allow = c 1:7 rwm
lxc.cgroup.devices.allow = c 1:7 rwm
lxc.cgroup.devices.allow = c 1:8 rwm
lxc.cgroup.devices.allow = c 1:8 rwm
lxc.cgroup.devices.allow = c 1:9 rwm
lxc.cgroup.devices.allow = c 1:9 rwm
lxc.cgroup.devices.allow = c 1:9 rwm
lxc.cgroup.devices.allow = c 4:1 rwm
lxc.cgroup.devices.allow = c 4:1 rwm
lxc.cgroup.devices.allow = c 5:0 rwm
lxc.cgroup.devices.allow = c 5:0 rwm
lxc.cgroup.devices.allow = c 5:1 rwm
lxc.cgroup.devices.allow = c 5:1 rwm
...
@@ -322,8 +319,4 @@ if [ -n "${root_passwd}" ]; then
...
@@ -322,8 +319,4 @@ if [ -n "${root_passwd}" ]; then
echo
"root:
${
root_passwd
}
"
|
chroot
"
${
rootfs_path
}
"
chpasswd
echo
"root:
${
root_passwd
}
"
|
chroot
"
${
rootfs_path
}
"
chpasswd
fi
fi
cat
<<
EOF
echo
"container config is
${
config_path
}
/config"
ArchLinux container
${
name
}
is successfully created! The configuration is
stored in
${
config_path
}
/config. Please refer to https://wiki.archlinux.org for
information about configuring ArchLinux.
EOF
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