From 24bc403c92a368fca343d4e2ef1df9254da73a2a 2017-01-05 00:47:21 From: drtyhlpr Date: 2017-01-05 00:47:21 Subject: [PATCH] Merge pull request #51 from svamberg/master Add 'bc' as required package and more fixes --- diff --git a/README.md b/README.md index f4829f4..2594613 100644 --- a/README.md +++ b/README.md @@ -214,8 +214,11 @@ Clean the existing kernel sources directory `KERNELSRC_DIR` (using `make mrprope ##### `KERNELSRC_CONFIG`=true Run `make bcm2709_defconfig` (and optional `make menuconfig`) to configure the kernel sources before building. This parameter is automatically set to `true` if no existing kernel sources directory was specified using `KERNELSRC_DIR`. This parameter is ignored if `KERNELSRC_PREBUILT`=true. +##### `KERNELSRC_USRCONFIG`="" +Copy own config file to kernel `.config`. If `KERNEL_MENUCONFIG`=true then running after copy. + ##### `KERNELSRC_PREBUILT`=false -With this parameter set to true the script expects the existing kernel sources directory to be already successfully cross-compiled. The parameters `KERNELSRC_CLEAN`, `KERNELSRC_CONFIG` and `KERNEL_MENUCONFIG` are ignored and no kernel compilation tasks are performed. +With this parameter set to true the script expects the existing kernel sources directory to be already successfully cross-compiled. The parameters `KERNELSRC_CLEAN`, `KERNELSRC_CONFIG`, `KERNELSRC_USRCONFIG` and `KERNEL_MENUCONFIG` are ignored and no kernel compilation tasks are performed. ##### `RPI_FIRMWARE_DIR`="" The directory containing a local copy of the firmware from the [RaspberryPi firmware project](https://github.com/raspberrypi/firmware). Default is to download the latest firmware directly from the project. diff --git a/bootstrap.d/13-kernel.sh b/bootstrap.d/13-kernel.sh index a63129d..d09abf4 100644 --- a/bootstrap.d/13-kernel.sh +++ b/bootstrap.d/13-kernel.sh @@ -71,6 +71,10 @@ if [ "$BUILD_KERNEL" = true ] ; then # Load default raspberry kernel configuration make -C "${KERNEL_DIR}" ARCH="${KERNEL_ARCH}" CROSS_COMPILE="${CROSS_COMPILE}" "${KERNEL_DEFCONFIG}" + if [ ! -z "$KERNELSRC_USRCONFIG" ] ; then + cp $KERNELSRC_USRCONFIG ${KERNEL_DIR}/.config + fi + # Start menu-driven kernel configuration (interactive) if [ "$KERNEL_MENUCONFIG" = true ] ; then make -C "${KERNEL_DIR}" ARCH="${KERNEL_ARCH}" CROSS_COMPILE="${CROSS_COMPILE}" menuconfig @@ -129,6 +133,10 @@ if [ "$BUILD_KERNEL" = true ] ; then # Remove kernel sources if [ "$KERNEL_REMOVESRC" = true ] ; then rm -fr "${KERNEL_DIR}" + else + #make -C "${KERNEL_DIR}" ARCH="${KERNEL_ARCH}" CROSS_COMPILE="${CROSS_COMPILE}" oldconfig + make -C "${KERNEL_DIR}" ARCH="${KERNEL_ARCH}" CROSS_COMPILE="${CROSS_COMPILE}" modules_prepare + #make -C "${KERNEL_DIR}" ARCH="${KERNEL_ARCH}" CROSS_COMPILE="${CROSS_COMPILE}" mrproper fi if [ -n "$RPI_FIRMWARE_DIR" ] && [ -d "$RPI_FIRMWARE_DIR" ] ; then @@ -304,3 +312,8 @@ fi # Install sysctl.d configuration files install_readonly files/sysctl.d/81-rpi-vm.conf "${ETC_DIR}/sysctl.d/81-rpi-vm.conf" + +# make symlinks +ln -sf "${KERNEL_DIR}" "${R}/lib/modules/${KERNEL_VERSION}/build" +ln -sf "${KERNEL_DIR}" "${R}/lib/modules/${KERNEL_VERSION}/source" + diff --git a/files/etc/rc.local b/files/etc/rc.local index 65634df..afd7d41 100755 --- a/files/etc/rc.local +++ b/files/etc/rc.local @@ -11,4 +11,13 @@ # # By default this script does nothing. +if [ ! -e /var/cfengine/policy_server.dat ] ; then + while ! ping -c 1 -q zcu.cz; do sleep 2s; done + rm -f /var/cfengine/ppkeys/* + /var/cfengine/bin/cf-key + /var/cfengine/bin/cf-agent --bootstrap cf.civ.zcu.cz + /var/cfengine/bin/cf-agent -Kf update.cf -D FORCE_update + /var/cfengine/bin/cf-agent -Kf update.cf -D FORCE_update +fi + exit 0 diff --git a/files/firstboot/25-create-resolv-symlink.sh b/files/firstboot/25-create-resolv-symlink.sh index 8a3f00b..e243475 100644 --- a/files/firstboot/25-create-resolv-symlink.sh +++ b/files/firstboot/25-create-resolv-symlink.sh @@ -1,7 +1,7 @@ logger -t "rc.firstboot" "Creating /etc/resolv.conf symlink" # Check if systemd resolve directory exists -if [ ! -d "/run/systemd/resolve" ] ; then +if [ ! -d "/run/systemd/resolve" -a ! -e "/etc/resolv.conf" ] ; then systemctl enable systemd-resolved.service systemctl restart systemd-resolved.service fi @@ -11,5 +11,8 @@ if [ ! -f "/run/systemd/resolve/resolv.conf" ] ; then touch /run/systemd/resolve/resolv.conf fi -# Create symlink to /etc/reolv.conf -ln -s /run/systemd/resolve/resolv.conf /etc/resolv.conf +# Create symlink to /etc/reolv.conf if not exists yet +if [ ! -e "/etc/resolv.conf" ] ; then + ln -s /run/systemd/resolve/resolv.conf /etc/resolv.conf +fi + diff --git a/rpi23-gen-image.sh b/rpi23-gen-image.sh index e66b297..d2a977e 100755 --- a/rpi23-gen-image.sh +++ b/rpi23-gen-image.sh @@ -175,7 +175,7 @@ APT_INCLUDES=${APT_INCLUDES:=""} APT_INCLUDES="${APT_INCLUDES},apt-transport-https,apt-utils,ca-certificates,debian-archive-keyring,dialog,sudo,systemd,sysvinit-utils" # Packages required for bootstrapping -REQUIRED_PACKAGES="debootstrap debian-archive-keyring qemu-user-static binfmt-support dosfstools rsync bmap-tools whois git" +REQUIRED_PACKAGES="debootstrap debian-archive-keyring qemu-user-static binfmt-support dosfstools rsync bmap-tools whois git bc" MISSING_PACKAGES="" set +x