From 6f1f7cfc98f419a1d6b08b0356188df3ab355373 Mon Sep 17 00:00:00 2001 From: Christopher Spinrath <christopher.spinrath@rwth-aachen.de> Date: Sun, 27 Sep 2015 22:03:19 +0200 Subject: [PATCH] rootfs_remaster: move simple copy ops to Makefile --- Makefile | 12 ++++++++++++ scripts/rootfs_remaster.sh | 27 +++------------------------ 2 files changed, 15 insertions(+), 24 deletions(-) diff --git a/Makefile b/Makefile index 16ca97e..c127075 100644 --- a/Makefile +++ b/Makefile @@ -239,6 +239,16 @@ ifneq ($(strip $(APT_SOURCE_URL_OVERRIDE)),) echo "deb $(APT_SOURCE_URL_OVERRIDE) $(ISO_RELEASE)-updates main restricted universe multiverse" \ >> "$(call archdir,$*)$(ROOTFS)/etc/apt/sources.list" endif + #set timezone + echo -n "Europe/Berlin" > "$(call archdir,$*)$(ROOTFS)/etc/timezone" + #install kde defaults + mkdir -p "$(call archdir,$*)$(ROOTFS)/etc/skel/.kde/share/config/" + cp "$(CURDIR)/contrib/rootfs/kde_config/"* "$(call archdir,$*)$(ROOTFS)/etc/skel/.kde/share/config/" + #install modprobe.d files + cp "$(CURDIR)/contrib/rootfs/modprobe.d/"* "$(call archdir,$*)$(ROOTFS)/etc/modprobe.d/" + #install sysctl.d files + cp "$(CURDIR)/contrib/rootfs/sysctl.d/"* "$(call archdir,$*)$(ROOTFS)/etc/sysctl.d/" + mkdir -p "$(call archdir,$*)$(LXC_DIR)" lxc-execute --name "lipck_remaster_$*" -P "$(call archdir,$*)$(LXC_DIR)" -f "$(CURDIR)/config/lxc_common.conf" \ -s lxc.arch="$*" -s lxc.rootfs="$(call archdir,$*)$(ROOTFS)" \ @@ -274,6 +284,8 @@ $(call gentargets,$(STATE_DIR)/rootfs_finalized) : $(call archdir,%)$(STATE_DIR) $(RM) "$(call archdir,$*)$(ROOTFS)/etc/resolv.conf" if [ -e "$(call archdir,$*)$(ROOTFS)/etc/resolv.conf.bak" ]; then mv "$(call archdir,$*)$(ROOTFS)/etc/resolv.conf.bak" "$(call archdir,$*)$(ROOTFS)/etc/resolv.conf"; fi $(RM) -r "$(call archdir,$*)$(ROOTFS)/remaster" + #clean up crash reports + $(RM) -rf "$(call archdir,$*)$(ROOTFS)/var/crash/"* $(RM) "$(call archdir,$*)$(STATE_DIR)/rootfs_prepared" touch "$(call archdir,$*)$(STATE_DIR)/rootfs_finalized" diff --git a/scripts/rootfs_remaster.sh b/scripts/rootfs_remaster.sh index 5406f92..b776b2b 100755 --- a/scripts/rootfs_remaster.sh +++ b/scripts/rootfs_remaster.sh @@ -98,9 +98,9 @@ function install_packages() function finalize() { - echo -n "Europe/Berlin" > /etc/timezone - - rm -rf /var/crash/* + #update initramfs - both this script and lipck may have changed files + #that should be copied over in the initramfs + update-initramfs -u if [ -z "$LIPCK_HAS_APT_CACHE" ] then @@ -108,23 +108,6 @@ function finalize() fi } -function install_kde_defaults() -{ - mkdir -p /etc/skel/.kde/share/config/ - cp "$CONTRIB_DIR/kde_config/"* /etc/skel/.kde/share/config/ -} - -function copy_modprobe_d() -{ - cp "$SCRIPT_DIR/contrib/modprobe.d/"* "/etc/modprobe.d/" - update-initramfs -u -} - -function copy_sysctl_d() -{ - cp "$SCRIPT_DIR/contrib/sysctl.d/"* "/etc/sysctl.d/" -} - function hold_packages() { for PKG in $@; do @@ -146,12 +129,8 @@ PKGS_TO_HOLD=$(get_packages_from_file "$CONTRIB_DIR/hold_packages") hold_packages $PKGS_TO_HOLD prepare_install -copy_modprobe_d -copy_sysctl_d install_packages -install_kde_defaults - #i.e. required for applying default-wallpaper patch #echo "compiling glib2 schemas..." #glib-compile-schemas /usr/share/glib-2.0/schemas -- GitLab