mirror of
ssh://git.janware.com/srv/git/janware/proj/jw-pkg
synced 2026-01-26 07:13:55 +01:00
linux-rpm-build.mk, rules.mk, generate-boot-medium.sh: Cleanup commit
This commit is contained in:
parent
bec2fe4ecd
commit
3f0b65cb96
3 changed files with 67 additions and 21 deletions
|
|
@ -206,7 +206,8 @@ dist: clean
|
||||||
mv ../kernel.tar.gz .
|
mv ../kernel.tar.gz .
|
||||||
clean:
|
clean:
|
||||||
rm -rf $(KERNEL_BASE)-*
|
rm -rf $(KERNEL_BASE)-*
|
||||||
rm -rf install/* reiser.patch *~ *.done *.lxdone *.uldone *.patch *.rpm *.tar.gz *.tar $(SCOPE_DRIVER_BASE)
|
rm -rf install/* reiser.patch *~ *.done *.lxdone *.uldone *.patch *.rpm *.tar.gz *.tar \
|
||||||
|
$(SCOPE_DRIVER_BASE)
|
||||||
rm -rf linux linux-$(KERNEL_VERSION) CURRENT_* pax_global_header
|
rm -rf linux linux-$(KERNEL_VERSION) CURRENT_* pax_global_header
|
||||||
rm -f toplevel-makefile EXTRAVERSION COMPLETE_VERSION
|
rm -f toplevel-makefile EXTRAVERSION COMPLETE_VERSION
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -197,10 +197,10 @@ endif
|
||||||
# gcc -M $(CPPFLAGS) $(DEPEND_CPPFLAGS) $(filter-out %.h,$(SRC_ALL_CPP)) -o $@; \
|
# gcc -M $(CPPFLAGS) $(DEPEND_CPPFLAGS) $(filter-out %.h,$(SRC_ALL_CPP)) -o $@; \
|
||||||
# fi
|
# fi
|
||||||
|
|
||||||
.%.o.dep.mk: %.cpp
|
.%.o.dep.mk: %.cpp $(BUILD_H)
|
||||||
gcc -M $(CPPFLAGS) $(DEPEND_CPPFLAGS) $< -o $@
|
gcc -M $(CPPFLAGS) $(DEPEND_CPPFLAGS) $< -o $@
|
||||||
|
|
||||||
.%.o.dep.mk: %.c
|
.%.o.dep.mk: %.c $(BUILD_H)
|
||||||
gcc -M $(CPPFLAGS) $(DEPEND_CPPFLAGS) $< -o $@
|
gcc -M $(CPPFLAGS) $(DEPEND_CPPFLAGS) $< -o $@
|
||||||
|
|
||||||
checkroot:
|
checkroot:
|
||||||
|
|
|
||||||
|
|
@ -3,21 +3,25 @@
|
||||||
myname=`basename $0`
|
myname=`basename $0`
|
||||||
cwd=`pwd`
|
cwd=`pwd`
|
||||||
|
|
||||||
make_initrd()
|
make_initrd_from_template()
|
||||||
{
|
{
|
||||||
template=$1
|
uname_r=$1
|
||||||
modules_dir=$2
|
target=$2
|
||||||
uname_r=$3
|
modules_dir=$3
|
||||||
target=$4
|
template=$4
|
||||||
|
shift 4
|
||||||
|
mod_names="$*"
|
||||||
|
|
||||||
|
# set up work space
|
||||||
dir=`mktemp -d "/tmp/$myname""_XXXXXX"`
|
dir=`mktemp -d "/tmp/$myname""_XXXXXX"`
|
||||||
|
|
||||||
mkdir $dir/source
|
mkdir $dir/source
|
||||||
|
|
||||||
cat $1 | (cd $dir/source; gunzip | cpio -i)
|
# unpack template and copy it
|
||||||
|
cat $template | (cd $dir/source; gunzip | cpio -i)
|
||||||
cp -rp $dir/source $dir/target
|
cp -rp $dir/source $dir/target
|
||||||
rm -rf $dir/target/lib/modules/*
|
rm -rf $dir/target/lib/modules/*
|
||||||
|
|
||||||
|
# copy all modules both in template and kernel
|
||||||
(
|
(
|
||||||
cd $dir/source
|
cd $dir/source
|
||||||
find . -name '*.ko'
|
find . -name '*.ko'
|
||||||
|
|
@ -39,13 +43,42 @@ make_initrd()
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
/sbin/depmod -a -b $dir/target -v $uname_r
|
# copy all explicitly specified modules
|
||||||
|
for mod_name in $mod_names; do
|
||||||
|
echo "processing explicitly requested module $mod_name"
|
||||||
|
mod_source_path=`find $modules_dir -name $mod_name.ko`
|
||||||
|
if [ -z "$mod_source_path" ]; then
|
||||||
|
echo "warning: explicitly specified module $mod_name not found in $uname_r" >&2
|
||||||
|
continue
|
||||||
|
fi
|
||||||
|
|
||||||
|
mod_relpath=`echo $mod_source_path | sed "s%$modules_dir%%g; s/$mod_name.ko$//"`
|
||||||
|
target_path=$dir/target/lib/modules/$uname_r/$mod_relpath
|
||||||
|
echo "copying $mod_name from $mod_relpath to $target_path"
|
||||||
|
mkdir -p $target_path
|
||||||
|
cp -p $mod_source_path $target_path
|
||||||
|
done
|
||||||
|
|
||||||
|
# linuxrc
|
||||||
|
if [ "$linux_rc" ]; then
|
||||||
|
echo "copying $linux_rc to linuxrc"
|
||||||
|
cp $linux_rc $dir/target/init
|
||||||
|
fi
|
||||||
|
|
||||||
|
# depmod
|
||||||
|
/sbin/depmod -a -b $dir/target -v $uname_r > /dev/null
|
||||||
|
|
||||||
|
# pack stuff up
|
||||||
(cd $dir/target; find . | cpio -co) | gzip -9 > $target
|
(cd $dir/target; find . | cpio -co) | gzip -9 > $target
|
||||||
|
|
||||||
rm -rf $dir
|
rm -rf $dir
|
||||||
}
|
}
|
||||||
|
|
||||||
|
unquote()
|
||||||
|
{
|
||||||
|
cat | sed 's/^[ ]*|//'
|
||||||
|
}
|
||||||
|
|
||||||
config_section()
|
config_section()
|
||||||
{
|
{
|
||||||
output_file=
|
output_file=
|
||||||
|
|
@ -64,12 +97,14 @@ boot_sections()
|
||||||
|
|
||||||
name_filter()
|
name_filter()
|
||||||
{
|
{
|
||||||
echo $1 | tr [A-Z] [a-z] | sed 's/\.tar\.gz/.tgz/; s/-/_/g; s/\([^.]*\)\.\([^.]*\)$$/\1@\2/; s/\./_/g; s/@/./'
|
echo $1 | \
|
||||||
|
tr [A-Z] [a-z] | \
|
||||||
|
sed 's/\.tar\.gz/.tgz/; s/-/_/g; s/\([^.]*\)\.\([^.]*\)$$/\1@\2/; s/\./_/g; s/@/./'
|
||||||
}
|
}
|
||||||
|
|
||||||
#make_initrd $template $modules_dir
|
#make_initrd $template $modules_dir
|
||||||
|
|
||||||
set -- `getopt 'f:o:d:' $*`
|
set -- `getopt 'i:f:o:d:' $*`
|
||||||
|
|
||||||
while [ "$1" != -- ]; do
|
while [ "$1" != -- ]; do
|
||||||
case $1 in
|
case $1 in
|
||||||
|
|
@ -86,8 +121,13 @@ while [ "$1" != -- ]; do
|
||||||
boot_dir="$2"
|
boot_dir="$2"
|
||||||
shift
|
shift
|
||||||
;;
|
;;
|
||||||
|
-i)
|
||||||
|
linux_rc="$2"
|
||||||
|
shift
|
||||||
|
;;
|
||||||
*)
|
*)
|
||||||
usage;
|
usage
|
||||||
|
;;
|
||||||
esac
|
esac
|
||||||
shift
|
shift
|
||||||
done
|
done
|
||||||
|
|
@ -105,6 +145,7 @@ echo PROMPT 0 >> $boot_dir/isolinux.cfg
|
||||||
for sec in `boot_sections $opt_config_file`; do
|
for sec in `boot_sections $opt_config_file`; do
|
||||||
|
|
||||||
echo "+ processing section boot.$sec"
|
echo "+ processing section boot.$sec"
|
||||||
|
config_section $opt_config_file boot.$sec
|
||||||
eval `config_section $opt_config_file boot.$sec`
|
eval `config_section $opt_config_file boot.$sec`
|
||||||
|
|
||||||
if [ "$add_boot_dir" ]; then
|
if [ "$add_boot_dir" ]; then
|
||||||
|
|
@ -128,17 +169,21 @@ for sec in `boot_sections $opt_config_file`; do
|
||||||
# create initrd
|
# create initrd
|
||||||
if [ "$initrd_template" ]; then
|
if [ "$initrd_template" ]; then
|
||||||
echo "+ creating initial ram disk from template $initrd_template"
|
echo "+ creating initial ram disk from template $initrd_template"
|
||||||
make_initrd \
|
make_initrd_from_template \
|
||||||
$initrd_template \
|
|
||||||
$add_modules_basedir/$kernel_version \
|
|
||||||
$kernel_version \
|
$kernel_version \
|
||||||
$boot_dir/initrd_$kernel_version_iso
|
$boot_dir/initrd_$kernel_version_iso \
|
||||||
|
$add_modules_basedir/$kernel_version \
|
||||||
|
$initrd_template \
|
||||||
|
$included_modules
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# create isolinux.cfg
|
# create isolinux.cfg
|
||||||
echo "LABEL $kernel_version" >> $boot_dir/isolinux.cfg
|
cat << EOT | unquote >> $boot_dir/isolinux.cfg
|
||||||
echo "KERNEL vmlinuz_$kernel_version_iso" >> $boot_dir/isolinux.cfg
|
|
|
||||||
echo "APPEND initrd=initrd_$kernel_version_iso root=$root_dev" >> $boot_dir/isolinux.cfg
|
|LABEL $kernel_version
|
||||||
|
|KERNEL vmlinuz_$kernel_version_iso
|
||||||
|
|APPEND initrd=initrd_$kernel_version_iso root=$root_dev
|
||||||
|
EOT
|
||||||
done
|
done
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue