Home Blog Page 750

This Automaker Just Joined IBM and Google as a Patron of Open-Source Software

The move reflects the growing importance of software to cars. While not as momentous as its introduction of the Prius in 1997—the first mass-produced hybrid vehicle—Toyota Motor Corp quietly took another bold, industry-leading step toward technological innovation last month.

The world’s largest automaker ponied up a one-time fee—believed to be $20 million—and became the eighth full member of a consortium that most people do not associate with the auto industry at all. 

It’s called the Open Invention Network, and its other members are Google, IBM, Red Hat, NEC, Philips, Sony, and SUSE (a unit of Britain’s Micro Focus). …Formed in 2005, OIN’s mission is to protect and encourage the collaborative development and use of open-source software, like the Linux operating system, which can be freely copied, altered, and distributed, and which no one person or company owns. OIN pursues a variety of strategies aimed at protecting the users and developers of such software against the threat of patent suits by proprietary software manufacturers, like Microsoft and Apple. Such suits, if successful, could deny users the freedoms that make open-source software desirable.

Read more at Fortune

Get the Look of KDE Plasma 5 on Your GNOME Desktop

Plasma 5 breathed a new look and feel in to the KDE desktop using a crisp new theme called ‘Breeze’ and now you get it on GNOME. 

The airy aesthetics have won Plasma 5 an army of admirers, and helped to cement the new visual impression of the  KDE desktop experience redux.

But what if you’re not using KDE? Well, you don’t have to miss out.

gnome breeze gtk theme

GNOME-Breeze is a GTK+ theme designed to mimic KDE’s Breeze. It requires GTK+ 3.16 or later, plus the Pixmap/Pixbuf theme engine for GTK2. Some Linux distributions, including Arch, have the theme ready and waiting to install.

This post, Get the Look of KDE Plasma 5 on Your GNOME Desktop, was written by Joey-Elijah Sneddon and first appeared on OMG! Ubuntu!.

The Emerging Containers as a Service Marketplace

While many developers are enthusiastic about the way containers can speed up deployments, administrators and operators may be a bit more wary, given the considerable amount of retooling that their internal systems may need to go through to support container-based pipelines.

Which is why the emerging Containers as a Service (CaaS) approach may prove popular to both camps.

CaaS changes the dynamic for how containers are perceived by operations teams that must otherwise build-out platforms that manage complex environments. At scale, containers bring with them the need for new tooling, services and platforms. And for most businesses, the expertise is missing to manage complex, scaled-out platforms built on container-based clusters.

Read more at The New Stack

 

OpenVPN – Secure your Server Administration with Multiplatform VPN Connection

OpenVPN is a full-featured SSL VPN which implements the OSI layer 2 or 3 secure network extension by using the industry standard SSL/TLS protocol. For this tutorial, we are going to use a Debian or Ubuntu server. You can use any server you already have in production.

Read the full article

Automotive Grade Linux Releases 2.0 Spec Amid Growing Support

The Linux Foundation’s Automotive Grade Linux (AGL) project, which is developing a “Linux-based, open platform for the connected car,” announced the release of the second version of its Unified Code Base (UCB) distribution for in-vehicle infotainment (IVI). The latest version adds features like audio routing, rear seat display support, the beginnings of an app platform, and new development boards including the DragonBoard, Wandboard, and Raspberry Pi.

AGL’s Yocto Project derived UCB distro, which is also based in part on the GENIVI and Tizen automotive specs, was first released in January. UCB 1.0 followed an experimental AGL stack in 2014 and an AGL Requirements Specification in June, 2015.

UCB is scheduled for a 3.0 release in early 2017, at which point some automotive manufacturers will finally use it in production cars. Most of the IVI software will be based on UCB, but carmakers can also differentiate with their own features.

