diff options
-rw-r--r-- | Makefile | 8 | ||||
-rwxr-xr-x | src/initrd.sh | 11 |
2 files changed, 13 insertions, 6 deletions
@@ -105,6 +105,8 @@ install-submodules-stamp: install-submodules | |||
105 | install-bin-programs: ${bin_programs} | 105 | install-bin-programs: ${bin_programs} |
106 | install -p ${bin_programs} ${instdir}${samizdat_bindir} | 106 | install -p ${bin_programs} ${instdir}${samizdat_bindir} |
107 | 107 | ||
108 | CP=cp --preserve=timestamps -r | ||
109 | |||
108 | install-stamp: install-bin-programs samizdat-paths.sh ${compiled_programs} | 110 | install-stamp: install-bin-programs samizdat-paths.sh ${compiled_programs} |
109 | mkdir -p ${instdir}${samizdat_initrd_files_dir} | 111 | mkdir -p ${instdir}${samizdat_initrd_files_dir} |
110 | mkdir -p ${instdir}${samizdat_child_dir} | 112 | mkdir -p ${instdir}${samizdat_child_dir} |
@@ -112,7 +114,7 @@ install-stamp: install-bin-programs samizdat-paths.sh ${compiled_programs} | |||
112 | mkdir -p ${instdir}${samizdat_initramfs_conf_dir} | 114 | mkdir -p ${instdir}${samizdat_initramfs_conf_dir} |
113 | mkdir -p ${instdir}${samizdat_isolinux_dir} | 115 | mkdir -p ${instdir}${samizdat_isolinux_dir} |
114 | mkdir -p ${instdir}${samizdat_linux_dir} | 116 | mkdir -p ${instdir}${samizdat_linux_dir} |
115 | cp -r ${initrd_files} ${instdir}${samizdat_initrd_files_dir} | 117 | $(CP) ${initrd_files} ${instdir}${samizdat_initrd_files_dir} |
116 | cp -r ${initramfs_conf_files} ${instdir}${samizdat_initramfs_conf_dir} | 118 | $(CP) ${initramfs_conf_files} ${instdir}${samizdat_initramfs_conf_dir} |
117 | cp -r ${isolinux_files} ${instdir}${samizdat_isolinux_dir} | 119 | $(CP) ${isolinux_files} ${instdir}${samizdat_isolinux_dir} |
118 | touch $@ | 120 | touch $@ |
diff --git a/src/initrd.sh b/src/initrd.sh index b99aa4e..1414c89 100755 --- a/src/initrd.sh +++ b/src/initrd.sh | |||
@@ -19,7 +19,8 @@ force_rebuild() | |||
19 | 19 | ||
20 | rebuild() | 20 | rebuild() |
21 | { | 21 | { |
22 | [ ! -f "$apt_dependencies" ] || sudo apt-get install -q=10 --no-upgrade -y $(cat "$apt_dependencies") | 22 | [ ! -f "$apt_dependencies" ] || |
23 | sudo apt-get install -q=10 --no-upgrade -y $(cat "$apt_dependencies") | ||
23 | 24 | ||
24 | set -ex | 25 | set -ex |
25 | cp -f /boot/vmlinuz-"${kernel_version}" "$vmlinuz" | 26 | cp -f /boot/vmlinuz-"${kernel_version}" "$vmlinuz" |
@@ -30,6 +31,10 @@ rebuild() | |||
30 | 31 | ||
31 | if [ ! -e "$initrd" -o ! -e "$vmlinuz" ]; then | 32 | if [ ! -e "$initrd" -o ! -e "$vmlinuz" ]; then |
32 | rebuild | 33 | rebuild |
33 | elif [ "$(find_source_dirs -newer "$initrd" -print -quit)" ]; then | 34 | else |
34 | rebuild | 35 | found=$(find_source_dirs -newer "$initrd" -print -quit) |
36 | if [ "$found" ]; then | ||
37 | echo "initrd.sh: rebuild forced: found modified source: $found" | ||
38 | rebuild | ||
39 | fi | ||
35 | fi | 40 | fi |