diff --git a/scripts/opkg_offline.sh b/scripts/opkg_offline.sh index b05c25165a5ad889cd6aeb1f86d246acc799020c..0d5682cdbc3115382e55916136b4c8e5bb9b9177 100755 --- a/scripts/opkg_offline.sh +++ b/scripts/opkg_offline.sh @@ -123,7 +123,7 @@ function install_package() resolve_dependency ${dep} install_package ${root} ${pkg} else - echo "Installing package ${pkg}" + log "Installing package ${pkg}" copy_single_opkg ${root} ${pkg} fi } @@ -138,5 +138,5 @@ if [ -z "${2}" ]; then exit 0; fi -echo "Preparing container for swmodd" +echo "Installing pkg [${2}] with dependencies" install_package ${1} ${2} diff --git a/templates/lxc-iopsys b/templates/lxc-iopsys index 675d205786a49bc2ddbd7037384d91cde8bd33b7..372bc03d25aaec8f49783c6e02837b3379f61937 100755 --- a/templates/lxc-iopsys +++ b/templates/lxc-iopsys @@ -53,6 +53,7 @@ install_busybox() ${rootfs}/etc/config \ ${rootfs}/etc/init.d \ ${rootfs}/etc/rc.d \ + ${rootfs}/etc/hotplug.d \ ${rootfs}/bin \ ${rootfs}/sbin \ ${rootfs}/usr/bin \ @@ -141,10 +142,22 @@ EOF chmod +x ${rootfs}/etc/init.d/boot + cat <<EOF >> "${rootfs}/bin/boot_lxc" +#!/bin/sh + +for f in \`ls -1 /etc/init.d/\`; do + /etc/init.d/\$f enable + /etc/init.d/\$f start +done + +/bin/login root +EOF + chmod +x ${rootfs}/bin/boot_lxc + cat <<EOF >> "${rootfs}/etc/inittab" ::sysinit:/etc/init.d/rcS S boot ::shutdown:/etc/init.d/rcS K shutdown -console::askfirst:/bin/login root +console::respawn:/bin/boot_lxc EOF # writable and readable for other chmod 644 "${rootfs}/etc/inittab" || return 1 @@ -268,17 +281,16 @@ lxc.net.0.name = eth0 lxc.net.0.mtu = 1500 EOF - libdirs="\ - lib \ - lib64 \ - usr/lib64" - - #cp -rf /lib/* ${rootfs}/lib/ - #for dir in ${libdirs}; do - # if [ -d "/${dir}" ] && [ -d "${rootfs}/${dir}" ]; then - # echo "lxc.mount.entry = /${dir} ${dir} none ro,bind 0 0" >> "${path}/config" - # fi - #done + libdirs="lib" + + #cp -rf /lib/functions.sh ${rootfs}/lib/ + #cp -rf /lib/functions ${rootfs}/lib/ + #cp -rf /lib/preinit ${rootfs}/lib/ + for dir in ${libdirs}; do + if [ -d "/${dir}" ] && [ -d "${rootfs}/${dir}" ]; then + echo "lxc.mount.entry = /${dir} ${dir} none ro,bind 0 0" >> "${path}/config" + fi + done echo "lxc.mount.entry = /sys/kernel/security sys/kernel/security none ro,bind,optional 0 0" >> "${path}/config" }