New features in UCB 2.0, which will be available for download by the end of the week, include:

  • Rear seat display and video playback — supports simultaneous playback on front and rear displays

  • Audio routing and mixing — based on GENIVI and Tizen audio management, prioritization, and layering

  • Application framework — controls and manages installation, launch, and update of applications, and adds security by assigning resources only to approved apps

  • ConnMan network management — ConnMan daemon based scheme for pairing multiple Bluetooth devices and switching data connections between Bluetooth and WiFi

  • Vehicle bus messaging — rewritten with built-in security to prevent unwanted intrusions and stop rogue apps from communicating with vehicle bus

  • New build environment faster server that lets developers specify what goes into the build, and submit custom jobs

  • New test infrastructure enables connect connectivity to a hardware board over the Internet to perform testing

  • New hardware support — NXP Sabre Automotive, Wandboard, Qualcomm DragonBoard, TI Vayu EVM, and Raspberry Pi, adding to previous support for Renesas R-CAR M2 PORTER and R-CAR E2 Silk, Intel boards like the MinnowBoard MAX, and the QEMU x86 64-bit emulator

AGL UCB 2.0 is being demonstrated at the Automotive Linux Summit on July 13-14 in Tokyo. The demo includes rear seat display, video playback, AM/FM radio, wheel input device, navigation, HVAC control, media player and browser, and settings and home screen functionality.

AGL Membership Expands

AGL seems to be eclipsing GENIVI as the leading open Linux car platform. More than 30 new companies have joined AGL in the past year, bringing the membership to more than 70.

The January release of UCB 1.0 was accompanied by the announcement of new members including Ford, Subaru, Mazda, and Mitsubishi Motors. Pre-existing members include Toyota, Nissan, and Jaguar Land Rover, which already offers an AGL-inspired IVI system. The addition of Ford, a longtime Windows Automotive partner, was a particularly significant coup, and the sign-on of automotive IVI component vendors like Harman, Panasonic, and Pioneer was also key.

In recent months, Hyundai has joined, along with dozens of technology companies. These include chipmakers like TI, MediaTek, and Qualcomm, which has launched an automotive-focused, Linux-ready Snapdragon 820a SoC and Connected Car Reference Platform. Previous semiconductor members included Renesas and Nvidia, which has a Linux-compatible Drive PX smart car system based on its Tegra SoCs.

Joining an organization doesn’t equate with a commitment to use its spec. Yet, the AGL has garnered promises to implement UCB from Toyota, as well as chipmaker Renesas and IVI equipment manufacturers like Aisin AW, DENSO, Fujitsu Ten, Harman, Panasonic, and Pioneer.

IVI’s Long Road

IVI systems started appearing in luxury cars about a decade ago around the time of the first iPhone and Android phones, and the oldest Linux-oriented organization focused on IVI — the GENIVI Alliance — was founded more than seven years ago. Yet IVI systems, which combine touch-enabled navigation and infotainment features, and in many cases the communications, safety, and security features provided by AGL’s UCB, are still far from universal.

An IHS report from late December projected that sales of automotive displays of 7.0-plus inches will reach only 33.5 million units in 2021, or less than half of the roughly 82.9 million cars sold globally in 2015.The IVI tide is rising faster, however, as the sales will grow at a rate of nearly 10 percent.

The relatively slow uptake compared to smartphones is due to the conservative nature of the automotive business, which is based largely on the necessary concern for safety. This continues to be a concern as IVI is integrated with advanced driver assistance systems (ADAS) systems and self-driving cars.

There’s still plenty of time for new contenders to take on leading platforms like QNX and Windows Embedded Automotive. Most of the newcomers run on Linux or the Linux-based Android, with projects based on AGL, GENIVI, or other Linux platforms such as Intel’s In-Vehicle Solutions or the new Qt Automotive Embedded. The Qt Company is an AGL member, and says it will provide backends for AGL, GENIVI, and QNX. Intel’s Wind River subsidiary is also a member.

Android-based IVI systems include Mitsubishi’s FlexConnect.IVI, Renault’s R-Link, and Parrot’s after-market Android IVI solutions. There continue to be rumors that mobile/IVI integration stacks like Google’s Android Auto and Apple’s CarPlay will turn into full-fledged IVI and telematics platforms.

The automotive business now has sufficient experience with IVI to realize the benefits of a universal open platform. They understand the complications and costs involved with keeping up with increasingly sophisticated, fast-changing technology. Like most other automotive platforms, UCB will support “instrument cluster, heads up display, telematics, and autonomous driving in the future,” says AGL.

