def buildQemu(): os.chdir(getScriptDir()) # Install dependencies ensureDependencies(['libglib2.0-dev', 'binfmt-support', 'qemu']) subprocess.call(['sudo', 'apt-get', '-y', 'build-dep', 'qemu']) # Clone RCN's git repository print('Building under Qemu') gitCloneAndEnter('git://github.com/RobertCNelson/linaro-tools.git', '4a1cb42df6e58') # Build and install qemu os.chdir('qemu') # MUST CD INTO DIRECTORY subprocess.call(['./build_qemu.sh']) os.chdir('..') os.chdir('..')
def buildKernel(): os.chdir(getScriptDir()) loadSettings() # Install dependencies (Ubuntu needs u-boot-tools, Debian needs uboot-mkimage) ensureDependencies( ['gcc-arm-linux-gnueabi', 'u-boot-tools', 'device-tree-compiler']) # Clone the linux kernel source tree print('Cloning the Linux kernel source tree') linuxDirName = gitCloneAndEnter( 'git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git', 'master') os.chdir('..') # Clone RCN's git repository print('Building kernel') gitCloneAndEnter('git://github.com/RobertCNelson/stable-kernel.git', '4d82ccd1b2093') # Configure the kernel build script shutil.copyfile('system.sh.sample', 'system.sh') # Overwrites existing file file = open('system.sh', 'a') # Open for appending file.write('LINUX_GIT=' + os.path.join(os.path.realpath('..'), linuxDirName) + '\n') file.write('ZRELADDR=0x80008000' + '\n') # For TI: OMAP3/4/AM35xx (BB is OMAP3) #file.write('BUILD_UIMAGE=1' + '\n') # Do I need to build uImage? file.write('MMC=' + getSetting('mmc') + '\n') # Pull in Torvalds current master tree before applying local patchset # This is very useful during an intial 'rc0' merge. # It is never supported... Enable at your own risk #file.write('LATEST_GIT=1' + '\n') file.write( 'LOCAL_PATCH_DIR=' + os.path.join(os.path.realpath('..'), 'patches', 'stable-kernel') + '\n') file.close() # Adding the CC parameter is a little more complex... we need to seek out # the config line and uncomment it. replaceAll('system.sh', '#CC=arm-linux-gnueabi-', 'CC=arm-linux-gnueabi-') # Build the kernel subprocess.call(['./build_deb.sh']) os.chdir('..')
def buildKernel(): os.chdir(getScriptDir()) loadSettings() # Install dependencies (Ubuntu needs u-boot-tools, Debian needs uboot-mkimage) ensureDependencies(["gcc-arm-linux-gnueabi", "u-boot-tools", "device-tree-compiler"]) # Clone the linux kernel source tree print("Cloning the Linux kernel source tree") linuxDirName = gitCloneAndEnter("git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git", "master") os.chdir("..") # Clone RCN's git repository print("Building kernel") gitCloneAndEnter("git://github.com/RobertCNelson/stable-kernel.git", "4d82ccd1b2093") # Configure the kernel build script shutil.copyfile("system.sh.sample", "system.sh") # Overwrites existing file file = open("system.sh", "a") # Open for appending file.write("LINUX_GIT=" + os.path.join(os.path.realpath(".."), linuxDirName) + "\n") file.write("ZRELADDR=0x80008000" + "\n") # For TI: OMAP3/4/AM35xx (BB is OMAP3) # file.write('BUILD_UIMAGE=1' + '\n') # Do I need to build uImage? file.write("MMC=" + getSetting("mmc") + "\n") # Pull in Torvalds current master tree before applying local patchset # This is very useful during an intial 'rc0' merge. # It is never supported... Enable at your own risk # file.write('LATEST_GIT=1' + '\n') file.write("LOCAL_PATCH_DIR=" + os.path.join(os.path.realpath(".."), "patches", "stable-kernel") + "\n") file.close() # Adding the CC parameter is a little more complex... we need to seek out # the config line and uncomment it. replaceAll("system.sh", "#CC=arm-linux-gnueabi-", "CC=arm-linux-gnueabi-") # Build the kernel subprocess.call(["./build_deb.sh"]) os.chdir("..")
def createCard(): os.chdir(getScriptDir()) loadSettings() fs = 'ext4' # btrfs is waaaaaaaaay too slow on a microSD card # Set swap equal to amount of RAM for kernel compiling, consider disabling # swap for production images swap = 512 # MB, set to zero to disable # Install dependencies ensureDependencies(['uboot-mkimage', 'wget', 'pv', 'dosfstools', 'parted']) # Look for u-boot and MLO useStable = True # as opposed to latest GIT uboot = False mlo = False ubootdir = os.path.join('Bootloader-Builder', 'deploy', 'beagleboard') if os.path.exists(ubootdir): found = useStable for f in sorted(os.listdir(ubootdir), reverse=True): if os.path.isfile(os.path.join(ubootdir, f)) and 'MLO' in f: # Stable will end in -r1. GIT will end in -def (three hex chars) # Therefore, in the real stable image comes last and the latest # GIT will be second-to-last. Simply use "useStable" as a flag # to target the second-to-last. if found: mlo = os.path.realpath(os.path.join(ubootdir, f)) print('Found MLO: ' + mlo) break else: found = True found = useStable for f in sorted(os.listdir(ubootdir), reverse=True): if os.path.isfile(os.path.join(ubootdir, f)) and 'u-boot' in f: if found: uboot = os.path.realpath(os.path.join(ubootdir, f)) print('Found u-boot: ' + uboot) break else: found = True # Build the image deploy = os.path.join('omap-image-builder', 'deploy') if not os.path.exists(deploy): print( 'Error: omap-image-builder directory doesn\'t exist. Try running buildImage()' ) return os.chdir(deploy) for f in sorted(os.listdir('.'), reverse=True): if not os.path.isfile(f): os.chdir(f) break else: print('Error: images not found. Try running buildImage()') return # Enter the only folder for f in os.listdir('.'): if not os.path.isfile(f): os.chdir(f) break else: print('Error: images not found. Try running buildImage()') return cmd = [ 'sudo', './setup_sdcard.sh', '--mmc', getSetting('mmc'), '--uboot', 'beagle_xm', '--rootfs', fs, '--boot_label', 'boot', '--rootfs_label', 'rootfs' ] if uboot and mlo: cmd.extend(['--bootloader', uboot, '--spl', mlo]) if swap: cmd.extend(['--swap_file', str(swap)]) subprocess.call(cmd) os.chdir('..') os.chdir('..') os.chdir('..') os.chdir('..')
def installDependencies(): # Enable ROS packages -- skip this step because there are no armhf packages # sudo sh -c 'echo "deb http://packages.ros.org/ros/ubuntu precise main" > /etc/apt/sources.list.d/ros-latest.list' # wget http://packages.ros.org/ros.key -O - | sudo apt-key add - ensureDependencies(getSetting('packages'))
def createCard(): os.chdir(getScriptDir()) loadSettings() fs = 'ext4' # btrfs is waaaaaaaaay too slow on a microSD card # Set swap equal to amount of RAM for kernel compiling, consider disabling # swap for production images swap = 512 # MB, set to zero to disable # Install dependencies ensureDependencies(['uboot-mkimage', 'wget', 'pv', 'dosfstools', 'parted']) # Look for u-boot and MLO useStable = True # as opposed to latest GIT uboot = False mlo = False ubootdir = os.path.join('Bootloader-Builder', 'deploy', 'beagleboard') if os.path.exists(ubootdir): found = useStable for f in sorted(os.listdir(ubootdir), reverse=True): if os.path.isfile(os.path.join(ubootdir, f)) and 'MLO' in f: # Stable will end in -r1. GIT will end in -def (three hex chars) # Therefore, in the real stable image comes last and the latest # GIT will be second-to-last. Simply use "useStable" as a flag # to target the second-to-last. if found: mlo = os.path.realpath(os.path.join(ubootdir, f)) print('Found MLO: ' + mlo) break else: found = True found = useStable for f in sorted(os.listdir(ubootdir), reverse=True): if os.path.isfile(os.path.join(ubootdir, f)) and 'u-boot' in f: if found: uboot = os.path.realpath(os.path.join(ubootdir, f)) print('Found u-boot: ' + uboot) break else: found = True # Build the image deploy = os.path.join('omap-image-builder', 'deploy') if not os.path.exists(deploy): print('Error: omap-image-builder directory doesn\'t exist. Try running buildImage()') return os.chdir(deploy) for f in sorted(os.listdir('.'), reverse=True): if not os.path.isfile(f): os.chdir(f) break else: print('Error: images not found. Try running buildImage()') return # Enter the only folder for f in os.listdir('.'): if not os.path.isfile(f): os.chdir(f) break else: print('Error: images not found. Try running buildImage()') return cmd = ['sudo', './setup_sdcard.sh', '--mmc', getSetting('mmc'), '--uboot', 'beagle_xm', '--rootfs', fs, '--boot_label', 'boot', '--rootfs_label', 'rootfs'] if uboot and mlo: cmd.extend(['--bootloader', uboot, '--spl', mlo]) if swap: cmd.extend(['--swap_file', str(swap)]) subprocess.call(cmd) os.chdir('..') os.chdir('..') os.chdir('..') os.chdir('..')