diff -NurpP linux-2.6.5/arch/alpha/Kconfig linux-2.6.5-vs1.9.0pre12.2+namespacefix+memdebug/arch/alpha/Kconfig --- linux-2.6.5/arch/alpha/Kconfig 2004-04-04 05:37:40.000000000 +0200 +++ linux-2.6.5-vs1.9.0pre12.2+namespacefix+memdebug/arch/alpha/Kconfig 2004-04-22 11:30:16.000000000 +0200 @@ -692,6 +692,8 @@ config DEBUG_INFO endmenu +source "kernel/vserver/Kconfig" + source "security/Kconfig" source "crypto/Kconfig" diff -NurpP linux-2.6.5/arch/alpha/kernel/ptrace.c linux-2.6.5-vs1.9.0pre12.2+namespacefix+memdebug/arch/alpha/kernel/ptrace.c --- linux-2.6.5/arch/alpha/kernel/ptrace.c 2004-04-04 05:38:13.000000000 +0200 +++ linux-2.6.5-vs1.9.0pre12.2+namespacefix+memdebug/arch/alpha/kernel/ptrace.c 2004-04-22 11:30:16.000000000 +0200 @@ -287,6 +287,8 @@ do_sys_ptrace(long request, long pid, lo read_unlock(&tasklist_lock); if (!child) goto out_notsk; + if (!vx_check(vx_task_xid(child), VX_WATCH|VX_IDENT)) + goto out; if (request == PTRACE_ATTACH) { ret = ptrace_attach(child); diff -NurpP linux-2.6.5/arch/alpha/kernel/systbls.S linux-2.6.5-vs1.9.0pre12.2+namespacefix+memdebug/arch/alpha/kernel/systbls.S --- linux-2.6.5/arch/alpha/kernel/systbls.S 2004-04-04 05:37:36.000000000 +0200 +++ linux-2.6.5-vs1.9.0pre12.2+namespacefix+memdebug/arch/alpha/kernel/systbls.S 2004-04-22 11:30:16.000000000 +0200 @@ -291,7 +291,7 @@ sys_call_table: .quad alpha_ni_syscall /* 270 */ .quad alpha_ni_syscall .quad alpha_ni_syscall - .quad alpha_ni_syscall + .quad sys_vserver /* 273 sys_vserver */ .quad alpha_ni_syscall .quad alpha_ni_syscall /* 275 */ .quad alpha_ni_syscall diff -NurpP linux-2.6.5/arch/arm/Kconfig linux-2.6.5-vs1.9.0pre12.2+namespacefix+memdebug/arch/arm/Kconfig --- linux-2.6.5/arch/arm/Kconfig 2004-04-04 05:37:07.000000000 +0200 +++ linux-2.6.5-vs1.9.0pre12.2+namespacefix+memdebug/arch/arm/Kconfig 2004-04-22 11:30:16.000000000 +0200 @@ -738,6 +738,8 @@ config DEBUG_CLPS711X_UART2 endmenu +source "kernel/vserver/Kconfig" + source "security/Kconfig" source "crypto/Kconfig" diff -NurpP linux-2.6.5/arch/arm/kernel/ptrace.c linux-2.6.5-vs1.9.0pre12.2+namespacefix+memdebug/arch/arm/kernel/ptrace.c --- linux-2.6.5/arch/arm/kernel/ptrace.c 2004-04-04 05:36:18.000000000 +0200 +++ linux-2.6.5-vs1.9.0pre12.2+namespacefix+memdebug/arch/arm/kernel/ptrace.c 2004-04-22 11:30:16.000000000 +0200 @@ -754,6 +754,8 @@ asmlinkage int sys_ptrace(long request, read_unlock(&tasklist_lock); if (!child) goto out; + if (!vx_check(vx_task_xid(child), VX_WATCH|VX_IDENT)) + goto out_tsk; ret = -EPERM; if (pid == 1) /* you may not mess with init */ diff -NurpP linux-2.6.5/arch/arm26/Kconfig linux-2.6.5-vs1.9.0pre12.2+namespacefix+memdebug/arch/arm26/Kconfig --- linux-2.6.5/arch/arm26/Kconfig 2004-04-04 05:37:23.000000000 +0200 +++ linux-2.6.5-vs1.9.0pre12.2+namespacefix+memdebug/arch/arm26/Kconfig 2004-04-22 11:30:16.000000000 +0200 @@ -327,6 +327,8 @@ config DEBUG_LL endmenu +source "kernel/vserver/Kconfig" + source "security/Kconfig" source "crypto/Kconfig" diff -NurpP linux-2.6.5/arch/arm26/kernel/ptrace.c linux-2.6.5-vs1.9.0pre12.2+namespacefix+memdebug/arch/arm26/kernel/ptrace.c --- linux-2.6.5/arch/arm26/kernel/ptrace.c 2004-04-04 05:37:07.000000000 +0200 +++ linux-2.6.5-vs1.9.0pre12.2+namespacefix+memdebug/arch/arm26/kernel/ptrace.c 2004-04-22 11:30:17.000000000 +0200 @@ -691,6 +691,8 @@ asmlinkage int sys_ptrace(long request, read_unlock(&tasklist_lock); if (!child) goto out; + if (!vx_check(vx_task_xid(child), VX_WATCH|VX_IDENT)) + goto out_tsk; ret = -EPERM; if (pid == 1) /* you may not mess with init */ diff -NurpP linux-2.6.5/arch/cris/Kconfig linux-2.6.5-vs1.9.0pre12.2+namespacefix+memdebug/arch/cris/Kconfig --- linux-2.6.5/arch/cris/Kconfig 2004-04-04 05:38:15.000000000 +0200 +++ linux-2.6.5-vs1.9.0pre12.2+namespacefix+memdebug/arch/cris/Kconfig 2004-04-22 11:30:17.000000000 +0200 @@ -214,6 +214,8 @@ config PROFILE_SHIFT endmenu +source "kernel/vserver/Kconfig" + source "security/Kconfig" source "crypto/Kconfig" diff -NurpP linux-2.6.5/arch/h8300/Kconfig linux-2.6.5-vs1.9.0pre12.2+namespacefix+memdebug/arch/h8300/Kconfig --- linux-2.6.5/arch/h8300/Kconfig 2004-04-04 05:37:41.000000000 +0200 +++ linux-2.6.5-vs1.9.0pre12.2+namespacefix+memdebug/arch/h8300/Kconfig 2004-04-22 11:30:17.000000000 +0200 @@ -432,6 +432,8 @@ config CONFIG_BLKDEV_RESERVE_ADDRESS BLKDEV start address. endmenu +source "kernel/vserver/Kconfig" + source "security/Kconfig" source "crypto/Kconfig" diff -NurpP linux-2.6.5/arch/h8300/kernel/ptrace.c linux-2.6.5-vs1.9.0pre12.2+namespacefix+memdebug/arch/h8300/kernel/ptrace.c --- linux-2.6.5/arch/h8300/kernel/ptrace.c 2004-04-04 05:36:54.000000000 +0200 +++ linux-2.6.5-vs1.9.0pre12.2+namespacefix+memdebug/arch/h8300/kernel/ptrace.c 2004-04-22 11:30:17.000000000 +0200 @@ -257,6 +257,8 @@ asmlinkage int sys_ptrace(long request, read_unlock(&tasklist_lock); if (!child) goto out; + if (!vx_check(vx_task_xid(child), VX_WATCH|VX_IDENT)) + goto out_tsk; ret = -EPERM; if (pid == 1) /* you may not mess with init */ diff -NurpP linux-2.6.5/arch/i386/Kconfig linux-2.6.5-vs1.9.0pre12.2+namespacefix+memdebug/arch/i386/Kconfig --- linux-2.6.5/arch/i386/Kconfig 2004-04-04 05:36:25.000000000 +0200 +++ linux-2.6.5-vs1.9.0pre12.2+namespacefix+memdebug/arch/i386/Kconfig 2004-04-22 11:30:17.000000000 +0200 @@ -1302,6 +1302,8 @@ config X86_MPPARSE endmenu +source "kernel/vserver/Kconfig" + source "security/Kconfig" source "crypto/Kconfig" diff -NurpP linux-2.6.5/arch/i386/kernel/entry.S linux-2.6.5-vs1.9.0pre12.2+namespacefix+memdebug/arch/i386/kernel/entry.S --- linux-2.6.5/arch/i386/kernel/entry.S 2004-04-04 05:36:52.000000000 +0200 +++ linux-2.6.5-vs1.9.0pre12.2+namespacefix+memdebug/arch/i386/kernel/entry.S 2004-04-22 11:33:47.000000000 +0200 @@ -881,6 +881,6 @@ ENTRY(sys_call_table) .long sys_tgkill /* 270 */ .long sys_utimes .long sys_fadvise64_64 - .long sys_ni_syscall /* sys_vserver */ + .long sys_vserver syscall_table_size=(.-sys_call_table) diff -NurpP linux-2.6.5/arch/i386/kernel/ptrace.c linux-2.6.5-vs1.9.0pre12.2+namespacefix+memdebug/arch/i386/kernel/ptrace.c --- linux-2.6.5/arch/i386/kernel/ptrace.c 2004-04-04 05:36:54.000000000 +0200 +++ linux-2.6.5-vs1.9.0pre12.2+namespacefix+memdebug/arch/i386/kernel/ptrace.c 2004-04-22 11:30:17.000000000 +0200 @@ -257,6 +257,8 @@ asmlinkage int sys_ptrace(long request, read_unlock(&tasklist_lock); if (!child) goto out; + if (!vx_check(vx_task_xid(child), VX_WATCH|VX_IDENT)) + goto out_tsk; ret = -EPERM; if (pid == 1) /* you may not mess with init */ diff -NurpP linux-2.6.5/arch/i386/kernel/sys_i386.c linux-2.6.5-vs1.9.0pre12.2+namespacefix+memdebug/arch/i386/kernel/sys_i386.c --- linux-2.6.5/arch/i386/kernel/sys_i386.c 2004-04-04 05:38:21.000000000 +0200 +++ linux-2.6.5-vs1.9.0pre12.2+namespacefix+memdebug/arch/i386/kernel/sys_i386.c 2004-04-22 11:30:17.000000000 +0200 @@ -217,7 +217,7 @@ asmlinkage int sys_uname(struct old_utsn if (!name) return -EFAULT; down_read(&uts_sem); - err=copy_to_user(name, &system_utsname, sizeof (*name)); + err=copy_to_user(name, vx_new_utsname(), sizeof (*name)); up_read(&uts_sem); return err?-EFAULT:0; } @@ -225,6 +225,7 @@ asmlinkage int sys_uname(struct old_utsn asmlinkage int sys_olduname(struct oldold_utsname __user * name) { int error; + struct new_utsname *ptr; if (!name) return -EFAULT; @@ -233,15 +234,16 @@ asmlinkage int sys_olduname(struct oldol down_read(&uts_sem); - error = __copy_to_user(&name->sysname,&system_utsname.sysname,__OLD_UTS_LEN); + ptr = vx_new_utsname(); + error = __copy_to_user(&name->sysname,ptr->sysname,__OLD_UTS_LEN); error |= __put_user(0,name->sysname+__OLD_UTS_LEN); - error |= __copy_to_user(&name->nodename,&system_utsname.nodename,__OLD_UTS_LEN); + error |= __copy_to_user(&name->nodename,ptr->nodename,__OLD_UTS_LEN); error |= __put_user(0,name->nodename+__OLD_UTS_LEN); - error |= __copy_to_user(&name->release,&system_utsname.release,__OLD_UTS_LEN); + error |= __copy_to_user(&name->release,ptr->release,__OLD_UTS_LEN); error |= __put_user(0,name->release+__OLD_UTS_LEN); - error |= __copy_to_user(&name->version,&system_utsname.version,__OLD_UTS_LEN); + error |= __copy_to_user(&name->version,ptr->version,__OLD_UTS_LEN); error |= __put_user(0,name->version+__OLD_UTS_LEN); - error |= __copy_to_user(&name->machine,&system_utsname.machine,__OLD_UTS_LEN); + error |= __copy_to_user(&name->machine,ptr->machine,__OLD_UTS_LEN); error |= __put_user(0,name->machine+__OLD_UTS_LEN); up_read(&uts_sem); diff -NurpP linux-2.6.5/arch/i386/mm/hugetlbpage.c linux-2.6.5-vs1.9.0pre12.2+namespacefix+memdebug/arch/i386/mm/hugetlbpage.c --- linux-2.6.5/arch/i386/mm/hugetlbpage.c 2004-04-04 05:38:15.000000000 +0200 +++ linux-2.6.5-vs1.9.0pre12.2+namespacefix+memdebug/arch/i386/mm/hugetlbpage.c 2004-04-22 11:30:17.000000000 +0200 @@ -105,7 +105,8 @@ static void set_huge_pte(struct mm_struc { pte_t entry; - mm->rss += (HPAGE_SIZE / PAGE_SIZE); + // mm->rss += (HPAGE_SIZE / PAGE_SIZE); + vx_rsspages_add(mm, HPAGE_SIZE / PAGE_SIZE); if (write_access) { entry = pte_mkwrite(pte_mkdirty(mk_pte(page, vma->vm_page_prot))); @@ -145,7 +146,8 @@ int copy_hugetlb_page_range(struct mm_st ptepage = pte_page(entry); get_page(ptepage); set_pte(dst_pte, entry); - dst->rss += (HPAGE_SIZE / PAGE_SIZE); + // dst->rss += (HPAGE_SIZE / PAGE_SIZE); + vx_rsspages_add(dst, HPAGE_SIZE / PAGE_SIZE); addr += HPAGE_SIZE; } return 0; @@ -315,7 +317,8 @@ void unmap_hugepage_range(struct vm_area huge_page_release(page); pte_clear(pte); } - mm->rss -= (end - start) >> PAGE_SHIFT; + // mm->rss -= (end - start) >> PAGE_SHIFT; + vx_rsspages_sub(mm, (end - start) >> PAGE_SHIFT); flush_tlb_range(vma, start, end); } diff -NurpP linux-2.6.5/arch/ia64/ia32/binfmt_elf32.c linux-2.6.5-vs1.9.0pre12.2+namespacefix+memdebug/arch/ia64/ia32/binfmt_elf32.c --- linux-2.6.5/arch/ia64/ia32/binfmt_elf32.c 2004-04-04 05:38:16.000000000 +0200 +++ linux-2.6.5-vs1.9.0pre12.2+namespacefix+memdebug/arch/ia64/ia32/binfmt_elf32.c 2004-04-22 11:30:17.000000000 +0200 @@ -185,7 +185,9 @@ ia32_setup_arg_pages (struct linux_binpr mpnt->vm_file = NULL; mpnt->vm_private_data = 0; insert_vm_struct(current->mm, mpnt); - current->mm->total_vm = (mpnt->vm_end - mpnt->vm_start) >> PAGE_SHIFT; + // current->mm->total_vm = (mpnt->vm_end - mpnt->vm_start) >> PAGE_SHIFT; + vx_vmpages_sub(current->mm, current->mm->total_vm - + ((mpnt->vm_end - mpnt->vm_start) >> PAGE_SHIFT)); } for (i = 0 ; i < MAX_ARG_PAGES ; i++) { diff -NurpP linux-2.6.5/arch/ia64/Kconfig linux-2.6.5-vs1.9.0pre12.2+namespacefix+memdebug/arch/ia64/Kconfig --- linux-2.6.5/arch/ia64/Kconfig 2004-04-04 05:38:18.000000000 +0200 +++ linux-2.6.5-vs1.9.0pre12.2+namespacefix+memdebug/arch/ia64/Kconfig 2004-04-22 11:30:17.000000000 +0200 @@ -499,6 +499,8 @@ config SYSVIPC_COMPAT default y endmenu +source "kernel/vserver/Kconfig" + source "security/Kconfig" source "crypto/Kconfig" diff -NurpP linux-2.6.5/arch/ia64/kernel/perfmon.c linux-2.6.5-vs1.9.0pre12.2+namespacefix+memdebug/arch/ia64/kernel/perfmon.c --- linux-2.6.5/arch/ia64/kernel/perfmon.c 2004-04-04 05:38:17.000000000 +0200 +++ linux-2.6.5-vs1.9.0pre12.2+namespacefix+memdebug/arch/ia64/kernel/perfmon.c 2004-04-22 11:30:17.000000000 +0200 @@ -2315,7 +2315,8 @@ pfm_smpl_buffer_alloc(struct task_struct */ insert_vm_struct(mm, vma); - mm->total_vm += size >> PAGE_SHIFT; + // mm->total_vm += size >> PAGE_SHIFT; + vx_vmpages_add(mm, size >> PAGE_SHIFT); up_write(&task->mm->mmap_sem); diff -NurpP linux-2.6.5/arch/ia64/kernel/ptrace.c linux-2.6.5-vs1.9.0pre12.2+namespacefix+memdebug/arch/ia64/kernel/ptrace.c --- linux-2.6.5/arch/ia64/kernel/ptrace.c 2004-04-04 05:38:22.000000000 +0200 +++ linux-2.6.5-vs1.9.0pre12.2+namespacefix+memdebug/arch/ia64/kernel/ptrace.c 2004-04-22 11:30:17.000000000 +0200 @@ -1310,6 +1310,9 @@ sys_ptrace (long request, pid_t pid, uns read_unlock(&tasklist_lock); if (!child) goto out; + if (!vx_check(vx_task_xid(child), VX_WATCH|VX_IDENT)) + goto out_tsk; + ret = -EPERM; if (pid == 1) /* no messing around with init! */ goto out_tsk; diff -NurpP linux-2.6.5/arch/ia64/mm/fault.c linux-2.6.5-vs1.9.0pre12.2+namespacefix+memdebug/arch/ia64/mm/fault.c --- linux-2.6.5/arch/ia64/mm/fault.c 2004-04-04 05:38:20.000000000 +0200 +++ linux-2.6.5-vs1.9.0pre12.2+namespacefix+memdebug/arch/ia64/mm/fault.c 2004-04-22 11:30:17.000000000 +0200 @@ -36,10 +36,14 @@ expand_backing_store (struct vm_area_str if (address - vma->vm_start > current->rlim[RLIMIT_STACK].rlim_cur || (((vma->vm_mm->total_vm + grow) << PAGE_SHIFT) > current->rlim[RLIMIT_AS].rlim_cur)) return -ENOMEM; + if (!vx_vmpages_avail(vma->vm_mm, grow) + return -ENOMEM; vma->vm_end += PAGE_SIZE; - vma->vm_mm->total_vm += grow; + // vma->vm_mm->total_vm += grow; + vx_vmpages_add(vma->vm_mm, grow); if (vma->vm_flags & VM_LOCKED) - vma->vm_mm->locked_vm += grow; + // vma->vm_mm->locked_vm += grow; + vx_vmlocked_add(vma->vm_mm, grow); return 0; } diff -NurpP linux-2.6.5/arch/ia64/mm/hugetlbpage.c linux-2.6.5-vs1.9.0pre12.2+namespacefix+memdebug/arch/ia64/mm/hugetlbpage.c --- linux-2.6.5/arch/ia64/mm/hugetlbpage.c 2004-04-04 05:37:07.000000000 +0200 +++ linux-2.6.5-vs1.9.0pre12.2+namespacefix+memdebug/arch/ia64/mm/hugetlbpage.c 2004-04-22 11:30:17.000000000 +0200 @@ -122,7 +122,8 @@ set_huge_pte (struct mm_struct *mm, stru { pte_t entry; - mm->rss += (HPAGE_SIZE / PAGE_SIZE); + // mm->rss += (HPAGE_SIZE / PAGE_SIZE); + vx_rsspages_add(mm, HPAGE_SIZE / PAGE_SIZE); if (write_access) { entry = pte_mkwrite(pte_mkdirty(mk_pte(page, vma->vm_page_prot))); @@ -165,7 +166,8 @@ int copy_hugetlb_page_range(struct mm_st ptepage = pte_page(entry); get_page(ptepage); set_pte(dst_pte, entry); - dst->rss += (HPAGE_SIZE / PAGE_SIZE); + // dst->rss += (HPAGE_SIZE / PAGE_SIZE); + vx_rsspages_add(dst, HPAGE_SIZE / PAGE_SIZE); addr += HPAGE_SIZE; } return 0; @@ -335,7 +337,8 @@ void unmap_hugepage_range(struct vm_area huge_page_release(page); pte_clear(pte); } - mm->rss -= (end - start) >> PAGE_SHIFT; + // mm->rss -= (end - start) >> PAGE_SHIFT; + vx_rsspages_sub(mm, (end - start) >> PAGE_SHIFT); flush_tlb_range(vma, start, end); } diff -NurpP linux-2.6.5/arch/m68k/atari/stram.c linux-2.6.5-vs1.9.0pre12.2+namespacefix+memdebug/arch/m68k/atari/stram.c --- linux-2.6.5/arch/m68k/atari/stram.c 2004-04-04 05:37:39.000000000 +0200 +++ linux-2.6.5-vs1.9.0pre12.2+namespacefix+memdebug/arch/m68k/atari/stram.c 2004-04-22 11:30:17.000000000 +0200 @@ -635,7 +635,8 @@ static inline void unswap_pte(struct vm_ set_pte(dir, pte_mkdirty(mk_pte(page, vma->vm_page_prot))); swap_free(entry); get_page(page); - ++vma->vm_mm->rss; + // ++vma->vm_mm->rss; + vx_rsspages_inc(vma->vm_mm); } static inline void unswap_pmd(struct vm_area_struct * vma, pmd_t *dir, diff -NurpP linux-2.6.5/arch/m68k/Kconfig linux-2.6.5-vs1.9.0pre12.2+namespacefix+memdebug/arch/m68k/Kconfig --- linux-2.6.5/arch/m68k/Kconfig 2004-04-04 05:37:23.000000000 +0200 +++ linux-2.6.5-vs1.9.0pre12.2+namespacefix+memdebug/arch/m68k/Kconfig 2004-04-22 11:30:17.000000000 +0200 @@ -690,6 +690,8 @@ config DEBUG_INFO endmenu +source "kernel/vserver/Kconfig" + source "security/Kconfig" source "crypto/Kconfig" diff -NurpP linux-2.6.5/arch/m68k/kernel/ptrace.c linux-2.6.5-vs1.9.0pre12.2+namespacefix+memdebug/arch/m68k/kernel/ptrace.c --- linux-2.6.5/arch/m68k/kernel/ptrace.c 2004-04-04 05:36:54.000000000 +0200 +++ linux-2.6.5-vs1.9.0pre12.2+namespacefix+memdebug/arch/m68k/kernel/ptrace.c 2004-04-22 11:30:17.000000000 +0200 @@ -126,6 +126,8 @@ asmlinkage int sys_ptrace(long request, read_unlock(&tasklist_lock); if (!child) goto out; + if (!vx_check(vx_task_xid(child), VX_WATCH|VX_IDENT)) + goto out_tsk; ret = -EPERM; if (pid == 1) /* you may not mess with init */ diff -NurpP linux-2.6.5/arch/m68knommu/Kconfig linux-2.6.5-vs1.9.0pre12.2+namespacefix+memdebug/arch/m68knommu/Kconfig --- linux-2.6.5/arch/m68knommu/Kconfig 2004-04-04 05:37:37.000000000 +0200 +++ linux-2.6.5-vs1.9.0pre12.2+namespacefix+memdebug/arch/m68knommu/Kconfig 2004-04-22 11:30:17.000000000 +0200 @@ -582,6 +582,8 @@ config BDM_DISABLE endmenu +source "kernel/vserver/Kconfig" + source "security/Kconfig" source "crypto/Kconfig" diff -NurpP linux-2.6.5/arch/m68knommu/kernel/ptrace.c linux-2.6.5-vs1.9.0pre12.2+namespacefix+memdebug/arch/m68knommu/kernel/ptrace.c --- linux-2.6.5/arch/m68knommu/kernel/ptrace.c 2004-04-04 05:37:23.000000000 +0200 +++ linux-2.6.5-vs1.9.0pre12.2+namespacefix+memdebug/arch/m68knommu/kernel/ptrace.c 2004-04-22 11:30:17.000000000 +0200 @@ -124,6 +124,8 @@ asmlinkage int sys_ptrace(long request, read_unlock(&tasklist_lock); if (!child) goto out; + if (!vx_check(vx_task_xid(child), VX_WATCH|VX_IDENT)) + goto out_tsk; ret = -EPERM; if (pid == 1) /* you may not mess with init */ diff -NurpP linux-2.6.5/arch/mips/Kconfig linux-2.6.5-vs1.9.0pre12.2+namespacefix+memdebug/arch/mips/Kconfig --- linux-2.6.5/arch/mips/Kconfig 2004-04-04 05:37:06.000000000 +0200 +++ linux-2.6.5-vs1.9.0pre12.2+namespacefix+memdebug/arch/mips/Kconfig 2004-04-22 11:30:17.000000000 +0200 @@ -1533,6 +1533,8 @@ config DEBUG_HIGHMEM endmenu +source "kernel/vserver/Kconfig" + source "security/Kconfig" source "crypto/Kconfig" diff -NurpP linux-2.6.5/arch/mips/kernel/irixelf.c linux-2.6.5-vs1.9.0pre12.2+namespacefix+memdebug/arch/mips/kernel/irixelf.c --- linux-2.6.5/arch/mips/kernel/irixelf.c 2004-04-04 05:38:28.000000000 +0200 +++ linux-2.6.5-vs1.9.0pre12.2+namespacefix+memdebug/arch/mips/kernel/irixelf.c 2004-04-22 11:35:24.000000000 +0200 @@ -687,7 +687,8 @@ static int load_irix_binary(struct linux /* Do this so that we can load the interpreter, if need be. We will * change some of these later. */ - current->mm->rss = 0; + //current->mm->rss = 0; + vx_rsspages_sub(current->mm, current->mm->rss); setup_arg_pages(bprm); current->mm->start_stack = bprm->p; diff -NurpP linux-2.6.5/arch/mips/kernel/linux32.c linux-2.6.5-vs1.9.0pre12.2+namespacefix+memdebug/arch/mips/kernel/linux32.c --- linux-2.6.5/arch/mips/kernel/linux32.c 2004-04-04 05:37:25.000000000 +0200 +++ linux-2.6.5-vs1.9.0pre12.2+namespacefix+memdebug/arch/mips/kernel/linux32.c 2004-04-22 11:30:17.000000000 +0200 @@ -1715,7 +1715,7 @@ asmlinkage long sys32_newuname(struct ne int ret = 0; down_read(&uts_sem); - if (copy_to_user(name,&system_utsname,sizeof *name)) + if (copy_to_user(name, vx_new_utsname(), sizeof *name)) ret = -EFAULT; up_read(&uts_sem); diff -NurpP linux-2.6.5/arch/mips/kernel/ptrace.c linux-2.6.5-vs1.9.0pre12.2+namespacefix+memdebug/arch/mips/kernel/ptrace.c --- linux-2.6.5/arch/mips/kernel/ptrace.c 2004-04-04 05:38:26.000000000 +0200 +++ linux-2.6.5-vs1.9.0pre12.2+namespacefix+memdebug/arch/mips/kernel/ptrace.c 2004-04-22 11:30:17.000000000 +0200 @@ -76,6 +76,8 @@ asmlinkage int sys_ptrace(long request, read_unlock(&tasklist_lock); if (!child) goto out; + if (!vx_check(vx_task_xid(child), VX_WATCH|VX_IDENT)) + goto out_tsk; ret = -EPERM; if (pid == 1) /* you may not mess with init */ diff -NurpP linux-2.6.5/arch/mips/kernel/syscall.c linux-2.6.5-vs1.9.0pre12.2+namespacefix+memdebug/arch/mips/kernel/syscall.c --- linux-2.6.5/arch/mips/kernel/syscall.c 2004-04-04 05:37:41.000000000 +0200 +++ linux-2.6.5-vs1.9.0pre12.2+namespacefix+memdebug/arch/mips/kernel/syscall.c 2004-04-22 11:30:17.000000000 +0200 @@ -202,7 +202,7 @@ out: */ asmlinkage int sys_uname(struct old_utsname * name) { - if (name && !copy_to_user(name, &system_utsname, sizeof (*name))) + if (name && !copy_to_user(name, vx_new_utsname(), sizeof (*name))) return 0; return -EFAULT; } @@ -213,21 +213,23 @@ asmlinkage int sys_uname(struct old_utsn asmlinkage int sys_olduname(struct oldold_utsname * name) { int error; + struct new_utsname *ptr; if (!name) return -EFAULT; if (!access_ok(VERIFY_WRITE,name,sizeof(struct oldold_utsname))) return -EFAULT; - error = __copy_to_user(&name->sysname,&system_utsname.sysname,__OLD_UTS_LEN); + ptr = vx_new_utsname(); + error = __copy_to_user(&name->sysname,ptr->sysname,__OLD_UTS_LEN); error -= __put_user(0,name->sysname+__OLD_UTS_LEN); - error -= __copy_to_user(&name->nodename,&system_utsname.nodename,__OLD_UTS_LEN); + error -= __copy_to_user(&name->nodename,ptr->nodename,__OLD_UTS_LEN); error -= __put_user(0,name->nodename+__OLD_UTS_LEN); - error -= __copy_to_user(&name->release,&system_utsname.release,__OLD_UTS_LEN); + error -= __copy_to_user(&name->release,ptr->release,__OLD_UTS_LEN); error -= __put_user(0,name->release+__OLD_UTS_LEN); - error -= __copy_to_user(&name->version,&system_utsname.version,__OLD_UTS_LEN); + error -= __copy_to_user(&name->version,ptr->version,__OLD_UTS_LEN); error -= __put_user(0,name->version+__OLD_UTS_LEN); - error -= __copy_to_user(&name->machine,&system_utsname.machine,__OLD_UTS_LEN); + error -= __copy_to_user(&name->machine,ptr->machine,__OLD_UTS_LEN); error = __put_user(0,name->machine+__OLD_UTS_LEN); error = error ? -EFAULT : 0; @@ -253,10 +255,10 @@ asmlinkage int _sys_sysmips(int cmd, lon return -EFAULT; down_write(&uts_sem); - strncpy(system_utsname.nodename, nodename, len); + strncpy(vx_new_uts(nodename), nodename, len); nodename[__NEW_UTS_LEN] = '\0'; - strlcpy(system_utsname.nodename, nodename, - sizeof(system_utsname.nodename)); + strlcpy(vx_new_uts(nodename), nodename, + sizeof(vx_new_uts(nodename))); up_write(&uts_sem); return 0; } diff -NurpP linux-2.6.5/arch/parisc/Kconfig linux-2.6.5-vs1.9.0pre12.2+namespacefix+memdebug/arch/parisc/Kconfig --- linux-2.6.5/arch/parisc/Kconfig 2004-04-04 05:37:24.000000000 +0200 +++ linux-2.6.5-vs1.9.0pre12.2+namespacefix+memdebug/arch/parisc/Kconfig 2004-04-22 11:30:17.000000000 +0200 @@ -224,6 +224,8 @@ config DEBUG_INFO endmenu +source "kernel/vserver/Kconfig" + source "security/Kconfig" source "crypto/Kconfig" diff -NurpP linux-2.6.5/arch/parisc/kernel/ptrace.c linux-2.6.5-vs1.9.0pre12.2+namespacefix+memdebug/arch/parisc/kernel/ptrace.c --- linux-2.6.5/arch/parisc/kernel/ptrace.c 2004-04-04 05:36:19.000000000 +0200 +++ linux-2.6.5-vs1.9.0pre12.2+namespacefix+memdebug/arch/parisc/kernel/ptrace.c 2004-04-22 11:30:17.000000000 +0200 @@ -110,6 +110,9 @@ long sys_ptrace(long request, pid_t pid, read_unlock(&tasklist_lock); if (!child) goto out; + if (!vx_check(vx_task_xid(child), VX_WATCH|VX_IDENT)) + goto out_tsk; + ret = -EPERM; if (pid == 1) /* no messing around with init! */ goto out_tsk; diff -NurpP linux-2.6.5/arch/parisc/kernel/sys_parisc32.c linux-2.6.5-vs1.9.0pre12.2+namespacefix+memdebug/arch/parisc/kernel/sys_parisc32.c --- linux-2.6.5/arch/parisc/kernel/sys_parisc32.c 2004-04-04 05:36:55.000000000 +0200 +++ linux-2.6.5-vs1.9.0pre12.2+namespacefix+memdebug/arch/parisc/kernel/sys_parisc32.c 2004-04-22 11:30:17.000000000 +0200 @@ -1209,6 +1209,7 @@ asmlinkage int sys32_sysinfo(struct sysi do { seq = read_seqbegin(&xtime_lock); + /* requires vx virtualization */ val.uptime = jiffies / HZ; val.loads[0] = avenrun[0] << (SI_LOAD_SHIFT - FSHIFT); diff -NurpP linux-2.6.5/arch/ppc/Kconfig linux-2.6.5-vs1.9.0pre12.2+namespacefix+memdebug/arch/ppc/Kconfig --- linux-2.6.5/arch/ppc/Kconfig 2004-04-04 05:38:22.000000000 +0200 +++ linux-2.6.5-vs1.9.0pre12.2+namespacefix+memdebug/arch/ppc/Kconfig 2004-04-22 11:30:17.000000000 +0200 @@ -1227,6 +1227,8 @@ config OCP endmenu +source "kernel/vserver/Kconfig" + source "security/Kconfig" source "crypto/Kconfig" diff -NurpP linux-2.6.5/arch/ppc/kernel/ptrace.c linux-2.6.5-vs1.9.0pre12.2+namespacefix+memdebug/arch/ppc/kernel/ptrace.c --- linux-2.6.5/arch/ppc/kernel/ptrace.c 2004-04-04 05:36:52.000000000 +0200 +++ linux-2.6.5-vs1.9.0pre12.2+namespacefix+memdebug/arch/ppc/kernel/ptrace.c 2004-04-22 11:30:17.000000000 +0200 @@ -197,6 +197,8 @@ int sys_ptrace(long request, long pid, l read_unlock(&tasklist_lock); if (!child) goto out; + if (!vx_check(vx_task_xid(child), VX_WATCH|VX_IDENT)) + goto out_tsk; ret = -EPERM; if (pid == 1) /* you may not mess with init */ diff -NurpP linux-2.6.5/arch/ppc/kernel/syscalls.c linux-2.6.5-vs1.9.0pre12.2+namespacefix+memdebug/arch/ppc/kernel/syscalls.c --- linux-2.6.5/arch/ppc/kernel/syscalls.c 2004-04-04 05:38:18.000000000 +0200 +++ linux-2.6.5-vs1.9.0pre12.2+namespacefix+memdebug/arch/ppc/kernel/syscalls.c 2004-04-22 11:30:17.000000000 +0200 @@ -229,7 +229,7 @@ int sys_uname(struct old_utsname __user int err = -EFAULT; down_read(&uts_sem); - if (name && !copy_to_user(name, &system_utsname, sizeof (*name))) + if (name && !copy_to_user(name, vx_new_utsname(), sizeof (*name))) err = 0; up_read(&uts_sem); return err; @@ -238,6 +238,7 @@ int sys_uname(struct old_utsname __user int sys_olduname(struct oldold_utsname __user * name) { int error; + struct new_utsname *ptr; if (!name) return -EFAULT; @@ -245,15 +246,16 @@ int sys_olduname(struct oldold_utsname _ return -EFAULT; down_read(&uts_sem); - error = __copy_to_user(&name->sysname,&system_utsname.sysname,__OLD_UTS_LEN); + ptr = vx_new_utsname(); + error = __copy_to_user(&name->sysname,ptr->sysname,__OLD_UTS_LEN); error -= __put_user(0,name->sysname+__OLD_UTS_LEN); - error -= __copy_to_user(&name->nodename,&system_utsname.nodename,__OLD_UTS_LEN); + error -= __copy_to_user(&name->nodename,ptr->nodename,__OLD_UTS_LEN); error -= __put_user(0,name->nodename+__OLD_UTS_LEN); - error -= __copy_to_user(&name->release,&system_utsname.release,__OLD_UTS_LEN); + error -= __copy_to_user(&name->release,ptr->release,__OLD_UTS_LEN); error -= __put_user(0,name->release+__OLD_UTS_LEN); - error -= __copy_to_user(&name->version,&system_utsname.version,__OLD_UTS_LEN); + error -= __copy_to_user(&name->version,ptr->version,__OLD_UTS_LEN); error -= __put_user(0,name->version+__OLD_UTS_LEN); - error -= __copy_to_user(&name->machine,&system_utsname.machine,__OLD_UTS_LEN); + error -= __copy_to_user(&name->machine,ptr->machine,__OLD_UTS_LEN); error = __put_user(0,name->machine+__OLD_UTS_LEN); up_read(&uts_sem); diff -NurpP linux-2.6.5/arch/ppc64/Kconfig linux-2.6.5-vs1.9.0pre12.2+namespacefix+memdebug/arch/ppc64/Kconfig --- linux-2.6.5/arch/ppc64/Kconfig 2004-04-04 05:37:23.000000000 +0200 +++ linux-2.6.5-vs1.9.0pre12.2+namespacefix+memdebug/arch/ppc64/Kconfig 2004-04-22 11:30:17.000000000 +0200 @@ -389,6 +389,8 @@ config DEBUG_INFO endmenu +source "kernel/vserver/Kconfig" + source "security/Kconfig" source "crypto/Kconfig" diff -NurpP linux-2.6.5/arch/ppc64/kernel/ptrace.c linux-2.6.5-vs1.9.0pre12.2+namespacefix+memdebug/arch/ppc64/kernel/ptrace.c --- linux-2.6.5/arch/ppc64/kernel/ptrace.c 2004-04-04 05:37:59.000000000 +0200 +++ linux-2.6.5-vs1.9.0pre12.2+namespacefix+memdebug/arch/ppc64/kernel/ptrace.c 2004-04-22 11:30:17.000000000 +0200 @@ -75,6 +75,8 @@ int sys_ptrace(long request, long pid, l read_unlock(&tasklist_lock); if (!child) goto out; + if (!vx_check(vx_task_xid(child), VX_WATCH|VX_IDENT)) + goto out_tsk; ret = -EPERM; if (pid == 1) /* you may not mess with init */ diff -NurpP linux-2.6.5/arch/ppc64/kernel/sys_ppc32.c linux-2.6.5-vs1.9.0pre12.2+namespacefix+memdebug/arch/ppc64/kernel/sys_ppc32.c --- linux-2.6.5/arch/ppc64/kernel/sys_ppc32.c 2004-04-04 05:37:37.000000000 +0200 +++ linux-2.6.5-vs1.9.0pre12.2+namespacefix+memdebug/arch/ppc64/kernel/sys_ppc32.c 2004-04-22 11:30:17.000000000 +0200 @@ -2456,6 +2456,7 @@ asmlinkage long sys32_time(compat_time_t int sys32_olduname(struct oldold_utsname * name) { int error; + struct new_utsname *ptr; if (!name) return -EFAULT; @@ -2463,15 +2464,16 @@ int sys32_olduname(struct oldold_utsname return -EFAULT; down_read(&uts_sem); - error = __copy_to_user(&name->sysname,&system_utsname.sysname,__OLD_UTS_LEN); + ptr = vx_new_utsname(); + error = __copy_to_user(&name->sysname,ptr->sysname,__OLD_UTS_LEN); error -= __put_user(0,name->sysname+__OLD_UTS_LEN); - error -= __copy_to_user(&name->nodename,&system_utsname.nodename,__OLD_UTS_LEN); + error -= __copy_to_user(&name->nodename,ptr->nodename,__OLD_UTS_LEN); error -= __put_user(0,name->nodename+__OLD_UTS_LEN); - error -= __copy_to_user(&name->release,&system_utsname.release,__OLD_UTS_LEN); + error -= __copy_to_user(&name->release,ptr->release,__OLD_UTS_LEN); error -= __put_user(0,name->release+__OLD_UTS_LEN); - error -= __copy_to_user(&name->version,&system_utsname.version,__OLD_UTS_LEN); + error -= __copy_to_user(&name->version,ptr->version,__OLD_UTS_LEN); error -= __put_user(0,name->version+__OLD_UTS_LEN); - error -= __copy_to_user(&name->machine,&system_utsname.machine,__OLD_UTS_LEN); + error -= __copy_to_user(&name->machine,ptr->machine,__OLD_UTS_LEN); error = __put_user(0,name->machine+__OLD_UTS_LEN); up_read(&uts_sem); diff -NurpP linux-2.6.5/arch/ppc64/mm/hugetlbpage.c linux-2.6.5-vs1.9.0pre12.2+namespacefix+memdebug/arch/ppc64/mm/hugetlbpage.c --- linux-2.6.5/arch/ppc64/mm/hugetlbpage.c 2004-04-04 05:37:07.000000000 +0200 +++ linux-2.6.5-vs1.9.0pre12.2+namespacefix+memdebug/arch/ppc64/mm/hugetlbpage.c 2004-04-22 11:30:18.000000000 +0200 @@ -207,7 +207,8 @@ static void setup_huge_pte(struct mm_str hugepte_t entry; int i; - mm->rss += (HPAGE_SIZE / PAGE_SIZE); + // mm->rss += (HPAGE_SIZE / PAGE_SIZE); + vx_rsspages_sub(mm, HPAGE_SIZE / PAGE_SIZE); entry = mk_hugepte(page, write_access); for (i = 0; i < HUGEPTE_BATCH_SIZE; i++) set_hugepte(ptep+i, entry); @@ -331,7 +332,8 @@ int copy_hugetlb_page_range(struct mm_st /* This is the first hugepte in a batch */ ptepage = hugepte_page(entry); get_page(ptepage); - dst->rss += (HPAGE_SIZE / PAGE_SIZE); + // dst->rss += (HPAGE_SIZE / PAGE_SIZE); + vx_rsspages_add(dst, HPAGE_SIZE / PAGE_SIZE); } set_hugepte(dst_pte, entry); @@ -480,7 +482,8 @@ void unmap_hugepage_range(struct vm_area huge_page_release(page); } - mm->rss -= (end - start) >> PAGE_SHIFT; + // mm->rss -= (end - start) >> PAGE_SHIFT; + vx_rsspages_sub(mm, (end - start) >> PAGE_SHIFT); } void zap_hugepage_range(struct vm_area_struct *vma, diff -NurpP linux-2.6.5/arch/s390/Kconfig linux-2.6.5-vs1.9.0pre12.2+namespacefix+memdebug/arch/s390/Kconfig --- linux-2.6.5/arch/s390/Kconfig 2004-04-04 05:36:56.000000000 +0200 +++ linux-2.6.5-vs1.9.0pre12.2+namespacefix+memdebug/arch/s390/Kconfig 2004-04-22 11:30:18.000000000 +0200 @@ -405,6 +405,8 @@ config DEBUG_SPINLOCK_SLEEP endmenu +source "kernel/vserver/Kconfig" + source "security/Kconfig" source "crypto/Kconfig" diff -NurpP linux-2.6.5/arch/s390/kernel/compat_exec.c linux-2.6.5-vs1.9.0pre12.2+namespacefix+memdebug/arch/s390/kernel/compat_exec.c --- linux-2.6.5/arch/s390/kernel/compat_exec.c 2004-04-04 05:38:13.000000000 +0200 +++ linux-2.6.5-vs1.9.0pre12.2+namespacefix+memdebug/arch/s390/kernel/compat_exec.c 2004-04-22 11:30:18.000000000 +0200 @@ -74,7 +74,9 @@ int setup_arg_pages32(struct linux_binpr INIT_LIST_HEAD(&mpnt->shared); mpnt->vm_private_data = (void *) 0; insert_vm_struct(mm, mpnt); - mm->total_vm = (mpnt->vm_end - mpnt->vm_start) >> PAGE_SHIFT; + // mm->total_vm = (mpnt->vm_end - mpnt->vm_start) >> PAGE_SHIFT; + vx_vmpages_sub(mm, mm->total_vm - + ((mpnt->vm_end - mpnt->vm_start) >> PAGE_SHIFT)); } for (i = 0 ; i < MAX_ARG_PAGES ; i++) { diff -NurpP linux-2.6.5/arch/s390/kernel/ptrace.c linux-2.6.5-vs1.9.0pre12.2+namespacefix+memdebug/arch/s390/kernel/ptrace.c --- linux-2.6.5/arch/s390/kernel/ptrace.c 2004-04-04 05:38:14.000000000 +0200 +++ linux-2.6.5-vs1.9.0pre12.2+namespacefix+memdebug/arch/s390/kernel/ptrace.c 2004-04-22 11:30:18.000000000 +0200 @@ -680,9 +680,11 @@ sys_ptrace(long request, long pid, long read_unlock(&tasklist_lock); if (!child) goto out; + if (!vx_check(vx_task_xid(child), VX_WATCH|VX_IDENT)) + goto out_tsk; ret = do_ptrace(child, request, addr, data); - +out_tsk: put_task_struct(child); out: unlock_kernel(); diff -NurpP linux-2.6.5/arch/s390/kernel/syscalls.S linux-2.6.5-vs1.9.0pre12.2+namespacefix+memdebug/arch/s390/kernel/syscalls.S --- linux-2.6.5/arch/s390/kernel/syscalls.S 2004-04-04 05:36:18.000000000 +0200 +++ linux-2.6.5-vs1.9.0pre12.2+namespacefix+memdebug/arch/s390/kernel/syscalls.S 2004-04-22 11:30:18.000000000 +0200 @@ -271,7 +271,7 @@ SYSCALL(sys_clock_settime,sys_clock_sett SYSCALL(sys_clock_gettime,sys_clock_gettime,sys32_clock_gettime_wrapper) /* 260 */ SYSCALL(sys_clock_getres,sys_clock_getres,sys32_clock_getres_wrapper) SYSCALL(sys_clock_nanosleep,sys_clock_nanosleep,sys32_clock_nanosleep_wrapper) -NI_SYSCALL /* reserved for vserver */ +SYSCALL(sys_vserver,sys_vserver,sys_vserver) SYSCALL(s390_fadvise64_64,sys_ni_syscall,sys32_fadvise64_64_wrapper) SYSCALL(sys_statfs64,sys_statfs64,compat_sys_statfs64_wrapper) SYSCALL(sys_fstatfs64,sys_fstatfs64,compat_sys_fstatfs64_wrapper) diff -NurpP linux-2.6.5/arch/sh/Kconfig linux-2.6.5-vs1.9.0pre12.2+namespacefix+memdebug/arch/sh/Kconfig --- linux-2.6.5/arch/sh/Kconfig 2004-04-04 05:38:23.000000000 +0200 +++ linux-2.6.5-vs1.9.0pre12.2+namespacefix+memdebug/arch/sh/Kconfig 2004-04-22 11:30:18.000000000 +0200 @@ -792,6 +792,8 @@ config FRAME_POINTER endmenu +source "kernel/vserver/Kconfig" + source "security/Kconfig" source "crypto/Kconfig" diff -NurpP linux-2.6.5/arch/sh/kernel/ptrace.c linux-2.6.5-vs1.9.0pre12.2+namespacefix+memdebug/arch/sh/kernel/ptrace.c --- linux-2.6.5/arch/sh/kernel/ptrace.c 2004-04-04 05:36:18.000000000 +0200 +++ linux-2.6.5-vs1.9.0pre12.2+namespacefix+memdebug/arch/sh/kernel/ptrace.c 2004-04-22 11:30:18.000000000 +0200 @@ -108,6 +108,8 @@ asmlinkage int sys_ptrace(long request, read_unlock(&tasklist_lock); if (!child) goto out; + if (!vx_check(vx_task_xid(child), VX_WATCH|VX_IDENT)) + goto out_tsk; ret = -EPERM; if (pid == 1) /* you may not mess with init */ diff -NurpP linux-2.6.5/arch/sh/mm/hugetlbpage.c linux-2.6.5-vs1.9.0pre12.2+namespacefix+memdebug/arch/sh/mm/hugetlbpage.c --- linux-2.6.5/arch/sh/mm/hugetlbpage.c 2004-04-04 05:37:23.000000000 +0200 +++ linux-2.6.5-vs1.9.0pre12.2+namespacefix+memdebug/arch/sh/mm/hugetlbpage.c 2004-04-22 11:30:18.000000000 +0200 @@ -123,7 +123,8 @@ static void set_huge_pte(struct mm_struc unsigned long i; pte_t entry; - mm->rss += (HPAGE_SIZE / PAGE_SIZE); + // mm->rss += (HPAGE_SIZE / PAGE_SIZE); + vx_rsspages_add(mm, HPAGE_SIZE / PAGE_SIZE); if (write_access) entry = pte_mkwrite(pte_mkdirty(mk_pte(page, @@ -176,7 +177,8 @@ int copy_hugetlb_page_range(struct mm_st pte_val(entry) += PAGE_SIZE; dst_pte++; } - dst->rss += (HPAGE_SIZE / PAGE_SIZE); + // dst->rss += (HPAGE_SIZE / PAGE_SIZE); + vx_rsspages_add(dst, HPAGE_SIZE / PAGE_SIZE); addr += HPAGE_SIZE; } return 0; @@ -294,7 +296,8 @@ void unmap_hugepage_range(struct vm_area pte++; } } - mm->rss -= (end - start) >> PAGE_SHIFT; + // mm->rss -= (end - start) >> PAGE_SHIFT; + vx_rsspages_sub(mm, (end - start) >> PAGE_SHIFT); flush_tlb_range(vma, start, end); } diff -NurpP linux-2.6.5/arch/sparc/Kconfig linux-2.6.5-vs1.9.0pre12.2+namespacefix+memdebug/arch/sparc/Kconfig --- linux-2.6.5/arch/sparc/Kconfig 2004-04-04 05:36:10.000000000 +0200 +++ linux-2.6.5-vs1.9.0pre12.2+namespacefix+memdebug/arch/sparc/Kconfig 2004-04-22 11:30:18.000000000 +0200 @@ -450,6 +450,8 @@ config DEBUG_BUGVERBOSE endmenu +source "kernel/vserver/Kconfig" + source "security/Kconfig" source "crypto/Kconfig" diff -NurpP linux-2.6.5/arch/sparc/kernel/ptrace.c linux-2.6.5-vs1.9.0pre12.2+namespacefix+memdebug/arch/sparc/kernel/ptrace.c --- linux-2.6.5/arch/sparc/kernel/ptrace.c 2004-04-04 05:38:24.000000000 +0200 +++ linux-2.6.5-vs1.9.0pre12.2+namespacefix+memdebug/arch/sparc/kernel/ptrace.c 2004-04-22 11:30:18.000000000 +0200 @@ -319,6 +319,10 @@ asmlinkage void do_ptrace(struct pt_regs pt_error_return(regs, ESRCH); goto out; } + if (!vx_check(vx_task_xid(child), VX_WATCH|VX_IDENT)) { + pt_error_return(regs, ESRCH); + goto out_tsk; + } if ((current->personality == PER_SUNOS && request == PTRACE_SUNATTACH) || (current->personality != PER_SUNOS && request == PTRACE_ATTACH)) { diff -NurpP linux-2.6.5/arch/sparc/kernel/sys_sparc.c linux-2.6.5-vs1.9.0pre12.2+namespacefix+memdebug/arch/sparc/kernel/sys_sparc.c --- linux-2.6.5/arch/sparc/kernel/sys_sparc.c 2004-04-04 05:36:56.000000000 +0200 +++ linux-2.6.5-vs1.9.0pre12.2+namespacefix+memdebug/arch/sparc/kernel/sys_sparc.c 2004-04-22 11:30:18.000000000 +0200 @@ -467,13 +467,13 @@ asmlinkage int sys_getdomainname(char __ down_read(&uts_sem); - nlen = strlen(system_utsname.domainname) + 1; + nlen = strlen(vx_new_uts(domainname)) + 1; if (nlen < len) len = nlen; if (len > __NEW_UTS_LEN) goto done; - if (copy_to_user(name, system_utsname.domainname, len)) + if (copy_to_user(name, vx_new_uts(domainname), len)) goto done; err = 0; done: diff -NurpP linux-2.6.5/arch/sparc64/Kconfig linux-2.6.5-vs1.9.0pre12.2+namespacefix+memdebug/arch/sparc64/Kconfig --- linux-2.6.5/arch/sparc64/Kconfig 2004-04-04 05:38:13.000000000 +0200 +++ linux-2.6.5-vs1.9.0pre12.2+namespacefix+memdebug/arch/sparc64/Kconfig 2004-04-22 11:30:18.000000000 +0200 @@ -702,6 +702,8 @@ config MCOUNT endmenu +source "kernel/vserver/Kconfig" + source "security/Kconfig" source "crypto/Kconfig" diff -NurpP linux-2.6.5/arch/sparc64/kernel/binfmt_aout32.c linux-2.6.5-vs1.9.0pre12.2+namespacefix+memdebug/arch/sparc64/kernel/binfmt_aout32.c --- linux-2.6.5/arch/sparc64/kernel/binfmt_aout32.c 2004-04-04 05:37:07.000000000 +0200 +++ linux-2.6.5-vs1.9.0pre12.2+namespacefix+memdebug/arch/sparc64/kernel/binfmt_aout32.c 2004-04-22 11:30:18.000000000 +0200 @@ -239,7 +239,8 @@ static int load_aout32_binary(struct lin current->mm->brk = ex.a_bss + (current->mm->start_brk = N_BSSADDR(ex)); - current->mm->rss = 0; + // current->mm->rss = 0; + vx_rsspages_sub(current->mm, current->mm->rss); current->mm->mmap = NULL; compute_creds(bprm); current->flags &= ~PF_FORKNOEXEC; diff -NurpP linux-2.6.5/arch/sparc64/kernel/ptrace.c linux-2.6.5-vs1.9.0pre12.2+namespacefix+memdebug/arch/sparc64/kernel/ptrace.c --- linux-2.6.5/arch/sparc64/kernel/ptrace.c 2004-04-04 05:38:22.000000000 +0200 +++ linux-2.6.5-vs1.9.0pre12.2+namespacefix+memdebug/arch/sparc64/kernel/ptrace.c 2004-04-22 11:30:18.000000000 +0200 @@ -168,6 +168,10 @@ asmlinkage void do_ptrace(struct pt_regs pt_error_return(regs, ESRCH); goto out; } + if (!vx_check(vx_task_xid(child), VX_WATCH|VX_IDENT)) { + pt_error_return(regs, ESRCH); + goto out_tsk; + } if ((current->personality == PER_SUNOS && request == PTRACE_SUNATTACH) || (current->personality != PER_SUNOS && request == PTRACE_ATTACH)) { diff -NurpP linux-2.6.5/arch/sparc64/kernel/sys_sparc.c linux-2.6.5-vs1.9.0pre12.2+namespacefix+memdebug/arch/sparc64/kernel/sys_sparc.c --- linux-2.6.5/arch/sparc64/kernel/sys_sparc.c 2004-04-04 05:37:23.000000000 +0200 +++ linux-2.6.5-vs1.9.0pre12.2+namespacefix+memdebug/arch/sparc64/kernel/sys_sparc.c 2004-04-22 11:30:18.000000000 +0200 @@ -458,13 +458,13 @@ asmlinkage int sys_getdomainname(char __ down_read(&uts_sem); - nlen = strlen(system_utsname.domainname) + 1; + nlen = strlen(vx_new_uts(domainname)) + 1; if (nlen < len) len = nlen; if (len > __NEW_UTS_LEN) goto done; - if (copy_to_user(name, system_utsname.domainname, len)) + if (copy_to_user(name, vx_new_uts(domainname), len)) goto done; err = 0; done: diff -NurpP linux-2.6.5/arch/sparc64/mm/hugetlbpage.c linux-2.6.5-vs1.9.0pre12.2+namespacefix+memdebug/arch/sparc64/mm/hugetlbpage.c --- linux-2.6.5/arch/sparc64/mm/hugetlbpage.c 2004-04-04 05:37:36.000000000 +0200 +++ linux-2.6.5-vs1.9.0pre12.2+namespacefix+memdebug/arch/sparc64/mm/hugetlbpage.c 2004-04-22 11:30:18.000000000 +0200 @@ -119,7 +119,8 @@ static void set_huge_pte(struct mm_struc unsigned long i; pte_t entry; - mm->rss += (HPAGE_SIZE / PAGE_SIZE); + // mm->rss += (HPAGE_SIZE / PAGE_SIZE); + vx_rsspages_add(mm, HPAGE_SIZE / PAGE_SIZE); if (write_access) entry = pte_mkwrite(pte_mkdirty(mk_pte(page, @@ -172,7 +173,8 @@ int copy_hugetlb_page_range(struct mm_st pte_val(entry) += PAGE_SIZE; dst_pte++; } - dst->rss += (HPAGE_SIZE / PAGE_SIZE); + // dst->rss += (HPAGE_SIZE / PAGE_SIZE); + vx_rsspages_add(dst, HPAGE_SIZE / PAGE_SIZE); addr += HPAGE_SIZE; } return 0; @@ -290,7 +292,8 @@ void unmap_hugepage_range(struct vm_area pte++; } } - mm->rss -= (end - start) >> PAGE_SHIFT; + // mm->rss -= (end - start) >> PAGE_SHIFT; + vx_rsspages_sub(mm, (end - start) >> PAGE_SHIFT); flush_tlb_range(vma, start, end); } diff -NurpP linux-2.6.5/arch/um/Kconfig linux-2.6.5-vs1.9.0pre12.2+namespacefix+memdebug/arch/um/Kconfig --- linux-2.6.5/arch/um/Kconfig 2004-04-04 05:37:06.000000000 +0200 +++ linux-2.6.5-vs1.9.0pre12.2+namespacefix+memdebug/arch/um/Kconfig 2004-04-22 11:30:18.000000000 +0200 @@ -188,6 +188,8 @@ source "net/Kconfig" source "fs/Kconfig" +source "kernel/vserver/Kconfig" + source "security/Kconfig" source "crypto/Kconfig" diff -NurpP linux-2.6.5/arch/um/kernel/ptrace.c linux-2.6.5-vs1.9.0pre12.2+namespacefix+memdebug/arch/um/kernel/ptrace.c --- linux-2.6.5/arch/um/kernel/ptrace.c 2004-04-04 05:36:24.000000000 +0200 +++ linux-2.6.5-vs1.9.0pre12.2+namespacefix+memdebug/arch/um/kernel/ptrace.c 2004-04-22 11:30:18.000000000 +0200 @@ -58,6 +58,8 @@ int sys_ptrace(long request, long pid, l read_unlock(&tasklist_lock); if (!child) goto out; + if (!vx_check(vx_task_xid(child), VX_WATCH|VX_IDENT)) + goto out_tsk; ret = -EPERM; if (pid == 1) /* you may not mess with init */ diff -NurpP linux-2.6.5/arch/um/kernel/syscall_kern.c linux-2.6.5-vs1.9.0pre12.2+namespacefix+memdebug/arch/um/kernel/syscall_kern.c --- linux-2.6.5/arch/um/kernel/syscall_kern.c 2004-04-04 05:37:37.000000000 +0200 +++ linux-2.6.5-vs1.9.0pre12.2+namespacefix+memdebug/arch/um/kernel/syscall_kern.c 2004-04-22 11:30:18.000000000 +0200 @@ -264,7 +264,7 @@ int sys_uname(struct old_utsname * name) if (!name) return -EFAULT; down_read(&uts_sem); - err=copy_to_user(name, &system_utsname, sizeof (*name)); + err=copy_to_user(name, vx_new_utsname(), sizeof (*name)); up_read(&uts_sem); return err?-EFAULT:0; } @@ -272,6 +272,7 @@ int sys_uname(struct old_utsname * name) int sys_olduname(struct oldold_utsname * name) { int error; + struct new_utsname *ptr; if (!name) return -EFAULT; @@ -280,19 +281,20 @@ int sys_olduname(struct oldold_utsname * down_read(&uts_sem); - error = __copy_to_user(&name->sysname,&system_utsname.sysname, + ptr = vx_new_utsname(); + error = __copy_to_user(&name->sysname,ptr->sysname, __OLD_UTS_LEN); error |= __put_user(0,name->sysname+__OLD_UTS_LEN); - error |= __copy_to_user(&name->nodename,&system_utsname.nodename, + error |= __copy_to_user(&name->nodename,ptr->nodename, __OLD_UTS_LEN); error |= __put_user(0,name->nodename+__OLD_UTS_LEN); - error |= __copy_to_user(&name->release,&system_utsname.release, + error |= __copy_to_user(&name->release,ptr->release, __OLD_UTS_LEN); error |= __put_user(0,name->release+__OLD_UTS_LEN); - error |= __copy_to_user(&name->version,&system_utsname.version, + error |= __copy_to_user(&name->version,ptr->version, __OLD_UTS_LEN); error |= __put_user(0,name->version+__OLD_UTS_LEN); - error |= __copy_to_user(&name->machine,&system_utsname.machine, + error |= __copy_to_user(&name->machine,ptr->machine, __OLD_UTS_LEN); error |= __put_user(0,name->machine+__OLD_UTS_LEN); diff -NurpP linux-2.6.5/arch/v850/Kconfig linux-2.6.5-vs1.9.0pre12.2+namespacefix+memdebug/arch/v850/Kconfig --- linux-2.6.5/arch/v850/Kconfig 2004-04-04 05:37:06.000000000 +0200 +++ linux-2.6.5-vs1.9.0pre12.2+namespacefix+memdebug/arch/v850/Kconfig 2004-04-22 11:30:18.000000000 +0200 @@ -334,6 +334,8 @@ config NO_KERNEL_MSG endmenu +source "kernel/vserver/Kconfig" + source "security/Kconfig" source "crypto/Kconfig" diff -NurpP linux-2.6.5/arch/v850/kernel/ptrace.c linux-2.6.5-vs1.9.0pre12.2+namespacefix+memdebug/arch/v850/kernel/ptrace.c --- linux-2.6.5/arch/v850/kernel/ptrace.c 2004-04-04 05:37:07.000000000 +0200 +++ linux-2.6.5-vs1.9.0pre12.2+namespacefix+memdebug/arch/v850/kernel/ptrace.c 2004-04-22 11:30:18.000000000 +0200 @@ -138,6 +138,8 @@ int sys_ptrace(long request, long pid, l read_unlock(&tasklist_lock); if (!child) goto out; + if (!vx_check(vx_task_xid(child), VX_WATCH|VX_IDENT)) + goto out_tsk; rval = -EPERM; if (pid == 1) /* you may not mess with init */ diff -NurpP linux-2.6.5/arch/x86_64/ia32/ia32_aout.c linux-2.6.5-vs1.9.0pre12.2+namespacefix+memdebug/arch/x86_64/ia32/ia32_aout.c --- linux-2.6.5/arch/x86_64/ia32/ia32_aout.c 2004-04-04 05:38:24.000000000 +0200 +++ linux-2.6.5-vs1.9.0pre12.2+namespacefix+memdebug/arch/x86_64/ia32/ia32_aout.c 2004-04-22 11:30:18.000000000 +0200 @@ -308,7 +308,8 @@ static int load_aout_binary(struct linux (current->mm->start_brk = N_BSSADDR(ex)); current->mm->free_area_cache = TASK_UNMAPPED_BASE; - current->mm->rss = 0; + // current->mm->rss = 0; + vx_rsspages_sub(current->mm, current->mm->rss); current->mm->mmap = NULL; compute_creds(bprm); current->flags &= ~PF_FORKNOEXEC; diff -NurpP linux-2.6.5/arch/x86_64/ia32/ia32_binfmt.c linux-2.6.5-vs1.9.0pre12.2+namespacefix+memdebug/arch/x86_64/ia32/ia32_binfmt.c --- linux-2.6.5/arch/x86_64/ia32/ia32_binfmt.c 2004-04-04 05:36:15.000000000 +0200 +++ linux-2.6.5-vs1.9.0pre12.2+namespacefix+memdebug/arch/x86_64/ia32/ia32_binfmt.c 2004-04-22 11:30:18.000000000 +0200 @@ -363,7 +363,9 @@ int setup_arg_pages(struct linux_binprm INIT_LIST_HEAD(&mpnt->shared); mpnt->vm_private_data = (void *) 0; insert_vm_struct(mm, mpnt); - mm->total_vm = (mpnt->vm_end - mpnt->vm_start) >> PAGE_SHIFT; + // mm->total_vm = (mpnt->vm_end - mpnt->vm_start) >> PAGE_SHIFT; + vx_vmpages_sub(mm, mm->total_vm - + ((mpnt->vm_end - mpnt->vm_start) >> PAGE_SHIFT)); } for (i = 0 ; i < MAX_ARG_PAGES ; i++) { diff -NurpP linux-2.6.5/arch/x86_64/ia32/sys_ia32.c linux-2.6.5-vs1.9.0pre12.2+namespacefix+memdebug/arch/x86_64/ia32/sys_ia32.c --- linux-2.6.5/arch/x86_64/ia32/sys_ia32.c 2004-04-04 05:36:57.000000000 +0200 +++ linux-2.6.5-vs1.9.0pre12.2+namespacefix+memdebug/arch/x86_64/ia32/sys_ia32.c 2004-04-22 11:30:18.000000000 +0200 @@ -1257,6 +1257,7 @@ asmlinkage long sys32_mmap2(unsigned lon asmlinkage long sys32_olduname(struct oldold_utsname * name) { int error; + struct new_utsname *ptr; if (!name) return -EFAULT; @@ -1265,13 +1266,14 @@ asmlinkage long sys32_olduname(struct ol down_read(&uts_sem); - error = __copy_to_user(&name->sysname,&system_utsname.sysname,__OLD_UTS_LEN); + ptr = vx_new_utsname(); + error = __copy_to_user(&name->sysname,ptr->sysname,__OLD_UTS_LEN); __put_user(0,name->sysname+__OLD_UTS_LEN); - __copy_to_user(&name->nodename,&system_utsname.nodename,__OLD_UTS_LEN); + __copy_to_user(&name->nodename,ptr->nodename,__OLD_UTS_LEN); __put_user(0,name->nodename+__OLD_UTS_LEN); - __copy_to_user(&name->release,&system_utsname.release,__OLD_UTS_LEN); + __copy_to_user(&name->release,ptr->release,__OLD_UTS_LEN); __put_user(0,name->release+__OLD_UTS_LEN); - __copy_to_user(&name->version,&system_utsname.version,__OLD_UTS_LEN); + __copy_to_user(&name->version,ptr->version,__OLD_UTS_LEN); __put_user(0,name->version+__OLD_UTS_LEN); { char *arch = "x86_64"; @@ -1294,7 +1296,7 @@ long sys32_uname(struct old_utsname * na if (!name) return -EFAULT; down_read(&uts_sem); - err=copy_to_user(name, &system_utsname, sizeof (*name)); + err=copy_to_user(name, vx_new_utsname(), sizeof (*name)); up_read(&uts_sem); if (personality(current->personality) == PER_LINUX32) err |= copy_to_user(&name->machine, "i686", 5); diff -NurpP linux-2.6.5/arch/x86_64/Kconfig linux-2.6.5-vs1.9.0pre12.2+namespacefix+memdebug/arch/x86_64/Kconfig --- linux-2.6.5/arch/x86_64/Kconfig 2004-04-04 05:37:41.000000000 +0200 +++ linux-2.6.5-vs1.9.0pre12.2+namespacefix+memdebug/arch/x86_64/Kconfig 2004-04-22 11:30:18.000000000 +0200 @@ -499,6 +499,8 @@ config IOMMU_LEAK endmenu +source "kernel/vserver/Kconfig" + source "security/Kconfig" source "crypto/Kconfig" diff -NurpP linux-2.6.5/arch/x86_64/kernel/ptrace.c linux-2.6.5-vs1.9.0pre12.2+namespacefix+memdebug/arch/x86_64/kernel/ptrace.c --- linux-2.6.5/arch/x86_64/kernel/ptrace.c 2004-04-04 05:36:54.000000000 +0200 +++ linux-2.6.5-vs1.9.0pre12.2+namespacefix+memdebug/arch/x86_64/kernel/ptrace.c 2004-04-22 11:30:18.000000000 +0200 @@ -207,6 +207,8 @@ asmlinkage long sys_ptrace(long request, read_unlock(&tasklist_lock); if (!child) goto out; + if (!vx_check(vx_task_xid(child), VX_WATCH|VX_IDENT)) + goto out_tsk; ret = -EPERM; if (pid == 1) /* you may not mess with init */ diff -NurpP linux-2.6.5/arch/x86_64/kernel/sys_x86_64.c linux-2.6.5-vs1.9.0pre12.2+namespacefix+memdebug/arch/x86_64/kernel/sys_x86_64.c --- linux-2.6.5/arch/x86_64/kernel/sys_x86_64.c 2004-04-04 05:37:36.000000000 +0200 +++ linux-2.6.5-vs1.9.0pre12.2+namespacefix+memdebug/arch/x86_64/kernel/sys_x86_64.c 2004-04-22 11:30:18.000000000 +0200 @@ -146,7 +146,7 @@ asmlinkage long sys_uname(struct new_uts { int err; down_read(&uts_sem); - err = copy_to_user(name, &system_utsname, sizeof (*name)); + err = copy_to_user(name, vx_new_utsname(), sizeof (*name)); up_read(&uts_sem); if (personality(current->personality) == PER_LINUX32) err |= copy_to_user(&name->machine, "i686", 5); diff -NurpP linux-2.6.5/conf.vars linux-2.6.5-vs1.9.0pre12.2+namespacefix+memdebug/conf.vars --- linux-2.6.5/conf.vars 1970-01-01 01:00:00.000000000 +0100 +++ linux-2.6.5-vs1.9.0pre12.2+namespacefix+memdebug/conf.vars 2004-04-28 15:05:43.000000000 +0200 @@ -0,0 +1,26 @@ +VERSION = 2 +PATCHLEVEL = 6 +SUBLEVEL = 5 +EXTRAVERSION = +APPEND_TO_VERSION = -vs1.9.0pre12.2+namespace-fix+vmdebug +ARCH = i386 +KPKG_ARCH = +HOSTCC = gcc +HOSTCFLAGS = -Wall -Wstrict-prototypes -O2 -fomit-frame-pointer +CROSS_COMPILE = +AS = as +LD = ld +CC = gcc +CPP = gcc -E +AR = ar +NM = nm +STRIP = strip +OBJCOPY = objcopy +OBJDUMP = objdump +MAKE = /usr/bin/make +GENKSYMS = scripts/genksyms/genksyms +CFLAGS = -D__KERNEL__ -Iinclude -Wall -Wstrict-prototypes -Wno-trigraphs -fno-strict-aliasing -fno-common -pipe -mpreferred-stack-boundary=2 -march=pentium3 -Iinclude/asm-i386/mach-default -O2 -fomit-frame-pointer -g +AFLAGS = -D__KERNEL__ -Iinclude -D__ASSEMBLY__ -Iinclude/asm-i386/mach-default +MODFLAGS = -DMODULE +do_parallel = +fast_dep = diff -NurpP linux-2.6.5/debian/buildinfo linux-2.6.5-vs1.9.0pre12.2+namespacefix+memdebug/debian/buildinfo --- linux-2.6.5/debian/buildinfo 1970-01-01 01:00:00.000000000 +0100 +++ linux-2.6.5-vs1.9.0pre12.2+namespacefix+memdebug/debian/buildinfo 2004-04-28 15:14:27.000000000 +0200 @@ -0,0 +1,19 @@ +gcc-3.3.2-2 +gcc-2.95-2.95.4-19 +gcc-3.0-3.0.4-7 +gcc-3.0-base-3.0.4-16 +gcc-3.2-base-3.2.3-9 +gcc-3.3-3.3.3-0pre3 +gcc-3.3-base-3.3.3-0pre3 +perl-5.8.3-1 +dpkg-1.10.18 +libc6-2.3.2.ds1-11 +libc6-dbg-2.3.2.ds1-11 +libc6-dev-2.3.2.ds1-11 +binutils-2.14.90.0.7-5 +make-3.80-4 +dpkg-dev-1.10.20 +this was built on a machine with the kernel: +Linux ice.aspic.com 2.4.24-1-686 #1 Wed Feb 4 20:22:14 EST 2004 i686 GNU/Linux +using the compiler: +gcc version 3.3.3 20040125 (prerelease) (Debian) diff -NurpP linux-2.6.5/debian/changelog linux-2.6.5-vs1.9.0pre12.2+namespacefix+memdebug/debian/changelog --- linux-2.6.5/debian/changelog 1970-01-01 01:00:00.000000000 +0100 +++ linux-2.6.5-vs1.9.0pre12.2+namespacefix+memdebug/debian/changelog 2004-04-28 15:05:40.000000000 +0200 @@ -0,0 +1,451 @@ +kernel-source-2.6.5-vs1.9.0pre12.2+namespace-fix+vmdebug (10.00.Custom) unstable; urgency=low + + * Added support for netwinders + * Modified modules support to not assume everything in /usr/src/modules + is a directory. + + -- Manoj Srivastava Wed, 25 Nov 1998 01:39:43 -0600 + +kernel-source-0.34 (1.01) unstable; urgency=low + + * This is a major change in the source/header packages. In architectures + different from i386, `kernel-headers-*' and `kernel-source-*' are + incompatible. This also has an effect on libc6-dev, which depends on + kernel-headers-2.0.3x | kernel-source-2.0.3x, which is only true on + i386 architectures. One possible solution would be to make libc6-dev + depend on kernel-headers-2.0.32, but that won't work because + kernel-source provides kernel-headers. In fact, since kernel-headers + are arch dependent, but kernel-source is arch: all, kernel-source-* + should not provide kernel-header* at all. + + Once kernel source stops providing kernel-header*, and libc6-dev + depends on kernel-headers-2.0.32 and links /usr/include/{linux,asm} to + /usr/src/kernel-headers-2.0.32 (nor /usr/src/linux-2.0.32) things + would work again in a Multi arch compatible fashion. + + Hence, now kernel-source-* packages compiled with this kernel-package + shall not provide any sort of kernel-headers. For the sake of + backwards compatibility, /usr/src/linux-$version symlinks are still + being provided (as people may upload newer kernels while keeping an + older libc6-dev around, which depends on /usr/src/linux-2.0.32. + + However, I have been badgered enough about this that I shall remove + the /usr/src/linux-$version symlinks at some point. This version no + longer registers stuff in /usr/src/.linux-versions, and is no longer + as paranoid about /usr/src/linux; but it does not outright remove + those files either, so as not to cause people with older kernels + having a problem during removal.As soon as it is deemed permissible, + we shall get less paranoid about /usr/src/linux-$version as well. + * closes: Bug#18277 + + -- Manoj Srivastava Wed, 18 Feb 1998 16:44:31 -0600 + +kernel-source-0.33 (1.01) unstable; urgency=low + + * Added SUBARCH, which is used to distinguish Amiga, Atari, Macintosh, + etc. kernels for Debian/m68k, and may well be required for the alpha, + from what I hear. Unlike the FLAVOURS variable, which affects + everything it can lay its grubby hands on (kernel image, headers, + source, doc package versions, and where the modules are looked for + under /lib/modules), this only affects the naming of the kernel-image + as the source and doc packages are architecture independent and the + kernel-headers do not vary from one sub-architecture to the + next. These changes are courtesy of James Troup + + -- Manoj Srivastava Mon, 16 Feb 1998 16:47:08 -0600 + +kernel-source-0.32 (1.01) unstable; urgency=low + + * Ensure that the /usr/src/linux and /usr/src/linux- links + always exist, no matter what. Apparently, upgrading from + kernel-source-2.0.32_2.0.32-1 to kernel-source-2.0.32_2.0.32-3 does + not create /usr/src/linux-, which breaks libc6-dev. + * Toned down the language about LILO, so as not to startle new sparc users + + -- Manoj Srivastava Thu, 12 Feb 1998 21:56:50 -0600 + +kernel-source-0.31 (1.01) unstable; urgency=low + + * Added ARCH to make called, this allows for cross compiling kernels + (added on a request by James Troup ) + * Make kernel-headers arch: any, so we can indeed have different headers + for different architectures. + * m68k can now handle vmlinuz, so reverse that behaviour in the rules + file. AFAIK m68k still uses zImage. + * Improvements to /usr/doc/kernel-patch/MultiArch.gz, based on + suggestions by James Troup / + + -- Manoj Srivastava Mon, 9 Feb 1998 17:11:05 -0600 + +kernel-source-0.30 (1.01) unstable; urgency=low + + * Redid the Headers README file + * Added a rationale to the LinkPolicy document. So far, it detailed + *what* Debian did. Now, it also says *why* we do it. + + -- Manoj Srivastava Thu, 29 Jan 1998 19:13:58 -0600 + +kernel-source-0.29 (1.01) unstable; urgency=low + + * Important changes for kernel-source-* and kernel-header-* packages: now + kernel-source-* packages also provide the exact kernel-header-* (libc6 + need only depend on kernel-header-* now. + * The kernel-header-* and kernel-source-* packages now also maitain the + /usr/src/linux-X.YY.ZZ links (in addition to the /usr/src/linux links) + This is used in the libc6 package. + + -- Manoj Srivastava Sat, 13 Dec 1997 12:46:47 -0600 + + +kernel-source-0.28 (1.01) unstable; urgency=low + + * Fixed a typo where we tried to dd /vmlinuz-2.0.32 rather than the + correct /boot/vmlinuz-2.0.32 in image.postinst. How come this glaring + an error has gone unreported until now? + + -- Manoj Srivastava Fri, 23 Jan 1998 14:36:34 -0600 + +kernel-source-0.27 (1.01) unstable; urgency=low + + * Fixed Typo in kernel rules that put all modules into block (this + is more of a thinko/cut and paste error. fixes: Bug#16697,Bug#16702 + * No longer a fatal error if there is no /vmlinuz (or + equivalent). fixes: Bug#16899 + * Added language to the abort on /usr/src/linux not being a + link. + * Documented the fact that if you re-run make-kpkg with a different + revision number, you have to reconfigure the kernel. + fixes: Bug#16968 + * ignore obsolete fdformat in favour of superformat. + * Changed the kernel rules file not break on the sound modules of + 2.1.70+ kernels (I think it is a bug in the kernel Makefile, but this + fix make make-kpkg handle the problem and be more robust). + * Modified image.postinst to also cater to people on whose architecture + the image is not called vmlinuz but something else (like vmlinux, for + example). closes:Bug#16258 + * Made the postrm's also know about the kernel versrion, not just the + postinst. (Sorry). closes:Bug#15920 + * Changed include.postrm to be more careful about removing the symbolic + link /usr/src/linux-X.Y.Z. Keep track if there is another package + installed that could provide the link. + + -- Manoj Srivastava Wed, 21 Jan 1998 03:27:35 -0600 + +kernel-source-0.26 (1.01) unstable; urgency=low + + * Added HAM modules to the module we know about, these were introduced + in 2.1.70. + + -- Manoj Srivastava Tue, 9 Dec 1997 23:27:04 -0600 + +kernel-source-0.25 (1.01) unstable; urgency=low + + * Ignore unmounted devices while looking for a root file system. Much + thanks to Thomas Kocourek for noticing + this. + * Make sure that the copyright file for the kernel-doc package is not + compressed. closes:Bug#14403,Bug#14405 + * Added internal utility kpkg-vercheck to test the validity of the + package version. + + -- Manoj Srivastava Mon, 10 Nov 1997 10:37:08 -0600 + +kernel-source-0.24 (1.01) unstable; urgency=low + + * Install the README.headers in the right place for the source + package. closes:Bug#14552. + * Handle the new NLS_MODULES that have appeared in the newest 2.1.6x + kernels. closes:Bug#14527. + + -- Manoj Srivastava Wed, 5 Nov 1997 23:30:48 -0600 + +kernel-source-0.23 (1.-0) unstable; urgency=low + + * Added README.headers to the kernel-source package as well, since the + information _is_ relevant to compiling kernels. Since kernel source + packages have higher visibility than kernel header packages, this may + help avoid some FAQs from being asked. + * Changed image postinst not to use the obsolete -d option to + superformat. Removed extra spaces from the exec option, so that it is + more likely to work. Noticed by Joost Kooij + * Note that the proposed two level versioning scheme fails if standard + kernels use epochs. Further note that one may introduce epochs even in + custom kernels. + + -- Manoj Srivastava Thu, 23 Oct 1997 12:19:51 -0500 + +kernel-source-0.22 (1.01) unstable; urgency=low + + * Handle obsolete /System.map and /System.old links left around by older + kernel-package packages. All the programs that look at the information + in the map files (including top, ps, and klogd) also will look at + /boot/System.map-, we just need to ensure that that file is + present, and no longer require the symbolic link. + Actually, having the symbolic link in / is technically detrimental + (apart from cluttering up /); many programs, though looking in /boot, + still allow /System.map to override. If you use LILO to choose between + multiple kernels, then the /System.map symbolic link only applies to + one such kernel, for all other choices the symbols loaded will be + wrong. Not having the symbolic links at all prevents this. + Therefore, the new image.postinst file shall offer to remove the + symbolic links in /. This should fix BUG#13359 + + -- Manoj Srivastava Fri, 26 Sep 1997 10:44:39 -0500 + +kernel-source-0.21 (1.01) unstable; urgency=low + + * Fixed handling of modules.dep in the image.postinst. We do not attempt + to recreate a modules.dep, since the man page admits the file so + created may be incorrect. We warn the installer that there maybe + problems loading modules into the kernel until reboot iff the version + being installed is the same as the version currently running. + + -- Manoj Srivastava Tue, 16 Sep 1997 15:07:02 -0500 + +kernel-source-0.20 (1.01) unstable; urgency=low + + * No longer create a System.map symlink in /, since that may confuse + klogd when choosing kernel images using LILO. Since top, ps, and klogd + look at /boot/System.map-, we just need to make sure that + file is present. This makes us friendlier to multiple images of the + same kernel version. + * No longer redirect output to a file in /tmp for security reasons (we + use a log file in /var/log instead). This fixes BUG#11765, + BUG#11766 and BUG#11847 + * Added support for different flavours of the same kernel version for + people who need them. This is based on the ideas and work of Bill + Mitchell and Noel Maddy . + This should make us fully compliant to having multiple flavours of the + same kernel version. + * Added dependencies to targets in rules. Now things should work as + expected if one edits a .config file. + * Fixed destination for the Buildinfo file. This fixes BUG#11884. + + -- Manoj Srivastava Mon, 4 Aug 1997 13:03:51 -0500 + +kernel-source-0.19 (1.01) unstable; urgency=low + + * All kernel packages produced now list the version of kernel-package + used in the file /usr/doc/Buildinfo. + * The image prerm will allow you to remove an running kernel image and + hose your system. You will be warned. (under protest). + * Fixed typo in control file for kernel-doc description. This fixes + Bug#11568. + + -- Manoj Srivastava Tue, 29 Jul 1997 17:47:41 -0500 + +kernel-source-0.18 (1.01) unstable; urgency=low + + * No longer carries around an extra uncompressed kernel image, and does + not anymore create /boot/psdatabase-X.X.XX. The psdatabase file does + not seem to be required anymore. + + -- Manoj Srivastava Wed, 18 Jun 1997 13:05:33 -0500 + +kernel-source-0.17 (1.01) unstable; urgency=low + + * Added patches to support m68k from "Frank Neumann" + . + * Added patched to support sparcs from Eric Delaunay + + + -- Manoj Srivastava Mon, 2 Jun 1997 15:17:59 -0500 + +kernel-source-0.16 (1.01) unstable; urgency=low + + * Moved config to /boot, where it arguably should have gone to in the + first place. The /boot directory contains other information pertinent + to the kernel, such as the System.map file, and the psdatabase. The + information about exactly what was configured into the kernel was + missing, and it can get quite critical on some machines. Also, the + config file may serve as a base for compiling the next kernel. This + file is not really a configuration file (not when packaged as part of + the kernel-image package), hence it does not belong in /etc (no amout + of changing this file will have any affet on system behaviour). + + -- Manoj Srivastava Wed, 21 May 1997 01:44:17 -0500 + +kernel-source-0.15 (1.01) unstable; urgency=low + + * Kernel-image and kernel-doc now suggest each other. + * Also recognize powerpc as a synonym for ppc in determining whether + we use zImage or bzImage by default. + * Fixed up some typos in documentation + * Added rules target kernel_doc. This fixes BUG#9138 + * Also install .config file under /usr/doc. This fixes BUG#9298 + + -- Manoj Srivastava Fri, 2 May 1997 14:34:51 -0500 + +kernel-source-0.14 (1.01) unstable; urgency=low + + * No longer install text files in the modules directory, since depmod + in modutils-2.1.34 fails when it finds a non-ELF file in modules + directory. This fixes Bug#9243. + + -- Manoj Srivastava Wed, 30 Apr 1997 15:24:51 -0500 + +kernel-source-0.13 (1.01) unstable; urgency=low + + * Really add in all the changes sent in by Herbert Xu. The changes are: + * Changed to source package name back to kernel-source-2.6.5-vs1.9.0pre12.2+namespace-fix+vmdebug again. + * Changed the installs to be without -o root -g root since it is no + longer useful as the chowns are done before the packages are built. It + also means that if it is used in targets like stamp-configure which may + be run by anyone it won't not generate an error. + * Made rules file generate the control file. + * Fixed some typos in chown commands while generating the header + packages. + + -- Manoj Srivastava Mon, 21 Apr 1997 15:12:19 -0500 + + kernel-source-0.12 (1.01) unstable; urgency=low + + * Forgot to mention that the source package for the kernel packages + (produced by make-kpkg buildpackage, for example) has been changed to + not contain the kernel version as part of the name (all the deb files + produced have not changed), so we now get kernel-image-xxx_yy_zz.deb, + kernel-source-xxx_yy_zz.deb, and kernel-headers-xxx_yy_zz.deb, along + with kernel-source.tar.gz and kernel-source_yy.diff.gz + * Added changes from the kernel packages maintainer (this is the + kernel-packages maintainer speaking, Herbert Xu handles the kernel + image, headers, and source packages at the moment). + + -- Manoj Srivastava Sun, 13 Apr 1997 00:03:36 -0500 + + kernel-source-0.11 (1.01) unstable; urgency=low + + * set umask to copy the kernel source files untainted by package creators + umask. + * set umask to copy the kernel header files untainted by package creators + umask. + + -- Manoj Srivastava Tuesday, 1 Apr 1997 11:04:42 -0600 + + kernel-source-0.10 (1.01) unstable; urgency=low + + * image postinst no longer aborts when the user gives up on formatting a + floppy, but is offered a choice to proceed with a preformatted floppy. + * Fixed spelling errors in kernel image postinst + * Offer to user superformat if it exists. + * Tested boot floppy creation. + * Tested on 2.0.29, 2.1.29, and 2.1.30 + * Mention setfdprm in postinst if fail to format floppy. + * Fix a typo in code determining which floppy drive to use + * Allow leading whitespace in responses + + -- Manoj Srivastava Sun, 23 Mar 1997 22:53:13 -0600 + +kernel-source-0.9 (1.01) unstable; urgency=low + + n Stupid @#$%$%@! vi changed Feb to February in the changelog messing up + gencontrol. + + -- Manoj Srivastava Mon, 17 Feb 1997 19:29:02 -0600 + +kernel-source-0.8 (1.01) unstable; urgency=low + + * Removed extra root checks + * Added error messages to failed root check + + -- Manoj Srivastava Thursday, 13 February 1997 14:47:06 -0600 + +kernel-source-0.7 (1.01) unstable; urgency=low + + * Fixed kernel rules file so that one does not depend on the existence of modules + + -- Manoj Srivastava Tuesday, 28 January 1997 22:15:27 -0600 + +kernel-source-0.6 (1.01) unstable; urgency=low + + * changed priority of kernel-source package to optional + * changed priority of kernel-image package to optional + + -- Manoj Srivastava Fri, 22 Nov 1996 11:02:31 -0600 + + +kernel-source-0.5 (1.01) unstable; urgency=low + + * kernel-source-X.XX now no longer recommends bin86, since bin86 is only + available intel platforms. It now merely mentions it in the + description. + + -- Manoj Srivastava Thu, 7 Nov 1996 22:17:47 -0600 + +kernel-source-0.4 (1.01) unstable; urgency=low + + * kernel-source-X.XX now recommends bin86, which fixes Bug#4443 + * Added short, succinct (and potentially dangerous) instructions on + compiling kernels at the top of the README file. This fixes Bug#4445. + + -- Manoj Srivastava Wed, 6 Nov 1996 23:59:47 -0600 + +kernel-source-0.3 (1.01) unstable; urgency=low + + * Changed everything to new packaging standards. + * Major re-organization. + * Added explanation for kernel-headers-X.XX (and why we need this + package inspite of having headers in libc5-dev) + * Added README files for all packages (the old README files became + copyright files). + * Added target for buildpackage (wich needed a hack in the target clean + so as not to remove the ./debian directory prematurely) + + -- Manoj Srivastava Tue, 5 Nov 1996 22:42:12 -0600 + +kernel-source-0.2 (1.01) unstable; urgency=low + + * Made image.postinst more polite. + * Also enabled kernel-{source,image,headers} targets in kernel.rules + * Changed make-kpkg to also accept the new targets. + * Fixed typo in man page. + * The man page says it is an administrators man page rather than a + programmers man page. + * Recommended libc-dev for kernel-source and kernel-package + * source suggests ncurses3.0-dev, tk40-dev and the description explains + you could use make menuconfig rather than plain old make config if you + had these packages. + * Fixed typo in the rules for modules in /usr/src/modules/ directory + * Made the rules for such modules ignore errors (since they are not + really a part of this package, error there should not halt this build + (or so people seem to want it) + * Look for modules in the kernel config file (or the default config file + if the user has not supplied a config file), and only make modules and + install them if modules have been configured in the config file. This + could be tested better. + * Fixed the make-kpkg.8 man page so that it now does not seem to mandate + a source and diff file for additional modules installed under the + directory /usr/src/modules/ (whether these files are produced is at + the discretion of the maintainer of that modules package. + * Make configure depend on stamp-configure which in turn depends on + .config Hopefully, this will remake the image target if one changes + the config file Hopefully, this will not cause the image target to + build needlessly. + + -- Manoj Srivastava + +kernel-source-0.1 (1.01) unstable; urgency=low + + * Changed the scripts to refer to /usr/bin/perl rather than /bin/perl. + * Added an extended description to the image control file. + * Added a note that the dist target requires a PGP key. + * Fixed a typo (missing DEBDIR) in debian.rules. + * Fixed the targets expected by make-kpkg (kernel_image rather than + kernel-image, etc). + * In image.postinst, made arguments to system be a single argument if + the arguments contain shell meta-characters, (this way perl passes + them to sh -c). + * Made make-kpkg accept non floats as revision numbers, to facilitate + local names. + * Fixed silly bug in makefloppy in image.postinst. + * Fixed the extended description of the kernel-package package. + * Updated the image postinst to install the mbr, if it exists, and to + activate the root partition, and to not overwrite the mbr (oops). + * Changed maintainer email address to debian.org (I'll be in a state of + flux soon) + + + -- Manoj Srivastava + +Local variables: +mode: debian-changelog +End: diff -NurpP linux-2.6.5/debian/control linux-2.6.5-vs1.9.0pre12.2+namespacefix+memdebug/debian/control --- linux-2.6.5/debian/control 1970-01-01 01:00:00.000000000 +0100 +++ linux-2.6.5-vs1.9.0pre12.2+namespacefix+memdebug/debian/control 2004-04-28 15:05:40.000000000 +0200 @@ -0,0 +1,80 @@ +Source: kernel-source-2.6.5-vs1.9.0pre12.2+namespace-fix+vmdebug +Section: devel +Priority: optional +Maintainer: Unknown Kernel Package Maintainer +Standards-Version: 3.5.9.0 + +Package: kernel-headers-2.6.5-vs1.9.0pre12.2+namespace-fix+vmdebug +Architecture: any +Section: devel +Priority: optional +Provides: kernel-headers, kernel-headers-2.6 +Description: Header files related to Linux kernel version 2.6.5-vs1.9.0pre12.2+namespace-fix+vmdebug + This package provides kernel header files for version 2.6.5-vs1.9.0pre12.2+namespace-fix+vmdebug, for sites + that want the latest kernel headers. Please read + /usr/share/doc/kernel-headers-2.6.5-vs1.9.0pre12.2+namespace-fix+vmdebug/debian.README.gz for details + +Package: kernel-source-2.6.5-vs1.9.0pre12.2+namespace-fix+vmdebug +Architecture: all +Section: devel +Priority: optional +Provides: kernel-source, kernel-source-2.6 +Depends: binutils, bzip2 +Recommends: libc-dev, gcc, make +Suggests: libncurses-dev | ncurses-dev, kernel-package +Description: Linux kernel source for version 2.6.5-vs1.9.0pre12.2+namespace-fix+vmdebug + This package provides the source code for the Linux kernel version 2.6.5-vs1.9.0pre12.2+namespace-fix+vmdebug. + . + You may configure the kernel to your setup by typing "make config" + and following instructions, but you could get ncursesX.X-dev and try + "make menuconfig" for a jazzier, and easier to use interface. There + are options to use QT or GNOME based configuration interfaces, but they + need additional packages to be installed. Also, please read the detailed + documentation in the file + /usr/share/doc/kernel-source-2.6.5-vs1.9.0pre12.2+namespace-fix+vmdebug/README.headers.gz. + . + If you wish to use this package to create a custom Linux kernel, then + it is suggested that you investigate the package kernel-package, + which has been designed to ease the task of creating kernel image + packages. + +Package: kernel-image-2.6.5-vs1.9.0pre12.2+namespace-fix+vmdebug +Architecture: i386 +Section: base +Priority: optional +Provides: kernel-image, kernel-image-2.6 +Depends: coreutils | fileutils (>= 4.0) +Suggests: lilo (>= 19.1) | grub, fdutils, kernel-doc-2.6.5-vs1.9.0pre12.2+namespace-fix+vmdebug | kernel-source-2.6.5-vs1.9.0pre12.2+namespace-fix+vmdebug +Description: Linux kernel binary image for version 2.6.5-vs1.9.0pre12.2+namespace-fix+vmdebug. + This package contains the Linux kernel image for version 2.6.5-vs1.9.0pre12.2+namespace-fix+vmdebug, + the corresponding System.map file, and the modules built by the + packager. It also contains scripts that try to ensure that the + system is not left in a unbootable state after an update. + . + If you wish to update a bootdisk, or to use a bootloader to make + installing and using the image easier, we suggest you install the latest + fdutils (for formatting a floppy to be used as boot disk), and LILO, for a + powerful bootloader. Of course, both these are optional. + . + Kernel image packages are generally produced using kernel-package, + and it is suggested that you install that package if you wish to + create a custom kernel from the sources. Please look at kernel-img.conf(5), + and /usr/share/doc/kernel-package/README.gz from the package kernel-package + for details on how to tailor the installation of this or any other kernel + image package + +Package: kernel-doc-2.6.5-vs1.9.0pre12.2+namespace-fix+vmdebug +Architecture: all +Section: doc +Priority: optional +Provides: kernel-doc-2.6 +Suggests: kernel-image-2.6.5-vs1.9.0pre12.2+namespace-fix+vmdebug +Description: Linux kernel specific documentation for version 2.6.5-vs1.9.0pre12.2+namespace-fix+vmdebug. + This package provides various Readme's in the 2.6.5-vs1.9.0pre12.2+namespace-fix+vmdebug kernel + Documentation/ subdirectory: these typically contain kernel-specific + installation notes for some drivers. for example. Please see + /usr/share/doc/kernel-doc-X.X.XX/Documentation/00-INDEX for a list of + contents. Please also read the Changes file, as it contains + information about the problems which may result by upgrading your + kernel. + diff -NurpP linux-2.6.5/debian/files linux-2.6.5-vs1.9.0pre12.2+namespacefix+memdebug/debian/files --- linux-2.6.5/debian/files 1970-01-01 01:00:00.000000000 +0100 +++ linux-2.6.5-vs1.9.0pre12.2+namespacefix+memdebug/debian/files 2004-04-28 15:14:35.000000000 +0200 @@ -0,0 +1 @@ +kernel-image-2.6.5-vs1.9.0pre12.2+namespace-fix+vmdebug_10.00.Custom_i386.deb base optional diff -NurpP linux-2.6.5/debian/rules linux-2.6.5-vs1.9.0pre12.2+namespacefix+memdebug/debian/rules --- linux-2.6.5/debian/rules 1970-01-01 01:00:00.000000000 +0100 +++ linux-2.6.5-vs1.9.0pre12.2+namespacefix+memdebug/debian/rules 2004-02-05 22:14:11.000000000 +0100 @@ -0,0 +1,2160 @@ +#! /usr/bin/make -f +############################ -*- Mode: Makefile -*- ########################### +## debian.rules --- +## Author : Manoj Srivastava ( srivasta@pilgrim.umass.edu ) +## Created On : Sat Apr 27 06:36:31 1996 +## Created On Node : melkor.pilgrim.umass.edu +## Last Modified By : Manoj Srivastava +## Last Modified On : Thu Feb 5 13:47:54 2004 +## Last Machine Used: glaurung.internal.golden-gryphon.com +## Update Count : 658 +## Status : Unknown, Use with caution! +## HISTORY : +## Description : +## $Id: rules,v 1.227 2003/10/07 16:24:20 srivasta Exp $ +############################################################################### + +ifdef KPKG_ARCH + ifneq ($(strip $(KPKG_ARCH)),um) + ha:=-a$(KPKG_ARCH) + endif +endif + +DPKG_ARCH := dpkg-architecture +# set the dpkg-architecture vars +export DEB_BUILD_ARCH := $(shell $(DPKG_ARCH) $(ha) -qDEB_BUILD_ARCH) +export DEB_BUILD_GNU_CPU := $(shell $(DPKG_ARCH) $(ha) -qDEB_BUILD_GNU_CPU) +export DEB_BUILD_GNU_TYPE := $(shell $(DPKG_ARCH) $(ha) -qDEB_BUILD_GNU_TYPE) +export DEB_HOST_ARCH := $(shell $(DPKG_ARCH) $(ha) -qDEB_HOST_ARCH) +export DEB_HOST_GNU_CPU := $(shell $(DPKG_ARCH) $(ha) -qDEB_HOST_GNU_CPU) +export DEB_HOST_GNU_SYSTEM := $(shell $(DPKG_ARCH) $(ha) -qDEB_HOST_GNU_SYSTEM) +export DEB_HOST_GNU_TYPE := $(shell $(DPKG_ARCH) $(ha) -qDEB_HOST_GNU_TYPE) +export DEB_BUILD_GNU_SYSTEM:= $(shell $(DPKG_ARCH) $(ha) -qDEB_BUILD_GNU_SYSTEM) + +# +# VERSION=$(shell LC_ALL=C dpkg-parsechangelog | grep ^Version: | \ +# sed 's/^Version: *//') +# + +# The version of kernel-package this belongs to +kpkg_version := 8.080 + +# The maintainer information. +maintainer = Herbert Xu +email= herbert@greathan.apana.org.au + +pgp=$(maintainer) + + +# Package specific stuff +# decide if image is meant to be in /boot rather than / +link_in_boot := +# Can we use symlinks? +no_symlink := +# If so, where is the real file (usually, vmlinuz-X.X.X is real, and +# vmlinuz is the link, this variable reverses it. +reverse_symlink := + +# The version numbers for kernel-image, kernel-headers and +# kernel-source are deduced from the Makefile (see below, +# and footnote 1 for details) + +# Whether to look for and install kernel patches by default. +# Be very careful if you do this. +patch_the_kernel := AUTO + +# do not create libc headers by default +make_libc_headers := NO + +# run make clean after build +do_clean := YES + +# install uncompressed kernel ELF-image (for oprofile) +int_install_vmlinux := NO + +# what kernel config target to run in our configure target. +config_target := oldconfig + + +# The default architecture (all if architecture independent) +CROSS_ARG:= + +ifdef KPKG_ARCH + architecture:=$(KPKG_ARCH) +else + #architecture:=$(shell CC=$(HOSTCC) dpkg --print-gnu-build-architecture) + architecture:=$(DEB_HOST_ARCH) +endif + +ifndef CROSS_COMPILE + ifneq ($(strip $(KPKG_ARCH)),um) + ifneq ($(strip $(architecture)),$(strip $(DEB_BUILD_ARCH))) + KERNEL_CROSS:=$(architecture)-$(strip $(DEB_HOST_GNU_SYSTEM))- + endif + endif +else + KERNEL_CROSS:=$(CROSS_COMPILE)- +endif + +ifneq ($(strip $(KERNEL_CROSS)),) + CROSS_ARG:=CROSS_COMPILE=$(KERNEL_CROSS) +endif + +KERNEL_ARCH:=$(architecture) +DEBCONFIG = $(CONFDIR)/config +IMAGEDIR=/boot +INT_IMAGE_DESTDIR=debian/tmp-image$(IMAGEDIR) + + +VERSION =$(shell egrep '^VERSION +=' Makefile 2>/dev/null | \ + sed -e 's/[^0-9]*\([0-9]*\)/\1/') +PATCHLEVEL =$(shell egrep '^PATCHLEVEL +=' Makefile 2>/dev/null | \ + sed -e 's/[^0-9]*\([0-9]*\)/\1/') +SUBLEVEL =$(shell egrep '^SUBLEVEL +=' Makefile 2>/dev/null | \ + sed -e 's/[^0-9]*\([0-9]*\)/\1/') +EXTRA_VERSION =$(shell egrep '^EXTRAVERSION +=' Makefile 2>/dev/null | \ + sed -e 's/EXTRAVERSION *= *\([^ \t]*\)/\1/') +HAVE_NEW_MODLIB =$(shell egrep '\(INSTALL_MOD_PATH\)' Makefile 2>/dev/null ) + +ifneq ($(strip $(EXTRA_VERSION)),) +HAS_ILLEGAL_EXTRA_VERSION =$(shell \ + perl -e '$$i="$(EXTRA_VERSION)"; $$i !~ m/^[a-z\.\-\+][a-z\d\.\-\+]*$$/o && print YES;') + ifneq ($(strip $(HAS_ILLEGAL_EXTRA_VERSION)),) + $(error Error: The EXTRAVERSION may only contain lowercase alphanumerics \ + and the characters - + . The current value is: $(EXTRA_VERSION). Aborting.) + endif +endif + +AM_OFFICIAL := $(shell if [ -f debian/official ]; then echo YES; fi ) + +###################################################################### +### Architecture specific stuff ### +###################################################################### +# Each architecture has the following specified for it +# (a) The kernel image type (i.e. zImage or bzImage) +# (b) The dependency on a loader, if any +# (c) The name of the loader +# (d) The name of the documentation file for the loader +# (e) The build target +# (f) The location of the kernelimage source +# (g) The location of the kernelimage destination +# (h) The name of the arch specific configuration file +# Some architectures has sub architectures + +### m68k +ifeq ($(strip $(architecture)),m68k) + ifeq (,$(findstring /$(KPKG_SUBARCH)/,/amiga/atari/mac/mvme147/mvme16x/bvme6000/)) + GUESS_SUBARCH:=$(shell awk '/Model/ { print $$2}' /proc/hardware) + ifneq (,$(findstring Motorola,$(GUESS_SUBARCH))) + GUESS_SUBARCH:=$(shell awk '/Model/ { print $$3}' /proc/hardware) + ifneq (,$(findstring MVME147,$(GUESS_SUBARCH))) + KPKG_SUBARCH:=mvme147 + else + KPKG_SUBARCH:=mvme16x + endif + else + ifneq (,$(findstring BVME,$(GUESS_SUBARCH))) + KPKG_SUBARCH:=bvme6000 + else + ifneq (,$(findstring Amiga,$(GUESS_SUBARCH))) + KPKG_SUBARCH:=amiga + else + ifneq (,$(findstring Atari,$(GUESS_SUBARCH))) + KPKG_SUBARCH:=atari + else + ifneq (,$(findstring Mac,$(GUESS_SUBARCH))) + KPKG_SUBARCH:=mac + endif + endif + endif + endif + endif + endif + NEED_DIRECT_GZIP_IMAGE=NO + kimage := zImage + target = $(kimage) + kimagesrc = vmlinux.gz + kimagedest = $(INT_IMAGE_DESTDIR)/vmlinuz-$(version) + DEBCONFIG = $(CONFDIR)/config.$(KPKG_SUBARCH) + ifneq (,$(findstring $(KPKG_SUBARCH),mvme147 mvme16x bvme6000)) + loaderdep=vmelilo + loader=vmelilo + loaderdoc=VmeliloDefault + else + loaderdep= + loader=lilo + loaderdoc= + endif +endif + +### ARM +ifeq ($(strip $(architecture)),arm) + GUESS_SUBARCH:='netwinder' + + ifneq (,$(findstring $(KPKG_SUBARCH),netwinder)) + KPKG_SUBARCH:=$(GUESS_SUBARCH) + kimage := zImage + target = Image + kimagesrc = arch/$(KERNEL_ARCH)/boot/Image + kimagedest = $(INT_IMAGE_DESTDIR)/vmlinux-$(version) + loaderdep= + loader=nettrom + loaderdoc= + NEED_DIRECT_GZIP_IMAGE=NO + DEBCONFIG= $(CONFDIR)/config.netwinder + else + kimage := zImage + target = zImage + NEED_DIRECT_GZIP_IMAGE=NO + kimagesrc = arch/$(KERNEL_ARCH)/boot/zImage + kimagedest = $(INT_IMAGE_DESTDIR)/vmlinuz-$(version) + DEBCONFIG = $(CONFDIR)/config.arm + endif +endif + +### PowerPC +ifneq ($(strip $(filter ppc powerpc,$(architecture))),) + ifeq ($(DEB_BUILD_ARCH),powerpc) + # This is only meaningful when building on a PowerPC + ifeq ($(GUESS_SUBARCH),) + GUESS_SUBARCH:=$(shell awk '/machine/ { print $$3}' /proc/cpuinfo) + ifneq (,$(findstring Power,$(GUESS_SUBARCH))) + GUESS_SUBARCH:=pmac + else + ifneq (,$(findstring iMac,$(GUESS_SUBARCH))) + GUESS_SUBARCH:=pmac + endif + endif + else + GUESS_SUBARCH:=pmac + endif + endif + + ifeq (,$(findstring $(KPKG_SUBARCH),apus prpmc chrp mbx pmac prep Amiga APUs CHRP MBX PReP chrp-rs6k )) + KPKG_SUBARCH:=$(GUESS_SUBARCH) + endif + + KERNEL_ARCH:=ppc + + ifneq (,$(findstring $(KPKG_SUBARCH),APUs apus Amiga)) + KPKG_SUBARCH:=apus + loader := NoLoader + kimage := vmapus.gz + target = zImage + kimagesrc = $(shell if [ -d arch/$(KERNEL_ARCH)/boot/images ]; then \ + echo arch/$(KERNEL_ARCH)/boot/images/vmapus.gz ; else \ + echo arch/$(KERNEL_ARCH)/boot/$(kimage) ; fi) + kimagedest = $(INT_IMAGE_DESTDIR)/vmlinuz-$(version) + DEBCONFIG = $(CONFDIR)/config.apus + endif + + ifneq (,$(findstring $(KPKG_SUBARCH),chrp-rs6k)) + KPKG_SUBARCH:=chrp-rs6k + loaderdep=quik + loader=quik + loaderdoc=QuikDefault + kimage := zImage + target = $(kimage) + kimagesrc = $(shell if [ -d arch/$(KERNEL_ARCH)/chrpboot ]; then \ + echo arch/$(KERNEL_ARCH)/chrpboot/$(kimage) ; else \ + echo arch/$(KERNEL_ARCH)/boot/images/$(kimage).chrp-rs6k ; fi) + kimagedest = $(INT_IMAGE_DESTDIR)/vmlinuz-$(version) + DEBCONFIG = $(CONFDIR)/config.chrp + endif + + ifneq (,$(findstring $(KPKG_SUBARCH),CHRP chrp)) + KPKG_SUBARCH:=chrp + loaderdep=quik + loader=quik + loaderdoc=QuikDefault + kimage := zImage + target = $(kimage) + kimagesrc = $(shell if [ -d arch/$(KERNEL_ARCH)/chrpboot ]; then \ + echo arch/$(KERNEL_ARCH)/chrpboot/$(kimage) ; else \ + echo arch/$(KERNEL_ARCH)/boot/images/$(kimage).chrp ; fi) + kimagedest = $(INT_IMAGE_DESTDIR)/vmlinuz-$(version) + DEBCONFIG = $(CONFDIR)/config.chrp + endif + + ifneq (,$(findstring $(KPKG_SUBARCH),PRPMC prpmc)) + KPKG_SUBARCH:=prpmc + loader := NoLoader + kimage := zImage + target = $(kimage) + kimagesrc = arch/$(KERNEL_ARCH)/boot/images/zImage.pplus + kimagedest = $(INT_IMAGE_DESTDIR)/vmlinuz-$(version) + endif + + ifneq (,$(findstring $(KPKG_SUBARCH),MBX mbx)) + KPKG_SUBARCH:=mbx + loader := NoLoader + kimage := zImage + target = $(kimage) + kimagesrc = $(shell if [ -d arch/$(KERNEL_ARCH)/mbxboot ]; then \ + echo arch/$(KERNEL_ARCH)/mbxboot/$(kimage) ; else \ + echo arch/$(KERNEL_ARCH)/boot/images/zvmlinux.embedded; fi) + kimagedest = $(INT_IMAGE_DESTDIR)/vmlinuz-$(version) + DEBCONFIG = $(CONFDIR)/config.mbx + endif + + ifneq (,$(findstring $(KPKG_SUBARCH),pmac)) + KPKG_SUBARCH:=pmac + target := zImage + ifeq ($(DEB_BUILD_ARCH),powerpc) + # This is only meaningful when building on a PowerPC + ifneq (,$(shell grep NewWorld /proc/cpuinfo)) + loaderdep=yaboot + loader=yaboot + #loaderdoc= + else + loaderdep=quik + loader=quik + loaderdoc=QuikDefault + endif + else + loaderdep=yaboot + loader=yaboot + endif + kimagesrc = vmlinux + kimage := vmlinux + kimagedest = $(INT_IMAGE_DESTDIR)/vmlinux-$(version) + HAVE_COFF_IMAGE = YES + coffsrc = $(shell if [ -d arch/$(KERNEL_ARCH)/coffboot ]; then \ + echo arch/$(KERNEL_ARCH)/coffboot/$(kimage).coff ; else \ + echo arch/$(KERNEL_ARCH)/boot/images/$(kimage).coff ; fi) + coffdest=$(INT_IMAGE_DESTDIR)/vmlinux.coff-$(version) + DEBCONFIG = $(CONFDIR)/config.pmac + endif + + ifneq (,$(findstring $(KPKG_SUBARCH),PReP prep)) + KPKG_SUBARCH:=prep + loader := NoLoader + kimage := zImage + target = $(kimage) + kimagesrc = $(shell if [ -d arch/$(KERNEL_ARCH)/boot/images ]; then \ + echo arch/$(KERNEL_ARCH)/boot/images/$(kimage).prep ; else \ + echo arch/$(KERNEL_ARCH)/boot/$(kimage) ; fi) + kimagedest = $(INT_IMAGE_DESTDIR)/vmlinuz-$(version) + DEBCONFIG = $(CONFDIR)/config.prep + endif + +endif + + +##### Alpha +ifeq ($(strip $(architecture)),alpha) +kimage := vmlinuz +loaderdep= +loader=milo +loaderdoc= +target = boot +kimagesrc = arch/$(KERNEL_ARCH)/boot/vmlinux.gz +kimagedest = $(INT_IMAGE_DESTDIR)/vmlinuz-$(version) +DEBCONFIG = $(CONFDIR)/config.alpha +endif + + +##### Sparc +ifeq ($(strip $(architecture)),sparc) + kimage := vmlinuz + loaderdep = silo + loader = silo + loaderdoc=SiloDefault + NEED_DIRECT_GZIP_IMAGE = YES + kimagedest = $(INT_IMAGE_DESTDIR)/vmlinuz-$(version) + DEBCONFIG = $(CONFDIR)/config.sparc + ifeq (,$(APPEND_TO_VERSION)) + ARCH_IN_NAME = YES + endif + + ifeq (,$(KPKG_SUBARCH)) + ifeq (sparc64,$(strip $(shell uname -m))) + KPKG_SUBARCH = sparc64 + else + KPKG_SUBARCH = sparc32 + endif + endif + + ifneq (,$(filter sparc64%,$(KPKG_SUBARCH))) + KERNEL_ARCH = sparc64 + else + ifneq (,$(filter sparc%,$(KPKG_SUBARCH))) + KERNEL_ARCH = sparc + else + KERNEL_ARCH = $(strip $(shell uname -m)) + endif + endif + + ifneq ($(shell if [ $(VERSION) -ge 2 -a $(PATCHLEVEL) -ge 5 -a \ + $(SUBLEVEL) -ge 41 ]; then echo new; \ + elif [ $(VERSION) -ge 2 -a $(PATCHLEVEL) -ge 6 ]; then \ + echo new; \ + elif [ $(VERSION) -ge 3 ]; then echo new; fi),) + target = image + kimagesrc = arch/$(KERNEL_ARCH)/boot/image + else + target = vmlinux + kimagesrc = vmlinux + endif +endif + + +##### i386 and such +ifeq ($(strip $(architecture)),i386) + # sub archs can be i386 i486 i586 i686 + GUESS_SUBARCH:=$(shell if test -f .config; then \ + perl -nle '/^CONFIG_M(.86)=y/ && print "$$1"' .config;\ + else \ + uname -m;\ + fi) + ifeq (,$(findstring $(KPKG_SUBARCH),i386 i486 i586 i686)) + KPKG_SUBARCH:=$(GUESS_SUBARCH) + endif + kimage := bzImage + loaderdep=lilo (>= 19.1) | grub + loader=lilo + loaderdoc=LiloDefault + target = $(kimage) + kimagesrc = $(strip arch/$(KERNEL_ARCH)/boot/$(kimage)) + kimagedest = $(INT_IMAGE_DESTDIR)/vmlinuz-$(version) + DEBCONFIG= $(CONFDIR)/config.$(KPKG_SUBARCH) + kelfimagesrc = vmlinux + kelfimagedest = $(INT_IMAGE_DESTDIR)/vmlinux-$(version) +endif + +##### S/390 +ifeq ($(strip $(architecture)),s390) + kimage := zimage + loaderdep=zipl + loader=zipl + loaderdoc= + target = image + NEED_DIRECT_GZIP_IMAGE=NO + kimagesrc = $(strip arch/$(KERNEL_ARCH)/boot/$(target)) + kimagedest = $(INT_IMAGE_DESTDIR)/vmlinuz-$(version) + DEBCONFIG= $(CONFDIR)/config.$(KPKG_SUBARCH) +endif + +##### hppa +ifeq ($(strip $(architecture)),hppa) + kimage := vmlinux + loaderdep=palo + loader=palo + loaderdoc= + target=$(kimage) + NEED_DIRECT_GZIP_IMAGE=NO + # Override arch name because hppa uses arch/parisc not arch/hppa + KERNEL_ARCH := parisc + kimagesrc=$(kimage) + kimagedest=$(INT_IMAGE_DESTDIR)/vmlinux-$(version) + # This doesn't seem to work, but the other archs do it... + DEBCONFIG=$(CONFDIR)/config.$(KPKG_SUBARCH) +endif + +##### ia64 +ifeq ($(strip $(architecture)),ia64) + kimage := vmlinuz + loaderdep=elilo + loader=elilo + loaderdoc= + target=compressed + NEED_DIRECT_GZIP_IMAGE=NO + kimagesrc=vmlinux.gz + kimagedest=$(INT_IMAGE_DESTDIR)/vmlinuz-$(version) + DEBCONFIG=$(CONFDIR)/config.$(KPKG_SUBARCH) +endif + +##### mips +ifeq ($(strip $(architecture)),mips) + kimage := vmlinux + loaderdep=arcboot + loader=arcboot + loaderdoc= + NEED_DIRECT_GZIP_IMAGE=NO + kimagesrc = $(strip vmlinux) + kimagedest = $(INT_IMAGE_DESTDIR)/vmlinux-$(version) + DEBCONFIG= $(CONFDIR)/config.$(KPKG_SUBARCH) + + ifneq ($(shell if [ $(VERSION) -ge 2 -a $(PATCHLEVEL) -ge 5 -a \ + $(SUBLEVEL) -ge 41 ]; then echo new; \ + elif [ $(VERSION) -ge 2 -a $(PATCHLEVEL) -ge 6 ]; then \ + echo new; \ + elif [ $(VERSION) -ge 3 ]; then echo new; fi),) + target = + else + target = boot + endif + + ifneq (,$(filter mips64%,$(KPKG_SUBARCH))) + KERNEL_ARCH = mips64 + endif + ifneq (,$(filter %-64,$(KPKG_SUBARCH))) + KERNEL_ARCH = mips64 + endif +endif + +##### mipsel +ifeq ($(strip $(architecture)),mipsel) + kimage := vmlinux + loaderdep=delo + loader=delo + loaderdoc= + NEED_DIRECT_GZIP_IMAGE=NO + kimagesrc = $(strip vmlinux) + kimagedest = $(INT_IMAGE_DESTDIR)/vmlinux-$(version) + DEBCONFIG= $(CONFDIR)/config.$(KPKG_SUBARCH) + KERNEL_ARCH= mips + #HAVE_COFF_IMAGE = YES + #coffsrc = $(strip arch/$(KERNEL_ARCH)/boot/vmlinux.ecoff) + #coffdest=$(INT_IMAGE_DESTDIR)/vmlinux.ecoff-$(version) + + ifneq ($(shell if [ $(VERSION) -ge 2 -a $(PATCHLEVEL) -ge 5 -a \ + $(SUBLEVEL) -ge 41 ]; then echo new; \ + elif [ $(VERSION) -ge 2 -a $(PATCHLEVEL) -ge 6 ]; then \ + echo new; \ + elif [ $(VERSION) -ge 3 ]; then echo new; fi),) + target = + else + target = boot + endif + + ifneq (,$(filter mips64el%,$(KPKG_SUBARCH))) + KERNEL_ARCH = mips64 + endif + ifneq (,$(filter %-64,$(KPKG_SUBARCH))) + KERNEL_ARCH = mips64 + endif +endif + +ifeq ($(strip $(architecture)),um) + kimage := linux + target = linux + loaderdep= + loaderdoc= +endif +###################################################################### +###################################################################### + +ifneq ($(strip $(loaderdep)),) + int_loaderdep := $(loaderdep), +else + int_loaderdep := +endif + + + +# The following variable is used to simplify the process of making +# diffs and orig targets, Please set it if AND ONLY IF no patches +# have been applied to the upstream source, in other words, we have +# just added debian* files. If any patches were applied, please +# leave it empty + +# NO_SRC_CHANGES = +NO_SRC_CHANGES = YES + + +# NOTE: FLAVOUR is now obsolete +# If you want to have more than one kernel configuration per kernel +# version, set FLAVOUR in the top level kernel Makefile *before* +# invoking make-kpkg -- it will be appended to UTS_RELEASE in +# version.h (separated by a hyphen). This affects everything -- the +# names and versions of the image, source, headers, and doc packages, +# and where the modules are searched for in /lib/modules. + +ifdef FLAVOUR +# uhm - should check if we really have a Makefile capable of Flavours? +endif + +FLAVOUR:=$(shell grep ^FLAVOUR Makefile 2>/dev/null | \ + perl -ple 's/FLAVOUR[\s:=]+//g') + +ifeq ($(strip $(FLAVOUR_SEP)),) +FLAVOUR_SEP:= + +endif + +ifneq ($(strip $(FLAVOUR)),) +INT_FLAV := $(FLAVOUR_SEP)$(FLAVOUR) +FLAV_ARG := FLAVOUR=$(FLAVOUR) +else +INT_FLAV := +FLAV_ARG := +endif + +## This is the replacement for FLAVOUR +EXTRAVERSION =$(strip $(EXTRA_VERSION)) +ifneq ($(strip $(APPEND_TO_VERSION)),) +iatv := $(strip $(APPEND_TO_VERSION)) +EXTRAV_ARG := EXTRAVERSION=${EXTRA_VERSION}${iatv} +else +iatv := +EXTRAV_ARG := +endif + +UTS_RELEASE_VERSION=$(shell if [ -f include/linux/version.h ]; then \ + grep 'define UTS_RELEASE' include/linux/version.h | \ + perl -nle 'm/^\s*\#define\s+UTS_RELEASE\s+("?)(\S+)\1/g && print $$2;';\ + else echo "" ; \ + fi) + +version = $(VERSION).$(PATCHLEVEL).$(SUBLEVEL)$(EXTRAVERSION)$(iatv)$(INT_FLAV) + +# KPKG_SUBARCH is used to distinguish Amiga, Atari, Macintosh, etc. kernels +# for Debian/m68k. INT_SUBARCH is used in the names of the image file +# produced. It only affects the naming of the kernel-image as the +# source and doc packages are architecture independent and the +# kernel-headers do not vary from one sub-architecture to the next. + +# This is the default +INT_SUBARCH := + +ifneq ($(strip $(ARCH_IN_NAME)),) +ifneq ($(strip $(KPKG_SUBARCH)),) +INT_SUBARCH := -$(KPKG_SUBARCH) +endif +endif + + + +# The name of the package (for example, `emacs'). +package := kernel-source-$(version) +h_package := kernel-headers-$(version) +i_package := kernel-image-$(version)$(INT_SUBARCH) +d_package := kernel-doc-$(version) +l_package := libc-kheaders + +SOURCE_TOP:= debian/tmp-source +HEADER_TOP:= debian/tmp-headers +IMAGE_TOP := debian/tmp-image +DOC_TOP := debian/tmp-doc + +SOURCE_DOC:= $(SOURCE_TOP)/usr/share/doc/$(package) +HEADER_DOC:= $(HEADER_TOP)/usr/share/doc/$(h_package) +IMAGE_DOC := $(IMAGE_TOP)/usr/share/doc/$(i_package) +DOC_DOC := $(DOC_TOP)/usr/share/doc/$(d_package) + +SOURCE_SRC:= $(SOURCE_TOP)/usr/src/$(package) +HEADER_SRC:= $(HEADER_TOP)/usr/src/$(h_package) + + + +FILES_TO_CLEAN = modules/modversions.h modules/ksyms.ver debian/files \ + conf.vars scripts/cramfs/cramfsck scripts/cramfs/mkcramfs \ + applied_patches debian/buildinfo +STAMPS_TO_CLEAN = stamp-build stamp-configure stamp-source stamp-image \ + stamp-headers stamp-src stamp-diff stamp-doc \ + stamp-buildpackage stamp-libc-kheaders stamp-debian \ + stamp-patch stamp-kernel-configure +DIRS_TO_CLEAN = $(SOURCE_TOP) $(HEADER_TOP) $(IMAGE_TOP) $(DOC_TOP) + +CONFLOC :=$(shell if test -f ~/.kernel-pkg.conf; then\ + echo ~/.kernel-pkg.conf; \ + else \ + echo /etc/kernel-pkg.conf; \ + fi) +LIBLOC :=/usr/share/kernel-package + +ifeq ($(strip $(MODULE_LOC)),) +MODULE_LOC =/usr/src/modules +endif + +DEBDIR = $(LIBLOC) +DEBDIR_NAME = $(shell basename $(DEBDIR)) + +ifeq ($(strip $(VERSIONED_PATCH_DIR)),) +VERSIONED_PATCH_DIR = $(shell if [ -d \ +/usr/src/kernel-patches/$(architecture)/$(VERSION).$(PATCHLEVEL).$(SUBLEVEL) \ + ]; then echo \ +/usr/src/kernel-patches/$(architecture)/$(VERSION).$(PATCHLEVEL).$(SUBLEVEL); \ + fi) +endif + +ifeq ($(strip $(VERSIONED_ALL_PATCH_DIR)),) +VERSIONED_ALL_PATCH_DIR = $(shell if [ -d \ +/usr/src/kernel-patches/all/$(VERSION).$(PATCHLEVEL).$(SUBLEVEL) \ + ]; then echo \ +/usr/src/kernel-patches/all/$(VERSION).$(PATCHLEVEL).$(SUBLEVEL); \ + fi) +endif + +ifeq ($(strip $(PATCH_DIR)),) +PATCH_DIR = $(shell if [ -d /usr/src/kernel-patches/$(architecture)/ ];\ + then echo /usr/src/kernel-patches/$(architecture); \ + fi) +endif + +ifeq ($(strip $(ALL_PATCH_DIR)),) +ALL_PATCH_DIR = $(shell if [ -d /usr/src/kernel-patches/all/ ]; \ + then echo /usr/src/kernel-patches/all/ ;\ + fi) +endif + +VERSIONED_ALL_PATCH_APPLY = $(VERSIONED_ALL_PATCH_DIR)/apply +VERSIONED_ALL_PATCH_UNPATCH = $(VERSIONED_ALL_PATCH_DIR)/unpatch + +VERSIONED_DIR_PATCH_APPLY = $(VERSIONED_PATCH_DIR)/apply +VERSIONED_DIR_PATCH_UNPATCH = $(VERSIONED_PATCH_DIR)/unpatch + +ALL_PATCH_APPLY = $(ALL_PATCH_DIR)/apply +ALL_PATCH_UNPATCH = $(ALL_PATCH_DIR)/unpatch + +DIR_PATCH_APPLY = $(PATCH_DIR)/apply +DIR_PATCH_UNPATCH = $(PATCH_DIR)/unpatch + +# The destination of all .deb files +# (suggested by Rob Browning ) +DEB_DEST := .. +SRCTOP := $(shell if [ "$$PWD" != "" ]; then echo $$PWD; else pwd; fi) +INSTALL_MOD_PATH=$(SRCTOP)/$(IMAGE_TOP) +KPKG_DEST_DIR ?= $(SRCTOP)/.. + +install_file= install -p -o root -g root -m 644 +install_program= install -p -o root -g root -m 755 +make_directory= install -p -d -o root -g root -m 755 +deb_rule = $(MAKE) -f $(DEBDIR)/rules + +# Include any site specific overrides here. +-include $(CONFLOC) + +# Over ride the config file from the environment/command line +ifneq ($(strip $(KPKG_MAINTAINER)),) +maintainer=$(KPKG_MAINTAINER) +endif + +ifneq ($(strip $(KPKG_EMAIL)),) +email=$(KPKG_EMAIL) +endif + +# This should be a name to feed the modules build for pgp signature, +# since we the maintainer would be different there. +ifneq ($(strip $(PGP_SIGNATURE)),) +pgp=$(PGP_SIGNATURE) +endif + +ifneq ($(strip $(EXTRA_DOCS)),) +extra_docs = $(EXTRA_DOCS) +endif + +ifneq ($(strip $(extra_docs)),) +HAVE_EXTRA_DOCS:=$(shell if [ -e $(extra_docs) ]; then echo YES; fi) +endif + +ifneq ($(strip $(DEBIAN_REVISION_MANDATORY)),) +debian_revision_mandatory:=$(DEBIAN_REVISION_MANDATORY) +endif + + +ifneq ($(strip $(install_vmlinux)),) +int_install_vmlinux:=$(install_vmlinux) +endif + +ifneq ($(strip $(KPKG_FOLLOW_SYMLINKS_IN_SRC)),) +int_follow_symlinks_in_src=YES +else +ifneq ($(strip $(kpkg_follow_symlinks_in_src)),) +int_follow_symlinks_in_src=YES +endif +endif + + + + + +# The Debian revision +ifneq ($(strip $(DEBIAN_REVISION)),) +HAS_CHANGELOG := $(shell \ + if test -f debian/changelog -a \( -f stamp-debian -o -f debian/official \);\ + then echo YES;\ + else echo NO; fi; ) +else +HAS_CHANGELOG := $(shell if test -f debian/changelog; then echo YES;\ + else echo NO; fi; ) +endif +# If there is a changelog file, it overrides. The only exception is +# when there is no stamp-config, and there is no debian/official, +# *AND* there is a DEBIAN_REVISION, in which case the DEBIAN_REVISION +# over rides (since we are going to replace the changelog file soon +# anyway. Else, use the commandline or env var setting. Or else +# default to 10.00.Custom, unless the human has requested that the +# revision is mandatory, in which case we raise an error + +ifeq ($(strip $(HAS_CHANGELOG)),YES) +debian := $(shell if test -f debian/changelog; then \ + perl -nle 'print /\((\S+)\)/; exit 0' debian/changelog;\ + fi; ) +else +ifneq ($(strip $(DEBIAN_REVISION)),) +debian := $(DEBIAN_REVISION) +else +ifeq ($(strip $(debian)),) +ifneq ($(strip $(debian_revision_mandatory)),) +$(error A Debian revision is mandatory, but none was provided) +else +debian := 10.00.Custom +endif +endif +endif +endif + +# Hmm. The version that we have computed *MUST* match the one that is in the +# changelog. +ifeq ($(strip $(HAS_CHANGELOG)),YES) +saved_version := $(shell if test -f debian/changelog; then \ + perl -nle 'print /^kernel-source-(\S+)/; exit 0' \ + debian/changelog;\ + fi; ) +ifneq ($(strip $(saved_version)),) +ifneq ($(strip $(saved_version)),$(strip $(version))) +HAVE_VERSION_MISMATCH=YES +endif +endif +endif + + +ifneq ($(strip $(DELETE_BUILD_LINK)),) +delete_build_link := YES +else +ifeq ($(strip $(delete_build_link)),) +delete_build_link := $(shell if test -f debian/official; then echo YES;\ + else echo NO; fi; ) +endif +endif + +ifneq ($(strip $(IMAGE_IN_BOOT)),) +link_in_boot := $(IMAGE_IN_BOOT) +endif + +ifneq ($(strip $(LINK_IN_BOOT)),) +link_in_boot := $(LINK_IN_BOOT) +endif + +ifneq ($(strip $(NO_SYMLINK)),) +no_symlink := $(NO_SYMLINK) +endif + +ifneq ($(strip $(REVERSE_SYMLINK)),) +reverse_symlink := $(REVERSE_SYMLINK) +endif + +ifneq ($(strip $(IMAGE_TYPE)),) +kimage = $(IMAGE_TYPE) +endif + +ifneq ($(strip $(PATCH_THE_KERNEL)),) +patch_the_kernel = $(PATCH_THE_KERNEL) +endif + +ifneq ($(strip $(KPKG_SELECTED_PATCHES)),) +ifeq ($(strip $(patch_the_kernel)),NO) +patch_the_kernel = NO +else +ifeq ($(strip $(patch_the_kernel)),no) +patch_the_kernel = NO +else +patch_the_kernel = YES +endif +endif +endif + + +ifeq ($(strip $(patch_the_kernel)),yes) +patch_the_kernel = YES +endif +ifeq ($(strip $(patch_the_kernel)),Yes) +patch_the_kernel = YES +endif +ifeq ($(strip $(patch_the_kernel)),YEs) +patch_the_kernel = YES +endif +ifeq ($(strip $(patch_the_kernel)),yEs) +patch_the_kernel = YES +endif +ifeq ($(strip $(patch_the_kernel)),yES) +patch_the_kernel = YES +endif +ifeq ($(strip $(patch_the_kernel)),yeS) +patch_the_kernel = YES +endif + + + +ifneq ($(strip $(CONFIG_TARGET)),) +config_target := $(CONFIG_TARGET) +have_new_config_target := YES +endif + +# If config_target doesn't end in `config' then reset it to `oldconfig'. +ifneq ($(patsubst %config,config,$(strip $(config_target))),config) +config_target := oldconfig +have_new_config_target := +endif + +ifneq ($(strip $(USE_SAVED_CONFIG)),) +use_saved_config = $(USE_SAVED_CONFIG) +endif + +#ifeq ($(origin var),command line) +#$(warn You are setting an internal var from the cmdline. Use at your own risk) +#endif +#you can automated it a bit more with $(foreach) and $(if) + +###ROOT_COMMAND +ifneq ($(strip $(ROOT_CMD)),) +int_root_cmd := -r$(strip $(ROOT_CMD)) +else +# well, ROOT_CMD is not set yet +ifneq ($(strip $(root_cmd)),) + +# Try and set ROOT_CMD from root_cmd +int_dummy_root := $(root_cmd) +ifneq ($(strip $(findstring -us, $(int_dummy_root))),) +int_dummy_root := $(subst -us,, $(strip $(int_dummy_root))) +endif +ifneq ($(strip $(findstring -uc, $(int_dummy_root))),) +int_dummy_root := $(subst -uc,, $(strip $(int_dummy_root))) +endif + + +ifneq ($(strip $(findstring -r, $(int_dummy_root))),) +ROOT_CMD := $(patsubst -r%, %, $(filter -r%, $(strip $(int_dummy_root)))) +else +ROOT_CMD := $(strip $(root_cmd)) +endif + + +ifeq ($(strip $(findstring -r, $(root_cmd))),) +int_root_cmd := -r$(strip $(root_cmd)) +else +int_root_cmd := $(root_cmd) +endif +endif +endif + +ifneq ($(strip $(UNSIGN_SOURCE)),) +int_root_cmd := $(int_root_cmd) -us +endif + +ifneq ($(strip $(UNSIGN_CHANGELOG)),) +int_root_cmd := $(int_root_cmd) -uc +endif + +# make sure that root_cmd and int_root_cmd are the same +ifneq ($(strip $(int_root_cmd)),) +root_cmd := $(int_root_cmd) +endif + +int_am_root := $(shell [ $$(id -u) -eq 0 ] && echo "YES" ) +int_get_root := $(shell [ $$(id -u) -ne 0 ] && echo "$(ROOT_CMD)" ) + + +ifneq ($(strip $(CLEAN_SOURCE)),) +do_clean = $(CLEAN_SOURCE) +endif + +ifneq ($(strip $(CONCURRENCY_LEVEL)),) +do_parallel = -j$(CONCURRENCY_LEVEL) + +# Well, I wish there was something better than guessing by version number +CAN_DO_DEP_FAST=$(shell if [ $(VERSION) -lt 2 ]; then echo ''; \ + elif [ $(VERSION) -gt 2 ]; then echo YES; \ + elif [ $(PATCHLEVEL) -lt 4 ]; then echo ''; \ + else echo YES; \ + fi) +ifneq ($(strip $(CAN_DO_DEP_FAST)),) +fast_dep= -j$(CONCURRENCY_LEVEL) +endif + +endif + +ifneq ($(strip $(SOURCE_CLEAN_HOOK)),) +source_clean_hook=$(SOURCE_CLEAN_HOOK) +endif +ifneq ($(strip $(HEADER_CLEAN_HOOK)),) +header_clean_hook=$(HEADER_CLEAN_HOOK) +endif +ifneq ($(strip $(DOC_CLEAN_HOOK)),) +doc_clean_hook=$(DOC_CLEAN_HOOK) +endif + +ifneq ($(strip $(INITRD)),) +initrddep := initrd-tools (>= 0.1.48), # there is a space here +else +initrddep := +endif + +ifeq ($(strip $(CONFDIR)),) +ifeq ($(strip $(patch_the_kernel)),YES) +CONFDIR = $(PATCH_DIR) +else +ifeq ($(strip $(patch_the_kernel)),yes) +CONFDIR = $(PATCH_DIR) +else +CONFDIR = $(DEBDIR)/Config +endif +endif +endif + +# The file which has local configuration +CONFIG_FILE := $(shell if test -e .config ; then \ + echo .config; \ + elif test -e $(DEBCONFIG) ; then \ + echo $(DEBCONFIG); \ + elif test -e $(CONFDIR)/config ; then \ + echo $(CONFDIR)/config ; \ + elif test -e $(DEBDIR)/config ; then \ + echo $(DEBDIR)/config ; \ + elif test -e /boot/config-$(version) ; then \ + echo /boot/config-$(version) ; \ + elif test -e /boot/config-$$(uname -r) ; then \ + echo /boot/config-$$(uname -r) ; \ + else echo /dev/null ; \ + fi) + + +# See if we are being run in the kernel directory +IN_KERNEL_DIR := $(shell if test -d drivers -a -d kernel -a -d fs -a \ + -d include/linux ; then \ + echo YES; \ + fi ) + +IN_KERNEL_HEADERS=$(shell if [ -f kernel-headers.revision ]; then \ + cat kernel-headers.revision; \ + else echo "" ; \ + fi) + +ifeq ($(strip $(IN_KERNEL_DIR)),) +ifneq ($(strip $(IN_KERNEL_HEADERS)),) +version=$(UTS_RELEASE_VERSION) +debian=$(IN_KERNEL_HEADERS) +endif +endif + + +# Deal with modules issues + +# define MODULES_ENABLED if appropriate +ifneq ($(strip $(shell egrep ^[^\#]*CONFIG_MODULES $(CONFIG_FILE))),) +MODULES_ENABLED := YES +endif + +# accept both space separated list of modules, as well as comma +# separated ones +comma:= , +empty:= +space:= $(empty) $(empty) +valid_modules:= + +# See what modules we are talking about +ifeq ($(strip $(MODULES_ENABLED)),YES) +ifneq ($(strip $(KPKG_SELECTED_MODULES)),) +canonical_modules=$(subst $(comma),$(space),$(KPKG_SELECTED_MODULES)) +else +canonical_modules=$(shell test -e $(MODULE_LOC) && \ + find $(MODULE_LOC) -follow -maxdepth 1 -type d -print |\ + egrep -v '^$(MODULE_LOC)/$$') +endif + + +# Now, if we have any modules at all, they are in canonical_modules +ifneq ($(strip $(canonical_modules)),) + +# modules can have the full path, or just the name of the module. We +# make all the modules ahve absolute paths by fleshing them out. +path_modules :=$(filter /%, $(canonical_modules)) +no_path_modules:=$(filter-out /%, $(canonical_modules)) +fleshed_out :=$(foreach mod,$(no_path_modules),$(MODULE_LOC)/$(mod)) + +# Hmmph. recreate the canonical modules; now everything has a full +# path name. + +canonical_modules:=$(path_modules) $(fleshed_out) +# test to see if the dir names are real +valid_modules = $(shell for dir in $(canonical_modules); do \ + if [ -d $$dir ] && [ -x $$dir/debian/rules ]; then \ + echo $$dir; \ + fi; \ + done) + + +endif +endif + +ifeq ($(strip $(patch_the_kernel)),YES) + +# Well then. Let us see if we want to select the patches we apply. +ifneq ($(strip $(KPKG_SELECTED_PATCHES)),) +canonical_patches=$(subst $(comma),$(space),$(KPKG_SELECTED_PATCHES)) + +ifneq ($(strip $(canonical_patches)),) +# test to see if the patches exist +temp_valid_patches = $(shell for name in $(canonical_patches); do \ + if [ -x $(VERSIONED_DIR_PATCH_APPLY)/$$name -a \ + -x $(VERSIONED_DIR_PATCH_UNPATCH)/$$name ]; \ + then echo $(VERSIONED_DIR_PATCH_APPLY)/$$name; \ + elif [ -x $(VERSIONED_ALL_PATCH_APPLY)/$$name -a \ + -x $(VERSIONED_ALL_PATCH_UNPATCH)/$$name ];\ + then echo $(VERSIONED_ALL_PATCH_APPLY)/$$name; \ + elif [ -x $(DIR_PATCH_APPLY)/$$name -a \ + -x $(DIR_PATCH_UNPATCH)/$$name ]; then \ + echo $(DIR_PATCH_APPLY)/$$name; \ + elif [ -x $(ALL_PATCH_APPLY)/$$name -a \ + -x $(ALL_PATCH_UNPATCH)/$$name ]; then \ + echo $(ALL_PATCH_APPLY)/$$name; \ + else \ + echo $$name.error; \ + fi; \ + done) + +temp_patch_not_found = $(filter %.error, $(temp_valid_patches)) +patch_not_found = $(subst .error,,$(temp_patch_not_found)) +ifneq ($(strip $(patch_not_found)),) +$(error Could not find patch for $(patch_not_found)) +endif + +valid_patches = $(filter-out %.error, $(temp_valid_patches)) + +ifeq ($(strip $(valid_patches)),) +$(error Could not find patch scripts for $(canonical_patches)) +endif + + + +canonical_unpatches = $(shell new=""; \ + for name in $(canonical_patches); do \ + new="$$name $$new"; \ + done; \ + echo $$new;) + +temp_valid_unpatches = $(shell for name in $(canonical_unpatches); do \ + if [ -x $(VERSIONED_DIR_PATCH_APPLY)/$$name -a \ + -x $(VERSIONED_DIR_PATCH_UNPATCH)/$$name ]; \ + then echo $(VERSIONED_DIR_PATCH_UNPATCH)/$$name;\ + elif [ -x $(VERSIONED_ALL_PATCH_APPLY)/$$name -a \ + -x $(VERSIONED_ALL_PATCH_UNPATCH)/$$name ];\ + then echo $(VERSIONED_ALL_PATCH_UNPATCH)/$$name;\ + elif [ -x $(DIR_PATCH_APPLY)/$$name -a \ + -x $(DIR_PATCH_UNPATCH)/$$name ]; then \ + echo $(DIR_PATCH_UNPATCH)/$$name; \ + elif [ -x $(ALL_PATCH_APPLY)/$$name -a \ + -x $(ALL_PATCH_UNPATCH)/$$name ]; then \ + echo $(ALL_PATCH_UNPATCH)/$$name; \ + else \ + echo $$name.error; \ + fi; \ + done) +temp_unpatch_not_found = $(filter %.error, $(temp_valid_unpatches)) +unpatch_not_found = $(subst .error,,$(temp_unpatch_not_found)) +ifneq ($(strip $(unpatch_not_found)),) +$(error Could not find unpatch for $(unpatch_not_found)) +endif + +valid_unpatches = $(filter-out %.error, $(temp_valid_unpatches)) + +ifeq ($(strip $(valid_unpatches)),) +$(error Could not find un-patch scripts for $(canonical_unpatches)) +endif + + +endif +endif +endif + +old_applied_patches=$(shell if [ -f applied_patches ]; then \ + cat applied_patches; \ + else \ + echo ''; \ + fi ) + +ifeq ($(strip $(valid_unpatches)),) +ifneq ($(strip $(old_applied_patches)),) +old_unpatches=$(shell new=""; \ + for name in $(notdir $(old_applied_patches)); do \ + new="$$name $$new"; \ + done; \ + echo $$new;) +temp_old_unpatches = $(shell for name in $(old_unpatches); do \ + if [ -x $(VERSIONED_DIR_PATCH_UNPATCH)/$$name ]; \ + then echo $(VERSIONED_DIR_PATCH_UNPATCH)/$$name;\ + elif [ -x $(VERSIONED_ALL_PATCH_UNPATCH)/$$name ];\ + then echo $(VERSIONED_ALL_PATCH_UNPATCH)/$$name;\ + elif [ -x $(DIR_PATCH_UNPATCH)/$$name ]; then \ + echo $(DIR_PATCH_UNPATCH)/$$name; \ + elif [ -x $(ALL_PATCH_UNPATCH)/$$name ]; then \ + echo $(ALL_PATCH_UNPATCH)/$$name; \ + else \ + echo $$name.error; \ + fi; \ + done) +temp_old_unpatch_not_found = $(filter %.error, $(temp_old_unpatches)) +old_unpatch_not_found = $(subst .error,,$(temp_unpatch_not_found)) +valid_unpatches = $(filter-out %.error, $(temp_old_unpatches)) +endif +endif + +# See if the version numbers are valid +HAVE_VALID_PACKAGE_VERSION := $(shell \ + if test -x $(DEBDIR)/kpkg-vercheck; then \ + $(DEBDIR)/kpkg-vercheck $(debian) ; \ + else \ + echo "Could not find $(DEBDIR)/kpkg-vercheck" ; \ + fi ) + +TAR_COMPRESSION := $(shell \ + if tar --help | grep -- \-\-bzip2 >/dev/null; then \ + echo --bzip2; \ + else \ + echo --gzip; \ + fi ) +TAR_SUFFIX := $(shell \ + if tar --help | grep -- \-\-bzip2 >/dev/null; then \ + echo bz2; \ + else \ + echo gz; \ + fi ) + +STOP_FOR_BIN86 = NO +CONTROL=$(DEBDIR)/Control +ifeq ($(strip $(architecture)),i386) +NEED_BIN86 := $(shell if dpkg --compare-versions \ + $(VERSION).$(PATCHLEVEL) lt 2.4 >/dev/null 2>&1; \ + then echo YES; fi) +ifeq ($(strip $(NEED_BIN86)),YES) +CONTROL=$(DEBDIR)/Control.bin86 +HAVE_BIN86 := $(shell if test -x /usr/bin/as86; then echo YES; \ + else echo NO; fi ) +ifeq ($(strip $(HAVE_BIN86)),NO) +STOP_FOR_BIN86 = YES +endif +endif +endif + +# Bug out if the version number id not all lowercase +lc_version = $(shell echo $(version) | tr A-Z a-z) +ifneq ($(strip $(version)),$(strip $(lc_version))) +$(error Error. The version number $(strip $(version)) is not all \ + lowercase. Since the version ends up in the package name of the \ + kernel image package, this is a Debian policy violation, and \ + the packaging system shall refuse to package the image. ) +endif + +ifeq (,$(strip $(kimagedest))) +$(error Error. I do not know where the kernel image goes to [kimagedest undefined]\ + The usual case for this is that I could not determine which arch or subarch \ + tihs machine belongs to. Please specify a subarch, and try again.) +endif +ifeq (,$(strip $(kimagesrc))) +$(error Error. I do not know where the kernel image goes to [kimagesrc undefined]\ + The usual case for this is that I could not determine which arch or subarch \ + tihs machine belongs to. Please specify a subarch, and try again.) +endif + +# export variables +export root_cmd FLAVOUR INT_SUBARCH APPEND_TO_VERSION UNSIGN_CHANGELOG \ + UNSIGN_SOURCE ROOT_CMD MODULE_LOC EXTRAVERSION ALL_PATCH_DIR \ + ALL_PATCH_APPLY ALL_PATCH_UNPATCH DIR_PATCH_UNPATCH \ + DIR_PATCH_APPLY VERSIONED_PATCH_DIR VERSIONED_ALL_PATCH_UNPATCH \ + VERSIONED_ALL_PATCH_APPLY VERSIONED_DIR_PATCH_UNPATCH \ + VERSIONED_DIR_PATCH_APPLY KPKG_SELECTED_PATCHES \ + KPKG_SELECTED_MODULES CONCURRENCY_LEVEL + + +ifeq ($(strip $(IN_KERNEL_DIR)),) +# Hah! Not in kernel directory!! +build configure clean binary kernel_source kernel-source kernel-headers\ +stamp-source kernel_headers stamp-headers kernel_image stamp-image \ +kernel-image kernel-doc kernel_doc stamp-doc buildpackage \ +libc_kheaders libc-kheaders stamp-libc-kheaders kernel-image-deb debian: + @echo "You should invoke this command from the top level directory of" + @echo "a linux kernel source directory tree, and as far as I can tell," + @echo "the current directory:" + @echo " $(SRCTOP)" + @echo "is not a top level linux kernel source directory. " + @echo "" + @echo " (If I am wrong then kernel-packages and the linux kernel" + @echo " are so out sync that you'd better get the latest versions" + @echo " of the kernel-package package and the Linux sources)" + @echo "" + @echo "Please change directory to wherever linux kernel sources" + @echo "reside and try again." +else +ifneq ($(strip $(HAVE_VALID_PACKAGE_VERSION)),YES) +# Hah! Bogus version number +build configure clean binary kernel_source kernel-source kernel-headers\ +stamp-source kernel_headers stamp-headers kernel_image stamp-image \ +kernel-image kernel-doc kernel_doc stamp-doc buildpackage kernel-image-deb \ +debian: + @echo "Problems ecountered with the version number $(debian)." + @echo "$(HAVE_VALID_PACKAGE_VERSION)" + @echo "" + @echo "Please re-read the README file and try again." +else +ifeq ($(strip $(STOP_FOR__BIN86)),YES) +# Hah! we need bin 86, but it aint here +build configure clean binary kernel_source kernel-source kernel-headers\ +stamp-source kernel_headers stamp-headers kernel_image stamp-image \ +kernel-image kernel-doc kernel_doc stamp-doc buildpackage kernel-image-deb \ +debian: + @echo "You Need to install the package bin86 before you can " + @echo "compile the kernel on this machine" + @echo "" + @echo "Please install bin86 and try again." +else +all build: debian configure stamp-build +stamp-build: +# Builds the binary package. +# debian.config contains the current idea of what the image should +# have. +ifneq ($(strip $(HAVE_VERSION_MISMATCH)),) + @(echo "The changelog says we are creating $(saved_version), but I thought the version is $(version)"; exit 1) +endif +ifneq ($(strip $(UTS_RELEASE_VERSION)), $(strip $(version))) + @echo "The UTS Release version in include/linux/version.h" + @echo " \"$(strip $(UTS_RELEASE_VERSION))\" " + @echo "does not match current version " + @echo " \"$(strip $(version))\" " + @echo "Reconfiguring." + touch Makefile +endif + -test -f stamp-configure || $(deb_rule) configure + $(MAKE) $(do_parallel) $(EXTRAV_ARG) $(FLAV_ARG) ARCH=$(KERNEL_ARCH) \ + $(CROSS_ARG) $(target) +ifneq ($(strip $(shell egrep ^[^\#]*CONFIG_MODULES $(CONFIG_FILE))),) + $(MAKE) $(do_parallel) $(EXTRAV_ARG) $(FLAV_ARG) ARCH=$(KERNEL_ARCH) \ + $(CROSS_ARG) modules +endif + COLUMNS=150 dpkg -l 'gcc*' perl dpkg 'libc6*' binutils ldso make dpkg-dev |\ + awk '$$1 == "ii" { printf("%s-%s\n", $$2, $$3) }' > debian/buildinfo + @echo this was built on a machine with the kernel: >> debian/buildinfo + uname -a >> debian/buildinfo + echo using the compiler: >> debian/buildinfo + grep LINUX_COMPILER include/linux/compile.h | \ + sed -e 's/.*LINUX_COMPILER "//' -e 's/"$$//' >> debian/buildinfo + echo done > $@ + +buildpackage: clean stamp-buildpackage +stamp-buildpackage: configure +ifneq ($(strip $(HAVE_VERSION_MISMATCH)),) + @(echo "The changelog says we are creating $(saved_version), but I thought the version is $(version)"; exit 1) +endif + test -f stamp-configure || $(deb_rule) configure + echo 'Building Package' > stamp-building +ifneq ($(strip $(root_cmd)),) + dpkg-buildpackage -nc $(strip $(root_cmd)) -m"$(maintainer) <$(email)>" -k"$(pgp)" +else + dpkg-buildpackage -nc -m"$(maintainer) <$(email)>" -k"$(pgp)" +endif + rm -f stamp-building + echo done > $@ + +# stamp-debian and stamp-configure used to be a single target. Now +# they are split - the reason is that arch-indep packages need to be +# built before arch-dep packages, and make-kpkg tries to do 'make +# config' for both cases. This used to work because the .config file +# resided with kernel-source, but now that it is in kernel-patch, it +# breaks down. I think the cleanest way out of this is to only deal +# with config files when necessary, and thus the split. Herbert Xu +debian: stamp-debian +stamp-debian: +ifneq ($(strip $(HAVE_VERSION_MISMATCH)),) + @(echo "The changelog says we are creating $(saved_version), but I thought the version is $(version)"; exit 1) +endif + @test -f $(DEBDIR)/rules || \ + echo Error: Could not find $(DEBDIR)/rules + -test ! -f stamp-debian && test ! -f debian/official && \ + rm -rf ./debian && mkdir ./debian +ifeq ($(strip $(patch_the_kernel)),YES) + -test -f applied_patches && rm -f applied_patches +ifneq ($(strip $(valid_patches)),) + -for patch in $(valid_patches) ; do \ + if test -x $$patch; then \ + if $$patch; then \ + echo "Patch $$patch processed fine"; \ + echo "$(notdir $$patch)" >> applied_patches; \ + else \ + echo "Patch $(notdir $$patch) failed."; \ + echo "Hit return to Continue"; \ + read ans; \ + fi; \ + fi; \ + done + echo done > stamp-patch +else + if [ -n "$(VERSIONED_PATCH_DIR)" -a \ + -d $(VERSIONED_DIR_PATCH_APPLY) ]; then \ + run-parts --exit-on-error $(VERSIONED_DIR_PATCH_APPLY); \ + (cd $(VERSIONED_DIR_PATCH_APPLY); ls -1) >> \ + applied_patches; \ + echo done > stamp-patch; \ + else \ + true; \ + fi + if [ -n "$(VERSIONED_ALL_PATCH_DIR)" -a \ + -d $(VERSIONED_ALL_PATCH_APPLY) ]; then \ + run-parts --exit-on-error $(VERSIONED_ALL_PATCH_APPLY); \ + (cd $(VERSIONED_ALL_PATCH_APPLY); ls -1) >> \ + applied_patches; \ + echo done > stamp-patch; \ + else \ + true; \ + fi + if [ -n "$(PATCH_DIR)" -a \ + -d $(DIR_PATCH_APPLY) ]; then \ + run-parts --exit-on-error $(DIR_PATCH_APPLY); \ + (cd $(DIR_PATCH_APPLY); ls -1) >> applied_patches;\ + else \ + true; \ + fi + if [ -n "$(ALL_PATCH_DIR)" -a \ + -d $(ALL_PATCH_APPLY) ]; then \ + run-parts --exit-on-error $(ALL_PATCH_APPLY); \ + (cd $(ALL_PATCH_APPLY); ls -1) >> applied_patches;\ + echo done > stamp-patch; \ + else \ + true; \ + fi +endif +endif + -test ! -f stamp-debian -a \ + ! \( -f debian/official -a -f debian/control \) && \ + sed -e 's/=V/$(version)/g' -e 's/=D/$(debian)/g' \ + -e 's/=A/$(architecture)/g' -e 's/=SA/$(INT_SUBARCH)/g' \ + -e 's/=L/$(int_loaderdep) /g' -e 's/=I/$(initrddep)/g' \ + -e 's/=CV/$(VERSION).$(PATCHLEVEL)/g' \ + -e 's/=M/$(maintainer) <$(email)>/g' \ + $(CONTROL)> debian/control + -test ! -f stamp-debian && test ! -f debian/official && \ + sed -e 's/=V/$(version)/g' -e 's/=D/$(debian)/g' \ + -e 's/=A/$(architecture)/g' -e 's/=M/$(maintainer) <$(email)>/g' \ + $(DEBDIR)/changelog > debian/changelog + -test ! -f debian/rules && \ + install -p -m 755 $(DEBDIR)/rules debian/rules + echo done > $@ + +# We could always do $(MAKE) -n -p dummy | grep ^CC >> .mak here if we cared +ifeq ($(strip $(INCLUDE_KERNEL_MAKEFILE)),yes) +include Makefile +conf_vars: + @echo Please ignore the warning about overriding and ignoring targets above. + @echo These are harmless. They are only invoked in a part of the process + @echo that tries to snarf variable values for the conf.vars file. + @echo "VERSION = $(VERSION)" > .mak + @echo "PATCHLEVEL = $(PATCHLEVEL)" >> .mak + @echo "SUBLEVEL = $(SUBLEVEL)" >> .mak + @echo "EXTRAVERSION = $(EXTRAVERSION)" >> .mak +ifneq ($(strip $(iatv)),) + @echo "APPEND_TO_VERSION = $(iatv)" >> .mak +endif + @echo "ARCH = $(ARCH)" >> .mak + @echo "KPKG_ARCH = $(KPKG_ARCH)" >> .mak + @echo "HOSTCC = $(HOSTCC)" >> .mak + @echo "HOSTCFLAGS = $(HOSTCFLAGS)" >> .mak + @echo "CROSS_COMPILE = $(CROSS_COMPILE)" >> .mak + @echo "AS = $(AS)" >> .mak + @echo "LD = $(LD)" >> .mak + @echo "CC = $(CC)" >> .mak + @echo "CPP = $(CPP)" >> .mak + @echo "AR = $(AR)" >> .mak + @echo "NM = $(NM)" >> .mak + @echo "STRIP = $(STRIP)" >> .mak + @echo "OBJCOPY = $(OBJCOPY)" >> .mak + @echo "OBJDUMP = $(OBJDUMP)" >> .mak + @echo "MAKE = $(MAKE)" >> .mak + @echo "GENKSYMS = $(GENKSYMS)" >> .mak + @echo "CFLAGS = $(CFLAGS)" >> .mak + @echo "AFLAGS = $(AFLAGS)" >> .mak + @echo "MODFLAGS = $(MODFLAGS)" >> .mak + @echo "do_parallel = $(do_parallel)" >> .mak