“The automotive industry is starting to embrace an open innovation mindset, and OEMs and suppliers are realizing that collaboration and joint development benefit the entire industry,” stated Dan Cauchy, General Manager of Automotive at The Linux Foundation. “The AGL UCB provides the industry with a single, shared platform that will ultimately reduce fragmentation, improve time-to- market and reduce the cost of software development for everyone.”

“The latest version of the AGL UCB distribution marks a significant step toward building a developer ecosystem around the platform,” stated Masashige Mizuyama, CTO, Infotainment Business, Panasonic. “The new platform enables developers to build and test one application that can be supported by multiple OEMs, instead of having to build multiple applications with the same function.”

 

Xen Project Release Strengthens Security and Pushes New Use Cases

Xen Project technology supports more than 10 million users and is a staple in some of the largest clouds in production today, including Amazon Web Service, Tencent, and Alibaba’s Aliyun. Recently, the project announced the arrival of Xen Project Hypervisor 4.7. This new release focuses on improving code quality, security hardening and features, and support for the latest hardware. It is also the first release of the project’s fixed-term June – December release cycles. The fixed-term release cycles provide more predictability making it easier for consumers of Xen to plan ahead.  

We recently sat down with the Xen Project chairperson, Lars Kurth, to talk about some of the key features of the release and the future of Xen Project technology. Lars will be discussing this topic and more during Xen Project’s Developer Summit in Toronto, CA from August 25-26 — the conference is directly after LinuxCon North America.

Q: What was the focus on this release?

Lars Kurth: There were five areas that we focused on for this release (full details are in our blog). In summary, we focused on security features, migration support, performance and workloads, support for new hardware features, and drivers and devices (Linux, FreeBSD and other).

Security is consistently something that we focus on in all of our releases. There are a lot of people that rely on Xen Project technology and security is our top concern in any release as well as how we organize our process around security disclosures.

Q: What was the biggest feature coming out of this release?

Lars: The biggest feature for us is live patching, which is a technology that enables re-boot free deployment for security patches to minimize disruption and downtime during security upgrades for cloud admins. It essentially eliminates all cloud reboots, making cloud providers and their users much more safe. It also eliminates a lot of headaches for system and DevOps admins of the world.

Q: Xen is often associated with the cloud, but are there additional use cases that you see growing around this technology, if so why?

Lars: We are seeing a lot of growth in terms of contributions, as well as many different use cases emerging, including automotive, aviation, embedded scenarios, security, and also IoT. In addition, we continue to grow within the public cloud sector and traditional server virtualization.

On the security front, for example, a number of vendors such as A1Logic, Bitdefender, Star Lab and Zentific have released or are working on new Xen Project-based security solutions. In addition, the security focused and Xen-based OpenXT project has started to work more closely with the Xen Project community.

Long-time contributors to the Xen Project, such as DornerWorks – a premier provider of electronic engineering services for the aerospace, medical, automotive, and industrial markets – have expanded their scope and are now providing support for the Xen Xilinx Zynq Distribution targeting embedded use-cases. We have also seen an increasing number of POCs and demos of automotive solutions, which include Xen as a virtualization solution.

Growth in these sectors is largely due to the Xen Project’s flexibility, extensibility, customisability and a clear lead when it comes to security-related technologies. Over the last year, we have also seen contributions increase from developers with strong security and embedded backgrounds. In fact, this totaled nearly 17 percent of the overall contributions in this release cycle, up from 9 percent in the previous release.

Q: How did you address these uses cases in this latest release?

Lars: We introduced the ability to remove core Xen Project Hypervisor features at compile via KCONFIG. This creates a more lightweight hypervisor and eliminates extra attack surfaces that are beneficial in security-first environments and microservice architectures. Users will still be able to get the core hypervisor functions, but they won’t receive all the drivers, schedulers, components or features that might not fit their use case.

Essentially it gives people an “a la carte” feature set. They can decide what they need for compliance, safety or performance reasons.

Q: Were there any new contributors for this release that surprised you?

