Changeset 868 for trunk


Ignore:
Timestamp:
Dec 11, 2016, 11:56:06 AM (3 years ago)
Author:
amain
Message:

rootfs: auto install all debwrt packages

Location:
trunk/debian/rootfs
Files:
1 added
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/debian/rootfs/debian.mk

    r770 r868  
    11# DebWrt - Debian on Embedded devices
    22#
    3 # Copyright (C) 2010,2015 Johan van Zoomeren <amain@debwrt.net>
     3# Copyright (C) 2010,2016 Johan van Zoomeren <amain@debwrt.net>
    44#
    55# This program is free software: you can redistribute it and/or modify
     
    2525MODULES_VERSION=$(shell echo `basename $(DEBWRT_MODULES_ARCHIVE) 2>/dev/null` | awk -F '-' '{print $$6}')
    2626ROOTFS_DEBIAN_INCLUDE_PACKAGES_DEBIAN_VERSION:=$(wildcard debian/rootfs/include_packages.list.$(ROOTFS_DEBIAN_RELEASE))
     27
     28include  $(TOPDIR)/debian/rootfs/packages.mk
    2729
    2830define qemu-prepare
     
    3436        @if ! (mount | grep -q $(ROOTFS_BUILD_DIR)/proc); then sudo chroot $(ROOTFS_BUILD_DIR) mount -t proc none /proc; fi
    3537        @if ! (mount | grep -q $(ROOTFS_BUILD_DIR)/sys ); then sudo chroot $(ROOTFS_BUILD_DIR) mount -t sysfs none /sys; fi
    36         @mount
    3738endef
    3839
     
    6465        $(call qemu-cleanup)
    6566
    66 debian/rootfs: debian/rootfs/bootstrap            \
    67                debian/rootfs/unpack               \
    68                debian/rootfs/files-install        \
    69                debian/rootfs/post-setup           \
    70                debian/rootfs/second-stage         \
    71                debian/rootfs/verify               \
    72                debian/rootfs/save
     67debian/rootfs: | debian/rootfs/prepare-debwrt-packages \
     68                 debian/rootfs/bootstrap               \
     69                 debian/rootfs/copy-debwrt-packages    \
     70                 debian/rootfs/unpack                  \
     71                 debian/rootfs/files-install           \
     72                 debian/rootfs/post-setup              \
     73                 debian/rootfs/post-setup-emulated     \
     74                 debian/rootfs/install-debwrt-packages \
     75                 debian/rootfs/verify                  \
     76                 debian/rootfs/save
    7377        @echo "I: Root filesystem $(ROOTFS_DEBIAN_RELEASE) $(ROOTFS_DEBIAN_ARCH) prepared in $(ROOTFS_BUILD_DIR) and archived in $(ROOTFS_INSTALL_DIR)/$(ROOTFS_TAR_BZ2)."
    7478        @echo "I:"
     
    103107        sudo chown $(USER) $(ROOTFS_INSTALL_DIR)/$(ROOTFS_TAR_BZ2)
    104108        sudo chmod 644 $(ROOTFS_INSTALL_DIR)/$(ROOTFS_TAR_BZ2)
    105 #ifeq ($(ROOTFS_DEBIAN_QEMU_2ND_STAGE),y)
    106 #else
    107 #       if [ -d /media/DEBWRT_ROOT ]; then \
    108 #               sudo bash -c "tar cjf $(ROOTFS_TAR_BZ2) -C /media/DEBWRT_ROOT ."; \
    109 #       fi
    110 #endif
    111109
    112110debian/rootfs/files-install: debian/rootfs/bootstrap
     
    118116                sudo mkfifo   $(ROOTFS_BUILD_DIR)/dev/initctl; \
    119117        fi
    120         chmod 600 $(DEBWRT_EXTRA_ROOTFS_FILES_DIR)/etc/ssh/ssh_host_rsa_key
    121         chmod 600 $(DEBWRT_EXTRA_ROOTFS_FILES_DIR)/etc/ssh/ssh_host_dsa_key
    122118        @echo "Installing generic files (all):"
    123119        sudo bash -c "tar cf - --exclude=".svn" -C $(DEBWRT_EXTRA_ROOTFS_FILES_DIR)/all . | tar -xovf - -C $(ROOTFS_BUILD_DIR)"
     
    125121        sudo mkdir -p $(ROOTFS_BUILD_DIR)/target
    126122        sudo bash -c "tar cf - --exclude=".svn" --exclude ./all -C $(DEBWRT_EXTRA_ROOTFS_FILES_DIR) . | tar -xovf - -C $(ROOTFS_BUILD_DIR)/target"
     123        sudo chmod 600 $(ROOTFS_BUILD_DIR)/etc/ssh/ssh_host_rsa_key
     124        sudo chmod 600 $(ROOTFS_BUILD_DIR)/etc/ssh/ssh_host_dsa_key
    127125        sudo cat $(ROOTFS_BUILD_DIR)/etc/securetty \
    128126                $(TOPDIR)/debian/rootfs/securetty.tail \
     
    133131# Fow now: Include debwrt-packages dependencies staticly. This
    134132#          list(DEBWRT_ROOTFS_PKGLST_DEPS) is managed in debian/package/debian.mk.
    135 debian/rootfs/bootstrap: debian/rootfs/clean-rootfs-dir
     133debian/rootfs/bootstrap: | debian/rootfs/clean-rootfs-dir debian/rootfs/prepare-debwrt-packages
    136134        mkdir -p $(ROOTFS_BUILD_DIR)
     135ifeq ($(ROOTFS_DEBIAN_QEMU_2ND_STAGE),y)
     136        # Debootstrap and automated qemu based 2nd stage install
     137        sudo qemu-debootstrap --arch=$(ROOTFS_DEBIAN_ARCH)\
     138                              --foreign \
     139                              --include=$(call rootfs-package-list),$(call debwrt-package-deps-list) \
     140                              $(ROOTFS_DEBIAN_RELEASE) \
     141                              $(ROOTFS_BUILD_DIR) \
     142                              $(CONFIG_DEBIAN_BUILDENV_REPOSITORY)
     143else
     144        # Use debootstrap to ony extract selected packages
    137145        sudo debootstrap --arch=$(ROOTFS_DEBIAN_ARCH)\
    138                      --foreign \
    139                      --include=$(call rootfs-package-list) \
    140                      $(ROOTFS_DEBIAN_RELEASE) \
    141                      $(ROOTFS_BUILD_DIR) \
    142                      $(CONFIG_DEBIAN_BUILDENV_REPOSITORY)
     146                         --foreign \
     147                         --include=$(call rootfs-package-list) \
     148                         $(ROOTFS_DEBIAN_RELEASE) \
     149                         $(ROOTFS_BUILD_DIR) \
     150                         $(CONFIG_DEBIAN_BUILDENV_REPOSITORY)
     151endif
    143152        # complete ROOTFS/dev/ with additional device files
    144153        sudo bash -c "cd $(ROOTFS_BUILD_DIR)/dev ; /sbin/MAKEDEV -v consoleonly"
    145154        sudo bash -c "cd $(ROOTFS_BUILD_DIR)/dev ; /sbin/MAKEDEV -v sda"
    146         sudo bash -c "cd $(ROOTFS_BUILD_DIR)/dev ; mknod -m 555 /dev/ttyS0 c 4 64; chown :tty ttyS0"
    147         touch $@
    148 
     155        sudo bash -c "cd $(ROOTFS_BUILD_DIR)/dev ; /sbin/MAKEDEV -v ttyS0"
     156        touch $@
     157
     158ifeq ($(ROOTFS_DEBIAN_QEMU_2ND_STAGE),y)
    149159debian/rootfs/unpack: debian/rootfs/bootstrap
     160        # no action
     161else
     162debian/rootfs/unpack: debian/rootfs/bootstrap
     163        # extract packages, to allow second stage to take place on physical
     164        # machine, while being able to boot the machine with most important
     165        # binaries in place.
    150166        find $(ROOTFS_BUILD_DIR) -name "*.deb" | while read deb; do \
    151167                n=`basename $$deb`; \
     
    155171        done
    156172        touch $@
    157 
    158 # install all available cross-compiled debwrt debian packages, except for the kernel-headers package and the cross packages
     173endif
    159174
    160175debian/rootfs/clean-rootfs-dir:
     
    165180debian/rootfs/post-setup: debian/rootfs/bootstrap
    166181        sudo mkdir -p $(ROOTFS_BUILD_DIR)/etc/apt
    167         # note: unfortunately /etc/apt/sources.list is cleaned after running second stage install
    168         sudo bash -c "echo \"deb http://ftp.debian.org/debian $(ROOTFS_DEBIAN_RELEASE) main\" > $(ROOTFS_BUILD_DIR)/etc/apt/sources.list"
     182        sudo bash -c "echo -e \"# For low memory (<64M) system, which have a hard time running apt-get update,\n# DebWrt provides a Debian mirror containing a, still very large, subset (~13.000) of all\n# Debian packages.\ndeb http://debian.debwrt.net/ $(ROOTFS_DEBIAN_RELEASE) main\" > $(ROOTFS_BUILD_DIR)/etc/apt/sources.list"
     183        sudo bash -c "echo \"deb http://packages.debwrt.net/ $(ROOTFS_DEBIAN_RELEASE)-debwrt-stable main\" >> $(ROOTFS_BUILD_DIR)/etc/apt/sources.list"
    169184        sudo bash -c "echo \"$(DEBWRTVERSION)\" >$(ROOTFS_BUILD_DIR)/etc/debwrt_version"
    170         sudo bash -c "echo \"$(ROOTFS_DEBIAN_RELEASE)\" >$(ROOTFS_BUILD_DIR)/etc/debian_release"
     185        sudo bash -c "echo \"$(ROOTFS_DEBIAN_RELEASE)\" >$(ROOTFS_BUILD_DIR)/etc/debwrt_debian_release"
    171186        touch $@
    172187
    173188ifeq ($(ROOTFS_DEBIAN_QEMU_2ND_STAGE),y)
    174 #debian/rootfs/second-stage: debian/rootfs/bootstrap debian/buildenv/qemu
    175 debian/rootfs/second-stage: debian/rootfs/bootstrap
     189debian/rootfs/post-setup-emulated: debian/rootfs/bootstrap
    176190        $(call qemu-prepare)
    177191        sudo chroot $(ROOTFS_BUILD_DIR) /usr/sbin/PostInstall && sudo rm -f $(ROOTFS_BUILD_DIR)/usr/sbin/PostInstall
     192        wget -qO - "http://buildd.debwrt.net:8066/mini_buildd/api?command=getkey&output=plain" | sudo chroot $(ROOTFS_BUILD_DIR) apt-key add -
     193        wget -qO - "http://debian.debwrt.net/apt/conf/debwrt-debian-mirror-public-gpg.key" | sudo chroot $(ROOTFS_BUILD_DIR) apt-key add -
    178194        $(call qemu-cleanup)
    179195else
    180 debian/rootfs/second-stage: debian/rootfs/bootstrap
     196debian/rootfs/post-setup-emulated: debian/rootfs/bootstrap
    181197        @echo "I: Qemu 2nd stage install disabled. Second stage needs now to be performend on the target device itself."
    182198        @echo "I: Qemu 2nd stage install can be enabled using menuconfig (ROOTFS_DEBIAN_QEMU_2ND_STAGE)."
  • trunk/debian/rootfs/files/all/usr/sbin/PostInstall

    r517 r868  
    2424# hack for Debian sid
    2525[ -e /tmp/sshd -a ! -e /var/run/sshd ] && mv /tmp/sshd /var/run
    26 
    27 if [ ! -s /etc/apt/sources.list ]; then
    28    debian_release=$( cat /etc/debian_release )
    29    echo "I: setting up /etc/apt/sources.list for ${debian_release}"
    30    cat >/etc/apt/sources.list <<EOF
    31 deb http://ftp.debian.org/debian ${debian_release} main
    32 EOF
    33 fi
    3426
    3527if [ -f /etc/init.d/rcS ] ; then
  • trunk/debian/rootfs/include_packages.list

    r770 r868  
    4242wpasupplicant
    4343hostapd
     44tmux
     45iw
     46kexec-tools
  • trunk/debian/rootfs/include_packages.list.jessie

    r770 r868  
    88#
    99fake-hwclock
    10 
    11 # Include sysvinit for fallback. Default is systemd as of jessie. 
    12 sysvinit
  • trunk/debian/rootfs/include_packages.list.sid

    r770 r868  
    88#
    99fake-hwclock
    10 
    11 # Include sysvinit for fallback. Default is systemd as of jessie. 
    12 sysvinit
Note: See TracChangeset for help on using the changeset viewer.