mirror of
https://github.com/danderson/netboot.git
synced 2026-04-14 10:12:14 +02:00
Add Arch Linux into quick boot options
This commit is contained in:
parent
c08175e180
commit
603e85bc4c
@ -299,6 +299,38 @@ func netbootRecipe(parent *cobra.Command) {
|
||||
parent.AddCommand(netbootCmd)
|
||||
}
|
||||
|
||||
func archRecipe(parent *cobra.Command) {
|
||||
archCmd := &cobra.Command{
|
||||
Use: "arch [version]",
|
||||
Short: "Boot Arch Linux live image",
|
||||
Long: `Boot Arch Linux live image for the given version
|
||||
version defaults to latest, can also be a YYYY.MM.DD iso release version`,
|
||||
Run: func(cmd *cobra.Command, args []string) {
|
||||
version := "latest"
|
||||
if len(args) >= 1 {
|
||||
version = args[0]
|
||||
}
|
||||
|
||||
arch := "x86_64"
|
||||
mirror, err := cmd.Flags().GetString("mirror")
|
||||
if err != nil {
|
||||
fatalf("Error reading flag: %s", err)
|
||||
}
|
||||
|
||||
httpSrv := fmt.Sprintf("%s/iso/%s", mirror, version)
|
||||
kernel := fmt.Sprintf("%s/arch/boot/%s/vmlinuz", httpSrv, arch)
|
||||
initrd := fmt.Sprintf("%s/arch/boot/%s/archiso.img", httpSrv, arch)
|
||||
cmdline := fmt.Sprintf("archisobasedir=arch archiso_http_srv=%s/ ip=dhcp verify=y net.ifnames=0", httpSrv)
|
||||
|
||||
fmt.Println(staticFromFlags(cmd, kernel, []string{initrd}, cmdline).Serve())
|
||||
},
|
||||
}
|
||||
archCmd.Flags().String("mirror", "https://mirrors.kernel.org/archlinux", "Root of the archlinux mirror to use")
|
||||
serverConfigFlags(archCmd)
|
||||
staticConfigFlags(archCmd)
|
||||
parent.AddCommand(archCmd)
|
||||
}
|
||||
|
||||
func init() {
|
||||
rootCmd.AddCommand(quickCmd)
|
||||
debianRecipe(quickCmd)
|
||||
@ -307,6 +339,7 @@ func init() {
|
||||
centosRecipe(quickCmd)
|
||||
netbootRecipe(quickCmd)
|
||||
coreosRecipe(quickCmd)
|
||||
archRecipe(quickCmd)
|
||||
|
||||
// TODO: some kind of caching support where quick OSes get
|
||||
// downloaded locally, so you don't have to fetch from a remote
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user