Lars: We had three new companies contributing to the project: Star Lab, Bosch and Netflix. I met engineers from Star Lab for the first time at the 2015 Developer Summit less than a year ago, and helped introduce them to the Project’s culture. In that short period of time, Doug Goldstein from Star Lab has moved into the top five contributors and top 10 code reviewers for the Project.

I was surprised about Netflix’s contributions; I didn’t even know the company used Xen. Netflix improved and secured the VPMU feature, which is incredibly useful for system tuning and performance monitoring. Bosch Car Multimedia GmbH added some new ARM functionality. In addition, we have seen quite a bit of Xen related development in upstream and downstream projects such as Linux, FreeBSD, NetBSD, OpenBSD, QEMU and Libvirt.  

Q: What’s next for Xen Project? Where do you think the technology is heading in the future and why?

Lars: In the last three releases, we introduced several major new features such as PVH, COLO, new schedulers, VMI, Live Patching, Graphics Virtualization, etc. and significant re-work of existing features such as Migration and the Xen Security Modules (XSM). Looking at trends within the community, I expect that stepwise evolution of large new features to continue.

Some new capabilities, such as restartable Dom0’s, and additional techniques to provide more isolation and security, are also likely to appear. In addition, it looks likely that we will see some GPU virtualization capabilities for GPUs that target the ARM ecosystem, although it is not yet clear whether these will be available as open source. I also expect that both Intel and ARM hardware features will be closely tracked.

Some areas, such as new schedulers, XSM, PVH and Live Patching, will see significant efforts to harden and improve existing functionality. The goal is to ensure their swift adoption in commercial products and Linux and BSD distributions. Some features, which are not enabled by default are likely to become part of the Xen Project Hypervisor’s default configuration.

Free Tools for Driving an Open Source Project to Success

Increasingly, as open source technology becomes more pervasive, tech and DevOps workers are choosing to or being asked to build out and oversee their own open source projects. From Google, to Netflix to Facebook, companies are also releasing their open source creations to the community.

Have you considered launching an open source project or are you in the process of doing so? Doing it successfully and rallying community support can be more complicated than you think, but a little up-front footwork and homework can help things go smoothly. Beyond that, some planning can also keep you and your organization out of legal trouble. Issues pertaining to licensing, distribution, support options and even branding require thinking ahead if you want your project to flourish. Here are some of the very best free resources to pay attention to if you’re launching or overseeing an open source project.

Standards and Licensing

The Open Source Definition is where every project leader should start when it comes to how open source projects should be distributed, and what actually qualifies as open source. It’s also good to review Open Standards requirements.

Another top decision to weigh is what kind of license your project should have. The Software Freedom Law Center (SFLC) has a set of very good online resources on how open source licenses and copyrights work, and much more. And, don’t miss the good advice at Choosealicense.com. Legal issues are smart to anticipate up front. The SFLC authors are attorneys who were part of creating popular open source licenses. It’s also an excellent idea to keep up with current and archived editions of the International Free and Open Source Software Law Review.

For another simple discussion of license types for open source projects, and which license will work best for your project, try FOSS License Wars. The discussion is broken up into chapters that you can skim as you see fit, and the information is solid. The Free Software Foundation has a good primer. And of course, you can visit GitHub to review the many projects housed there, which types of licenses they have, how their communities work, and more. Should your project reside there?

One more note on licenses: If you’re leveraging existing open source code or components, Hewlett-Packard’s free application Fossology is designed to analyze the source code for any project and report accurately on which licenses are being used.

Best Practices

How can you showcase the fact that your open source project follows best practices and is secure? The Core Infrastructure Initiative (CII) Badge Program is a free program that is good to know about on this front. Its Best Practices Badge is a symbol of open source secure development maturity. Projects having a CII badge showcase the project’s commitment to security, and The Linux Foundation is the steward of this program.

Note that The Linux Foundation also has a collection of very useful free resources pertaining to open source compliance topics. For example, Publishing Source Code for FOSS Compliance: Lightweight Process and Checklists and Generic FOSS Policy can align your project’s development with best practices and policies.

Do you anticipate that your open source project may benefit from some funding, perhaps to build out community resources? If so, take note of the Mozilla Open Source Support Program (MOSS) – a funding awards program specifically focused on supporting open source and free software. Especially if your project upholds Mozilla’s values regarding openness, you can have a good shot at becoming a Mozilla “Mission Partner.”

Red Hat has an internally developed tool that could make a difference for your project. The company has announced the release of a community version of the Open Decision Framework, which consists of the company’s collection of its own best practices for making decisions and leading projects. Red Hat, of course, has a time-tested track record at advancing open source projects, so this framework is worth consideration. According to the company, the new community edition framework is directly related to how the company has advanced its open source projects. By making its Open Decision Framework freely available, Red Hat wants to enable project leaders to learn from the experiences of Red Hatters and contribute their own findings back to the community.

Are you interested in looking into open source projects similar to yours or perhaps projects that share libraries and components with yours? If so, Google and GitHub have produced a new open dataset on Google BigQuery, a low cost analytics data warehouse service in the cloud, so that anyone can get data-driven insights based on more than 2.8 million open source GitHub repositories. For example, if you are using an open source library, you can quickly find every open source project on GitHub that’s using it. You can also evaluate whether you might improve your APIs based on what other users are doing with similar tools.

Finally, note that a startup company called Snyk, has a very unique focus on helping developers keep open source code secure. It has recently come out of beta with tools that help developers monitor and secure vulnerabilities and dependencies in open source code in real time. You can find out more about Snyk’s offerings here.

These resources should help you and those you work with advance your open source project successfully, legally and securely.

AT&T Open Sources ECOMP to Linux Foundation, Hopes to Make it Industry’s Standard for SDN

AT&T today announced it will release its Enhanced Control, Orchestration, Management and Policy (ECOMP) platform to the wider telecom industry as an open source offering managed by the Linux Foundation. The goal, the company said, is to make ECOMP the telecom industry’s standard automation platform for managing virtual network functions and other software-centric network capabilities.

According to AT&T’s John Donovan, that’s exactly what appears to be on the horizon. “We want to build a community — where people contribute to the code base and advance the platform. And, we want this to help align the global industry,” Donovan said in an AT&T release.

Read more at Fierce Telecom

How to Modify a Raw Disk Image of Your Custom Linux Distro

SUSE Studio is pretty awesome for building custom Linux spins. When you have designed your spin to your liking, you can download what’s known as a “raw image” that you can copy to a USB thumbdrive, and… Hey presto! You’ve got yourself a tailor-made distro on a stick!

There is one serious caveat, however: If you want to add external packages that are not in the otherwise very comprehensive repositories, things can get complicated indeed.

Say you need a customized distro for the kids at your maker club. You want an image they can burn to their own USB thumbdrives so they can use it at home or in the computer lab. Maybe something like this (by the way, if you want to follow along with this tutorial, you may want to download that). You may want to have the Arduino IDE preinstalled. However, the default package for Arduino that comes with openSUSE is quite old, and newer boards are not supported. Of course, you want the most recent version.

Packaging the Arduino IDE for openSUSE is perfectly possible, but it’s a whole new kettle of fish. There must be a shortcut, right? After all, the Arduino IDE requires virtually no installation as such and very little in the way of dependencies. “Installing” Arduino usually consists of downloading the zip file for your architecture, decompressing it in /home/[your user directory]/[somewhere sensible]/ and creating a soft link to the arduino app itself from a bin/ directory on your $PATH. Surely you can do all that by manipulating the disk image that SUSE Studio provides you with.

Well, yes, but there are several steps you have to follow to pull this off.

Raw vs. ISO Images

Before we dig in any deeper, a few words on the differences between raw and ISO images. Although both are a byte per byte copy of block devices, and both can be recorded to read only or read/write media, ISO images do not contain a partition table and are read only, whereas RAW images can contain a complete table and are read/writable.

Raw image files are useful for several reasons. Think of how you “install” Raspberry Pi’s Raspbian, for example: You simply dd the image file to an SD card. Same goes for the default SUSE Studio images mentioned above, and a few other distros. As they are read/writable, copied to a USB thumbdrive or SD card, they become “run ready”, so there’s no need to dump everything into RAM and lose all your changes at power off like with Live CDs/DVDs. With a bootable raw image on a thumbdrive, you can carry around a complete OS in your pocket.

Dealing with Raw Images

So, you download the .raw file, but before making it available to all your friends and colleagues, you want to add in the latest Arduino IDE.

Why do it this way? Why not copy to a USB, boot it, modify whatever, and then copy from the USB back to a raw image? The reason is that first boots are usually different from other boots. There are scripts that poke around the hardware and media and modify stuff depending on what they find. Images generated with SUSE Studio and other similar services contain scripts that automatically grow the partitions so they occupy the whole thumb-drive, for example. If you are making an image available to others, this is a problem. A vanilla raw image that weighs less than 4GB, like the example we’re using in this tutorial, will, if copied to a 16GB pen drive, be enormous when copied back. See Figures 1 and 2.

Figure 1: Before the first boot, GParted shows the image occupying 3.39GB on a 16GB USB thumb drive.

Figure 2: After booting, the image has expended to occupy nearly the whole thumb drive.

Plus, doing it the other way around is not elegant.

Poking Around Your Image

You may be familiar with mount‘s -o loop option. In its simplest form, this option allows you to mount and explore an ISO or raw image like this:

$ mkdir image_mount_point
# mount -o loop image.iso image_mount_point

Where image_mount_point is a directory you create specifically to mount the ISO, and image.iso is an ISO image file, say, a live CD image (Figure 3).

Figure 3: You can mount an image file and access it like a partition.

Again, notice that you can only explore an ISO image. You can’t actually touch or change anything because the ISO 9660 filesystem — the filesystem used in ISO images — is read only.

Mounting raw images is a little different. As raw images can contain different partitions, you have to figure out which one you want to mount and where it is located on the “virtual” disk. To do this check the map of your image with fdisk -l:


# fdisk -l ArduinoOS_Redux.x86_64-0.0.XX.raw
Disk ArduinoOS_Redux.x86_64-0.0.XX.raw: 3.2 GiB, 3478126592 bytes, 6793216 sectors 
Units: sectors of 1 * 512 = 512 bytes 
Sector size (logical/physical): 512 bytes / 512 bytes 
I/O size (minimum/optimal): 512 bytes / 512 bytes 
Disklabel type: dos 
Disk identifier: 0x4e37b4f7 

Device                      Boot Start     End Sectors  Size Id Type 
ArduinoOS_Redux.x86_64-0.0.XX.raw1 *     2048 6793215 6791168  3.2G 83 Linux

This gives you crucial information as to where a mountable partition is located. First, it says that each sector is 512 bytes long (Sector size (logical/physical): 512 bytes / 512 bytes ), then that there’s a mountable partition that starts on sector 2048 (ArduinoOS_Redux.x86_64-0.0.XX.raw1 * 2048 6793215 6791168 3.2G 83 Linux).

If you want to mount the partition, you’ll have pass that information along:

 # mount -o loop,offset=1048576 ArduinoOS_Redux.x86_64-0.0.XX.raw /home/[your user]/image_mount_point/ 

The offset options tells mount where the partition you actually want to mount is. Because 512 (sector size) multiplied by 2048 (sector where partition starts) equals 1048576, that’s what you pass on to offset.

Making Space

With the image mounted, you could start changing stuff right away. However, if you take a closer look at your mounted partition, you may notice you don’t have much empty space:

$ df -h /home/[your user]/image_mount_point/
Filesystem      Size  Used Avail Use% Mounted on 
/dev/loop0      3.1G  2.7G  265M  92%

In the (real) example above, there’s only 265MB to spare. That’s not a lot of wiggle room for major changes. I mean, look at what the latest Arduino IDE (1.6.9 at the moment of writing) takes up:

du -ch arduino-1.6.9/
.
.
.
419M    ../Downloads/Arduino/arduino-1.6.9/
419M    total

At 419MB, it’s definitely not going to fit. You are going to have to make the mountable partition bigger. And this is where things get sticky.

Before you continue, unmount the raw image with:

# umount /home/[your user]/image_mount_point/

to expand a partition on a regular drive with parted, given you had empty space on your drive. But, a raw image is not a regular drive; it is more like a potential drive, and its size is static:


# parted ArduinoOS_Redux.x86_64-0.0.XX.raw
GNU Parted 3.2 
Using /home/[your user]/ArduinoOS_Redux.x86_64-0.0.XX.raw 
Welcome to GNU Parted! Type 'help' to view a list of commands. 
(parted) print free
Model:  (file) 
Disk /home/[your user]/ArduinoOS_Redux.x86_64-0.0.XX.raw: 3427MB 
Sector size (logical/physical): 512B/512B 
Partition Table: msdos 
Disk Flags:  

Number  Start   End     Size    Type     File system  Flags 
      32.3kB  1049kB  1016kB           Free Space 
1      1049kB  3427MB  3426MB  primary  ext3         boot, type=83

There seems to be about 1MB of free space at the beginning of the disk, and then about 3.3GB in the mountable partition at the end. The empty space at the beginning is not going to help us because, apart from being insufficient, it is not really empty at all. It actually contains the Master Boot Record, a partition table, and so on. If you overwrite that, your USB drive will not be able to boot.

The trick is to tack on the extra space using dd:

# dd if=/dev/zero bs=1M count=512 >> ArduinoOS_Redux.x86_64-0.0.XX.raw

This copies 512MB of null characters on to the end of the file, effectively increasing its space by half a gigabyte:


# parted ArduinoOS_Redux.x86_64-0.0.XX.raw
GNU Parted 3.2 
Using /home/[your user]/ArduinoOS_Redux.x86_64-0.0.XX.raw 
Welcome to GNU Parted! Type 'help' to view a list of commands. 
(parted) print free                                                        
Model:  (file) 
Disk /home/[your user]/ArduinoOS_Redux.x86_64-0.0.XX.raw: 3964MB 
Sector size (logical/physical): 512B/512B 
Partition Table: msdos 
Disk Flags:  

Number  Start   End     Size    Type     File system  Flags 
      32.3kB  1049kB  1016kB           Free Space 
1      1049kB  3427MB  3426MB  primary  ext3         boot, type=83 
      3427MB  3964MB  537MB            Free Space

See the extra 537MB at the bottom of the list? Now you have space that partition 1 can grow into. Don’t exit parted just yet, because you can use it to to take over the adjacent free space you just created:

(parted) resizepart 1 3964MB
(parted) print free
Model: (file) 
Disk /home/[your user]/ArduinoOS_Redux.x86_64-0.0.XX.raw: 3964MB 
Sector size (logical/physical): 512B/512B 
Partition Table: msdos 
Disk Flags:  

Number  Start   End     Size    Type     File system  Flags 
      32.3kB  1049kB  1016kB           Free Space 
1      1049kB  3964MB  3963MB  primary  ext3         boot, type=83

parted‘s resizepart instruction takes two parameters: the partition to resize — in this case 1 — and the new end of the partition. As you saw two listings up, the empty space you created ends at the 3964MB mark, so you use that with resizepart.

Notice that, when you’re done, partition 1 is larger by about 500MB and there is no empty space at the end of the device any more.

It may look like everything is as it should be, but, open the image file in any other disk-managing program, and you’ll get contradictory information and errors. This is because the underlying tools parted used to resize and manage partitions works fine with real disks, but not so much with raw images. In fact, if you mounted the mountable partition in ArduinoOS_Redux.x86_64-0.0.XX.raw again, you would still see only 256MB of free space. But, as with nearly everything in Linux, there is a way to sort things out.

Enter kpartx, a tool designed just for the occasion. What kpartx does is take a raw image of a disc and create a “virtual device” in /dev/mapper that can then be manipulated as a real device with real partitions:

# kpartx -a ArduinoOS_Redux.x86_64-0.0.XX.raw

The -a option adds an entry, so if you now look under /dev/mapper:

$ ls /dev/mapper/ 
control  loop0p1

The raw image appears as device loop 0 and, as it contains only one mountable partition, it has only one entry called loop0p1. If the image contained more mountable partitions, you would see loop0p1, loop0p2, loop0p3, and so on.

Now you have a device you can play with, so let’s first run a check on its virtual partition:

# e2fsck -f -y -v -C 0 /dev/mapper/loop0p1
e2fsck 1.42.13 (17-May-2015) 
Pass 1: Checking inodes, blocks, and sizes 
Pass 2: Checking directory structure                                            
Pass 3: Checking directory connectivity 
Pass 4: Checking reference counts 
Pass 5: Checking group summary information 
                                                                              
     86010 inodes used (41.10%, out of 209248) 
      5413 non-contiguous files (6.3%) 
        83 non-contiguous directories (0.1%) 
           # of inodes with ind/dind/tind blocks: 5404/51/0 
    726741 blocks used (86.89%, out of 836352) 
         0 bad blocks 
         1 large file 

     69360 regular files 
      8272 directories 
         7 character device files 
         4 block device files 
         0 fifos 
      7797 links 
      8358 symbolic links (8166 fast symbolic links) 
         0 sockets 
------------ 
     93798 files

Things are looking good. Now you can try resizing the filesystem so it takes up the whole of the partition:


# resize2fs -p /dev/mapper/loop0p1
resize2fs 1.42.13 (17-May-2015) 
Resizing the filesystem on /dev/mapper/loop0p1 to 967424 (4k) blocks. 
Begin pass 1 (max = 4) 
Extending the inode table     XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX 
The filesystem on /dev/mapper/loop0p1 is now 967424 (4k) blocks long.

See that? The resize2fs just expanded your filesystem to take advantage of the available space on its partition.

You can now delete the virtual device from /dev/mapper with

# kpartx -d ArduinoOS_Redux.x86_64-0.0.XX.raw

(The -d option stands for delete, by the way).

If you mount ArduinoOS_Redux.x86_64-0.0.XX.raw and run df again, you can see that you now have the space you need to install the Arduino IDE:


# mount -o loop,offset=1048576 ArduinoOS_Redux.x86_64-0.0.XX.raw  /home/[your user]/image_mount_point/
# df -h /home/[your user]/image_mount_point                                                                       
Filesystem    Size  Used Avail Use% Mounted on   
/dev/loop1    3.6G  2.7G  743M  79% /home/[your user]/image_mount_point

Copying Over

Now you can copy over the uncompressed Arduino directory to the image’s /usr/bin directory, change into the directory, and create a soft link to the arduino executable to make sure it can be run from anywhere:


# cp -Rfv /route/to/download/arduino-1.6.9/ /home/[your user]/image_mount_point/usr/bin
# cd /home/[your user]/image_mount_point/usr/bin
# ln -s arduino-1.6.9/arduino

When you’re done, dismount the image:

# umount /home/[your user]/image_mount_point/

And copy it to your thumbdrive, using:

# dd bs=1M if=ArduinoOS_Redux.x86_64-0.0.XX.raw of=/dev/sdXX

where sdXX is wherever your system maps your USB thumbdrive when you plug it in.

Figure 4: The custom SUSE spin running off the USB thumbdrive (visible plugged in on the right) now comes with the most recent version of Arduino.

Bear in mind that first boots of SUSE Studio images take a long time. The system goes through a series of chores that can take several minutes, so be patient.

Conclusion

This may seem like a very specific user case, but the techniques described above are good for lots of other situations. You could use them to customize images of Raspberry Pi operating systems, such as Raspbian or NOOBS, or to tweak mirror images of hard disks before installing them elsewhere. The point is, given the default command-line tools provided with GNU/Linux, you can carry out some extraordinarily sophisticated disk image manipulation tasks.

See you next time.

SiFive Launches Freedom FOSS SoC Platforms

SiFive announced its flagship Freedom family of system on a chip platforms.

The platforms are based on the free and open source RISC-V instruction set architecture that several of the company’s founders created at the University of California at Berkeley.

SiFive’s Freedom U500 and E300 platforms take a new approach to SoCs, redefining traditional silicon business models and reversing the industry’s increasingly high licensing, design and implementation costs.

“The software cost is a huge part of taking any chip to production,” noted Jack Kang, SiFive’s VP of product and business development.

Read more at LinuxInsider